aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2013-03-12 13:57:05 +0100
committerHarald Welte <laforge@gnumonks.org>2013-03-12 13:58:30 +0100
commit8b29180cad875b396288a22fb252e158fa2a060a (patch)
tree0364f1d20fe1b734c587e1ca4fd08bd985d835f9
parent1af682adb9c43bd5f646b801ab3e4fa7f983cd69 (diff)
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.
-rw-r--r--openbsc/include/openbsc/gsm_data_shared.h1
-rw-r--r--openbsc/src/libbsc/bsc_vty.c29
-rw-r--r--openbsc/src/libbsc/bts_ipaccess_nanobts.c3
3 files changed, 32 insertions, 1 deletions
diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h
index f66a1401..83758b12 100644
--- a/openbsc/include/openbsc/gsm_data_shared.h
+++ b/openbsc/include/openbsc/gsm_data_shared.h
@@ -602,6 +602,7 @@ struct gsm_bts {
uint16_t site_id;
uint16_t bts_id;
uint32_t flags;
+ uint32_t rsl_ip;
} ip_access;
struct {
struct {
diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c
index d985e034..8027a630 100644
--- a/openbsc/src/libbsc/bsc_vty.c
+++ b/openbsc/src/libbsc/bsc_vty.c
@@ -540,6 +540,12 @@ static void config_write_bts_single(struct vty *vty, struct gsm_bts *bts)
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 @@ DEFUN(cfg_bts_unit_id,
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 @@ int bsc_vty_init(const struct log_info *cat)
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);
diff --git a/openbsc/src/libbsc/bts_ipaccess_nanobts.c b/openbsc/src/libbsc/bts_ipaccess_nanobts.c
index 86c9fdc2..5d96967c 100644
--- a/openbsc/src/libbsc/bts_ipaccess_nanobts.c
+++ b/openbsc/src/libbsc/bts_ipaccess_nanobts.c
@@ -407,7 +407,8 @@ static int sw_activ_rep(struct msgb *mb)
abis_nm_opstart(trx->bts, foh->obj_class,
trx->bts->bts_nr, trx->nr, 0xff);
/* TRX software is active, tell it to initiate RSL Link */
- abis_nm_ipaccess_rsl_connect(trx, 0, 3003, trx->rsl_tei);
+ abis_nm_ipaccess_rsl_connect(trx, trx->bts->ip_access.rsl_ip,
+ 3003, trx->rsl_tei);
break;
case NM_OC_RADIO_CARRIER: {
/*