Neels Hofmeyr | 7c359eb | 2016-09-16 01:44:52 +0200 | [diff] [blame] | 1 | /* OpenBSC allocation contexts initialization code */ |
| 2 | /* (C) 2011-2016 by sysmocom s.f.m.c. GmbH <info@sysmocom.de> |
| 3 | * All Rights Reserved |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU Affero General Public License as published by |
| 7 | * the Free Software Foundation; either version 3 of the License, or |
| 8 | * (at your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU Affero General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU Affero General Public License |
| 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 | * |
| 18 | */ |
Harald Welte (local) | d19e58b | 2009-08-15 02:30:58 +0200 | [diff] [blame] | 19 | |
Neels Hofmeyr | 7c359eb | 2016-09-16 01:44:52 +0200 | [diff] [blame] | 20 | #include <osmocom/core/talloc.h> |
Harald Welte | af9a9b0 | 2016-11-11 15:52:58 +0100 | [diff] [blame] | 21 | #include <osmocom/core/msgb.h> |
Neels Hofmeyr | 7c359eb | 2016-09-16 01:44:52 +0200 | [diff] [blame] | 22 | |
| 23 | extern void *tall_bsc_ctx; |
Harald Welte (local) | d19e58b | 2009-08-15 02:30:58 +0200 | [diff] [blame] | 24 | extern void *tall_gsms_ctx; |
| 25 | extern void *tall_subscr_ctx; |
Harald Welte (local) | d19e58b | 2009-08-15 02:30:58 +0200 | [diff] [blame] | 26 | extern void *tall_call_ctx; |
Harald Welte (local) | d19e58b | 2009-08-15 02:30:58 +0200 | [diff] [blame] | 27 | extern void *tall_sigh_ctx; |
Harald Welte (local) | d19e58b | 2009-08-15 02:30:58 +0200 | [diff] [blame] | 28 | extern void *tall_trans_ctx; |
Harald Welte (local) | d19e58b | 2009-08-15 02:30:58 +0200 | [diff] [blame] | 29 | |
Neels Hofmeyr | c13e687 | 2016-05-11 13:53:47 +0200 | [diff] [blame] | 30 | void talloc_ctx_init(void *ctx_root) |
Harald Welte (local) | d19e58b | 2009-08-15 02:30:58 +0200 | [diff] [blame] | 31 | { |
Neels Hofmeyr | 39ae17f | 2016-09-16 01:49:08 +0200 | [diff] [blame] | 32 | msgb_talloc_ctx_init(ctx_root, 0); |
Neels Hofmeyr | c13e687 | 2016-05-11 13:53:47 +0200 | [diff] [blame] | 33 | tall_gsms_ctx = talloc_named_const(ctx_root, 0, "sms"); |
| 34 | tall_subscr_ctx = talloc_named_const(ctx_root, 0, "subscriber"); |
Neels Hofmeyr | c13e687 | 2016-05-11 13:53:47 +0200 | [diff] [blame] | 35 | tall_call_ctx = talloc_named_const(ctx_root, 0, "gsm_call"); |
Neels Hofmeyr | c13e687 | 2016-05-11 13:53:47 +0200 | [diff] [blame] | 36 | tall_sigh_ctx = talloc_named_const(ctx_root, 0, "signal_handler"); |
Neels Hofmeyr | c13e687 | 2016-05-11 13:53:47 +0200 | [diff] [blame] | 37 | tall_trans_ctx = talloc_named_const(ctx_root, 0, "transaction"); |
Harald Welte (local) | d19e58b | 2009-08-15 02:30:58 +0200 | [diff] [blame] | 38 | } |