IPA: Allow RSL connection to different IP address as OML

This patch adds a new VTY command "ip.access rsl-ip A.B.C.D" at the
BTS level.  If you set this IP address, the BTS will be instructed to
establish the RSL link to the indiciated IP address, rather than using
the same as for the OML link (default).

Use "ip.access rsl-ip 0" to disable the feature.
diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c
index d985e03..8027a63 100644
--- a/openbsc/src/libbsc/bsc_vty.c
+++ b/openbsc/src/libbsc/bsc_vty.c
@@ -540,6 +540,12 @@
 	case GSM_BTS_TYPE_OSMO_SYSMO:
 		vty_out(vty, "  ip.access unit_id %u %u%s",
 			bts->ip_access.site_id, bts->ip_access.bts_id, VTY_NEWLINE);
+		if (bts->ip_access.rsl_ip) {
+			struct in_addr ia;
+			ia.s_addr = htonl(bts->ip_access.rsl_ip);
+			vty_out(vty, "  ip.access rsl-ip %s%s", inet_ntoa(ia),
+				VTY_NEWLINE);
+		}
 		vty_out(vty, "  oml ip.access stream_id %u line %u%s",
 			bts->oml_tei, bts->oml_e1_link.e1_nr, VTY_NEWLINE);
 		break;
@@ -1626,6 +1632,28 @@
 	return CMD_SUCCESS;
 }
 
+DEFUN(cfg_bts_rsl_ip,
+      cfg_bts_rsl_ip_cmd,
+      "ip.access rsl-ip A.B.C.D",
+      "Abis/IP specific options\n"
+      "Set the IPA RSL IP Address of the BSC\n"
+      "Destination IP address for RSL connection\n")
+{
+	struct gsm_bts *bts = vty->index;
+	struct in_addr ia;
+
+	if (!is_ipaccess_bts(bts)) {
+		vty_out(vty, "%% BTS is not of ip.access type%s", VTY_NEWLINE);
+		return CMD_WARNING;
+	}
+
+	inet_aton(argv[0], &ia);
+	bts->ip_access.rsl_ip = ntohl(ia.s_addr);
+
+	return CMD_SUCCESS;
+}
+
+
 DEFUN(cfg_bts_serno,
       cfg_bts_serno_cmd,
       "hsl serial-number STRING",
@@ -3022,6 +3050,7 @@
 	install_element(BTS_NODE, &cfg_bts_tsc_cmd);
 	install_element(BTS_NODE, &cfg_bts_bsic_cmd);
 	install_element(BTS_NODE, &cfg_bts_unit_id_cmd);
+	install_element(BTS_NODE, &cfg_bts_rsl_ip_cmd);
 	install_element(BTS_NODE, &cfg_bts_timezone_cmd);
 	install_element(BTS_NODE, &cfg_bts_no_timezone_cmd);
 	install_element(BTS_NODE, &cfg_bts_serno_cmd);