diff options
author | Harald Welte <laforge@gnumonks.org> | 2009-08-09 18:52:33 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2009-08-09 18:52:33 +0200 |
commit | 1a6f79818e867e2d9ab684c6352142cb036c6889 (patch) | |
tree | 2a03c898bb2a690ed259655258cfcbcd24909dfe /openbsc/src/chan_alloc.c | |
parent | f9daefd65be32a43b1bcd1e270922153172147a9 (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.c | 15 |
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; +} |