diff --git a/scapy/contrib/gtp.py b/scapy/contrib/gtp.py index 804506a8e10f82098142fee9396a8910c54888bd..9582fa3e7e8c1213f8790298d6373ea318886eed 100644 --- a/scapy/contrib/gtp.py +++ b/scapy/contrib/gtp.py @@ -167,7 +167,6 @@ class IE_Cause(Packet): def extract_padding(self, pkt): return "",pkt - class IE_IMSI(Packet): name = "IMSI - Subscriber identity of the MS" fields_desc = [ ByteEnumField("ietype", 2, IEType), @@ -175,7 +174,6 @@ class IE_IMSI(Packet): def extract_padding(self, pkt): return "",pkt - class IE_Routing(Packet): name = "Routing Area Identity" fields_desc = [ ByteEnumField("ietype", 3, IEType), @@ -313,6 +311,20 @@ class IE_MSInternationalNumber(Packet): def extract_padding(self, pkt): return "",pkt +class IE_UserLocationInformation(Packet): + name = "User Location Information" + fields_desc = [ ByteEnumField("ietype", 152, IEType), + ShortField("length", None), + ByteField("type", 1), + # Only type 1 is currently supported + TBCDByteField("MCC", "", 2), + # MNC: if the third digit of MCC is 0xf, then the length of MNC is 1 byte + TBCDByteField("MNC", "", 1), + ShortField("LAC", None), + ShortField("SAC", None) ] + def extract_padding(self, pkt): + return "",pkt + class IE_IMEI(Packet): name = "IMEI" fields_desc = [ ByteEnumField("ietype", 154, IEType), @@ -333,7 +345,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, 154: IE_IMEI } + 134: IE_MSInternationalNumber, 152: IE_UserLocationInformation, 154: IE_IMEI } def IE_Dispatcher(s): """Choose the correct Information Element class."""