diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2018-03-22 16:43:40 +0100 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2018-03-22 17:07:59 +0100 |
commit | 55014d050991a4f4be56bee85c47a3c40c091fdd (patch) | |
tree | 67794523124715f38abbb40ead0872d037ed1363 /src | |
parent | 67fa909494c407862a4e7e020152b7bbf3833468 (diff) |
dissolve libcommon-cs: move gsm_network_init() to libmsc
Move to libmsc/osmo_msc.c (for lack of a better place and reluctance to create
an own file just for gsm_network_init()).
Change-Id: I2279eee4db6f6687726bfd55841b3748d4930f15
Diffstat (limited to 'src')
-rw-r--r-- | src/libcommon-cs/common_cs.c | 43 | ||||
-rw-r--r-- | src/libmsc/osmo_msc.c | 37 |
2 files changed, 37 insertions, 43 deletions
diff --git a/src/libcommon-cs/common_cs.c b/src/libcommon-cs/common_cs.c index a1d229816..c3b971e3c 100644 --- a/src/libcommon-cs/common_cs.c +++ b/src/libcommon-cs/common_cs.c @@ -31,49 +31,6 @@ #include <osmocom/msc/gsm_04_11.h> #include <osmocom/msc/gsm_04_08.h> -/* Warning: if bsc_network_init() is not called, some of the members of - * gsm_network are not initialized properly and must not be used! (In - * particular the llist heads and stats counters.) - * The long term aim should be to have entirely separate structs for libbsc and - * libmsc with some common general items. - */ -struct gsm_network *gsm_network_init(void *ctx, mncc_recv_cb_t mncc_recv) -{ - struct gsm_network *net; - - net = talloc_zero(ctx, struct gsm_network); - if (!net) - return NULL; - - net->plmn = (struct osmo_plmn_id){ .mcc=1, .mnc=1 }; - - /* Permit a compile-time default of A5/3 and A5/1 */ - net->a5_encryption_mask = (1 << 3) | (1 << 1); - - /* Use 30 min periodic update interval as sane default */ - net->t3212 = 5; - - net->paging_response_timer = MSC_PAGING_RESPONSE_TIMER_DEFAULT; - - INIT_LLIST_HEAD(&net->trans_list); - INIT_LLIST_HEAD(&net->upqueue); - INIT_LLIST_HEAD(&net->subscr_conns); - - /* init statistics */ - net->msc_ctrs = rate_ctr_group_alloc(net, &msc_ctrg_desc, 0); - if (!net->msc_ctrs) { - talloc_free(net); - return NULL; - } - net->active_calls = osmo_counter_alloc("msc.active_calls"); - - net->mncc_recv = mncc_recv; - - INIT_LLIST_HEAD(&net->a.bscs); - - return net; -} - struct msgb *gsm48_create_mm_serv_rej(enum gsm48_reject_value value) { struct msgb *msg; diff --git a/src/libmsc/osmo_msc.c b/src/libmsc/osmo_msc.c index d0c523502..62a7e8a22 100644 --- a/src/libmsc/osmo_msc.c +++ b/src/libmsc/osmo_msc.c @@ -38,6 +38,43 @@ #include <osmocom/msc/iu_dummy.h> #endif +struct gsm_network *gsm_network_init(void *ctx, mncc_recv_cb_t mncc_recv) +{ + struct gsm_network *net; + + net = talloc_zero(ctx, struct gsm_network); + if (!net) + return NULL; + + net->plmn = (struct osmo_plmn_id){ .mcc=1, .mnc=1 }; + + /* Permit a compile-time default of A5/3 and A5/1 */ + net->a5_encryption_mask = (1 << 3) | (1 << 1); + + /* Use 30 min periodic update interval as sane default */ + net->t3212 = 5; + + net->paging_response_timer = MSC_PAGING_RESPONSE_TIMER_DEFAULT; + + INIT_LLIST_HEAD(&net->trans_list); + INIT_LLIST_HEAD(&net->upqueue); + INIT_LLIST_HEAD(&net->subscr_conns); + + /* init statistics */ + net->msc_ctrs = rate_ctr_group_alloc(net, &msc_ctrg_desc, 0); + if (!net->msc_ctrs) { + talloc_free(net); + return NULL; + } + net->active_calls = osmo_counter_alloc("msc.active_calls"); + + net->mncc_recv = mncc_recv; + + INIT_LLIST_HEAD(&net->a.bscs); + + return net; +} + /* Receive a SAPI-N-REJECT from BSC */ void msc_sapi_n_reject(struct gsm_subscriber_connection *conn, int dlci) { |