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字段

IE_list

PacketListField

[<IE_TEIDI  TEIDI=4276808304 |>, <IE_NSAPI  NSAPI=4 |>, <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字段

IE_list

PacketListField

[]

hashret()
class scapy.contrib.gtp.GTPDeletePDPContextRequest

Bases: scapy.packet.Packet

aliastypes
fields_desc
GTPDeletePDPContextRequest字段

IE_list

PacketListField

[]

class scapy.contrib.gtp.GTPDeletePDPContextResponse

Bases: scapy.packet.Packet

aliastypes
fields_desc
GTPDeletePDPContextResponse字段

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字段

IE_list

PacketListField

[]

hashret()
class scapy.contrib.gtp.GTPErrorIndication

Bases: scapy.packet.Packet

aliastypes
fields_desc
GTPErrorIndication字段

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字段

version

BitField (3位)

1

PT

BitField (1位)

1

reserved

BitField (1 bit)

0

E

BitField (1位)

0

S

BitField (1位)

0

PN

BitField (1位)

0

gtp_type

ByteEnumField

None

length

ShortField

None

teid

IntField

0

seq

XBitField (Cond)(16位)

0

npdu

ByteField (Cond)

0

next_ex

ByteEnumField (Cond)

0

hashret()
payload_guess

可能的子层: GTPCreatePDPContextRequestGTPCreatePDPContextResponseGTPDeletePDPContextRequestGTPDeletePDPContextResponseGTPEchoRequestGTPEchoResponseGTPPDUNotificationRequestGTPSupportedExtensionHeadersNotificationGTPUpdatePDPContextRequestGTPUpdatePDPContextResponseGTP_PDCP_PDU_ExtensionHeaderGTP_UDPPort_ExtensionHeader

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

Bases: scapy.packet.Packet

aliastypes
fields_desc
GTPPDUNotificationRequest字段

IE_list

PacketListField

[<IE_IMSI  |>, <IE_TEICP  TEICI=561526853 |>, <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字段

ExtHdrLen

ByteField

None

type

BitField (4位)

0

spare1

BitField (4位)

0

P

BitField (1位)

0

R

BitField (1位)

0

QFI

BitField (6位)

0

PPI

XBitField (Cond)(3位)

0

spare2

XBitField (Cond)(5位)

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字段

IE_list

PacketListField

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

class scapy.contrib.gtp.GTPUpdatePDPContextRequest

Bases: scapy.packet.Packet

aliastypes
fields_desc
GTPUpdatePDPContextRequest字段

IE_list

PacketListField

[<IE_Cause  |>, <IE_Recovery  |>, <IE_TEIDI  TEIDI=494473963 |>, <IE_TEICP  TEICI=1147172483 |>, <IE_ChargingId  Charging_id=2003869375 |>, <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字段

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字段

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字段

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字段

version

BitField (3位)

1

PT

BitField (1位)

1

reserved

BitField (1位)

0

E

BitField (1位)

0

S

BitField (1位)

0

PN

BitField (1位)

0

gtp_type

ByteEnumField

None

length

ShortField

None

teid

IntField

0

seq

XBitField (Cond)(16位)

0

npdu

ByteField (Cond)

0

next_ex

ByteEnumField (Cond)

0

guess_payload_class(payload)
payload_guess

可能的子层: GTPCreatePDPContextRequestGTPCreatePDPContextResponseGTPDeletePDPContextRequestGTPDeletePDPContextResponseGTPEchoRequestGTPEchoResponseGTPErrorIndicationGTPPDUNotificationRequestGTPPDUSessionContainerGTPSupportedExtensionHeadersNotificationGTPUpdatePDPContextRequestGTPUpdatePDPContextResponseGTP_PDCP_PDU_ExtensionHeaderGTP_UDPPort_ExtensionHeader

class scapy.contrib.gtp.GTPmorethan1500

Bases: scapy.packet.Packet

aliastypes
fields_desc
GTPmorethan1500字段

IE_Cause

ByteEnumField

1

IE

BitField (12000位)

1

class scapy.contrib.gtp.IE_APNRestriction

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_APN限制字段

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字段

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字段

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_原因字段

ietype

ByteEnumField

1

CauseValue

ByteEnumField

None

class scapy.contrib.gtp.IE_CharginGatewayAddress

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_CharginGatewayAddress字段

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字段

ietype

ByteEnumField

26

Ch_ChSpare

XBitField (4位)

None

normal_charging

XBitField (1位)

None

prepaid_charging

XBitField (1位)

None

flat_rate_charging

XBitField (1位)

None

hot_billing_charging

XBitField (1位)

None

Ch_ChReserved

XBitField (8位)

0

class scapy.contrib.gtp.IE_ChargingId

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_ChargingId字段

ietype

ByteEnumField

127

Charging_id

XIntField

<RandInt>

class scapy.contrib.gtp.IE_CommonFlags

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_CommonFlags字段

ietype

ByteEnumField

148

length

ShortField

None

dual_addr_bearer_fl

BitField (1位)

0

upgrade_qos_supported

BitField (1位)

0

nrsn

BitField (1位)

0

no_qos_nego

BitField (1位)

0

mbms_cnting_info

BitField (1位)

0

ran_procedure_ready

BitField (1位)

0

mbms_service_type

BitField (1位)

0

prohibit_payload_compression

BitField (1位)

0

class scapy.contrib.gtp.IE_DirectTunnelFlags

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_DirectTunnelFlags字段

ietype

ByteEnumField

182

length

ShortField

1

Spare

BitField (1位)

0

Spare

BitField (1位)

0

Spare

BitField (1位)

0

Spare

BitField (1位)

0

Spare

BitField (1位)

0

EI

BitField (1位)

0

GCSI

BitField (1 bit)

0

DTI

BitField (1位)

0

scapy.contrib.gtp.IE_Dispatcher(s)

选择正确的信息元素类.

class scapy.contrib.gtp.IE_EndUserAddress

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_EndUserAddress字段

ietype

ByteEnumField

128

length

ShortField

2

SPARE

BitField (4位)

15

PDPTypeOrganization

BitField (4位)

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字段

ietype

ByteEnumField

191

length

ShortField

1

Spare

BitField (1位)

0

PCI

BitField (1位)

0

PL

XBitField (4位)

0

Spare

BitField (1位)

0

PVI

BitField (1位)

0

class scapy.contrib.gtp.IE_ExtensionHeaderList

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_ExtensionHeaderList字段

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字段

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栏位

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字段

ietype

ByteEnumField

2

imsi

TBCDByteField

b'588039690925426'

class scapy.contrib.gtp.IE_MSInfoChangeReportingAction

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_MSInfoChangeReportingAction字段

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字段

ietype

ByteEnumField

134

length

ShortField

None

flags

FlagsField (8位)

<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字段

ietype

ByteEnumField

153

length

ShortField

None

timezone

ByteField

0

Spare

BitField (1位)

0

Spare

BitField (1位)

0

Spare

BitField (1位)

0

Spare

BitField (1位)

0

Spare

BitField (1位)

0

Spare

BitField (1位)

0

daylight_saving_time

XBitField (2位)

0

class scapy.contrib.gtp.IE_NSAPI

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_NSAPI字段

ietype

ByteEnumField

20

sparebits

XBitField (4位)

0

NSAPI

XBitField (4位)

<RandNum>

class scapy.contrib.gtp.IE_NotImplementedTLV

Bases: scapy.packet.Packet

aliastypes
extract_padding(pkt)
fields_desc
IE_NotImplementedTLV字段

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

扩展标识符

ByteField

0

extention_value

StrLenField

b''

class scapy.contrib.gtp.IE_ProtocolConfigurationOptions

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_ProtocolConfigurationOptions字段

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字段

ietype

ByteEnumField

135

length

ShortField

None

allocation_retention_prioiry

ByteField

1

spare

XBitField (Cond)(2位)

0

delay_class

XBitField (Cond)(3位)

0

reliability_class

XBitField (Cond)(3位)

0

peak_troughput

XBitField (Cond)(4位)

0

spare

BitField (条件)(1位)

0

precedence_class

XBitField (Cond)(3位)

0

spare

XBitField (Cond)(3位)

0

mean_troughput

XBitField (Cond)(5位)

0

traffic_class

XBitField (Cond)(3位)

0

delivery_order

XBitField (Cond) (2 bits)

0

delivery_of_err_sdu

XBitField (Cond)(3位)

0

max_sdu_size

ByteField (Cond)

None

max_bitrate_up

ByteField (Cond)

None

max_bitrate_down

ByteField (Cond)

None

redidual_ber

XBitField (Cond)(4位)

0

sdu_err_ratio

XBitField (Cond)(4位)

0

transfer_delay

XBitField (Cond)(6位)

0

traffic_handling_prio

XBitField (Cond)(2位)

0

guaranteed_bit_rate_up

ByteField (Cond)

None

guaranteed_bit_rate_down

ByteField (Cond)

None

spare

XBitField (Cond)(3位)

0

signaling_indication

BitField (条件)(1位)

0

source_stats_desc

XBitField (Cond)(4位)

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字段

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栏位

ietype

ByteEnumField

14

restart_counter

ByteField

24

class scapy.contrib.gtp.IE_ReorderingRequired

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_Reordering必填字段

ietype

ByteEnumField

8

reordering_required

ByteEnumField

254

class scapy.contrib.gtp.IE_Routing

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_Routing栏位

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字段

ietype

ByteEnumField

15

SelectionMode

BitEnumField (8位)

11111100

class scapy.contrib.gtp.IE_TEICP

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_TEICP字段

ietype

ByteEnumField

17

TEICI

XIntField

<RandInt>

class scapy.contrib.gtp.IE_TEIDI

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_TEIDI字段

ietype

ByteEnumField

16

TEIDI

XIntField

<RandInt>

class scapy.contrib.gtp.IE_Teardown

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_Teardown字段

ietype

ByteEnumField

19

indicator

ByteEnumField

255

class scapy.contrib.gtp.IE_TraceReference

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_TraceReference字段

ietype

ByteEnumField

27

Trace_reference

XBitField (16位)

None

class scapy.contrib.gtp.IE_TraceType

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_TraceType字段

ietype

ByteEnumField

28

Trace_type

XBitField (16位)

None

class scapy.contrib.gtp.IE_UserLocationInformation

Bases: scapy.contrib.gtp.IE_Base

aliastypes
fields_desc
IE_UserLocationInformation字段

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字段

qos_ei

ByteField

0

length

ByteField

None

spare

XBitField (2 bits)

0

delay_class

XBitField (3位)

0

reliability_class

XBitField (3位)

0

peak_troughput

XBitField (4位)

0

spare

BitField (1位)

0

precedence_class

XBitField (3位)

0

spare

XBitField (3位)

0

mean_troughput

XBitField (5位)

0

traffic_class

XBitField (3位)

0

delivery_order

XBitField (2位)

0

delivery_of_err_sdu

XBitField (3位)

0

max_sdu_size

ByteField

None

max_bitrate_up

ByteField

None

max_bitrate_down

ByteField

None

redidual_ber

XBitField (4位)

0

sdu_err_ratio

XBitField (4位)

0

transfer_delay

XBitField (5位)

0

traffic_handling_prio

XBitField (3位)

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)