diff options
author | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2016-05-10 13:27:32 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2016-12-02 12:09:15 +0000 |
commit | 05667a0aff4f7020222e07fac41b1f783e0696aa (patch) | |
tree | 5ab8c5b1bb9038f6d76a258d79c5143fb1afbefe /openbsc/src/libcommon-cs | |
parent | ac1f1436e9d380f632dd850fcd253d3480f0fc2d (diff) |
sms_next_rp_msg_ref(): use direct pointer to next_rp_ref counter
libbsc and libmsc will have separate subscriber connection structs. Hence don't
rely on gsm_subscriber_connection, but work on a direct pointer to the counter
for the next RP reference.
The only very thin function in gsm_04_11_helper.c thus becomes obsolete: drop
the entire file.
Change-Id: I2a2e9ba6a981a385d1f8f07acbe03536ffed0072
Diffstat (limited to 'openbsc/src/libcommon-cs')
-rw-r--r-- | openbsc/src/libcommon-cs/common_cs.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/openbsc/src/libcommon-cs/common_cs.c b/openbsc/src/libcommon-cs/common_cs.c index 8d09b7ee3..3149580f0 100644 --- a/openbsc/src/libcommon-cs/common_cs.c +++ b/openbsc/src/libcommon-cs/common_cs.c @@ -27,6 +27,8 @@ #include <openbsc/common_cs.h> #include <openbsc/gsm_data.h> #include <openbsc/gsm_subscriber.h> +#include <openbsc/gsm_data.h> +#include <openbsc/gsm_04_11.h> /* Warning: if bsc_network_init() is not called, some of the members of * gsm_network are not initialized properly and must not be used! (In @@ -113,3 +115,16 @@ struct msgb *gsm48_create_loc_upd_rej(uint8_t cause) gh->data[0] = cause; return msg; } + +uint8_t sms_next_rp_msg_ref(uint8_t *next_rp_ref) +{ + const uint8_t rp_msg_ref = *next_rp_ref; + /* + * This should wrap as the valid range is 0 to 255. We only + * transfer one SMS at a time so we don't need to check if + * the id has been already assigned. + */ + *next_rp_ref += 1; + + return rp_msg_ref; +} |