diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2014-12-03 09:28:24 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-12-05 14:59:02 +0100 |
commit | 1e30a28e51b5e8a14b977233858f267f839197d5 (patch) | |
tree | 07f0a3f2fc5cf316b40d55cae5f40243b419e5ca /openbsc/src/libmsc/sms_queue.c | |
parent | dae1f64ba688eaa24aad6ce15a8529bdef788146 (diff) |
msc: Add and use gsm_subscriber_group
Currently every subcriber object directly refers to the gsm_network
which contains a flag shared by every related subscriber
(keep_subscr). This adds a dependency on gsm_network even if only the
function defined in gsm_subscriber_base.c are used.
This patch adds a new struct gsm_subscriber_group which contains the
keep_subscr flag and a back reference to the network object. The
latter is not dereferenced in gsm_subscriber_base.c, so it can safely
be set to NULL when only that part of the gsm_subscriber API is being
used. It also changes that API to use gsm_subscriber_group instead of
gsm_network parameters.
Since there are some places where a pointer to the gsm_network is
needed but where only a gsm_subscriber is available, a 'net' back
pointer is added to the group struct, too. Nevertheless subscr group
and network could be separated completely, but this is not the topic
of this commit.
Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/src/libmsc/sms_queue.c')
-rw-r--r-- | openbsc/src/libmsc/sms_queue.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/openbsc/src/libmsc/sms_queue.c b/openbsc/src/libmsc/sms_queue.c index 536bfdd14..3ed8b562a 100644 --- a/openbsc/src/libmsc/sms_queue.c +++ b/openbsc/src/libmsc/sms_queue.c @@ -135,7 +135,7 @@ static void sms_pending_resend(struct gsm_sms_pending *pending) pending->resend = 1; - smsq = pending->subscr->net->sms_queue; + smsq = pending->subscr->group->net->sms_queue; if (osmo_timer_pending(&smsq->resend_pending)) return; @@ -149,7 +149,7 @@ static void sms_pending_failed(struct gsm_sms_pending *pending, int paging_error LOGP(DLSMS, LOGL_NOTICE, "Sending SMS %llu failed %d times.\n", pending->sms_id, pending->failed_attempts); - smsq = pending->subscr->net->sms_queue; + smsq = pending->subscr->group->net->sms_queue; if (++pending->failed_attempts < smsq->max_fail) return sms_pending_resend(pending); @@ -285,7 +285,7 @@ static void sms_submit_pending(void *_data) */ static void sms_send_next(struct gsm_subscriber *subscr) { - struct gsm_sms_queue *smsq = subscr->net->sms_queue; + struct gsm_sms_queue *smsq = subscr->group->net->sms_queue; struct gsm_sms_pending *pending; struct gsm_sms *sms; @@ -316,7 +316,7 @@ static void sms_send_next(struct gsm_subscriber *subscr) no_pending_sms: /* Try to send the SMS to avoid the queue being stuck */ - sms_submit_pending(subscr->net->sms_queue); + sms_submit_pending(subscr->group->net->sms_queue); } /* |