Use port number #defines for VTY and CTRL ports

.. as defined in libosmocore
This commit is contained in:
Harald Welte 2014-08-24 17:54:49 +02:00
parent 6e68808247
commit 55dc31e781
8 changed files with 18 additions and 10 deletions

View File

@ -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 @@ int main(int argc, char **argv)
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);

View File

@ -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 @@ int main(int argc, char **argv)
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);

View File

@ -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 @@ int bsc_bootstrap_network(int (*mncc_recv)(struct gsm_network *, struct msgb *),
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;

View File

@ -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 @@ int main(int argc, char **argv)
}
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);

View File

@ -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 @@ int main(int argc, char **argv)
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;

View File

@ -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 @@ int main(int argc, char **argv)
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;

View File

@ -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 @@ struct ctrl_handle *bsc_nat_controlif_setup(struct bsc_nat *nat, int port)
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;

View File

@ -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 @@ int main(int argc, char **argv)
#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;