From 95805925d599879eae4c1e7839484bc6dcf1fa30 Mon Sep 17 00:00:00 2001 From: Guillaume Valadon <guillaume@valadon.net> Date: Thu, 25 Dec 2014 09:37:13 +0100 Subject: [PATCH] MSISDN & IMSI IE --HG-- branch : GTP support --- scapy/contrib/gtp.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/scapy/contrib/gtp.py b/scapy/contrib/gtp.py index 80ce3020..804506a8 100644 --- a/scapy/contrib/gtp.py +++ b/scapy/contrib/gtp.py @@ -309,7 +309,15 @@ class IE_MSInternationalNumber(Packet): fields_desc = [ ByteEnumField("ietype", 134, IEType), ShortField("length", None), FlagsField("flags", 0, 8, ["Extension","","","International Number","","","","ISDN numbering"]), - StrLenField("digits", "33607080910", length_from=lambda x: x.length-1) ] + TBCDByteField("digits", "33607080910", length_from=lambda x: x.length-1) ] + def extract_padding(self, pkt): + return "",pkt + +class IE_IMEI(Packet): + name = "IMEI" + fields_desc = [ ByteEnumField("ietype", 154, IEType), + ShortField("length", None), + TBCDByteField("IMEI", "", length_from=lambda x: x.length) ] def extract_padding(self, pkt): return "",pkt @@ -325,7 +333,7 @@ ietypecls = { 1: IE_Cause, 2: IE_IMSI, 3: IE_Routing, 15: IE_SelectionMode, 16 17: IE_TEICP, 19: IE_Teardown, 20: IE_NSAPI, 26: IE_ChargingCharacteristics, 27: IE_TraceReference, 28: IE_TraceType, 128: IE_EndUserAddress, 131: IE_AccessPointName, 133: IE_GSNAddress, - 134: IE_MSInternationalNumber } + 134: IE_MSInternationalNumber, 154: IE_IMEI } def IE_Dispatcher(s): """Choose the correct Information Element class.""" -- GitLab