aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/osmo-bsc/osmo_bsc_main.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-06-04 19:58:26 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2012-03-16 11:56:21 +0100
commit20fea245150b377ec97a3e56818cfbfc6e691097 (patch)
treef80a08be6cba80da909a145d6879bb6657b7b505 /openbsc/src/osmo-bsc/osmo_bsc_main.c
parent44e5dad3e25ed8aa200bd6229f2d4d94b8326123 (diff)
bsc: Prepare to have multiple MSC connections
We now have a list of MSCs but in the code we will try to access the MSC with the nr 0.
Diffstat (limited to 'openbsc/src/osmo-bsc/osmo_bsc_main.c')
-rw-r--r--openbsc/src/osmo-bsc/osmo_bsc_main.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_main.c b/openbsc/src/osmo-bsc/osmo_bsc_main.c
index 6e34105ab..63e1d8ea8 100644
--- a/openbsc/src/osmo-bsc/osmo_bsc_main.c
+++ b/openbsc/src/osmo-bsc/osmo_bsc_main.c
@@ -144,6 +144,8 @@ static struct vty_app_info vty_info = {
extern int bsc_shutdown_net(struct gsm_network *net);
static void signal_handler(int signal)
{
+ struct osmo_msc_data *msc;
+
fprintf(stdout, "signal %u received\n", signal);
switch (signal) {
@@ -163,11 +165,8 @@ static void signal_handler(int signal)
case SIGUSR2:
if (!bsc_gsmnet->bsc_data)
return;
- if (!bsc_gsmnet->bsc_data->msc.msc_con)
- return;
- if (!bsc_gsmnet->bsc_data->msc.msc_con->is_connected)
- return;
- bsc_msc_lost(bsc_gsmnet->bsc_data->msc.msc_con);
+ llist_for_each_entry(msc, &bsc_gsmnet->bsc_data->mscs, entry)
+ bsc_msc_lost(msc->msc_con);
break;
default:
break;
@@ -391,6 +390,7 @@ static int verify_net_rf_lock(struct ctrl_cmd *cmd, const char *value, void *dat
int main(int argc, char **argv)
{
+ struct osmo_msc_data *msc;
struct osmo_bsc_data *data;
int rc;
@@ -443,11 +443,14 @@ int main(int argc, char **argv)
}
}
- if (osmo_bsc_msc_init(&bsc_gsmnet->bsc_data->msc) != 0) {
- LOGP(DNAT, LOGL_ERROR, "Failed to start up. Exiting.\n");
- exit(1);
+ llist_for_each_entry(msc, &bsc_gsmnet->bsc_data->mscs, entry) {
+ if (osmo_bsc_msc_init(msc) != 0) {
+ LOGP(DNAT, LOGL_ERROR, "Failed to start up. Exiting.\n");
+ exit(1);
+ }
}
+
if (osmo_bsc_sccp_init(bsc_gsmnet) != 0) {
LOGP(DNM, LOGL_ERROR, "Failed to register SCCP.\n");
exit(1);