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
diff --git a/openbsc/src/osmo-nitb/bsc_hack.c b/openbsc/src/osmo-nitb/bsc_hack.c
index 552ab4f..ccd3b74 100644
--- a/openbsc/src/osmo-nitb/bsc_hack.c
+++ b/openbsc/src/osmo-nitb/bsc_hack.c
@@ -285,15 +285,26 @@
 
 	/* internal MNCC handler or MNCC socket? */
 	if (mncc_sock_path) {
-		rc = bsc_bootstrap_network(mncc_sock_from_cc, config_file);
-		if (rc >= 0)
-			mncc_sock_init(bsc_gsmnet, mncc_sock_path);
+		rc = bsc_network_alloc(mncc_sock_from_cc);
+		if (rc) {
+			fprintf(stderr, "Allocation failed. Exiting.\n");
+			exit(1);
+		}
+		mncc_sock_init(bsc_gsmnet, mncc_sock_path);
 	} else {
 		DEBUGP(DMNCC, "Using internal MNCC handler.\n");
-		rc = bsc_bootstrap_network(int_mncc_recv, config_file);
+		rc = bsc_network_alloc(int_mncc_recv);
+		if (rc) {
+			fprintf(stderr, "Allocation failed. Exiting.\n");
+			exit(1);
+		}
 	}
-	if (rc < 0)
+	rc = bsc_network_configure(config_file);
+	if (rc < 0) {
+		fprintf(stderr, "Reading config failed. Exiting.\n");
 		exit(1);
+	}
+
 #ifdef BUILD_SMPP
 	smpp_openbsc_start(bsc_gsmnet);
 #endif