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-bsc_nat/bsc_nat.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'openbsc/src/osmo-bsc_nat/bsc_nat.c') diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat.c b/openbsc/src/osmo-bsc_nat/bsc_nat.c index 04c12e33f..cdab4064d 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat.c @@ -52,6 +52,7 @@ #include #include #include +#include #include @@ -1618,6 +1619,7 @@ int main(int argc, char **argv) logging_vty_add_cmds(&log_info); osmo_stats_vty_add_cmds(&log_info); bsc_nat_vty_init(nat); + ctrl_vty_init(tall_bsc_ctx); /* parse options */ @@ -1664,7 +1666,12 @@ int main(int argc, char **argv) exit(1); } - nat->ctrl = bsc_nat_controlif_setup(nat, OSMO_CTRL_PORT_BSC_NAT); + /* start control interface after reading config for + * ctrl_vty_get_bind_addr() */ + LOGP(DNAT, LOGL_NOTICE, "CTRL at %s %d\n", + ctrl_vty_get_bind_addr(), OSMO_CTRL_PORT_BSC_NAT); + nat->ctrl = bsc_nat_controlif_setup(nat, ctrl_vty_get_bind_addr(), + OSMO_CTRL_PORT_BSC_NAT); if (!nat->ctrl) { fprintf(stderr, "Creating the control interface failed.\n"); exit(1); -- cgit v1.2.3