aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2014-08-18 22:46:42 +0200
committerHarald Welte <laforge@gnumonks.org>2014-08-24 17:25:47 +0200
commitaf066bab9dac8f52efad4d924b6dcc3bc3c64626 (patch)
tree68986b115de9479d6d7683851cabf4278f06934e
parentc0a3030277ed1541bcbfd5f602ee6dbe906fac14 (diff)
Use new libosmo-abis features to allow OML on non-standard TCP port
If we run osmo-bts, osmobts-omlrouter and osmo-nitb or osmo-bsc on one machine, we cannot have both omlrouter and osmo-{nitb,bsc} listen on TCP Port 3002. This introduces a new 'oml remote-port <0-65535>' directive to the osmo-bts configuration to connect to sunch a non-standard port.
-rw-r--r--include/osmo-bts/abis.h2
-rw-r--r--include/osmo-bts/gsm_data.h1
-rw-r--r--src/common/abis.c3
-rw-r--r--src/common/bts.c2
-rw-r--r--src/common/vty.c16
-rw-r--r--src/osmo-bts-sysmo/main.c2
6 files changed, 23 insertions, 3 deletions
diff --git a/include/osmo-bts/abis.h b/include/osmo-bts/abis.h
index 8c055d7..91b9cd0 100644
--- a/include/osmo-bts/abis.h
+++ b/include/osmo-bts/abis.h
@@ -18,7 +18,7 @@ enum {
void abis_init(struct gsm_bts *bts);
struct e1inp_line *abis_open(struct gsm_bts *bts, const char *dst_host,
- const char *model_name);
+ uint16_t dst_port, const char *model_name);
int abis_oml_sendmsg(struct msgb *msg);
diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h
index 5e0af77..c893a3d 100644
--- a/include/osmo-bts/gsm_data.h
+++ b/include/osmo-bts/gsm_data.h
@@ -73,6 +73,7 @@ struct gsm_bts_role_bts {
struct paging_state *paging_state;
char *bsc_oml_host;
+ uint16_t bsc_oml_port;
unsigned int rtp_jitter_buf_ms;
struct {
uint8_t ciphers; /* flags A5/1==0x1, A5/2==0x2, A5/3==0x4 */
diff --git a/src/common/abis.c b/src/common/abis.c
index d546a76..1e53d1c 100644
--- a/src/common/abis.c
+++ b/src/common/abis.c
@@ -210,12 +210,13 @@ void abis_init(struct gsm_bts *bts)
}
struct e1inp_line *abis_open(struct gsm_bts *bts, const char *dst_host,
- const char *model_name)
+ uint16_t dst_port, const char *model_name)
{
struct e1inp_line *line;
/* patch in various data from VTY and othe sources */
line_ops.cfg.ipa.addr = dst_host;
+ line_ops.cfg.ipa.oml_port = dst_port;
osmo_get_macaddr(bts_dev_info.mac_addr, "eth0");
bts_dev_info.site_id = bts->ip_access.site_id;
bts_dev_info.bts_id = bts->ip_access.bts_id;
diff --git a/src/common/bts.c b/src/common/bts.c
index 6cbafd1..d9683d5 100644
--- a/src/common/bts.c
+++ b/src/common/bts.c
@@ -33,6 +33,7 @@
#include <osmocom/core/msgb.h>
#include <osmocom/core/talloc.h>
#include <osmocom/gsm/protocol/gsm_12_21.h>
+#include <osmocom/gsm/protocol/ipaccess.h>
#include <osmocom/gsm/lapdm.h>
#include <osmocom/trau/osmo_ortp.h>
@@ -88,6 +89,7 @@ int bts_init(struct gsm_bts *bts)
INIT_LLIST_HEAD(&btsb->agch_queue);
btsb->agch_queue_length = 0;
+ btsb->bsc_oml_port = IPA_TCP_PORT_OML;
/* enable management with default levels,
* raise threshold to GSM_BTS_AGCH_QUEUE_THRESH_LEVEL_DISABLE to
diff --git a/src/common/vty.c b/src/common/vty.c
index a2f2fb3..d0290a5 100644
--- a/src/common/vty.c
+++ b/src/common/vty.c
@@ -170,6 +170,7 @@ static void config_write_bts_single(struct vty *vty, struct gsm_bts *bts)
vty_out(vty, " ipa unit-id %u %u%s",
bts->ip_access.site_id, bts->ip_access.bts_id, VTY_NEWLINE);
vty_out(vty, " oml remote-ip %s%s", btsb->bsc_oml_host, VTY_NEWLINE);
+ vty_out(vty, " oml remote-port %u%s", btsb->bsc_oml_port, VTY_NEWLINE);
vty_out(vty, " rtp jitter-buffer %u%s", btsb->rtp_jitter_buf_ms,
VTY_NEWLINE);
vty_out(vty, " paging queue-size %u%s", paging_get_queue_max(btsb->paging_state),
@@ -305,6 +306,20 @@ DEFUN(cfg_bts_oml_ip,
return CMD_SUCCESS;
}
+DEFUN(cfg_bts_oml_port,
+ cfg_bts_oml_port_cmd,
+ "oml remote-port <0-65535>",
+ "OML Parameters\n" "OML TCP Port\n" "OML TCP Port\n")
+{
+ struct gsm_bts *bts = vty->index;
+ struct gsm_bts_role_bts *btsb = bts_role_bts(bts);
+
+ btsb->bsc_oml_port = atoi(argv[0]);
+
+ return CMD_SUCCESS;
+}
+
+
#define RTP_STR "RTP parameters\n"
DEFUN_HIDDEN(cfg_bts_rtp_bind_ip,
@@ -625,6 +640,7 @@ int bts_vty_init(const struct log_info *cat)
install_default(BTS_NODE);
install_element(BTS_NODE, &cfg_bts_unit_id_cmd);
install_element(BTS_NODE, &cfg_bts_oml_ip_cmd);
+ install_element(BTS_NODE, &cfg_bts_oml_port_cmd);
install_element(BTS_NODE, &cfg_bts_rtp_bind_ip_cmd);
install_element(BTS_NODE, &cfg_bts_rtp_jitbuf_cmd);
install_element(BTS_NODE, &cfg_bts_band_cmd);
diff --git a/src/osmo-bts-sysmo/main.c b/src/osmo-bts-sysmo/main.c
index 51619ee..d2e1dd0 100644
--- a/src/osmo-bts-sysmo/main.c
+++ b/src/osmo-bts-sysmo/main.c
@@ -384,7 +384,7 @@ int main(int argc, char **argv)
exit(1);
}
- line = abis_open(bts, btsb->bsc_oml_host, "sysmoBTS");
+ line = abis_open(bts, btsb->bsc_oml_host, btsb->bsc_oml_port, "sysmoBTS");
if (!line) {
fprintf(stderr, "unable to connect to BSC\n");
exit(1);