aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libxsc
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-05-10 13:27:32 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-11-12 15:50:36 +0100
commite224a81f92ebc02dd5bcbba8069801ca1d2b7196 (patch)
tree70ec2fc181c896141c9f05bc64c8976e89d660f8 /openbsc/src/libxsc
parent2ac47f62ae395902e03f5d7f60598ce937639a8d (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/libxsc')
-rw-r--r--openbsc/src/libxsc/xsc.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/openbsc/src/libxsc/xsc.c b/openbsc/src/libxsc/xsc.c
index 04bc53e1b..3692a3a3b 100644
--- a/openbsc/src/libxsc/xsc.c
+++ b/openbsc/src/libxsc/xsc.c
@@ -27,6 +27,8 @@
#include <openbsc/xsc.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
@@ -149,3 +151,16 @@ struct msgb *gsm0480_gen_releaseComplete(void)
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;
+}