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/src/osmo-bsc_nat/bsc_nat.c b/openbsc/src/osmo-bsc_nat/bsc_nat.c
index 04c12e3..cdab406 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 @@
 	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 @@
 		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);