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.
diff --git a/openbsc/include/openbsc/bsc_nat.h b/openbsc/include/openbsc/bsc_nat.h
index 027b6de..309adb1 100644
--- a/openbsc/include/openbsc/bsc_nat.h
+++ b/openbsc/include/openbsc/bsc_nat.h
@@ -423,7 +423,8 @@
void bsc_nat_send_mgcp_to_msc(struct bsc_nat *bsc_nat, struct msgb *msg);
void bsc_nat_handle_mgcp(struct bsc_nat *bsc, struct msgb *msg);
-struct ctrl_handle *bsc_nat_controlif_setup(struct bsc_nat *nat, int port);
+struct ctrl_handle *bsc_nat_controlif_setup(struct bsc_nat *nat,
+ const char *bind_addr, int port);
void bsc_nat_ctrl_del_pending(struct bsc_cmd_list *pending);
int bsc_nat_handle_ctrlif_msg(struct bsc_connection *bsc, struct msgb *msg);
diff --git a/openbsc/include/openbsc/ctrl.h b/openbsc/include/openbsc/ctrl.h
index 38fa054..c5ac210 100644
--- a/openbsc/include/openbsc/ctrl.h
+++ b/openbsc/include/openbsc/ctrl.h
@@ -1,3 +1,4 @@
#pragma once
-struct ctrl_handle *bsc_controlif_setup(struct gsm_network *net, uint16_t port);
+struct ctrl_handle *bsc_controlif_setup(struct gsm_network *net,
+ const char *bind_addr, uint16_t port);
diff --git a/openbsc/include/openbsc/gprs_sgsn.h b/openbsc/include/openbsc/gprs_sgsn.h
index 74f0735..49d5407 100644
--- a/openbsc/include/openbsc/gprs_sgsn.h
+++ b/openbsc/include/openbsc/gprs_sgsn.h
@@ -315,7 +315,8 @@
* ctrl interface related work
*/
struct gsm_network;
-struct ctrl_handle *sgsn_controlif_setup(struct gsm_network *, uint16_t port);
+struct ctrl_handle *sgsn_controlif_setup(struct gsm_network *,
+ const char *bind_addr, uint16_t port);
int sgsn_ctrl_cmds_install(void);
/*