Update wrong references to bsc in sgsn code
Change-Id: I93f0dc721c2eff8a87fb9248882f24768f708713
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@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);