aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs/gprs_utils.c
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2014-10-02 16:14:47 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-10-09 18:12:27 +0200
commit49389178cc6059f4e80f30dda2192560e580b29d (patch)
treea35b4d0f5b0ff5e7c3e06add67ff62a00a282755 /openbsc/src/gprs/gprs_utils.c
parent43b8f9f8a10c16ddbcd1caeae742aace0c5e4ee9 (diff)
gbproxy: Use pointer to PTMSI value instead of MI
Currently, ptmsi_enc and new_ptmsi_enc point to the beginning of the mobile identity. Since all P-TMSI in 04.08 (MM) are encoded this way (1 byte header + 4 byte P-TMSI value). This is different to the P-TMSI encoding in 08.18 (BSSGP), where the P-TMSI is encoded into 4 byte without MI header. This patch changes the code to use pointers to the P-TMSI value, which is encoded in the same way in both specifications. Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/src/gprs/gprs_utils.c')
-rw-r--r--openbsc/src/gprs/gprs_utils.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/openbsc/src/gprs/gprs_utils.c b/openbsc/src/gprs/gprs_utils.c
index c62045480..0cf8e4f95 100644
--- a/openbsc/src/gprs/gprs_utils.c
+++ b/openbsc/src/gprs/gprs_utils.c
@@ -209,3 +209,11 @@ int gprs_parse_mi_tmsi(const uint8_t *value, size_t value_len, uint32_t *tmsi)
return 1;
}
+void gprs_parse_tmsi(const uint8_t *value, uint32_t *tmsi)
+{
+ uint32_t tmsi_be;
+
+ memcpy(&tmsi_be, value, sizeof(tmsi_be));
+
+ *tmsi = ntohl(tmsi_be);
+}