scapy.layers.ppp

PPP(点对点协议)

[RFC 1661]

class scapy.layers.ppp.DIR_PPP

Bases: scapy.packet.Packet

aliastypes
fields_desc
DIR_PPP字段

direction

ByteEnumField

0

payload_guess

可能的子层: PPP

class scapy.layers.ppp.HDLC

Bases: scapy.packet.Packet

aliastypes
fields_desc
HDLC字段

address

XByteField

255

control

XByteField

3

payload_guess

可能的子层: PPP

class scapy.layers.ppp.PPP

Bases: scapy.packet.Packet

aliastypes
classmethod dispatch_hook(_pkt=None, *args, **kargs)
fields_desc
PPP栏位

proto

_PPPProtoField

33

payload_guess

可能的子层: EAPIPIPv6PPP_CHAPPPP_ECPPPP_IPCPPPP_LCPPPP_PAP

class scapy.layers.ppp.PPP_CHAP

Bases: scapy.packet.Packet

aliastypes
answers(other)
classmethod dispatch_hook(_pkt=None, *_, **kargs)
extract_padding(pay)
fields_desc
PPP_CHAP字段

code

ByteEnumField

1

id

XByteField

0

len

FieldLenField

None

data

StrLenField

b''

mysummary()
class scapy.layers.ppp.PPP_CHAP_ChallengeResponse

Bases: scapy.layers.ppp.PPP_CHAP

aliastypes
answers(other)
fields_desc
PPP_CHAP_ChallengeResponse字段

code

ByteEnumField

1

id

XByteField

0

len

FieldLenField

None

value_size

FieldLenField

None

value

XStrLenField

b'\x00\x00\x00\x00\x00\x00\x00\x00'

optional_name

StrLenField

b''

mysummary()
class scapy.layers.ppp.PPP_ECP

Bases: scapy.packet.Packet

aliastypes
fields_desc
PPP_ECP字段

code

ByteEnumField

1

id

XByteField

0

len

FieldLenField

None

options

PacketListField

[]

class scapy.layers.ppp.PPP_ECP_Option

Bases: scapy.packet.Packet

aliastypes
classmethod dispatch_hook(_pkt=None, *args, **kargs)
extract_padding(pay)
fields_desc
PPP_ECP_Option栏位

type

ByteEnumField

None

len

FieldLenField

None

data

StrLenField

b''

classmethod register_variant()
registered_options = {None: <class 'scapy.layers.ppp.PPP_ECP_Option'>, 0: <class 'scapy.layers.ppp.PPP_ECP_Option_OUI'>}
class scapy.layers.ppp.PPP_ECP_Option_OUI

Bases: scapy.layers.ppp.PPP_ECP_Option

aliastypes
fields_desc
PPP_ECP_Option_OUI字段

type

ByteEnumField

0

len

FieldLenField

None

oui

StrFixedLenField

b''

subtype

ByteField

0

data

StrLenField

b''

class scapy.layers.ppp.PPP_IPCP

Bases: scapy.packet.Packet

aliastypes
fields_desc
PPP_IPCP字段

code

ByteEnumField

1

id

XByteField

0

len

FieldLenField

None

options

PacketListField

[]

class scapy.layers.ppp.PPP_IPCP_Option

Bases: scapy.packet.Packet

aliastypes
classmethod dispatch_hook(_pkt=None, *args, **kargs)
extract_padding(pay)
fields_desc
PPP_IPCP_Option栏位

type

ByteEnumField

None

len

FieldLenField

None

data

StrLenField

b''

classmethod register_variant()
registered_options = {None: <class 'scapy.layers.ppp.PPP_IPCP_Option'>, 3: <class 'scapy.layers.ppp.PPP_IPCP_Option_IPAddress'>, 129: <class 'scapy.layers.ppp.PPP_IPCP_Option_DNS1'>, 131: <class 'scapy.layers.ppp.PPP_IPCP_Option_DNS2'>, 130: <class 'scapy.layers.ppp.PPP_IPCP_Option_NBNS1'>, 132: <class 'scapy.layers.ppp.PPP_IPCP_Option_NBNS2'>}
class scapy.layers.ppp.PPP_IPCP_Option_DNS1

Bases: scapy.layers.ppp.PPP_IPCP_Option_IPAddress

aliastypes
fields_desc
PPP_IPCP_Option_DNS1字段

type

ByteEnumField

129

len

FieldLenField

None

data

IPField

'0.0.0.0'

garbage

StrLenField

b''

class scapy.layers.ppp.PPP_IPCP_Option_DNS2

Bases: scapy.layers.ppp.PPP_IPCP_Option_IPAddress

aliastypes
fields_desc
PPP_IPCP_Option_DNS2字段

type

ByteEnumField

131

len

FieldLenField

None

data

IPField

'0.0.0.0'

garbage

StrLenField

b''

class scapy.layers.ppp.PPP_IPCP_Option_IPAddress

Bases: scapy.layers.ppp.PPP_IPCP_Option

aliastypes
fields_desc
PPP_IPCP_Option_IPAddress字段

type

ByteEnumField

3

len

FieldLenField

None

data

IPField

'0.0.0.0'

garbage

StrLenField

b''

class scapy.layers.ppp.PPP_IPCP_Option_NBNS1

Bases: scapy.layers.ppp.PPP_IPCP_Option_IPAddress

aliastypes
fields_desc
PPP_IPCP_Option_NBNS1字段

type

ByteEnumField

130

len

FieldLenField

None

data

IPField

'0.0.0.0'

garbage

StrLenField

b''

class scapy.layers.ppp.PPP_IPCP_Option_NBNS2

Bases: scapy.layers.ppp.PPP_IPCP_Option_IPAddress

aliastypes
fields_desc
PPP_IPCP_Option_NBNS2字段

type

ByteEnumField

132

len

FieldLenField

None

data

IPField

'0.0.0.0'

garbage

StrLenField

b''

class scapy.layers.ppp.PPP_LCP

Bases: scapy.packet.Packet

aliastypes
classmethod dispatch_hook(_pkt=None, *args, **kargs)
extract_padding(pay)
fields_desc
PPP_LCP字段

code

ByteEnumField

5

id

XByteField

0

len

FieldLenField

None

data

StrLenField

b''

mysummary()
class scapy.layers.ppp.PPP_LCP_ACCM_Option

Bases: scapy.layers.ppp.PPP_LCP_Option

aliastypes
fields_desc
PPP_LCP_ACCM_Option栏位

type

ByteEnumField

2

len

ByteField

6

accm

BitField (32位)

0

class scapy.layers.ppp.PPP_LCP_Auth_Protocol_Option

Bases: scapy.layers.ppp.PPP_LCP_Option

aliastypes
fields_desc
PPP_LCP_Auth_Protocol_Option字段

type

ByteEnumField

3

len

FieldLenField

None

auth_protocol

ShortEnumField

49187

data

StrLenField (Cond)

b''

algorithm

ByteEnumField (Cond)

5

class scapy.layers.ppp.PPP_LCP_Callback_Option

Bases: scapy.layers.ppp.PPP_LCP_Option

aliastypes
fields_desc
PPP_LCP_Callback_Option栏位

type

ByteEnumField

13

len

FieldLenField

None

operation

ByteEnumField

0

message

StrLenField

b''

class scapy.layers.ppp.PPP_LCP_Code_Reject

Bases: scapy.layers.ppp.PPP_LCP

aliastypes
fields_desc
PPP_LCP_Code_Reject字段

code

ByteEnumField

7

id

XByteField

0

len

FieldLenField

None

rejected_packet

PacketField

None

class scapy.layers.ppp.PPP_LCP_Configure

Bases: scapy.layers.ppp.PPP_LCP

aliastypes
answers(other)
fields_desc
PPP_LCP_Configure字段

code

ByteEnumField

1

id

XByteField

0

len

FieldLenField

None

options

PacketListField

[]

class scapy.layers.ppp.PPP_LCP_Discard_Request

Bases: scapy.layers.ppp.PPP_LCP

aliastypes
fields_desc
PPP_LCP_Discard_Request字段

code

ByteEnumField

11

id

XByteField

0

len

FieldLenField

None

magic_number

IntField

None

data

StrLenField

b''

class scapy.layers.ppp.PPP_LCP_Echo

Bases: scapy.layers.ppp.PPP_LCP_Discard_Request

aliastypes
answers(other)
fields_desc
PPP_LCP_Echo字段

code

ByteEnumField

9

id

XByteField

0

len

FieldLenField

None

magic_number

IntField

None

data

StrLenField

b''

class scapy.layers.ppp.PPP_LCP_MRU_Option

Bases: scapy.layers.ppp.PPP_LCP_Option

aliastypes
fields_desc
PPP_LCP_MRU_Option字段

type

ByteEnumField

1

len

ByteField

4

max_recv_unit

ShortField

1500

class scapy.layers.ppp.PPP_LCP_Magic_Number_Option

Bases: scapy.layers.ppp.PPP_LCP_Option

aliastypes
fields_desc
PPP_LCP_Magic_Number_Option字段

type

ByteEnumField

5

len

ByteField

6

magic_number

IntField

None

class scapy.layers.ppp.PPP_LCP_Option

Bases: scapy.packet.Packet

aliastypes
classmethod dispatch_hook(_pkt=None, *args, **kargs)
extract_padding(pay)
fields_desc
PPP_LCP_Option栏位

type

ByteEnumField

None

len

FieldLenField

None

data

StrLenField

None

classmethod register_variant()
registered_options = {None: <class 'scapy.layers.ppp.PPP_LCP_Option'>, 1: <class 'scapy.layers.ppp.PPP_LCP_MRU_Option'>, 2: <class 'scapy.layers.ppp.PPP_LCP_ACCM_Option'>, 3: <class 'scapy.layers.ppp.PPP_LCP_Auth_Protocol_Option'>, 4: <class 'scapy.layers.ppp.PPP_LCP_Quality_Protocol_Option'>, 5: <class 'scapy.layers.ppp.PPP_LCP_Magic_Number_Option'>, 13: <class 'scapy.layers.ppp.PPP_LCP_Callback_Option'>}
class scapy.layers.ppp.PPP_LCP_Protocol_Reject

Bases: scapy.layers.ppp.PPP_LCP

aliastypes
fields_desc
PPP_LCP_Protocol_Reject字段

code

ByteEnumField

8

id

XByteField

0

len

FieldLenField

None

rejected_protocol

ShortEnumField

None

rejected_information

PacketField

None

class scapy.layers.ppp.PPP_LCP_Quality_Protocol_Option

Bases: scapy.layers.ppp.PPP_LCP_Option

aliastypes
fields_desc
PPP_LCP_Quality_Protocol_Option字段

type

ByteEnumField

4

len

FieldLenField

None

quality_protocol

ShortEnumField

49189

data

StrLenField

b''

class scapy.layers.ppp.PPP_LCP_Terminate

Bases: scapy.layers.ppp.PPP_LCP

aliastypes
answers(other)
fields_desc
PPP_LCP_Terminate字段

code

ByteEnumField

5

id

XByteField

0

len

FieldLenField

None

data

StrLenField

b''

class scapy.layers.ppp.PPP_PAP

Bases: scapy.packet.Packet

aliastypes
classmethod dispatch_hook(_pkt=None, *_, **kargs)
extract_padding(pay)
fields_desc
PPP_PAP字段

code

ByteEnumField

1

id

XByteField

0

len

FieldLenField

None

data

StrLenField

b''

class scapy.layers.ppp.PPP_PAP_Request

Bases: scapy.layers.ppp.PPP_PAP

aliastypes
fields_desc
PPP_PAP_Request字段

code

ByteEnumField

1

id

XByteField

0

len

FieldLenField

None

username_len

FieldLenField

None

username

StrLenField

None

passwd_len

FieldLenField

None

password

StrLenField

None

mysummary()
class scapy.layers.ppp.PPP_PAP_Response

Bases: scapy.layers.ppp.PPP_PAP

aliastypes
answers(other)
fields_desc
PPP_PAP_Response字段

code

ByteEnumField

2

id

XByteField

0

len

FieldLenField

None

msg_len

FieldLenField

None

message

StrLenField

b''

mysummary()
class scapy.layers.ppp.PPPoE

Bases: scapy.packet.Packet

aliastypes
fields_desc
PPPoE字段

version

BitField (4位)

1

type

BitField (4位)

1

code

ByteEnumField

0

sessionid

XShortField

0

len

ShortField

None

payload_guess

可能的子层: PPP

post_build(p, pay)
class scapy.layers.ppp.PPPoED

Bases: scapy.layers.ppp.PPPoE

aliastypes
code_list = {0: 'PPP Session Stage', 7: 'PPPoE Active Discovery Offer (PADO)', 9: 'PPPoE Active Discovery Initiation (PADI)', 10: 'PPPoE Active Discovery Session-Grant (PADG)', 11: 'PPPoE Active Discovery Session-Credit Response (PADC)', 12: 'PPPoE Active Discovery Quality (PADQ)', 25: 'PPPoE Active Discovery Request (PADR)', 101: 'PPPoE Active Discovery Session-confirmation (PADS)', 167: 'PPPoE Active Discovery Terminate (PADT)'}
fields_desc
PPPoED字段

version

BitField (4位)

1

type

BitField (4 bits)

1

code

ByteEnumField

9

sessionid

XShortField

0

len

ShortField

None

payload_guess

可能的子层: PPPoED_Tags

class scapy.layers.ppp.PPPoED_Tags

Bases: scapy.packet.Packet

aliastypes
fields_desc
PPPoED_Tags字段

tag_list

PacketListField

[]

class scapy.layers.ppp.PPPoETag

Bases: scapy.packet.Packet

aliastypes
extract_padding(s)
fields_desc
PPPoETag字段

tag_type

ShortEnumField

None

tag_len

FieldLenField

None

tag_value

StrLenField

b''

tag_list = {0: 'End-Of-List', 257: 'Service-Name', 258: 'AC-Name', 259: 'Host-Uniq', 260: 'AC-Cookie', 261: 'Vendor-Specific', 262: 'Credits', 263: 'Metrics', 264: 'Sequence Number', 265: 'Credit Scale Factor', 272: 'Relay-Session-Id', 288: 'PPP-Max-Payload', 513: 'Service-Name-Error', 514: 'AC-System-Error', 515: 'Generic-Error'}
scapy.layers.ppp.adjust_auth_len(pkt, x)