scapy.contrib.icmp_extensions module

class scapy.contrib.icmp_extensions.ICMPExtensionHeader

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.icmp_extensions.ICMPExtensionHeader'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ICMPExtensionHeader).version>, <Field (ICMPExtensionHeader).reserved>, <Field (ICMPExtensionHeader).chksum>]
guess_payload_class(payload)

DEV: Guesses the next payload class from layer bonds. Can be overloaded to use a different mechanism.

Parameters:payload (str) – the layer’s payload
Returns:the payload class
payload_guess = [({'classnum': 1, 'classtype': 1}, <class 'scapy.contrib.icmp_extensions.ICMPExtensionMPLS'>), ({'classnum': 2}, <class 'scapy.contrib.icmp_extensions.ICMPExtensionInterfaceInformation'>)]
post_build(p, pay)

DEV: called right after the current layer is build.

Parameters:
  • pkt (str) – the current packet (build by self_buil function)
  • pay (str) – the packet payload (build by do_build_payload function)
Returns:

a string of the packet with the payload

class scapy.contrib.icmp_extensions.ICMPExtensionInterfaceInformation

Bases: scapy.contrib.icmp_extensions.ICMPExtensionObject

aliastypes = [<class 'scapy.contrib.icmp_extensions.ICMPExtensionInterfaceInformation'>, <class 'scapy.contrib.icmp_extensions.ICMPExtensionObject'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ICMPExtensionInterfaceInformation).len>, <Field (ICMPExtensionInterfaceInformation).classnum>, <Field (ICMPExtensionInterfaceInformation).interface_role>, <Field (ICMPExtensionInterfaceInformation).reserved>, <Field (ICMPExtensionInterfaceInformation).has_ifindex>, <Field (ICMPExtensionInterfaceInformation).has_ipaddr>, <Field (ICMPExtensionInterfaceInformation).has_ifname>, <Field (ICMPExtensionInterfaceInformation).has_mtu>, <scapy.fields.ConditionalField object>, <scapy.fields.ConditionalField object>, <scapy.fields.ConditionalField object>, <scapy.fields.ConditionalField object>, <scapy.fields.ConditionalField object>, <scapy.fields.ConditionalField object>, <scapy.fields.ConditionalField object>, <scapy.fields.ConditionalField object>]
self_build(field_pos_list=None)

Create the default layer regarding fields_desc dict

Parameters:field_pos_list
class scapy.contrib.icmp_extensions.ICMPExtensionMPLS

Bases: scapy.contrib.icmp_extensions.ICMPExtensionObject

aliastypes = [<class 'scapy.contrib.icmp_extensions.ICMPExtensionMPLS'>, <class 'scapy.contrib.icmp_extensions.ICMPExtensionObject'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ICMPExtensionMPLS).len>, <Field (ICMPExtensionMPLS).classnum>, <Field (ICMPExtensionMPLS).classtype>, <Field (ICMPExtensionMPLS).stack>]
class scapy.contrib.icmp_extensions.ICMPExtensionObject

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.icmp_extensions.ICMPExtensionObject'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ICMPExtensionObject).len>, <Field (ICMPExtensionObject).classnum>, <Field (ICMPExtensionObject).classtype>]
post_build(p, pay)

DEV: called right after the current layer is build.

Parameters:
  • pkt (str) – the current packet (build by self_buil function)
  • pay (str) – the packet payload (build by do_build_payload function)
Returns:

a string of the packet with the payload

scapy.contrib.icmp_extensions.ICMPExtension_post_dissection(self, pkt)