diff options
author | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2016-05-20 17:15:44 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2016-12-02 12:09:17 +0000 |
commit | 42eb0141d7f41ca4576c92bf694406f9fefa26df (patch) | |
tree | 951186c930eed621ac5c37814154dcc15f8e044a /openbsc/src/libmsc/gsm_04_08.c | |
parent | 640b794de072131f0976ffc00e45fc5f7d8dc439 (diff) |
split subscr_con_allocate()/_free() in bsc_ and msc_
Rename current subscr_con_allocate() and subscr_con_free to bsc_*,
and add two separate msc_subscr_con_allocate() and _free().
The msc_subscr_con_free() ignores all lchan members.
In libbsc use bsc_*, in libmsc use msc_*.
Change-Id: I3cf7c7cafdf4672ec7b26058bba8a77159855257
Future: there will be distinct subscr conns for libbsc and libmsc.
Diffstat (limited to 'openbsc/src/libmsc/gsm_04_08.c')
-rw-r--r-- | openbsc/src/libmsc/gsm_04_08.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c index d10f8cf1e..34492bbea 100644 --- a/openbsc/src/libmsc/gsm_04_08.c +++ b/openbsc/src/libmsc/gsm_04_08.c @@ -3683,6 +3683,33 @@ int gsm0408_new_conn(struct gsm_subscriber_connection *conn) return 0; } +struct gsm_subscriber_connection *msc_subscr_con_allocate(struct gsm_network *network) +{ + struct gsm_subscriber_connection *conn; + + conn = talloc_zero(network, struct gsm_subscriber_connection); + if (!conn) + return NULL; + + conn->network = network; + llist_add_tail(&conn->entry, &network->subscr_conns); + return conn; +} + +void msc_subscr_con_free(struct gsm_subscriber_connection *conn) +{ + if (!conn) + return; + + if (conn->subscr) { + subscr_put(conn->subscr); + conn->subscr = NULL; + } + + llist_del(&conn->entry); + talloc_free(conn); +} + /* Main entry point for GSM 04.08/44.008 Layer 3 data (e.g. from the BSC). */ int gsm0408_dispatch(struct gsm_subscriber_connection *conn, struct msgb *msg) { |