aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/osmo-bsc_nat/bsc_nat.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-02-23 15:10:33 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-02-25 12:18:04 +0100
commit73828152d9472d5977a18491f2d9ca9b24077f43 (patch)
tree72d54bdd16bd2efa3f750825bff79771b7310fe7 /openbsc/src/osmo-bsc_nat/bsc_nat.c
parentfc7add20e1b54e1b0d10c7457629507fb62d7d31 (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_nat/bsc_nat.c')
-rw-r--r--openbsc/src/osmo-bsc_nat/bsc_nat.c9
1 files changed, 8 insertions, 1 deletions
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 <osmocom/ctrl/control_cmd.h>
#include <osmocom/ctrl/control_if.h>
#include <osmocom/ctrl/ports.h>
+#include <osmocom/ctrl/control_vty.h>
#include <osmocom/crypt/auth.h>
@@ -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);