Change in osmo-sgsn[master]: Update wrong references to bsc in sgsn code

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Tue Oct 30 16:36:48 UTC 2018


Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/11528


Change subject: Update wrong references to bsc in sgsn code
......................................................................

Update wrong references to bsc in sgsn code

Change-Id: I93f0dc721c2eff8a87fb9248882f24768f708713
---
M src/gprs/gb_proxy.c
M src/gprs/gb_proxy_main.c
M src/gprs/gb_proxy_patch.c
M src/gprs/gb_proxy_peer.c
M src/gprs/gprs_gmm.c
M src/gprs/gprs_sgsn.c
M src/gprs/gprs_subscriber.c
M src/gprs/gsup_client.c
M src/gprs/gtphub_main.c
M src/gprs/gtphub_vty.c
M src/gprs/sgsn_ares.c
M src/gprs/sgsn_main.c
M src/gprs/sgsn_vty.c
M tests/gbproxy/gbproxy_test.c
M tests/sgsn/sgsn_test.c
M tests/vty_test_runner.py
16 files changed, 80 insertions(+), 80 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/28/11528/1

diff --git a/src/gprs/gb_proxy.c b/src/gprs/gb_proxy.c
index 8bb6789..fe6a6c6 100644
--- a/src/gprs/gb_proxy.c
+++ b/src/gprs/gb_proxy.c
@@ -50,7 +50,7 @@
 #include <osmocom/gsm/protocol/gsm_04_08_gprs.h>
 #include <osmocom/sgsn/gprs_utils.h>
 
-extern void *tall_bsc_ctx;
+extern void *tall_sgsn_ctx;
 
 static const struct rate_ctr_desc global_ctr_description[] = {
 	{ "inv-bvci",	    "Invalid BVC Identifier          " },
@@ -1447,7 +1447,7 @@
 	struct timespec tp;
 
 	INIT_LLIST_HEAD(&cfg->bts_peers);
-	cfg->ctrg = rate_ctr_group_alloc(tall_bsc_ctx, &global_ctrg_desc, 0);
+	cfg->ctrg = rate_ctr_group_alloc(tall_sgsn_ctx, &global_ctrg_desc, 0);
 	if (!cfg->ctrg) {
 		LOGP(DGPRS, LOGL_ERROR, "Cannot allocate global counter group!\n");
 		return -1;
diff --git a/src/gprs/gb_proxy_main.c b/src/gprs/gb_proxy_main.c
index 97e6342..19fbbba 100644
--- a/src/gprs/gb_proxy_main.c
+++ b/src/gprs/gb_proxy_main.c
@@ -62,7 +62,7 @@
 #define _GNU_SOURCE
 #include <getopt.h>
 
-void *tall_bsc_ctx;
+void *tall_sgsn_ctx;
 
 const char *openbsc_copyright =
 	"Copyright (C) 2010 Harald Welte and On-Waves\r\n"
@@ -116,7 +116,7 @@
 		 * and then return to the caller, who will abort the process */
 	case SIGUSR1:
 		talloc_report(tall_vty_ctx, stderr);
-		talloc_report_full(tall_bsc_ctx, stderr);
+		talloc_report_full(tall_sgsn_ctx, stderr);
 		break;
 	case SIGUSR2:
 		talloc_report_full(tall_vty_ctx, stderr);
@@ -269,9 +269,9 @@
 	int rc;
 	struct ctrl_handle *ctrl;
 
-	tall_bsc_ctx = talloc_named_const(NULL, 0, "nsip_proxy");
-	msgb_talloc_ctx_init(tall_bsc_ctx, 0);
-	vty_info.tall_ctx = tall_bsc_ctx;
+	tall_sgsn_ctx = talloc_named_const(NULL, 0, "nsip_proxy");
+	msgb_talloc_ctx_init(tall_sgsn_ctx, 0);
+	vty_info.tall_ctx = tall_sgsn_ctx;
 
 	signal(SIGINT, &signal_handler);
 	signal(SIGTERM, &signal_handler);
@@ -280,7 +280,7 @@
 	signal(SIGUSR2, &signal_handler);
 	osmo_init_ignore_signals();
 
-	osmo_init_logging2(tall_bsc_ctx, &gprs_log_info);
+	osmo_init_logging2(tall_sgsn_ctx, &gprs_log_info);
 
 	vty_info.copyright = openbsc_copyright;
 	vty_init(&vty_info);
@@ -306,16 +306,16 @@
 			config_file = CONFIG_FILE_DEFAULT;
 	}
 
-	rate_ctr_init(tall_bsc_ctx);
-	osmo_stats_init(tall_bsc_ctx);
+	rate_ctr_init(tall_sgsn_ctx);
+	osmo_stats_init(tall_sgsn_ctx);
 
-	bssgp_nsi = gprs_ns_instantiate(&proxy_ns_cb, tall_bsc_ctx);
+	bssgp_nsi = gprs_ns_instantiate(&proxy_ns_cb, tall_sgsn_ctx);
 	if (!bssgp_nsi) {
 		LOGP(DGPRS, LOGL_ERROR, "Unable to instantiate NS\n");
 		exit(1);
 	}
 
-	gbcfg = talloc_zero(tall_bsc_ctx, struct gbproxy_config);
+	gbcfg = talloc_zero(tall_sgsn_ctx, struct gbproxy_config);
 	if (!gbcfg) {
 		LOGP(DGPRS, LOGL_FATAL, "Unable to allocate config\n");
 		exit(1);
@@ -334,7 +334,7 @@
 	}
 
 	/* start telnet after reading config for vty_get_bind_addr() */
-	rc = telnet_init_dynif(tall_bsc_ctx, NULL,
+	rc = telnet_init_dynif(tall_sgsn_ctx, NULL,
 			       vty_get_bind_addr(), OSMO_VTY_PORT_GBPROXY);
 	if (rc < 0)
 		exit(1);
diff --git a/src/gprs/gb_proxy_patch.c b/src/gprs/gb_proxy_patch.c
index 9cca9a8..251bb67 100644
--- a/src/gprs/gb_proxy_patch.c
+++ b/src/gprs/gb_proxy_patch.c
@@ -29,7 +29,7 @@
 #include <osmocom/core/rate_ctr.h>
 #include <osmocom/gsm/apn.h>
 
-extern void *tall_bsc_ctx;
+extern void *tall_sgsn_ctx;
 
 /* patch RA identifier in place */
 static void gbproxy_patch_raid(struct gsm48_ra_id *raid_enc, struct gbproxy_peer *peer,
@@ -420,7 +420,7 @@
 
 	if (rc == 0) {
 		match->enable = 1;
-		match->re_str = talloc_strdup(tall_bsc_ctx, filter);
+		match->re_str = talloc_strdup(tall_sgsn_ctx, filter);
 		return 0;
 	}
 
diff --git a/src/gprs/gb_proxy_peer.c b/src/gprs/gb_proxy_peer.c
index a862a83..48482b6 100644
--- a/src/gprs/gb_proxy_peer.c
+++ b/src/gprs/gb_proxy_peer.c
@@ -32,7 +32,7 @@
 
 #include <string.h>
 
-extern void *tall_bsc_ctx;
+extern void *tall_sgsn_ctx;
 
 static const struct rate_ctr_desc peer_ctr_description[] = {
 	{ "blocked",	   "BVC Block                       " },
@@ -185,7 +185,7 @@
 {
 	struct gbproxy_peer *peer;
 
-	peer = talloc_zero(tall_bsc_ctx, struct gbproxy_peer);
+	peer = talloc_zero(tall_sgsn_ctx, struct gbproxy_peer);
 	if (!peer)
 		return NULL;
 
diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c
index a0221ea..cc6ea4a 100644
--- a/src/gprs/gprs_gmm.c
+++ b/src/gprs/gprs_gmm.c
@@ -68,7 +68,7 @@
 #define PTMSI_ALLOC
 
 extern struct sgsn_instance *sgsn;
-extern void *tall_bsc_ctx;
+extern void *tall_sgsn_ctx;
 
 static const struct tlv_definition gsm48_gmm_att_tlvdef = {
 	.def = {
@@ -2623,7 +2623,7 @@
 		goto no_context;
 
 	/* schedule a dynamic look-up */
-	mmctx->ggsn_lookup = talloc_zero(tall_bsc_ctx, struct sgsn_ggsn_lookup);
+	mmctx->ggsn_lookup = talloc_zero(tall_sgsn_ctx, struct sgsn_ggsn_lookup);
 	if (!mmctx->ggsn_lookup)
 		goto no_context;
 
diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c
index efbae22..bac7325 100644
--- a/src/gprs/gprs_sgsn.c
+++ b/src/gprs/gprs_sgsn.c
@@ -56,7 +56,7 @@
 #define GPRS_LLME_CHECK_TICK 30
 
 extern struct sgsn_instance *sgsn;
-extern void *tall_bsc_ctx;
+extern void *tall_sgsn_ctx;
 
 LLIST_HEAD(sgsn_mm_ctxts);
 LLIST_HEAD(sgsn_ggsn_ctxts);
@@ -135,7 +135,7 @@
 };
 
 void sgsn_rate_ctr_init() {
-	sgsn->rate_ctrs = rate_ctr_group_alloc(tall_bsc_ctx, &sgsn_ctrg_desc, 0);
+	sgsn->rate_ctrs = rate_ctr_group_alloc(tall_sgsn_ctx, &sgsn_ctrg_desc, 0);
 	OSMO_ASSERT(sgsn->rate_ctrs);
 }
 
@@ -223,7 +223,7 @@
 {
 	struct sgsn_mm_ctx *ctx;
 
-	ctx = talloc_zero(tall_bsc_ctx, struct sgsn_mm_ctx);
+	ctx = talloc_zero(tall_sgsn_ctx, struct sgsn_mm_ctx);
 	if (!ctx)
 		return NULL;
 
@@ -257,7 +257,7 @@
 	struct sgsn_mm_ctx *ctx;
 	struct ranap_ue_conn_ctx *ue_ctx = uectx;
 
-	ctx = talloc_zero(tall_bsc_ctx, struct sgsn_mm_ctx);
+	ctx = talloc_zero(tall_sgsn_ctx, struct sgsn_mm_ctx);
 	if (!ctx)
 		return NULL;
 
@@ -403,7 +403,7 @@
 	if (pdp)
 		return NULL;
 
-	pdp = talloc_zero(tall_bsc_ctx, struct sgsn_pdp_ctx);
+	pdp = talloc_zero(tall_sgsn_ctx, struct sgsn_pdp_ctx);
 	if (!pdp)
 		return NULL;
 
@@ -512,7 +512,7 @@
 {
 	struct sgsn_ggsn_ctx *ggc;
 
-	ggc = talloc_zero(tall_bsc_ctx, struct sgsn_ggsn_ctx);
+	ggc = talloc_zero(tall_sgsn_ctx, struct sgsn_ggsn_ctx);
 	if (!ggc)
 		return NULL;
 
@@ -575,7 +575,7 @@
 {
 	struct apn_ctx *actx;
 
-	actx = talloc_zero(tall_bsc_ctx, struct apn_ctx);
+	actx = talloc_zero(tall_sgsn_ctx, struct apn_ctx);
 	if (!actx)
 		return NULL;
 	actx->name = talloc_strdup(actx, ap_name);
diff --git a/src/gprs/gprs_subscriber.c b/src/gprs/gprs_subscriber.c
index dfd697b..6c4f81f 100644
--- a/src/gprs/gprs_subscriber.c
+++ b/src/gprs/gprs_subscriber.c
@@ -47,7 +47,7 @@
 	     (gsup)->imsi, \
 	     ## args)
 
-extern void *tall_bsc_ctx;
+extern void *tall_sgsn_ctx;
 
 LLIST_HEAD(_gprs_subscribers);
 struct llist_head * const gprs_subscribers = &_gprs_subscribers;
@@ -141,7 +141,7 @@
 static struct gprs_subscr *gprs_subscr_alloc(void)
 {
 	struct gprs_subscr *gsub;
-	gsub = talloc_zero(tall_bsc_ctx, struct gprs_subscr);
+	gsub = talloc_zero(tall_sgsn_ctx, struct gprs_subscr);
 	if (!gsub)
 		return NULL;
 	llist_add_tail(&gsub->entry, gprs_subscribers);
diff --git a/src/gprs/gsup_client.c b/src/gprs/gsup_client.c
index 95c4988..37bebd9 100644
--- a/src/gprs/gsup_client.c
+++ b/src/gprs/gsup_client.c
@@ -33,7 +33,7 @@
 #include <errno.h>
 #include <string.h>
 
-extern void *tall_bsc_ctx;
+extern void *tall_sgsn_ctx;
 
 static void start_test_procedure(struct gsup_client *gsupc);
 
@@ -274,7 +274,7 @@
 	struct gsup_client *gsupc;
 	int rc;
 
-	gsupc = talloc_zero(tall_bsc_ctx, struct gsup_client);
+	gsupc = talloc_zero(tall_sgsn_ctx, struct gsup_client);
 	OSMO_ASSERT(gsupc);
 
 	/* struct ipaccess_unit has a non-const unit_name, so let's copy to be
diff --git a/src/gprs/gtphub_main.c b/src/gprs/gtphub_main.c
index f824016..0369ed7 100644
--- a/src/gprs/gtphub_main.c
+++ b/src/gprs/gtphub_main.c
@@ -51,7 +51,7 @@
 #endif
 
 extern void *osmo_gtphub_ctx;
-void *tall_bsc_ctx;
+void *tall_sgsn_ctx;
 
 const char *gtphub_copyright =
 	"Copyright (C) 2015 sysmocom s.f.m.c GmbH <info at sysmocom.de>\r\n"
diff --git a/src/gprs/gtphub_vty.c b/src/gprs/gtphub_vty.c
index ec35e4d..abc08fd 100644
--- a/src/gprs/gtphub_vty.c
+++ b/src/gprs/gtphub_vty.c
@@ -37,7 +37,7 @@
  * globals. */
 #include <osmocom/sgsn/sgsn.h>
 extern struct sgsn_instance *sgsn;
-extern void *tall_bsc_ctx;
+extern void *tall_sgsn_ctx;
 
 static struct gtphub *g_hub = 0;
 static struct gtphub_cfg *g_cfg = 0;
@@ -270,7 +270,7 @@
 	"grx-dns-add A.B.C.D",
 	"Add DNS server\nIPv4 address\n")
 {
-	struct ares_addr_node *node = talloc_zero(tall_bsc_ctx, struct ares_addr_node);
+	struct ares_addr_node *node = talloc_zero(tall_sgsn_ctx, struct ares_addr_node);
 	node->family = AF_INET;
 	inet_aton(argv[0], &node->addr.addr4);
 
diff --git a/src/gprs/sgsn_ares.c b/src/gprs/sgsn_ares.c
index 17567c4..ba168d6 100644
--- a/src/gprs/sgsn_ares.c
+++ b/src/gprs/sgsn_ares.c
@@ -24,7 +24,7 @@
 
 #include <netdb.h>
 
-extern void *tall_bsc_ctx;
+extern void *tall_sgsn_ctx;
 
 struct cares_event_fd {
 	struct llist_head head;
@@ -110,7 +110,7 @@
 	}
 
 	LOGP(DGPRS, LOGL_DEBUG, "Registering C-ares fd (%d)\n", fd);
-	ufd = talloc_zero(tall_bsc_ctx, struct cares_event_fd);
+	ufd = talloc_zero(tall_sgsn_ctx, struct cares_event_fd);
 	ufd->fd.fd = fd;
 	ufd->fd.cb = ares_osmo_fd_cb;
 	ufd->fd.data = data;
@@ -137,7 +137,7 @@
 {
 	struct cares_cb_data *cb_data;
 
-	cb_data = talloc_zero(tall_bsc_ctx, struct cares_cb_data);
+	cb_data = talloc_zero(tall_sgsn_ctx, struct cares_cb_data);
 	cb_data->cb = cb;
 	cb_data->data = data;
 	ares_gethostbyname(sgsn->ares_channel, name, AF_INET, ares_cb, cb_data);
diff --git a/src/gprs/sgsn_main.c b/src/gprs/sgsn_main.c
index 11ed5d3..a17d925 100644
--- a/src/gprs/sgsn_main.c
+++ b/src/gprs/sgsn_main.c
@@ -76,7 +76,7 @@
 #define _GNU_SOURCE
 #include <getopt.h>
 
-void *tall_bsc_ctx;
+void *tall_sgsn_ctx;
 struct ctrl_handle *g_ctrlh;
 
 struct gprs_ns_inst *sgsn_nsi;
@@ -165,7 +165,7 @@
 		 * and then return to the caller, who will abort the process */
 	case SIGUSR1:
 		talloc_report(tall_vty_ctx, stderr);
-		talloc_report_full(tall_bsc_ctx, stderr);
+		talloc_report_full(tall_sgsn_ctx, stderr);
 		break;
 	case SIGUSR2:
 		talloc_report_full(tall_vty_ctx, stderr);
@@ -375,9 +375,9 @@
 #endif
 
 	srand(time(NULL));
-	tall_bsc_ctx = talloc_named_const(NULL, 0, "osmo_sgsn");
-	msgb_talloc_ctx_init(tall_bsc_ctx, 0);
-	vty_info.tall_ctx = tall_bsc_ctx;
+	tall_sgsn_ctx = talloc_named_const(NULL, 0, "osmo_sgsn");
+	msgb_talloc_ctx_init(tall_sgsn_ctx, 0);
+	vty_info.tall_ctx = tall_sgsn_ctx;
 
 	signal(SIGINT, &signal_handler);
 	signal(SIGTERM, &signal_handler);
@@ -386,8 +386,8 @@
 	signal(SIGUSR2, &signal_handler);
 
 	osmo_init_ignore_signals();
-	osmo_init_logging2(tall_bsc_ctx, &gprs_log_info);
-	osmo_stats_init(tall_bsc_ctx);
+	osmo_init_logging2(tall_sgsn_ctx, &gprs_log_info);
+	osmo_stats_init(tall_sgsn_ctx);
 
 	vty_info.copyright = openbsc_copyright;
 	vty_init(&vty_info);
@@ -395,11 +395,11 @@
 	osmo_talloc_vty_add_cmds();
 	osmo_stats_vty_add_cmds(&gprs_log_info);
 	sgsn_vty_init(&sgsn_inst.cfg);
-	ctrl_vty_init(tall_bsc_ctx);
+	ctrl_vty_init(tall_sgsn_ctx);
 
 #if BUILD_IU
 	osmo_ss7_init();
-	osmo_ss7_vty_init_asp(tall_bsc_ctx);
+	osmo_ss7_vty_init_asp(tall_sgsn_ctx);
 	osmo_sccp_vty_init();
 #endif
 
@@ -420,12 +420,12 @@
 			sgsn_inst.config_file = CONFIG_FILE_DEFAULT;
 	}
 
-	rate_ctr_init(tall_bsc_ctx);
+	rate_ctr_init(tall_sgsn_ctx);
 
 	gprs_ns_set_log_ss(DNS);
 	bssgp_set_log_ss(DBSSGP);
 
-	sgsn_nsi = gprs_ns_instantiate(&sgsn_ns_cb, tall_bsc_ctx);
+	sgsn_nsi = gprs_ns_instantiate(&sgsn_ns_cb, tall_sgsn_ctx);
 	if (!sgsn_nsi) {
 		LOGP(DGPRS, LOGL_ERROR, "Unable to instantiate NS\n");
 		exit(1);
@@ -451,7 +451,7 @@
 	}
 
 	/* start telnet after reading config for vty_get_bind_addr() */
-	rc = telnet_init_dynif(tall_bsc_ctx, NULL,
+	rc = telnet_init_dynif(tall_sgsn_ctx, NULL,
 			       vty_get_bind_addr(), OSMO_VTY_PORT_SGSN);
 	if (rc < 0)
 		exit(1);
@@ -507,7 +507,7 @@
 
 #if BUILD_IU
 	/* Note that these are mostly defaults and can be overriden from the VTY */
-	sccp = osmo_sccp_simple_client(tall_bsc_ctx, "OsmoSGSN",
+	sccp = osmo_sccp_simple_client(tall_sgsn_ctx, "OsmoSGSN",
 				       (23 << 3) + 4,
 				       OSMO_SS7_ASP_PROT_M3UA,
 				       0, NULL,
@@ -517,7 +517,7 @@
 		return 8;
 	}
 
-	ranap_iu_init(tall_bsc_ctx, DRANAP, "OsmoSGSN-IuPS", sccp, gsm0408_gprs_rcvmsg_iu, sgsn_ranap_iu_event);
+	ranap_iu_init(tall_sgsn_ctx, DRANAP, "OsmoSGSN-IuPS", sccp, gsm0408_gprs_rcvmsg_iu, sgsn_ranap_iu_event);
 #endif
 
 	if (daemonize) {
diff --git a/src/gprs/sgsn_vty.c b/src/gprs/sgsn_vty.c
index 87c6884..72a310b 100644
--- a/src/gprs/sgsn_vty.c
+++ b/src/gprs/sgsn_vty.c
@@ -56,7 +56,7 @@
 #include <osmocom/ranap/iu_client.h>
 #endif
 
-extern void *tall_bsc_ctx;
+extern void *tall_sgsn_ctx;
 
 static struct sgsn_config *g_cfg = NULL;
 
@@ -416,7 +416,7 @@
 	"Use the specified IP address for DNS-resolving the AP names to GGSN IP addresses\n"
 	"IPv4 address\n")
 {
-	struct ares_addr_node *node = talloc_zero(tall_bsc_ctx, struct ares_addr_node);
+	struct ares_addr_node *node = talloc_zero(tall_sgsn_ctx, struct ares_addr_node);
 	node->family = AF_INET;
 	inet_aton(argv[0], &node->addr.addr4);
 
diff --git a/tests/gbproxy/gbproxy_test.c b/tests/gbproxy/gbproxy_test.c
index a183320..55776be 100644
--- a/tests/gbproxy/gbproxy_test.c
+++ b/tests/gbproxy/gbproxy_test.c
@@ -47,7 +47,7 @@
 
 #define MATCH_ANY (-1)
 
-void *tall_bsc_ctx = NULL;
+void *tall_sgsn_ctx = NULL;
 
 struct gbproxy_config gbcfg = {0};
 
@@ -1329,7 +1329,7 @@
 
 static void test_gbproxy()
 {
-	struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, tall_bsc_ctx);
+	struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, tall_sgsn_ctx);
 	struct sockaddr_in bss_peer[4] = {{0},};
 	struct sockaddr_in sgsn_peer= {0};
 
@@ -1497,7 +1497,7 @@
 
 static void test_gbproxy_ident_changes()
 {
-	struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, tall_bsc_ctx);
+	struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, tall_sgsn_ctx);
 	struct sockaddr_in bss_peer[1] = {{0},};
 	struct sockaddr_in sgsn_peer= {0};
 	uint16_t nsei[2] = {0x1000, 0x2000};
@@ -1629,7 +1629,7 @@
 
 static void test_gbproxy_ra_patching()
 {
-	struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, tall_bsc_ctx);
+	struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, tall_sgsn_ctx);
 	struct sockaddr_in bss_peer[1] = {{0},};
 	struct sockaddr_in sgsn_peer= {0};
 	struct  gprs_ra_id rai_bss =
@@ -1657,7 +1657,7 @@
 	gbcfg.nsi = bssgp_nsi;
 	gbcfg.nsip_sgsn_nsei = SGSN_NSEI;
 	gbcfg.core_plmn = (struct osmo_plmn_id){ .mcc = 123, .mnc = 456 };
-	gbcfg.core_apn = talloc_zero_size(tall_bsc_ctx, 100);
+	gbcfg.core_apn = talloc_zero_size(tall_sgsn_ctx, 100);
 	gbcfg.core_apn_size = gprs_str_to_apn(gbcfg.core_apn, 100, "foo.bar");
 	gbcfg.patch_ptmsi = 0;
 
@@ -1971,7 +1971,7 @@
 
 static void test_gbproxy_ptmsi_assignment()
 {
-	struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, tall_bsc_ctx);
+	struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, tall_sgsn_ctx);
 	struct sockaddr_in bss_peer[1] = {{0},};
 	struct sockaddr_in sgsn_peer= {0};
 	struct  gprs_ra_id rai_bss =
@@ -2000,7 +2000,7 @@
 	gbcfg.nsi = bssgp_nsi;
 	gbcfg.nsip_sgsn_nsei = SGSN_NSEI;
 	gbcfg.core_plmn = (struct osmo_plmn_id){};
-	gbcfg.core_apn = talloc_zero_size(tall_bsc_ctx, 100);
+	gbcfg.core_apn = talloc_zero_size(tall_sgsn_ctx, 100);
 	gbcfg.core_apn_size = gprs_str_to_apn(gbcfg.core_apn, 100, "foo.bar");
 	gbcfg.patch_ptmsi = 0;
 
@@ -2187,7 +2187,7 @@
 
 static void test_gbproxy_ptmsi_patching()
 {
-	struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, tall_bsc_ctx);
+	struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, tall_sgsn_ctx);
 	struct sockaddr_in bss_peer[1] = {{0},};
 	struct sockaddr_in sgsn_peer= {0};
 	struct  gprs_ra_id rai_bss =
@@ -2236,7 +2236,7 @@
 	gbcfg.nsi = bssgp_nsi;
 	gbcfg.nsip_sgsn_nsei = SGSN_NSEI;
 	gbcfg.core_plmn = (struct osmo_plmn_id){ .mcc = 123, .mnc = 456 };
-	gbcfg.core_apn = talloc_zero_size(tall_bsc_ctx, 100);
+	gbcfg.core_apn = talloc_zero_size(tall_sgsn_ctx, 100);
 	gbcfg.core_apn_size = gprs_str_to_apn(gbcfg.core_apn, 100, "foo.bar");
 	gbcfg.patch_ptmsi = 1;
 
@@ -2526,7 +2526,7 @@
 
 static void test_gbproxy_ptmsi_patching_bad_cases()
 {
-	struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, tall_bsc_ctx);
+	struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, tall_sgsn_ctx);
 	struct sockaddr_in bss_peer[1] = {{0},};
 	struct sockaddr_in sgsn_peer= {0};
 	struct  gprs_ra_id rai_bss =
@@ -2557,7 +2557,7 @@
 	gbcfg.nsi = bssgp_nsi;
 	gbcfg.nsip_sgsn_nsei = SGSN_NSEI;
 	gbcfg.core_plmn = (struct osmo_plmn_id){ .mcc = 123, .mnc = 456 };
-	gbcfg.core_apn = talloc_zero_size(tall_bsc_ctx, 100);
+	gbcfg.core_apn = talloc_zero_size(tall_sgsn_ctx, 100);
 	gbcfg.core_apn_size = gprs_str_to_apn(gbcfg.core_apn, 100, "foo.bar");
 	gbcfg.patch_ptmsi = 1;
 
@@ -2708,7 +2708,7 @@
 
 static void test_gbproxy_imsi_acquisition()
 {
-	struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, tall_bsc_ctx);
+	struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, tall_sgsn_ctx);
 	struct sockaddr_in bss_peer[1] = {{0},};
 	struct sockaddr_in sgsn_peer= {0};
 	struct  gprs_ra_id rai_bss =
@@ -2743,7 +2743,7 @@
 	gbcfg.nsi = bssgp_nsi;
 	gbcfg.nsip_sgsn_nsei = SGSN_NSEI;
 	gbcfg.core_plmn = (struct osmo_plmn_id){ .mcc = 123, .mnc = 456 };
-	gbcfg.core_apn = talloc_zero_size(tall_bsc_ctx, 100);
+	gbcfg.core_apn = talloc_zero_size(tall_sgsn_ctx, 100);
 	gbcfg.core_apn_size = gprs_str_to_apn(gbcfg.core_apn, 100, "foo.bar");
 	gbcfg.patch_ptmsi = 1;
 	gbcfg.acquire_imsi = 1;
@@ -3021,7 +3021,7 @@
 
 static void test_gbproxy_secondary_sgsn()
 {
-	struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, tall_bsc_ctx);
+	struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, tall_sgsn_ctx);
 	struct sockaddr_in bss_peer[1] = {{0},};
 	struct sockaddr_in sgsn_peer[2]= {{0},};
 	struct  gprs_ra_id rai_bss =
@@ -3071,7 +3071,7 @@
 	gbcfg.nsi = bssgp_nsi;
 	gbcfg.nsip_sgsn_nsei = SGSN_NSEI;
 	gbcfg.core_plmn = (struct osmo_plmn_id){ .mcc = 123, .mnc = 456 };
-	gbcfg.core_apn = talloc_zero_size(tall_bsc_ctx, 100);
+	gbcfg.core_apn = talloc_zero_size(tall_sgsn_ctx, 100);
 	gbcfg.core_apn_size = gprs_str_to_apn(gbcfg.core_apn, 100, "foo.bar");
 	gbcfg.patch_ptmsi = 1;
 	gbcfg.acquire_imsi = 1;
@@ -3525,7 +3525,7 @@
 
 static void test_gbproxy_keep_info()
 {
-	struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, tall_bsc_ctx);
+	struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, tall_sgsn_ctx);
 	struct sockaddr_in bss_peer[1] = {{0},};
 	struct sockaddr_in sgsn_peer= {0};
 	struct  gprs_ra_id rai_bss =
@@ -4833,7 +4833,7 @@
 
 static void test_gbproxy_stored_messages()
 {
-	struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, tall_bsc_ctx);
+	struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, tall_sgsn_ctx);
 	struct sockaddr_in bss_peer[1] = {{0},};
 	struct sockaddr_in sgsn_peer= {0};
 	struct  gprs_ra_id rai_bss =
@@ -4857,7 +4857,7 @@
 	gbcfg.nsi = bssgp_nsi;
 	gbcfg.nsip_sgsn_nsei = SGSN_NSEI;
 	gbcfg.core_plmn = (struct osmo_plmn_id){};
-	gbcfg.core_apn = talloc_zero_size(tall_bsc_ctx, 100);
+	gbcfg.core_apn = talloc_zero_size(tall_sgsn_ctx, 100);
 	gbcfg.core_apn_size = gprs_str_to_apn(gbcfg.core_apn, 100, "foo.bar");
 	gbcfg.patch_ptmsi = 0;
 	gbcfg.acquire_imsi = 1;
@@ -5030,10 +5030,10 @@
 int main(int argc, char **argv)
 {
 	talloc_enable_leak_report();
-	tall_bsc_ctx = talloc_named_const(NULL, 0, "gbproxy_test");
-	void *log_ctx = talloc_named_const(tall_bsc_ctx, 0, "log");
+	tall_sgsn_ctx = talloc_named_const(NULL, 0, "gbproxy_test");
+	void *log_ctx = talloc_named_const(tall_sgsn_ctx, 0, "log");
 
-	msgb_talloc_ctx_init(tall_bsc_ctx, 0);
+	msgb_talloc_ctx_init(tall_sgsn_ctx, 0);
 
 	osmo_init_logging2(log_ctx, &info);
 	log_set_use_color(osmo_stderr_target, 0);
@@ -5044,7 +5044,7 @@
 	log_set_log_level(osmo_stderr_target, LOGL_DEBUG);
 	log_set_all_filter(osmo_stderr_target, 1);
 
-	rate_ctr_init(tall_bsc_ctx);
+	rate_ctr_init(tall_sgsn_ctx);
 
 	setlinebuf(stdout);
 
@@ -5070,8 +5070,8 @@
 
 	talloc_free(log_ctx);
 	/* expecting root and msgb ctx, empty */
-	OSMO_ASSERT(talloc_total_blocks(tall_bsc_ctx) == 2);
-	talloc_free(tall_bsc_ctx);
+	OSMO_ASSERT(talloc_total_blocks(tall_sgsn_ctx) == 2);
+	talloc_free(tall_sgsn_ctx);
 
 	return 0;
 }
diff --git a/tests/sgsn/sgsn_test.c b/tests/sgsn/sgsn_test.c
index 3e86266..214d07b 100644
--- a/tests/sgsn/sgsn_test.c
+++ b/tests/sgsn/sgsn_test.c
@@ -40,7 +40,7 @@
 
 #include <stdio.h>
 
-void *tall_bsc_ctx;
+void *tall_sgsn_ctx;
 static struct sgsn_instance sgsn_inst = {
 	.config_file = "osmo_sgsn.cfg",
 	.cfg = {
@@ -1637,7 +1637,7 @@
 
 	osmo_sgsn_ctx = talloc_named_const(NULL, 0, "osmo_sgsn");
 	osmo_init_logging2(osmo_sgsn_ctx, &info);
-	tall_bsc_ctx = talloc_named_const(osmo_sgsn_ctx, 0, "bsc");
+	tall_sgsn_ctx = talloc_named_const(osmo_sgsn_ctx, 0, "sgsn");
 	msgb_ctx = msgb_talloc_ctx_init(osmo_sgsn_ctx, 0);
 
 	sgsn_rate_ctr_init();
@@ -1661,7 +1661,7 @@
 
 	talloc_report_full(osmo_sgsn_ctx, stderr);
 	OSMO_ASSERT(talloc_total_blocks(msgb_ctx) == 1);
-	OSMO_ASSERT(talloc_total_blocks(tall_bsc_ctx) == 2);
+	OSMO_ASSERT(talloc_total_blocks(tall_sgsn_ctx) == 2);
 	return 0;
 }
 
diff --git a/tests/vty_test_runner.py b/tests/vty_test_runner.py
index afe1cfd..73dd399 100755
--- a/tests/vty_test_runner.py
+++ b/tests/vty_test_runner.py
@@ -75,7 +75,7 @@
                 "doc/examples/osmo-gbproxy/osmo-gbproxy.cfg"]
 
     def vty_app(self):
-        return (4246, "./src/gprs/osmo-gbproxy", "OsmoGbProxy", "bsc")
+        return (4246, "./src/gprs/osmo-gbproxy", "OsmoGbProxy", "gbproxy")
 
     def testVtyTree(self):
         self.vty.enable()

-- 
To view, visit https://gerrit.osmocom.org/11528
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I93f0dc721c2eff8a87fb9248882f24768f708713
Gerrit-Change-Number: 11528
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181030/441c10ec/attachment.htm>


More information about the gerrit-log mailing list