bsc: Create a osmo_bsc_data and embed osmo_msc_data
We want to have multiple MSCs but we also have some data
that is only present on a per BSC basis. Right now the
MSC data is not allocated with talloc, so we have some
change in the talloc contexts.
diff --git a/openbsc/src/libcommon/gsm_data.c b/openbsc/src/libcommon/gsm_data.c
index 4bad8b8..a731c1a 100644
--- a/openbsc/src/libcommon/gsm_data.c
+++ b/openbsc/src/libcommon/gsm_data.c
@@ -79,14 +79,14 @@
if (!net)
return NULL;
- net->msc_data = talloc_zero(net, struct osmo_msc_data);
- if (!net->msc_data) {
+ net->bsc_data = talloc_zero(net, struct osmo_bsc_data);
+ if (!net->bsc_data) {
talloc_free(net);
return NULL;
}
/* Init back pointer */
- net->msc_data->network = net;
+ net->bsc_data->network = net;
net->country_code = country_code;
net->network_code = network_code;
@@ -141,12 +141,13 @@
net->mncc_recv = mncc_recv;
- INIT_LLIST_HEAD(&net->msc_data->dests);
- net->msc_data->ping_timeout = 20;
- net->msc_data->pong_timeout = 5;
- net->msc_data->core_ncc = -1;
- net->msc_data->core_mcc = -1;
- net->msc_data->rtp_base = 4000;
+ INIT_LLIST_HEAD(&net->bsc_data->msc.dests);
+ net->bsc_data->msc.ping_timeout = 20;
+ net->bsc_data->msc.pong_timeout = 5;
+ net->bsc_data->msc.core_ncc = -1;
+ net->bsc_data->msc.core_mcc = -1;
+ net->bsc_data->msc.rtp_base = 4000;
+ net->bsc_data->msc.network = net;
gsm_net_update_ctype(net);