From 73828152d9472d5977a18491f2d9ca9b24077f43 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Tue, 23 Feb 2016 15:10:33 +0100 Subject: enable ctrl bind config for various programs Add ctrl_vty_init() calls and feed the ctrl_vty_get_bind_addr() return value to ctrl_interface_setup() in the following programs: osmo-bsc osmo-bsc_nat osmo-nitb osmo-sgsn For osmo-sgsn, move the control interface setup invocation below the config parsing, so that the ctrl_vty_get_bind_addr() can return the configured address. --- openbsc/src/osmo-nitb/bsc_hack.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'openbsc/src/osmo-nitb') diff --git a/openbsc/src/osmo-nitb/bsc_hack.c b/openbsc/src/osmo-nitb/bsc_hack.c index bfc1b7165..257fe3ede 100644 --- a/openbsc/src/osmo-nitb/bsc_hack.c +++ b/openbsc/src/osmo-nitb/bsc_hack.c @@ -49,6 +49,7 @@ #include #include #include +#include #include #include #include @@ -272,6 +273,7 @@ int main(int argc, char **argv) /* This needs to precede handle_options() */ vty_init(&vty_info); bsc_vty_init(&log_info); + ctrl_vty_init(tall_bsc_ctx); #ifdef BUILD_SMPP if (smpp_openbsc_init(tall_bsc_ctx, 0) < 0) @@ -295,7 +297,13 @@ int main(int argc, char **argv) #endif bsc_api_init(bsc_gsmnet, msc_bsc_api()); - bsc_gsmnet->ctrl = bsc_controlif_setup(bsc_gsmnet, OSMO_CTRL_PORT_NITB_BSC); + /* start control interface after reading config for + * ctrl_vty_get_bind_addr() */ + LOGP(DNM, LOGL_NOTICE, "CTRL at %s %d\n", + ctrl_vty_get_bind_addr(), OSMO_CTRL_PORT_NITB_BSC); + bsc_gsmnet->ctrl = bsc_controlif_setup(bsc_gsmnet, + ctrl_vty_get_bind_addr(), + OSMO_CTRL_PORT_NITB_BSC); if (!bsc_gsmnet->ctrl) { printf("Failed to initialize control interface. Exiting.\n"); return -1; -- cgit v1.2.3