aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-09-16 00:53:37 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-09-16 02:16:02 +0800
commit79f763fe9151b06bea6fa2d1c94d71b86db4539e (patch)
tree8696ea51df8562c79480adcd706f0bf08496944f /openbsc
parenta2aedad00541a020b2083fb31ba14d8670a5c26f (diff)
bsc: Keep all active subscriber connections in a list.
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/include/openbsc/gsm_data.h2
-rw-r--r--openbsc/src/bsc_api.c5
2 files changed, 7 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h
index e0f7c7049..016cdaacf 100644
--- a/openbsc/include/openbsc/gsm_data.h
+++ b/openbsc/include/openbsc/gsm_data.h
@@ -228,6 +228,8 @@ enum gsm_lchan_state {
/* the per subscriber data for lchan */
struct gsm_subscriber_connection {
+ struct llist_head entry;
+
/* To whom we are allocated at the moment */
struct gsm_subscriber *subscr;
diff --git a/openbsc/src/bsc_api.c b/openbsc/src/bsc_api.c
index 6c2a467e4..5048f2b96 100644
--- a/openbsc/src/bsc_api.c
+++ b/openbsc/src/bsc_api.c
@@ -33,6 +33,8 @@
#include <osmocore/talloc.h>
+static LLIST_HEAD(sub_connections);
+
static void rll_ind_cb(struct gsm_lchan *, uint8_t, void *, enum bsc_rllr_ind);
static void send_sapi_reject(struct gsm_subscriber_connection *conn, int link_id);
@@ -48,6 +50,7 @@ struct gsm_subscriber_connection *subscr_con_allocate(struct gsm_lchan *lchan)
conn->lchan = lchan;
conn->bts = lchan->ts->trx->bts;
lchan->conn = conn;
+ llist_add_tail(&conn->entry, &sub_connections);
return conn;
}
@@ -70,6 +73,8 @@ void subscr_con_free(struct gsm_subscriber_connection *conn)
if (conn->ho_lchan)
LOGP(DNM, LOGL_ERROR, "The ho_lchan should have been cleared.\n");
+ llist_del(&conn->entry);
+
lchan = conn->lchan;
talloc_free(conn);