aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2018-10-30 17:27:59 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2018-10-30 17:35:31 +0100
commitb1d1c240dbfe6a065fd489c38e2e8563ff2d747c (patch)
tree98b83617f88e734c542c05884d96b0fc383cfc31
parente64f0ef1f6a5cca0c77dfb5966b295aa37202e5e (diff)
Update wrong references to bsc in sgsn code
-rw-r--r--src/gprs/gb_proxy.c4
-rw-r--r--src/gprs/gb_proxy_main.c22
-rw-r--r--src/gprs/gb_proxy_patch.c4
-rw-r--r--src/gprs/gb_proxy_peer.c4
-rw-r--r--src/gprs/gprs_gmm.c4
-rw-r--r--src/gprs/gprs_sgsn.c14
-rw-r--r--src/gprs/gprs_subscriber.c4
-rw-r--r--src/gprs/gsup_client.c4
-rw-r--r--src/gprs/gtphub_main.c2
-rw-r--r--src/gprs/gtphub_vty.c4
-rw-r--r--src/gprs/sgsn_ares.c6
-rw-r--r--src/gprs/sgsn_main.c28
-rw-r--r--src/gprs/sgsn_vty.c4
-rw-r--r--tests/gbproxy/gbproxy_test.c48
-rw-r--r--tests/sgsn/sgsn_test.c6
-rwxr-xr-xtests/vty_test_runner.py2
16 files changed, 80 insertions, 80 deletions
diff --git a/src/gprs/gb_proxy.c b/src/gprs/gb_proxy.c
index 8bb67895..fe6a6c64 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 @@ int gbproxy_init_config(struct gbproxy_config *cfg)
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 97e63420..19fbbba8 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 @@ static void signal_handler(int signal)
* 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 main(int argc, char **argv)
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 @@ int main(int argc, char **argv)
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 @@ int main(int argc, char **argv)
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 @@ int main(int argc, char **argv)
}
/* 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 9cca9a86..251bb67d 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 @@ int gbproxy_set_patch_filter(struct gbproxy_match *match, const char *filter,
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 a862a832..48482b6a 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 *gbproxy_peer_alloc(struct gbproxy_config *cfg, uint16_t bvc
{
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 a0221ea8..cc6ea4a2 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 @@ static int do_act_pdp_req(struct sgsn_mm_ctx *mmctx, struct msgb *msg, bool *del
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 efbae220..bac7325b 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 @@ static const struct rate_ctr_group_desc sgsn_ctrg_desc = {
};
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 *sgsn_mm_ctx_alloc_gb(uint32_t tlli,
{
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 *sgsn_mm_ctx_alloc_iu(void *uectx)
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 @@ struct sgsn_pdp_ctx *sgsn_pdp_ctx_alloc(struct sgsn_mm_ctx *mm,
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 *sgsn_ggsn_ctx_alloc(uint32_t id)
{
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 @@ static struct apn_ctx *sgsn_apn_ctx_alloc(const char *ap_name, const char *imsi_
{
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 dfd697b7..6c4f81fe 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 @@ struct gprs_subscr *gprs_subscr_get_by_imsi(const char *imsi)
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 95c49889..37bebd9d 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 *gsup_client_create(const char *unit_name,
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 f824016c..0369ed77 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@sysmocom.de>\r\n"
diff --git a/src/gprs/gtphub_vty.c b/src/gprs/gtphub_vty.c
index ec35e4dc..abc08fd6 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 @@ DEFUN(cfg_grx_ggsn, cfg_grx_ggsn_cmd,
"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 17567c48..ba168d62 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 @@ static void setup_ares_osmo_fd(void *data, int fd, int read, int write)
}
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 @@ int sgsn_ares_query(struct sgsn_instance *sgsn, const char *name,
{
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 11ed5d35..a17d9255 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 @@ static void signal_handler(int signal)
* 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 @@ int main(int argc, char **argv)
#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 @@ int main(int argc, char **argv)
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 @@ int main(int argc, char **argv)
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 @@ int main(int argc, char **argv)
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 @@ int main(int argc, char **argv)
}
/* 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 @@ int main(int argc, char **argv)
#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 @@ int main(int argc, char **argv)
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 87c68842..72a310b2 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 @@ DEFUN(cfg_grx_ggsn, cfg_grx_ggsn_cmd,
"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 a1833208..55776be8 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 gprs_dump_nsi(struct gprs_ns_inst *nsi)
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()
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_ident_changes()
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 @@ static void test_gbproxy_ra_patching()
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_ra_patching()
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 @@ static void test_gbproxy_ptmsi_assignment()
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_assignment()
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 @@ static void test_gbproxy_ptmsi_patching()
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()
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 @@ static void test_gbproxy_ptmsi_patching_bad_cases()
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_ptmsi_patching_bad_cases()
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 @@ static void test_gbproxy_imsi_acquisition()
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_imsi_acquisition()
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 @@ static void test_gbproxy_secondary_sgsn()
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_secondary_sgsn()
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_imsi_matching(void)
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 @@ static void test_gbproxy_stored_messages()
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 @@ static struct log_info info = {
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 @@ int main(int argc, char **argv)
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 @@ int main(int argc, char **argv)
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 3e86266e..214d07b9 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 @@ int main(int argc, char **argv)
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 @@ int main(int argc, char **argv)
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 afe1cfd3..73dd3996 100755
--- a/tests/vty_test_runner.py
+++ b/tests/vty_test_runner.py
@@ -75,7 +75,7 @@ class TestVTYGbproxy(TestVTYBase):
"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()