diff --git a/scapy/contrib/gtp.py b/scapy/contrib/gtp.py index 80ce30204318138ad396c87e22ac88d5a89957b3..804506a8e10f82098142fee9396a8910c54888bd 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."""