diff options
author | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2016-02-23 15:10:33 +0100 |
---|---|---|
committer | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2016-02-25 12:18:04 +0100 |
commit | 73828152d9472d5977a18491f2d9ca9b24077f43 (patch) | |
tree | 72d54bdd16bd2efa3f750825bff79771b7310fe7 /openbsc/src/osmo-bsc/osmo_bsc_main.c | |
parent | fc7add20e1b54e1b0d10c7457629507fb62d7d31 (diff) |
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.
Diffstat (limited to 'openbsc/src/osmo-bsc/osmo_bsc_main.c')
-rw-r--r-- | openbsc/src/osmo-bsc/osmo_bsc_main.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_main.c b/openbsc/src/osmo-bsc/osmo_bsc_main.c index 3806b2473..3594a5b5a 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_main.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_main.c @@ -32,6 +32,7 @@ #include <osmocom/ctrl/control_cmd.h> #include <osmocom/ctrl/control_if.h> #include <osmocom/ctrl/ports.h> +#include <osmocom/ctrl/control_vty.h> #include <osmocom/core/application.h> #include <osmocom/core/linuxlist.h> @@ -205,6 +206,7 @@ int main(int argc, char **argv) vty_init(&vty_info); bsc_vty_init(&log_info); bsc_msg_lst_vty_init(tall_bsc_ctx, &access_lists, BSC_NODE); + ctrl_vty_init(tall_bsc_ctx); INIT_LLIST_HEAD(&access_lists); @@ -225,7 +227,13 @@ int main(int argc, char **argv) } bsc_api_init(bsc_gsmnet, osmo_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) { fprintf(stderr, "Failed to init the control interface. Exiting.\n"); exit(1); |