diff options
author | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2016-02-10 23:42:17 +0100 |
---|---|---|
committer | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2016-03-03 16:19:09 +0100 |
commit | 5e47b1a1d370c187c776b29c5958f167519e94d7 (patch) | |
tree | 109151df31be3ebfb242d3345f82a0475b44a4cc /openbsc/src/libcommon | |
parent | b9e5403ef46171f58390757d002a756bd9d2d202 (diff) |
mscplit: try to clarify root talloc ctx and global gsm_network.
The aim is to allow osmo-cscn to pass its own root talloc context and
global gsm_network struct instance cleanly. This may stir up some old and
dusty globals, but I hope it's for the better, since not all is a BSC.
To ensure that a global gsm_network pointer for the bsc_vty is set, have it as
argument to bsc_vty_init(). The vty configuration commands are added only after
bsc_vty_init(), which are needed to configure the network struct. So split up
the bsc_bootstrap_network() function into bsc_network_init() to allocate a
gsm_struct, and bsc_network_configure() to read the config file once the vty
commands are in place. In this way, no global bsc_gsmnet pointer is needed for
the bsc vty. The atomic super glue is dissolved and osmo-cscn will be allowed
to have a different name for it.
Admitted, it's still called the bsc_vty, but a split thereof is probably coming
soon, because the CSCN doesn't want any of the BSC nor BTS specific vty
commands.
Diffstat (limited to 'openbsc/src/libcommon')
-rw-r--r-- | openbsc/src/libcommon/talloc_ctx.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/openbsc/src/libcommon/talloc_ctx.c b/openbsc/src/libcommon/talloc_ctx.c index ae6a15636..c26b50f98 100644 --- a/openbsc/src/libcommon/talloc_ctx.c +++ b/openbsc/src/libcommon/talloc_ctx.c @@ -17,22 +17,22 @@ extern void *tall_map_ctx; extern void *tall_upq_ctx; extern void *tall_ctr_ctx; -void talloc_ctx_init(void) +void talloc_ctx_init(void *ctx_root) { - tall_msgb_ctx = talloc_named_const(tall_bsc_ctx, 0, "msgb"); - tall_fle_ctx = talloc_named_const(tall_bsc_ctx, 0, + tall_msgb_ctx = talloc_named_const(ctx_root, 0, "msgb"); + tall_fle_ctx = talloc_named_const(ctx_root, 0, "bs11_file_list_entry"); - tall_locop_ctx = talloc_named_const(tall_bsc_ctx, 0, "loc_updating_oper"); - tall_authciphop_ctx = talloc_named_const(tall_bsc_ctx, 0, "auth_ciph_oper"); - tall_gsms_ctx = talloc_named_const(tall_bsc_ctx, 0, "sms"); - tall_subscr_ctx = talloc_named_const(tall_bsc_ctx, 0, "subscriber"); - tall_sub_req_ctx = talloc_named_const(tall_bsc_ctx, 0, "subscr_request"); - tall_call_ctx = talloc_named_const(tall_bsc_ctx, 0, "gsm_call"); - tall_paging_ctx = talloc_named_const(tall_bsc_ctx, 0, "paging_request"); - 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_trans_ctx = talloc_named_const(tall_bsc_ctx, 0, "transaction"); - tall_map_ctx = talloc_named_const(tall_bsc_ctx, 0, "trau_map_entry"); - tall_upq_ctx = talloc_named_const(tall_bsc_ctx, 0, "trau_upq_entry"); - tall_ctr_ctx = talloc_named_const(tall_bsc_ctx, 0, "counter"); + 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_sub_req_ctx = talloc_named_const(ctx_root, 0, "subscr_request"); + 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_map_ctx = talloc_named_const(ctx_root, 0, "trau_map_entry"); + tall_upq_ctx = talloc_named_const(ctx_root, 0, "trau_upq_entry"); + tall_ctr_ctx = talloc_named_const(ctx_root, 0, "counter"); } |