Implement AoIP, port to M3UA SIGTRAN (large addition and refactoring)

This was originally a long series of commits converging to the final result
seen in this patch. It does not make much sense to review the smaller steps'
trial and error, we need to review this entire change as a whole.

Implement AoIP in osmo-msc and osmo-bsc.

Change over to the new libosmo-sigtran API with support for proper
SCCP/M3UA/SCTP stacking, as mandated by 3GPP specifications for the IuCS and
IuPS interfaces.

From here on, a separate osmo-stp process is required for SCCP routing between
OsmoBSC / OsmoHNBGW <-> OsmoMSC / OsmoSGSN

jenkins.sh: build from libosmo-sccp and osmo-iuh master branches now for new
M3UA SIGTRAN.

Patch-by: pmaier, nhofmeyr, laforge
Change-Id: I5ae4e05ee7c57cad341ea5e86af37c1f6b0ffa77
diff --git a/src/libiu/iu_vty.c b/src/libiu/iu_vty.c
index 73ad126..3fd3cd1 100644
--- a/src/libiu/iu_vty.c
+++ b/src/libiu/iu_vty.c
@@ -23,6 +23,8 @@
 #include <osmocom/core/logging.h>
 #include <osmocom/vty/command.h>
 #include <osmocom/vty/logging.h>
+#include <osmocom/sigtran/osmo_ss7.h>
+#include <osmocom/sigtran/sccp_sap.h>
 
 #include <openbsc/iu.h>
 
@@ -52,9 +54,10 @@
 	return CMD_SUCCESS;
 }
 
+#define IU_STR "Iu interface protocol options\n"
 DEFUN(cfg_iu_rab_assign_addr_enc, cfg_iu_rab_assign_addr_enc_cmd,
       "iu rab-assign-addr-enc (x213|v4raw)",
-      "Iu interface protocol options\n"
+      IU_STR
       "Choose RAB Assignment's Transport Layer Address encoding\n"
       "ITU-T X.213 compliant address encoding (default)\n"
       "32bit length raw IPv4 address (for ip.access nano3G)\n")
@@ -72,6 +75,24 @@
 	return CMD_SUCCESS;
 }
 
+extern struct osmo_sccp_addr local_sccp_addr;
+
+/* Note from the future: change-id Ib8c4fcdb4766c5e575618b95ce16dce51063206b will move this file to
+ * osmo-iuh, and there, change-id I3bb7fc1cd5261d214c6ba0cccfe95f637e6db087 will drop this vty command
+ * and use the point code defined via libosmo-sccp vty commands instead. */
+DEFUN(cfg_iu_local_addr_pc, cfg_iu_local_addr_pc_cmd,
+	"iu local-address point-code PC",
+	IU_STR "Local SCCP Address\n" "Set local point code\n" "point code\n")
+{
+	local_sccp_addr.presence = OSMO_SCCP_ADDR_T_PC | OSMO_SCCP_ADDR_T_SSN;
+	local_sccp_addr.ri = OSMO_SCCP_RI_SSN_PC;
+	local_sccp_addr.pc = osmo_ss7_pointcode_parse(NULL, argv[0]);
+
+	return CMD_SUCCESS;
+}
+
+/* TODO: GT address configuration, in line with 4.5.1.1.1 of TS 25.410 */
+
 int iu_vty_config_write(struct vty *vty, const char *indent)
 {
 	if (!g_rab_assign_addr_enc) {
@@ -95,6 +116,9 @@
 		return CMD_WARNING;
 	}
 
+	vty_out(vty, "%siu local-address point-code %s%s", indent,
+		osmo_ss7_pointcode_print(NULL, local_sccp_addr.pc), VTY_NEWLINE);
+
 	return CMD_SUCCESS;
 }
 
@@ -105,4 +129,5 @@
 	install_element(CFG_LOG_NODE, &logging_asn_debug_cmd);
 	install_element(CFG_LOG_NODE, &logging_asn_xer_print_cmd);
 	install_element(iu_parent_node, &cfg_iu_rab_assign_addr_enc_cmd);
+	install_element(iu_parent_node, &cfg_iu_local_addr_pc_cmd);
 }