summaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs/sgsn_libgtp.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-05-12 22:20:05 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-05-17 17:23:57 +0200
commitd6900dfba4cf1c12133d0bf3200ef560f5c7f0d4 (patch)
tree837a0cf2569737610245ba1f1a630b3957a73a5c /openbsc/src/gprs/sgsn_libgtp.c
parent6ddb6ac0284ccfcfc538af175c0cde8beb13f7c5 (diff)
sgsn: Give the IMEI to the GGSN for analysis
Most SGSNs pass the IMEI(SV). We currently only enquire about the IMEI and then pad the 'SV' with 1111b (thanks to the encoding routine). Sadly it insists on always writing the length which means we have to memmove the data around by a single octet. Manually verified using the pcu-emu and looking at the trace using wireshark.
Diffstat (limited to 'openbsc/src/gprs/sgsn_libgtp.c')
-rw-r--r--openbsc/src/gprs/sgsn_libgtp.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/openbsc/src/gprs/sgsn_libgtp.c b/openbsc/src/gprs/sgsn_libgtp.c
index 008ec1e6a..a96eb5c78 100644
--- a/openbsc/src/gprs/sgsn_libgtp.c
+++ b/openbsc/src/gprs/sgsn_libgtp.c
@@ -237,6 +237,12 @@ struct sgsn_pdp_ctx *sgsn_create_pdp_ctx(struct sgsn_ggsn_ctx *ggsn,
pdp->userloc.v[0] = 0; /* CGI for GERAN */
bssgp_create_cell_id(&pdp->userloc.v[1], &mmctx->ra, mmctx->cell_id);
+ /* include the IMEI(SV) */
+ pdp->imeisv_given = 1;
+ gsm48_encode_bcd_number(&pdp->imeisv.v[0], 8, 0, mmctx->imei);
+ pdp->imeisv.l = pdp->imeisv.v[0];
+ memmove(&pdp->imeisv.v[0], &pdp->imeisv.v[1], 8);
+
/* change pdp state to 'requested' */
pctx->state = PDP_STATE_CR_REQ;