diff options
-rw-r--r-- | include/osmo-bts/control_if.h | 3 | ||||
-rw-r--r-- | src/common/bts_ctrl_lookup.c | 6 | ||||
-rw-r--r-- | src/common/main.c | 7 |
3 files changed, 12 insertions, 4 deletions
diff --git a/include/osmo-bts/control_if.h b/include/osmo-bts/control_if.h index 750f6bd7..490c87af 100644 --- a/include/osmo-bts/control_if.h +++ b/include/osmo-bts/control_if.h @@ -1,4 +1,5 @@ #pragma once int bts_ctrl_cmds_install(struct gsm_bts *bts); -struct ctrl_handle *bts_controlif_setup(struct gsm_bts *bts); +struct ctrl_handle *bts_controlif_setup(struct gsm_bts *bts, + const char *bind_addr, uint16_t port); diff --git a/src/common/bts_ctrl_lookup.c b/src/common/bts_ctrl_lookup.c index 3ee9b4a3..f0157e9a 100644 --- a/src/common/bts_ctrl_lookup.c +++ b/src/common/bts_ctrl_lookup.c @@ -87,12 +87,14 @@ err_index: return -ERANGE; } -struct ctrl_handle *bts_controlif_setup(struct gsm_bts *bts) +struct ctrl_handle *bts_controlif_setup(struct gsm_bts *bts, + const char *bind_addr, uint16_t port) { struct ctrl_handle *hdl; int rc = 0; - hdl = ctrl_interface_setup(bts, OSMO_CTRL_PORT_BTS, bts_ctrl_node_lookup); + hdl = ctrl_interface_setup_dynip(bts, bind_addr, port, + bts_ctrl_node_lookup); if (!hdl) return NULL; diff --git a/src/common/main.c b/src/common/main.c index f99f196a..00c8b23d 100644 --- a/src/common/main.c +++ b/src/common/main.c @@ -50,6 +50,10 @@ #include <osmo-bts/bts_model.h> #include <osmo-bts/pcu_if.h> #include <osmo-bts/control_if.h> +#include <osmocom/ctrl/control_if.h> +#include <osmocom/ctrl/ports.h> +#include <osmocom/ctrl/control_vty.h> +#include <openbsc/ctrl.h> #include <osmo-bts/oml.h> int quit = 0; @@ -237,6 +241,7 @@ int bts_main(int argc, char **argv) bts_log_init(NULL); vty_init(&bts_vty_info); + ctrl_vty_init(tall_bts_ctx); handle_options(argc, argv); @@ -308,7 +313,7 @@ int bts_main(int argc, char **argv) write_pid_file("osmo-bts"); - bts_controlif_setup(bts); + bts_controlif_setup(bts, ctrl_vty_get_bind_addr(), OSMO_CTRL_PORT_BTS); rc = telnet_init_dynif(tall_bts_ctx, NULL, vty_get_bind_addr(), g_vty_port_num); |