From 5e47b1a1d370c187c776b29c5958f167519e94d7 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Wed, 10 Feb 2016 23:42:17 +0100 Subject: 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. --- openbsc/src/utils/bs11_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'openbsc/src/utils/bs11_config.c') diff --git a/openbsc/src/utils/bs11_config.c b/openbsc/src/utils/bs11_config.c index 0d13e25c5..8baa7faa0 100644 --- a/openbsc/src/utils/bs11_config.c +++ b/openbsc/src/utils/bs11_config.c @@ -893,7 +893,7 @@ int main(int argc, char **argv) handle_options(argc, argv); bts_model_bs11_init(); - gsmnet = gsm_network_init(1, 1, NULL); + gsmnet = gsm_network_init(tall_bsc_ctx, 1, 1, NULL); if (!gsmnet) { fprintf(stderr, "Unable to allocate gsm network\n"); exit(1); -- cgit v1.2.3