scapy.contrib.mpls module

class scapy.contrib.mpls.EoMCW

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.mpls.EoMCW'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (EoMCW).zero>, <Field (EoMCW).reserved>, <Field (EoMCW).seq>]
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 = [({'zero': 0, 'reserved': 0}, <class 'scapy.layers.l2.Ether'>)]
class scapy.contrib.mpls.MPLS

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.mpls.MPLS'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (MPLS).label>, <Field (MPLS).cos>, <Field (MPLS).s>, <Field (MPLS).ttl>]
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 = [({'s': 0}, <class 'scapy.contrib.mpls.MPLS'>), ({'label': 0}, <class 'scapy.layers.inet.IP'>), ({'label': 2}, <class 'scapy.layers.inet6.IPv6'>), ({}, <class 'scapy.contrib.mpls.EoMCW'>)]