aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/chan_alloc.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2009-08-09 18:52:33 +0200
committerHarald Welte <laforge@gnumonks.org>2009-08-09 18:52:33 +0200
commit1a6f79818e867e2d9ab684c6352142cb036c6889 (patch)
tree2a03c898bb2a690ed259655258cfcbcd24909dfe /openbsc/src/chan_alloc.c
parentf9daefd65be32a43b1bcd1e270922153172147a9 (diff)
move search for existing lchan for subscriber to new function
There's now a new function called 'lchan_for_subscr()' which can be used to determine if there is any existing lchan for this subscriber.
Diffstat (limited to 'openbsc/src/chan_alloc.c')
-rw-r--r--openbsc/src/chan_alloc.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/openbsc/src/chan_alloc.c b/openbsc/src/chan_alloc.c
index a66f70e8c..860355a02 100644
--- a/openbsc/src/chan_alloc.c
+++ b/openbsc/src/chan_alloc.c
@@ -269,3 +269,18 @@ struct gsm_lchan* lchan_find(struct gsm_bts *bts, struct gsm_subscriber *subscr)
return NULL;
}
+
+struct gsm_lchan *lchan_for_subscr(struct gsm_subscriber *subscr)
+{
+ struct gsm_bts *bts;
+ struct gsm_network *net = subscr->net;
+ struct gsm_lchan *lchan;
+
+ llist_for_each_entry(bts, &net->bts_list, list) {
+ lchan = lchan_find(bts, subscr);
+ if (lchan)
+ return lchan;
+ }
+
+ return 0;
+}