Use port number #defines for VTY and CTRL ports
.. as defined in libosmocore
diff --git a/openbsc/src/gprs/gb_proxy_main.c b/openbsc/src/gprs/gb_proxy_main.c
index 149253b..03299df 100644
--- a/openbsc/src/gprs/gb_proxy_main.c
+++ b/openbsc/src/gprs/gb_proxy_main.c
@@ -48,6 +48,7 @@
#include <osmocom/vty/command.h>
#include <osmocom/vty/telnet_interface.h>
#include <osmocom/vty/logging.h>
+#include <osmocom/vty/ports.h>
#include "../../bscconfig.h"
@@ -250,7 +251,7 @@
rate_ctr_init(tall_bsc_ctx);
- rc = telnet_init(tall_bsc_ctx, &dummy_network, 4246);
+ rc = telnet_init(tall_bsc_ctx, &dummy_network, OSMO_VTY_PORT_GBPROXY);
if (rc < 0)
exit(1);
diff --git a/openbsc/src/gprs/sgsn_main.c b/openbsc/src/gprs/sgsn_main.c
index c8078ba..41e11f7 100644
--- a/openbsc/src/gprs/sgsn_main.c
+++ b/openbsc/src/gprs/sgsn_main.c
@@ -43,6 +43,7 @@
#include <osmocom/vty/telnet_interface.h>
#include <osmocom/vty/logging.h>
+#include <osmocom/vty/ports.h>
#include <openbsc/signal.h>
#include <openbsc/debug.h>
@@ -51,6 +52,7 @@
#include <openbsc/gprs_llc.h>
#include <openbsc/gprs_gmm.h>
#include <osmocom/ctrl/control_if.h>
+#include <osmocom/ctrl/ports.h>
#include <gtp.h>
@@ -312,11 +314,11 @@
handle_options(argc, argv);
rate_ctr_init(tall_bsc_ctx);
- rc = telnet_init(tall_bsc_ctx, &dummy_network, 4245);
+ rc = telnet_init(tall_bsc_ctx, &dummy_network, OSMO_VTY_PORT_SGSN);
if (rc < 0)
exit(1);
- ctrl = sgsn_controlif_setup(NULL, 4251);
+ ctrl = sgsn_controlif_setup(NULL, OSMO_CTRL_PORT_SGSN);
if (!ctrl) {
LOGP(DGPRS, LOGL_ERROR, "Failed to create CTRL interface.\n");
exit(1);
diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c
index 8fd72cf..796d027 100644
--- a/openbsc/src/libbsc/bsc_init.c
+++ b/openbsc/src/libbsc/bsc_init.c
@@ -27,6 +27,7 @@
#include <openbsc/debug.h>
#include <openbsc/misdn.h>
#include <osmocom/vty/telnet_interface.h>
+#include <osmocom/vty/ports.h>
#include <openbsc/system_information.h>
#include <openbsc/paging.h>
#include <openbsc/signal.h>
@@ -478,7 +479,7 @@
return rc;
}
- rc = telnet_init(tall_bsc_ctx, bsc_gsmnet, 4242);
+ rc = telnet_init(tall_bsc_ctx, bsc_gsmnet, OSMO_VTY_PORT_NITB_BSC);
if (rc < 0)
return rc;
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_main.c b/openbsc/src/osmo-bsc/osmo_bsc_main.c
index d39759b..5c38855 100644
--- a/openbsc/src/osmo-bsc/osmo_bsc_main.c
+++ b/openbsc/src/osmo-bsc/osmo_bsc_main.c
@@ -31,6 +31,7 @@
#include <osmocom/ctrl/control_cmd.h>
#include <osmocom/ctrl/control_if.h>
+#include <osmocom/ctrl/ports.h>
#include <osmocom/core/application.h>
#include <osmocom/core/linuxlist.h>
@@ -213,7 +214,7 @@
}
bsc_api_init(bsc_gsmnet, osmo_bsc_api());
- bsc_gsmnet->ctrl = bsc_controlif_setup(bsc_gsmnet, 4249);
+ bsc_gsmnet->ctrl = bsc_controlif_setup(bsc_gsmnet, OSMO_CTRL_PORT_NITB_BSC);
if (!bsc_gsmnet) {
fprintf(stderr, "Failed to init the control interface. Exiting.\n");
exit(1);
diff --git a/openbsc/src/osmo-bsc_mgcp/mgcp_main.c b/openbsc/src/osmo-bsc_mgcp/mgcp_main.c
index 16fb722..bee1276 100644
--- a/openbsc/src/osmo-bsc_mgcp/mgcp_main.c
+++ b/openbsc/src/osmo-bsc_mgcp/mgcp_main.c
@@ -44,7 +44,7 @@
#include <osmocom/vty/telnet_interface.h>
#include <osmocom/vty/logging.h>
-
+#include <osmocom/vty/ports.h>
#include <osmocom/vty/command.h>
#include "../../bscconfig.h"
@@ -228,7 +228,7 @@
if (rc < 0)
return rc;
- rc = telnet_init(tall_bsc_ctx, &dummy_network, 4243);
+ rc = telnet_init(tall_bsc_ctx, &dummy_network, OSMO_VTY_PORT_BSC_MGCP);
if (rc < 0)
return rc;
diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat.c b/openbsc/src/osmo-bsc_nat/bsc_nat.c
index e66eb08..dcc30ca 100644
--- a/openbsc/src/osmo-bsc_nat/bsc_nat.c
+++ b/openbsc/src/osmo-bsc_nat/bsc_nat.c
@@ -57,6 +57,7 @@
#include <osmocom/vty/telnet_interface.h>
#include <osmocom/vty/vty.h>
#include <osmocom/vty/logging.h>
+#include <osmocom/vty/ports.h>
#include <osmocom/sccp/sccp.h>
@@ -1534,7 +1535,7 @@
rate_ctr_init(tall_bsc_ctx);
/* init vty and parse */
- telnet_init(tall_bsc_ctx, NULL, 4244);
+ telnet_init(tall_bsc_ctx, NULL, OSMO_VTY_PORT_BSC_NAT);
if (mgcp_parse_config(config_file, nat->mgcp_cfg, MGCP_BSC_NAT) < 0) {
fprintf(stderr, "Failed to parse the config file: '%s'\n", config_file);
return -3;
diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c b/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c
index 14985e7..877a8c8 100644
--- a/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c
+++ b/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c
@@ -23,6 +23,7 @@
#include <osmocom/ctrl/control_cmd.h>
#include <osmocom/ctrl/control_if.h>
+#include <osmocom/ctrl/ports.h>
#include <openbsc/ctrl.h>
#include <openbsc/bsc_nat.h>
@@ -383,7 +384,7 @@
int rc;
- ctrl = bsc_controlif_setup(NULL, 4250);
+ ctrl = bsc_controlif_setup(NULL, OSMO_CTRL_PORT_BSC_NAT);
if (!ctrl) {
fprintf(stderr, "Failed to initialize the control interface. Exiting.\n");
return NULL;
diff --git a/openbsc/src/osmo-nitb/bsc_hack.c b/openbsc/src/osmo-nitb/bsc_hack.c
index 372e527..a802507 100644
--- a/openbsc/src/osmo-nitb/bsc_hack.c
+++ b/openbsc/src/osmo-nitb/bsc_hack.c
@@ -47,6 +47,7 @@
#include <openbsc/handover_decision.h>
#include <openbsc/rrlp.h>
#include <osmocom/ctrl/control_if.h>
+#include <osmocom/ctrl/ports.h>
#include <openbsc/ctrl.h>
#include <openbsc/osmo_bsc_rf.h>
@@ -285,7 +286,7 @@
#endif
bsc_api_init(bsc_gsmnet, msc_bsc_api());
- bsc_gsmnet->ctrl = bsc_controlif_setup(bsc_gsmnet, 4249);
+ bsc_gsmnet->ctrl = bsc_controlif_setup(bsc_gsmnet, OSMO_CTRL_PORT_NITB_BSC);
if (!bsc_gsmnet->ctrl) {
printf("Failed to initialize control interface. Exiting.\n");
return -1;