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/libbsc/abis_om2000_vty.c | |
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/libbsc/abis_om2000_vty.c')
-rw-r--r-- | openbsc/src/libbsc/abis_om2000_vty.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/openbsc/src/libbsc/abis_om2000_vty.c b/openbsc/src/libbsc/abis_om2000_vty.c index 8325e29a7..72422a1d5 100644 --- a/openbsc/src/libbsc/abis_om2000_vty.c +++ b/openbsc/src/libbsc/abis_om2000_vty.c @@ -82,7 +82,7 @@ DEFUN(om2k_class_inst, om2k_class_inst_cmd, struct oml_node_state *oms; int bts_nr = atoi(argv[0]); - bts = gsm_bts_num(bsc_gsmnet, bts_nr); + bts = gsm_bts_num(gsmnet_from_vty(vty), bts_nr); if (!bts) { vty_out(vty, "%% No such BTS (%d)%s", bts_nr, VTY_NEWLINE); return CMD_WARNING; @@ -122,7 +122,7 @@ DEFUN(om2k_classnum_inst, om2k_classnum_inst_cmd, struct oml_node_state *oms; int bts_nr = atoi(argv[0]); - bts = gsm_bts_num(bsc_gsmnet, bts_nr); + bts = gsm_bts_num(gsmnet_from_vty(vty), bts_nr); if (!bts) { vty_out(vty, "%% No such BTS (%d)%s", bts_nr, VTY_NEWLINE); return CMD_WARNING; |