scapy.contrib.icmp_extensions

class scapy.contrib.icmp_extensions.ICMPExtensionHeader(_pkt, /, *, version=2, reserved=0, chksum=None)[源代码]

基类:Packet

aliastypes
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|VERSION|        RESERVED       |             CHKSUM            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                     Fig. ICMPExtensionHeader                     
ICMPExtensionHeader fields

version

BitField (4 bits)

2

reserved

BitField (12 bits)

0

chksum

BitField (16 bits)

None

guess_payload_class(payload)[源代码]
payload_guess

Possible sublayers: ICMPExtensionInterfaceInformation, ICMPExtensionMPLS

post_build(p, pay)[源代码]
class scapy.contrib.icmp_extensions.ICMPExtensionInterfaceInformation(_pkt, /, *, len=None, classnum=2, interface_role=0, reserved=0, has_ifindex=0, has_ipaddr=0, has_ifname=0, has_mtu=0, ifindex=None, afi=None, reserved2=0, ip4=None, ip6=None, ifname_len=None, ifname=None, mtu=None)[源代码]

基类:ICMPExtensionObject

aliastypes
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|              LEN              |    CLASSNUM   |INT|RES|H|H|H|H|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                            IFINDEX                            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|              AFI              |           RESERVED2           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                              IP4                              |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                              IP6                              |
+                                                               +
|                                                               |
+                                                               +
|                                                               |
+                                                               +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|   IFNAME LEN  |             IFNAME            |      MTU      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

              Fig. ICMPExtensionInterfaceInformation              
ICMPExtensionInterfaceInformation fields

len

ShortField

None

classnum

ByteField

2

interface_role

BitField (2 bits)

0

reserved

BitField (2 bits)

0

has_ifindex

BitField (1 bit)

0

has_ipaddr

BitField (1 bit)

0

has_ifname

BitField (1 bit)

0

has_mtu

BitField (1 bit)

0

ifindex

IntField (Cond)

None

afi

ShortField (Cond)

None

reserved2

ShortField (Cond)

0

ip4

IPField (Cond)

None

ip6

IP6Field (Cond)

None

ifname_len

FieldLenField (Cond)

None

ifname

StrLenField (Cond)

None

mtu

IntField (Cond)

None

self_build(**kwargs)[源代码]
class scapy.contrib.icmp_extensions.ICMPExtensionMPLS(_pkt, /, *, len=None, classnum=1, classtype=1, stack=[])[源代码]

基类:ICMPExtensionObject

aliastypes
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|              LEN              |    CLASSNUM   |   CLASSTYPE   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             STACK             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                      Fig. ICMPExtensionMPLS                      
ICMPExtensionMPLS fields

len

ShortField

None

classnum

ByteField

1

classtype

ByteField

1

stack

PacketListField

[]

class scapy.contrib.icmp_extensions.ICMPExtensionObject(_pkt, /, *, len=None, classnum=0, classtype=0)[源代码]

基类:Packet

aliastypes
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|              LEN              |    CLASSNUM   |   CLASSTYPE   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                     Fig. ICMPExtensionObject                     
ICMPExtensionObject fields

len

ShortField

None

classnum

ByteField

0

classtype

ByteField

0

post_build(p, pay)[源代码]
scapy.contrib.icmp_extensions.ICMPExtension_post_dissection(self, pkt)[源代码]