[PATCH 3/3] bsc: on-demand setup of nanoBTS and HSL femto sockets

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

pablo at gnumonks.org pablo at gnumonks.org
Tue May 3 20:44:41 UTC 2011


From: Pablo Neira Ayuso <pablo at gnumonks.org>

The daemon set up nanoBTS and HSL femto sockets by default,
ie. the three sockets to support these two drivers are open even
if we have no BTS of that kind. This patch enables them if they
are present in any configuration file.
---
 openbsc/src/libbsc/bsc_init.c |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c
index 8ea2cfa..09d826e 100644
--- a/openbsc/src/libbsc/bsc_init.c
+++ b/openbsc/src/libbsc/bsc_init.c
@@ -19,6 +19,7 @@
  *
  */
 
+#include <stdbool.h>
 #include <openbsc/gsm_data.h>
 #include <osmocom/gsm/gsm_utils.h>
 #include <openbsc/gsm_04_08.h>
@@ -415,6 +416,7 @@ int bsc_bootstrap_network(int (*mncc_recv)(struct gsm_network *, struct msgb *),
 	struct telnet_connection dummy_conn;
 	struct gsm_bts *bts;
 	int rc;
+	bool enabled_nanobts = false, enabled_hsl = false;
 
 	/* initialize our data structures */
 	bsc_gsmnet = gsm_network_init(1, 1, mncc_recv);
@@ -444,7 +446,20 @@ int bsc_bootstrap_network(int (*mncc_recv)(struct gsm_network *, struct msgb *),
 
 		switch (bts->type) {
 		case GSM_BTS_TYPE_NANOBTS:
+			if (!enabled_nanobts) {
+				rc = ipaccess_setup(bsc_gsmnet);
+				if (rc < 0)
+					break;
+				enabled_nanobts = true;
+			}
+			break;
 		case GSM_BTS_TYPE_HSL_FEMTO:
+			if (!enabled_hsl) {
+				rc = hsl_setup(bsc_gsmnet);
+				if (rc < 0)
+					break;
+				enabled_hsl = true;
+			}
 			break;
 		default:
 			rc = e1_reconfig_bts(bts);
@@ -456,10 +471,5 @@ int bsc_bootstrap_network(int (*mncc_recv)(struct gsm_network *, struct msgb *),
 			exit (1);
 		}
 	}
-
-	/* initialize nanoBTS support omce */
-	rc = ipaccess_setup(bsc_gsmnet);
-	rc = hsl_setup(bsc_gsmnet);
-
 	return 0;
 }
-- 
1.7.2.3





More information about the OpenBSC mailing list