Re-introduce support for IPA-encapsulated MGCP

Old osmo-bsc-sccplite already supported this, but in the migration
over to libosmo-sigtran and to real 3GPP AoIP, this functionality
got lost.

We now create a UDP proxy socket. Any MGCP commands received via IPA
from MSC (or rather: bsc_nat) are retransmitted to the MGW via UDP on
this socket.  Any responses back from the MGW received on the UDP
socket are retransmitted back to MSC/bsc_nat as MGCP inside the IPA
multiplex.

Closes: OS#2536
Change-Id: I38ad8fa645c08900e0e1f1b4b96136bc6d96b3ab
diff --git a/include/osmocom/bsc/bsc_msc_data.h b/include/osmocom/bsc/bsc_msc_data.h
index 1f9872a..2ad7c68 100644
--- a/include/osmocom/bsc/bsc_msc_data.h
+++ b/include/osmocom/bsc/bsc_msc_data.h
@@ -33,6 +33,7 @@
 #include "osmux.h"
 
 #include <osmocom/core/timer.h>
+#include <osmocom/core/select.h>
 #include <osmocom/gsm/protocol/gsm_04_08.h>
 
 
@@ -135,6 +136,16 @@
 	enum osmux_usage use_osmux;
 	/* Whether we detected the MSC supports Osmux (during BSSMAP_RESET) */
 	bool remote_supports_osmux;
+
+	/* Proxy between IPA/SCCPlite encapsulated MGCP and UDP */
+	struct {
+		/* local (BSC) IP address to be used */
+		char *local_addr;
+		/* local (BSC) UDP port to be used to talk with MGW */
+		uint16_t local_port;
+		/* UDP socket for proxying MGCP via SCCPlite/IPA */
+		struct osmo_fd ofd;
+	} mgcp_ipa;
 };
 
 /*