From d6900dfba4cf1c12133d0bf3200ef560f5c7f0d4 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Tue, 12 May 2015 22:20:05 +0200 Subject: 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. --- openbsc/src/gprs/sgsn_libgtp.c | 6 ++++++ 1 file changed, 6 insertions(+) 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; -- cgit v1.2.3