scapy.contrib.gtp

class scapy.contrib.gtp.APNStrLenField(name, default, fld=None, length_from=None, max_length=None)

Bases: scapy.fields.StrLenField

i2m(pkt, s)
m2i(pkt, s)
class scapy.contrib.gtp.GTPCreatePDPContextRequest

Bases: scapy.packet.Packet

aliastypes
fields_desc
GTPCreatePDPContextRequest fields

IE_list

PacketListField

[<IE_TEIDI  TEIDI=3217758098 |>, <IE_NSAPI  NSAPI=13 |>, <IE_GSNAddress  address=<RandIP> |>, <IE_GSNAddress  address=<RandIP> |>, <IE_NotImplementedTLV  ietype=QoS length=15 data=<RandString> |>]

hashret()
class scapy.contrib.gtp.GTPCreatePDPContextResponse

Bases: scapy.packet.Packet

aliastypes
answers(other)
fields_desc
GTPCreatePDPContextResponse fields

IE_list

PacketListField

[]

hashret()
class scapy.contrib.gtp.GTPDeletePDPContextRequest

Bases: scapy.packet.Packet

aliastypes
fields_desc
GTPDeletePDPContextRequest fields

IE_list

PacketListField

[]

class scapy.contrib.gtp.GTPDeletePDPContextResponse

Bases: scapy.packet.Packet

aliastypes
fields_desc
GTPDeletePDPContextResponse fields

IE_list

PacketListField

[]

class scapy.contrib.gtp.GTPEchoRequest

Bases: scapy.packet.Packet

aliastypes
hashret()
class scapy.contrib.gtp.GTPEchoResponse

Bases: scapy.packet.Packet

aliastypes
answers(other)
fields_desc
GTPEchoResponse fields

IE_list

PacketListField

[]

hashret()
class scapy.contrib.gtp.GTPErrorIndication

Bases: scapy.packet.Packet

aliastypes
fields_desc
GTPErrorIndication fields

IE_list

PacketListField

[]

class scapy.contrib.gtp.GTPHeader

Bases: scapy.packet.Packet

aliastypes
answers(other)
classmethod dispatch_hook(_pkt=None, *args, **kargs)
fields_desc
GTPHeader fields

version

BitField (3 bits)

1

PT

BitField (1 bit)

1

reserved

BitField (1 bit)

0

E

BitField (1 bit)

0

S

BitField (1 bit)

0

PN

BitField (1 bit)

0

gtp_type

ByteEnumField

None

length

ShortField

None

teid

IntField

0

seq

XBitField (Cond) (16 bits)

0

npdu

ByteField (Cond)

0

next_ex

ByteEnumField (Cond)

0

hashret()
payload_guess

Possible sublayers: GTPCreatePDPContextRequest, GTPCreatePDPContextResponse, GTPDeletePDPContextRequest, GTPDeletePDPContextResponse, GTPEchoRequest, GTPEchoResponse, GTPPDUNotificationRequest, GTPSupportedExtensionHeadersNotification, GTPUpdatePDPContextRequest, GTPUpdatePDPContextResponse, GTP_PDCP_PDU_ExtensionHeader, GTP_UDPPort_ExtensionHeader

post_build(p, pay)
class scapy.contrib.gtp.GTPPDUNotificationRequest

Bases: scapy.packet.Packet

aliastypes
fields_desc
GTPPDUNotificationRequest fields

IE_list

PacketListField

[<IE_IMSI  |>, <IE_TEICP  TEICI=2541305541 |>, <IE_EndUserAddress  PDPTypeNumber=0x21 |>, <IE_AccessPointName  |>, <IE_GSNAddress  address=127.0.0.1 |>]

class scapy.contrib.gtp.GTPPDUSessionContainer

Bases: scapy.packet.Packet

aliastypes
fields_desc
GTPPDUSessionContainer fields

ExtHdrLen

ByteField

None

type

BitField (4 bits)

0

spare1

BitField (4 bits)

0

P

BitField (1 bit)

0

R

BitField (1 bit)

0

QFI

BitField (6 bits)

0

PPI

XBitField (Cond) (3 bits)

0

spare2

XBitField (Cond) (5 bits)

0

pad1

ByteField (Cond)

0

pad2

ByteField (Cond)

0

pad3

ByteField (Cond)

0

NextExtHdr

ByteEnumField

0

guess_payload_class(payload)
hashret()
post_build(p, pay)
class scapy.contrib.gtp.GTPSupportedExtensionHeadersNotification

Bases: scapy.packet.Packet

aliastypes
fields_desc
GTPSupportedExtensionHeadersNotification fields

IE_list

PacketListField

[<IE_ExtensionHeaderList  extension_headers=[64, 192] |>]

class scapy.contrib.gtp.GTPUpdatePDPContextRequest

Bases: scapy.packet.Packet

aliastypes
fields_desc
GTPUpdatePDPContextRequest fields

IE_list

PacketListField

[<IE_Cause  |>, <IE_Recovery  |>, <IE_TEIDI  TEIDI=2144287838 |>, <IE_TEICP  TEICI=4286076970 |>, <IE_ChargingId  Charging_id=1453416417 |>, <IE_ProtocolConfigurationOptions  |>, <IE_GSNAddress  address=<RandIP> |>, <IE_GSNAddress  address=<RandIP> |>, <IE_GSNAddress  address=<RandIP> |>, <IE_GSNAddress  address=<RandIP> |>, <IE_QoS  |>, <IE_CharginGatewayAddress  |>, <IE_CharginGatewayAddress  |>, <IE_CommonFlags  |>, <IE_APNRestriction  |>, <IE_BearerControlMode  |>, <IE_MSInfoChangeReportingAction  |>, <IE_EvolvedAllocationRetentionPriority  |>, <IE_PrivateExtension  |>]

hashret()
class scapy.contrib.gtp.GTPUpdatePDPContextResponse

Bases: scapy.packet.Packet

aliastypes
fields_desc
GTPUpdatePDPContextResponse fields

IE_list

PacketListField

[]

hashret()
class scapy.contrib.gtp.GTP_ExtensionHeader

Bases: scapy.packet.Packet

aliastypes
classmethod dispatch_hook(_pkt=None, *args, **kargs)
class scapy.contrib.gtp.GTP_PDCP_PDU_ExtensionHeader

Bases: scapy.contrib.gtp.GTP_ExtensionHeader

aliastypes
fields_desc
GTP_PDCP_PDU_ExtensionHeader fields

length

ByteField

1

pdcp_pdu

ShortField

None

next_ex

ByteEnumField

0

class scapy.contrib.gtp.GTP_UDPPort_ExtensionHeader

Bases: scapy.contrib.gtp.GTP_ExtensionHeader

aliastypes
fields_desc
GTP_UDPPort_ExtensionHeader fields

length

ByteField

64

udp_port

ShortField

None

next_ex

ByteEnumField

0

class scapy.contrib.gtp.GTP_U_Header

Bases: scapy.contrib.gtp.GTPHeader

aliastypes
fields_desc
GTP_U_Header fields

version

BitField (3 bits)

1

PT

BitField (1 bit)

1

reserved

BitField (1 bit)

0

E

BitField (1 bit)

0

S

BitField (1 bit)

0

PN

BitField (1 bit)

0

gtp_type

ByteEnumField

None

length

ShortField

None

teid

IntField

0

seq

XBitField (Cond) (16 bits)

0

npdu

ByteField (Cond)

0

next_ex

ByteEnumField (Cond)

0

guess_payload_class(payload)
payload_guess

Possible sublayers: GTPCreatePDPContextRequest, GTPCreatePDPContextResponse, GTPDeletePDPContextRequest, GTPDeletePDPContextResponse, GTPEchoRequest, GTPEchoResponse, GTPErrorIndication, GTPPDUNotificationRequest, GTPPDUSessionContainer, GTPSupportedExtensionHeadersNotification, GTPUpdatePDPContextRequest, GTPUpdatePDPContextResponse, GTP_PDCP_PDU_ExtensionHeader, GTP_UDPPort_ExtensionHeader

class scapy.contrib.gtp.GTPmorethan1500

Bases: scapy.packet.Packet

aliastypes
fields_desc
GTPmorethan1500 fields

IE_Cause

ByteEnumField

1

IE

BitField (12000 bits)

1

class scapy.contrib.gtp.IE_APNRestriction

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_APNRestriction fields

ietype

ByteEnumField

149

length

ShortField

1

restriction_type_value

ByteField

0

class scapy.contrib.gtp.IE_AccessPointName

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_AccessPointName fields

ietype

ByteEnumField

131

length

ShortField

None

APN

APNStrLenField

b'nternet'

post_build(p, pay)
class scapy.contrib.gtp.IE_Base

Bases: scapy.packet.Packet

aliastypes
extract_padding(pkt)
class scapy.contrib.gtp.IE_BearerControlMode

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_BearerControlMode fields

ietype

ByteEnumField

184

length

ShortField

1

bearer_control_mode

ByteField

0

class scapy.contrib.gtp.IE_Cause

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_Cause fields

ietype

ByteEnumField

1

CauseValue

ByteEnumField

None

class scapy.contrib.gtp.IE_CharginGatewayAddress

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_CharginGatewayAddress fields

ietype

ByteEnumField

251

length

ShortField

4

ipv4_address

IPField (Cond)

'127.0.0.1'

ipv6_address

IP6Field (Cond)

'::1'

class scapy.contrib.gtp.IE_ChargingCharacteristics

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_ChargingCharacteristics fields

ietype

ByteEnumField

26

Ch_ChSpare

XBitField (4 bits)

None

normal_charging

XBitField (1 bit)

None

prepaid_charging

XBitField (1 bit)

None

flat_rate_charging

XBitField (1 bit)

None

hot_billing_charging

XBitField (1 bit)

None

Ch_ChReserved

XBitField (8 bits)

0

class scapy.contrib.gtp.IE_ChargingId

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_ChargingId fields

ietype

ByteEnumField

127

Charging_id

XIntField

<RandInt>

class scapy.contrib.gtp.IE_CommonFlags

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_CommonFlags fields

ietype

ByteEnumField

148

length

ShortField

None

dual_addr_bearer_fl

BitField (1 bit)

0

upgrade_qos_supported

BitField (1 bit)

0

nrsn

BitField (1 bit)

0

no_qos_nego

BitField (1 bit)

0

mbms_cnting_info

BitField (1 bit)

0

ran_procedure_ready

BitField (1 bit)

0

mbms_service_type

BitField (1 bit)

0

prohibit_payload_compression

BitField (1 bit)

0

class scapy.contrib.gtp.IE_DirectTunnelFlags

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_DirectTunnelFlags fields

ietype

ByteEnumField

182

length

ShortField

1

Spare

BitField (1 bit)

0

Spare

BitField (1 bit)

0

Spare

BitField (1 bit)

0

Spare

BitField (1 bit)

0

Spare

BitField (1 bit)

0

EI

BitField (1 bit)

0

GCSI

BitField (1 bit)

0

DTI

BitField (1 bit)

0

scapy.contrib.gtp.IE_Dispatcher(s)

Choose the correct Information Element class.

class scapy.contrib.gtp.IE_EndUserAddress

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_EndUserAddress fields

ietype

ByteEnumField

128

length

ShortField

2

SPARE

BitField (4 bits)

15

PDPTypeOrganization

BitField (4 bits)

1

PDPTypeNumber

XByteField

None

PDPAddress

IPField (Cond)

<RandIP>

IPv6_PDPAddress

IP6Field (Cond)

'::1'

class scapy.contrib.gtp.IE_EvolvedAllocationRetentionPriority

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_EvolvedAllocationRetentionPriority fields

ietype

ByteEnumField

191

length

ShortField

1

Spare

BitField (1 bit)

0

PCI

BitField (1 bit)

0

PL

XBitField (4 bits)

0

Spare

BitField (1 bit)

0

PVI

BitField (1 bit)

0

class scapy.contrib.gtp.IE_ExtensionHeaderList

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_ExtensionHeaderList fields

ietype

ByteEnumField

141

length

FieldLenField

None

extension_headers

FieldListField

[64, 192]

class scapy.contrib.gtp.IE_GSNAddress

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_GSNAddress fields

ietype

ByteEnumField

133

length

ShortField

4

address

IPField

<RandIP>

class scapy.contrib.gtp.IE_IMEI

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_IMEI fields

ietype

ByteEnumField

154

length

ShortField

None

IMEI

TBCDByteField

b''

class scapy.contrib.gtp.IE_IMSI

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_IMSI fields

ietype

ByteEnumField

2

imsi

TBCDByteField

b'649471162805511'

class scapy.contrib.gtp.IE_MSInfoChangeReportingAction

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_MSInfoChangeReportingAction fields

ietype

ByteEnumField

181

length

ShortField

1

Action

ByteField

0

class scapy.contrib.gtp.IE_MSInternationalNumber

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_MSInternationalNumber fields

ietype

ByteEnumField

134

length

ShortField

None

flags

FlagsField (8 bits)

<Flag 145 (Extension++ISDN numbering)>

digits

TBCDByteField

b'33607080910'

class scapy.contrib.gtp.IE_MSTimeZone

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_MSTimeZone fields

ietype

ByteEnumField

153

length

ShortField

None

timezone

ByteField

0

Spare

BitField (1 bit)

0

Spare

BitField (1 bit)

0

Spare

BitField (1 bit)

0

Spare

BitField (1 bit)

0

Spare

BitField (1 bit)

0

Spare

BitField (1 bit)

0

daylight_saving_time

XBitField (2 bits)

0

class scapy.contrib.gtp.IE_NSAPI

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_NSAPI fields

ietype

ByteEnumField

20

sparebits

XBitField (4 bits)

0

NSAPI

XBitField (4 bits)

<RandNum>

class scapy.contrib.gtp.IE_NotImplementedTLV

Bases: scapy.packet.Packet

aliastypes
extract_padding(pkt)
fields_desc
IE_NotImplementedTLV fields

ietype

ByteEnumField

0

length

ShortField

None

data

StrLenField

b''

class scapy.contrib.gtp.IE_PrivateExtension

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_PrivateExtension fields

ietype

ByteEnumField

255

length

ShortField

1

extension identifier

ByteField

0

extention_value

StrLenField

b''

class scapy.contrib.gtp.IE_ProtocolConfigurationOptions

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_ProtocolConfigurationOptions fields

ietype

ByteEnumField

132

length

ShortField

4

Protocol_Configuration

StrLenField

b''

class scapy.contrib.gtp.IE_QoS

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_QoS fields

ietype

ByteEnumField

135

length

ShortField

None

allocation_retention_prioiry

ByteField

1

spare

XBitField (Cond) (2 bits)

0

delay_class

XBitField (Cond) (3 bits)

0

reliability_class

XBitField (Cond) (3 bits)

0

peak_troughput

XBitField (Cond) (4 bits)

0

spare

BitField (Cond) (1 bit)

0

precedence_class

XBitField (Cond) (3 bits)

0

spare

XBitField (Cond) (3 bits)

0

mean_troughput

XBitField (Cond) (5 bits)

0

traffic_class

XBitField (Cond) (3 bits)

0

delivery_order

XBitField (Cond) (2 bits)

0

delivery_of_err_sdu

XBitField (Cond) (3 bits)

0

max_sdu_size

ByteField (Cond)

None

max_bitrate_up

ByteField (Cond)

None

max_bitrate_down

ByteField (Cond)

None

redidual_ber

XBitField (Cond) (4 bits)

0

sdu_err_ratio

XBitField (Cond) (4 bits)

0

transfer_delay

XBitField (Cond) (6 bits)

0

traffic_handling_prio

XBitField (Cond) (2 bits)

0

guaranteed_bit_rate_up

ByteField (Cond)

None

guaranteed_bit_rate_down

ByteField (Cond)

None

spare

XBitField (Cond) (3 bits)

0

signaling_indication

BitField (Cond) (1 bit)

0

source_stats_desc

XBitField (Cond) (4 bits)

0

max_bitrate_down_ext

ByteField (Cond)

None

guaranteed_bitrate_down_ext

ByteField (Cond)

None

max_bitrate_up_ext

ByteField (Cond)

None

guaranteed_bitrate_up_ext

ByteField (Cond)

None

max_bitrate_down_ext2

ByteField (Cond)

None

guaranteed_bitrate_down_ext2

ByteField (Cond)

None

max_bitrate_up_ext2

ByteField (Cond)

None

guaranteed_bitrate_up_ext2

ByteField (Cond)

None

class scapy.contrib.gtp.IE_RATType

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_RATType fields

ietype

ByteEnumField

151

length

ShortField

1

RAT_Type

ByteEnumField

None

class scapy.contrib.gtp.IE_Recovery

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_Recovery fields

ietype

ByteEnumField

14

restart_counter

ByteField

24

class scapy.contrib.gtp.IE_ReorderingRequired

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_ReorderingRequired fields

ietype

ByteEnumField

8

reordering_required

ByteEnumField

254

class scapy.contrib.gtp.IE_Routing

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_Routing fields

ietype

ByteEnumField

3

MCC

TBCDByteField

b''

MNC

TBCDByteField

b''

LAC

ShortField

None

RAC

ByteField

None

class scapy.contrib.gtp.IE_SelectionMode

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_SelectionMode fields

ietype

ByteEnumField

15

SelectionMode

BitEnumField (8 bits)

11111100

class scapy.contrib.gtp.IE_TEICP

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_TEICP fields

ietype

ByteEnumField

17

TEICI

XIntField

<RandInt>

class scapy.contrib.gtp.IE_TEIDI

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_TEIDI fields

ietype

ByteEnumField

16

TEIDI

XIntField

<RandInt>

class scapy.contrib.gtp.IE_Teardown

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_Teardown fields

ietype

ByteEnumField

19

indicator

ByteEnumField

255

class scapy.contrib.gtp.IE_TraceReference

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_TraceReference fields

ietype

ByteEnumField

27

Trace_reference

XBitField (16 bits)

None

class scapy.contrib.gtp.IE_TraceType

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_TraceType fields

ietype

ByteEnumField

28

Trace_type

XBitField (16 bits)

None

class scapy.contrib.gtp.IE_UserLocationInformation

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_UserLocationInformation fields

ietype

ByteEnumField

152

length

ShortField

None

type

ByteField

1

MCC

TBCDByteField

b''

MNC

TBCDByteField

b''

LAC

ShortField

None

SAC

ShortField

None

class scapy.contrib.gtp.QoS_Profile

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
QoS_Profile fields

qos_ei

ByteField

0

length

ByteField

None

spare

XBitField (2 bits)

0

delay_class

XBitField (3 bits)

0

reliability_class

XBitField (3 bits)

0

peak_troughput

XBitField (4 bits)

0

spare

BitField (1 bit)

0

precedence_class

XBitField (3 bits)

0

spare

XBitField (3 bits)

0

mean_troughput

XBitField (5 bits)

0

traffic_class

XBitField (3 bits)

0

delivery_order

XBitField (2 bits)

0

delivery_of_err_sdu

XBitField (3 bits)

0

max_sdu_size

ByteField

None

max_bitrate_up

ByteField

None

max_bitrate_down

ByteField

None

redidual_ber

XBitField (4 bits)

0

sdu_err_ratio

XBitField (4 bits)

0

transfer_delay

XBitField (5 bits)

0

traffic_handling_prio

XBitField (3 bits)

0

guaranteed_bit_rate_up

ByteField

None

guaranteed_bit_rate_down

ByteField

None

class scapy.contrib.gtp.TBCDByteField(name, default, length=None, length_from=None)

Bases: scapy.fields.StrFixedLenField

i2h(pkt, val)
i2m(pkt, val)
m2i(pkt, val)