diff options
author | Harald Welte <laforge@gnumonks.org> | 2014-08-18 22:46:42 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2014-08-24 17:25:47 +0200 |
commit | af066bab9dac8f52efad4d924b6dcc3bc3c64626 (patch) | |
tree | 68986b115de9479d6d7683851cabf4278f06934e /src | |
parent | c0a3030277ed1541bcbfd5f602ee6dbe906fac14 (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.
Diffstat (limited to 'src')
-rw-r--r-- | src/common/abis.c | 3 | ||||
-rw-r--r-- | src/common/bts.c | 2 | ||||
-rw-r--r-- | src/common/vty.c | 16 | ||||
-rw-r--r-- | src/osmo-bts-sysmo/main.c | 2 |
4 files changed, 21 insertions, 2 deletions
diff --git a/src/common/abis.c b/src/common/abis.c index d546a760..1e53d1c2 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 6cbafd1f..d9683d5f 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 a2f2fb37..d0290a5e 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 51619ee9..d2e1dd01 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); |