aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/ipaccess/ipaccess-proxy.c2
-rw-r--r--src/libbsc/abis_nm.c2
-rw-r--r--src/libbsc/paging.c2
-rw-r--r--src/libcommon/Makefile.am1
-rw-r--r--src/libcommon/gsm_data.c2
-rw-r--r--src/libcommon/talloc_ctx.c51
-rw-r--r--src/osmo-bsc/osmo_bsc_main.c12
-rw-r--r--src/osmo-bsc_nat/bsc_nat.c4
-rw-r--r--src/utils/bs11_config.c4
9 files changed, 24 insertions, 56 deletions
diff --git a/src/ipaccess/ipaccess-proxy.c b/src/ipaccess/ipaccess-proxy.c
index 5cf6d6d93..d44cdf289 100644
--- a/src/ipaccess/ipaccess-proxy.c
+++ b/src/ipaccess/ipaccess-proxy.c
@@ -121,7 +121,7 @@ enum ipp_fd_type {
};
/* some of the code against we link from OpenBSC needs this */
-void *tall_bsc_ctx;
+void *tall_bsc_ctx = NULL;
static char *listen_ipaddr;
static char *bsc_ipaddr;
diff --git a/src/libbsc/abis_nm.c b/src/libbsc/abis_nm.c
index 403b94cb4..671c87419 100644
--- a/src/libbsc/abis_nm.c
+++ b/src/libbsc/abis_nm.c
@@ -2374,7 +2374,7 @@ int abis_nm_bs11_get_state(struct gsm_bts *bts)
/* BS11 SWL */
-void *tall_fle_ctx;
+void *tall_fle_ctx = NULL;
struct abis_nm_bs11_sw {
struct gsm_bts *bts;
diff --git a/src/libbsc/paging.c b/src/libbsc/paging.c
index be272f579..825d31e35 100644
--- a/src/libbsc/paging.c
+++ b/src/libbsc/paging.c
@@ -51,7 +51,7 @@
#include <osmocom/bsc/chan_alloc.h>
#include <osmocom/bsc/bsc_api.h>
-void *tall_paging_ctx;
+void *tall_paging_ctx = NULL;
#define PAGING_TIMER 0, 500000
diff --git a/src/libcommon/Makefile.am b/src/libcommon/Makefile.am
index a6ef44e03..3518a554a 100644
--- a/src/libcommon/Makefile.am
+++ b/src/libcommon/Makefile.am
@@ -22,6 +22,5 @@ noinst_LIBRARIES = \
libcommon_a_SOURCES = \
gsm_data.c \
gsm_data_shared.c \
- talloc_ctx.c \
handover_cfg.c \
$(NULL)
diff --git a/src/libcommon/gsm_data.c b/src/libcommon/gsm_data.c
index 92ebbfe0c..3b63ad022 100644
--- a/src/libcommon/gsm_data.c
+++ b/src/libcommon/gsm_data.c
@@ -39,7 +39,7 @@
#include <osmocom/bsc/abis_nm.h>
#include <osmocom/bsc/handover_cfg.h>
-void *tall_bsc_ctx;
+void *tall_bsc_ctx = NULL;
static LLIST_HEAD(bts_models);
diff --git a/src/libcommon/talloc_ctx.c b/src/libcommon/talloc_ctx.c
deleted file mode 100644
index 9f64d75b3..000000000
--- a/src/libcommon/talloc_ctx.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/* OpenBSC allocation contexts initialization code */
-/* (C) 2011-2016 by sysmocom s.f.m.c. GmbH <info@sysmocom.de>
- * All Rights Reserved
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-#include <osmocom/core/talloc.h>
-#include <osmocom/core/msgb.h>
-
-extern void *tall_bsc_ctx;
-extern void *tall_fle_ctx;
-extern void *tall_locop_ctx;
-extern void *tall_authciphop_ctx;
-extern void *tall_gsms_ctx;
-extern void *tall_subscr_ctx;
-extern void *tall_sub_req_ctx;
-extern void *tall_call_ctx;
-extern void *tall_paging_ctx;
-extern void *tall_sigh_ctx;
-extern void *tall_tqe_ctx;
-extern void *tall_trans_ctx;
-extern void *tall_ctr_ctx;
-
-void talloc_ctx_init(void *ctx_root)
-{
- msgb_talloc_ctx_init(ctx_root, 0);
- tall_fle_ctx = talloc_named_const(ctx_root, 0, "bs11_file_list_entry");
- tall_locop_ctx = talloc_named_const(ctx_root, 0, "loc_updating_oper");
- tall_authciphop_ctx = talloc_named_const(ctx_root, 0, "auth_ciph_oper");
- tall_gsms_ctx = talloc_named_const(ctx_root, 0, "sms");
- tall_subscr_ctx = talloc_named_const(ctx_root, 0, "subscriber");
- tall_call_ctx = talloc_named_const(ctx_root, 0, "gsm_call");
- tall_paging_ctx = talloc_named_const(ctx_root, 0, "paging_request");
- tall_sigh_ctx = talloc_named_const(ctx_root, 0, "signal_handler");
- tall_tqe_ctx = talloc_named_const(ctx_root, 0, "subch_txq_entry");
- tall_trans_ctx = talloc_named_const(ctx_root, 0, "transaction");
- tall_ctr_ctx = talloc_named_const(ctx_root, 0, "counter");
-}
diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c
index a6ea56c07..424d8169b 100644
--- a/src/osmo-bsc/osmo_bsc_main.c
+++ b/src/osmo-bsc/osmo_bsc_main.c
@@ -464,6 +464,12 @@ const struct log_info log_info = {
.num_cat = ARRAY_SIZE(osmo_bsc_categories),
};
+extern void *tall_paging_ctx;
+extern void *tall_fle_ctx;
+extern void *tall_sigh_ctx;
+extern void *tall_tqe_ctx;
+extern void *tall_ctr_ctx;
+
int main(int argc, char **argv)
{
struct bsc_msc_data *msc;
@@ -474,6 +480,12 @@ int main(int argc, char **argv)
msgb_talloc_ctx_init(tall_bsc_ctx, 0);
vty_info.tall_ctx = tall_bsc_ctx;
+ tall_paging_ctx = talloc_named_const(tall_bsc_ctx, 0, "paging_request");
+ tall_fle_ctx = talloc_named_const(tall_bsc_ctx, 0, "bs11_file_list_entry");
+ tall_sigh_ctx = talloc_named_const(tall_bsc_ctx, 0, "signal_handler");
+ tall_tqe_ctx = talloc_named_const(tall_bsc_ctx, 0, "subch_txq_entry");
+ tall_ctr_ctx = talloc_named_const(tall_bsc_ctx, 0, "counter");
+
osmo_init_logging(&log_info);
osmo_stats_init(tall_bsc_ctx);
diff --git a/src/osmo-bsc_nat/bsc_nat.c b/src/osmo-bsc_nat/bsc_nat.c
index 2f8d32563..cf67d9bc9 100644
--- a/src/osmo-bsc_nat/bsc_nat.c
+++ b/src/osmo-bsc_nat/bsc_nat.c
@@ -1566,11 +1566,15 @@ out:
osmo_timer_schedule(&sccp_close, SCCP_CLOSE_TIME, 0);
}
+extern void *tall_sigh_ctx;
extern void *tall_ctr_ctx;
+
static void talloc_init_ctx()
{
tall_bsc_ctx = talloc_named_const(NULL, 0, "nat");
msgb_talloc_ctx_init(tall_bsc_ctx, 0);
+
+ tall_sigh_ctx = talloc_named_const(tall_bsc_ctx, 0, "signal_handler");
tall_ctr_ctx = talloc_named_const(tall_bsc_ctx, 0, "counter");
}
diff --git a/src/utils/bs11_config.c b/src/utils/bs11_config.c
index 2122abe6a..8e947eb3e 100644
--- a/src/utils/bs11_config.c
+++ b/src/utils/bs11_config.c
@@ -899,12 +899,16 @@ const struct log_info log_info = {
};
extern int bts_model_bs11_init(void);
+
+extern void *tall_fle_ctx;
+
int main(int argc, char **argv)
{
struct gsm_network *gsmnet;
struct e1inp_line *line;
tall_bs11cfg_ctx = talloc_named_const(NULL, 0, "bs11-config");
+ tall_fle_ctx = talloc_named_const(tall_bs11cfg_ctx, 0, "bs11_file_list_entry");
msgb_talloc_ctx_init(tall_bs11cfg_ctx, 0);
osmo_init_logging(&log_info);