summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am3
-rw-r--r--src/e1_input.c1
-rw-r--r--src/init.c27
-rw-r--r--src/input/hsl.c6
-rw-r--r--src/input/ipaccess.c8
5 files changed, 39 insertions, 6 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index ce053cf..d6f8340 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -11,6 +11,7 @@ AM_LDFLAGS = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(COVERAGE_LDFLAGS)
lib_LTLIBRARIES = libosmoabis.la
libosmoabis_la_LIBADD = input/libosmoabis-input.la
-libosmoabis_la_SOURCES = e1_input.c \
+libosmoabis_la_SOURCES = init.c \
+ e1_input.c \
subchan_demux.c \
trau_frame.c
diff --git a/src/e1_input.c b/src/e1_input.c
index 8a4e1b9..fb3d9a6 100644
--- a/src/e1_input.c
+++ b/src/e1_input.c
@@ -605,6 +605,7 @@ void e1inp_hsl_init(void);
void e1inp_init(void)
{
+ tall_e1inp_ctx = talloc_named_const(libosmo_abis_ctx, 1, "e1inp");
tall_sigl_ctx = talloc_named_const(tall_e1inp_ctx, 1,
"e1inp_sign_link");
osmo_signal_register_handler(SS_GLOBAL, e1i_sig_cb, NULL);
diff --git a/src/init.c b/src/init.c
new file mode 100644
index 0000000..f461856
--- /dev/null
+++ b/src/init.c
@@ -0,0 +1,27 @@
+/* (C) 2011 by Harald Welte <laforge@gnumonks.org>
+ * 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 "internal.h"
+#include <talloc.h>
+
+void *libosmo_abis_ctx;
+
+void libosmo_abis_init(void *ctx)
+{
+ libosmo_abis_ctx = talloc_named_const(ctx, 0, "abis");
+ e1inp_init();
+}
diff --git a/src/input/hsl.c b/src/input/hsl.c
index 689698c..b7c7897 100644
--- a/src/input/hsl.c
+++ b/src/input/hsl.c
@@ -59,7 +59,7 @@
#define PRIV_OML 1
#define PRIV_RSL 2
-static void *tall_bsc_ctx;
+static void *tall_hsl_ctx;
/* data structure for one E1 interface with A-bis */
struct hsl_e1_handle {
@@ -292,7 +292,9 @@ int hsl_setup(struct gsm_network *gsmnet)
void e1inp_hsl_init(void)
{
- e1h = talloc_zero(tall_bsc_ctx, struct hsl_e1_handle);
+ tall_hsl_ctx = talloc_named_const(libosmo_abis_ctx, 1, "hsl");
+
+ e1h = talloc_zero(tall_hsl_ctx, struct hsl_e1_handle);
if (!e1h)
return;
diff --git a/src/input/ipaccess.c b/src/input/ipaccess.c
index 40d69b6..ef773ba 100644
--- a/src/input/ipaccess.c
+++ b/src/input/ipaccess.c
@@ -46,7 +46,7 @@
#define PRIV_OML 1
#define PRIV_RSL 2
-static void *tall_bsc_ctx;
+static void *tall_ipa_ctx;
/* data structure for one E1 interface with A-bis */
struct ia_e1_handle {
@@ -378,7 +378,7 @@ static int rsl_listen_fd_cb(struct osmo_fd *listen_bfd, unsigned int what)
if (!(what & BSC_FD_READ))
return 0;
- bfd = talloc_zero(tall_bsc_ctx, struct osmo_fd);
+ bfd = talloc_zero(tall_ipa_ctx, struct osmo_fd);
if (!bfd)
return -ENOMEM;
@@ -502,7 +502,9 @@ int ipaccess_setup(struct gsm_network *gsmnet)
void e1inp_ipaccess_init(void)
{
- e1h = talloc_zero(tall_bsc_ctx, struct ia_e1_handle);
+ tall_ipa_ctx = talloc_named_const(libosmo_abis_ctx, 1, "ipa");
+
+ e1h = talloc_zero(tall_ipa_ctx, struct ia_e1_handle);
if (!e1h)
return;