diff options
author | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2016-05-11 14:12:00 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2016-12-02 12:09:15 +0000 |
commit | e235441f73a6baf1b43da9dde3cb6828ced9d1fe (patch) | |
tree | 32f46ba437f4b92bb817631fc7cab5e9a2280a57 /openbsc/src/osmo-bsc/osmo_bsc_main.c | |
parent | 6a366055dd9fcdea537ae2752458c02cf7433357 (diff) |
split bsc_bootstrap_network() in alloc and config
For patch clarity, keep some code dup to be removed in a subsequent patch. In
the same sense don't change the fact that mncc_sock_init()'s return value is
ignored.
The global gsm_network instance 'bsc_gsmnet' is basically only used by the VTY,
and a future patch will "hide" that global in a vty .c file. In a nutshell, I
want to
- first allocate a gsm_network,
- then initialize the VTY passing the gsm_network pointer,
- and then read the config file using the initialized VTY.
So far, bsc_bootstrap_network() allocates the gsm_network and reads the config
file right away, which only works by sharing the extern bsc_gsmnet pointer,
which I would like to uncouple.
Change-Id: I480a09a31a79766ad07b627dd5238b7e37f3be7a
Diffstat (limited to 'openbsc/src/osmo-bsc/osmo_bsc_main.c')
-rw-r--r-- | openbsc/src/osmo-bsc/osmo_bsc_main.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_main.c b/openbsc/src/osmo-bsc/osmo_bsc_main.c index daab55b0e..b6b1ae16e 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_main.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_main.c @@ -220,8 +220,12 @@ int main(int argc, char **argv) /* initialize SCCP */ sccp_set_log_area(DSCCP); - - rc = bsc_bootstrap_network(NULL, config_file); + rc = bsc_network_alloc(NULL); + if (rc) { + fprintf(stderr, "Allocation failed. exiting.\n"); + exit(1); + } + rc = bsc_network_configure(config_file); if (rc < 0) { fprintf(stderr, "Bootstrapping the network failed. exiting.\n"); exit(1); |