scapy.contrib.ldp module

class scapy.contrib.ldp.AddressTLVField(name, default, fmt='H', remain=0)

Bases: scapy.fields.StrField

getfield(pkt, s)

Extract an internal value from a string

Extract from the raw packet s the field value belonging to layer pkt.

Returns a two-element list, first the raw packet string after having removed the extracted field, second the extracted field itself in internal representation.

i2m(pkt, x)

Convert internal value to machine value

islist = 1
m2i(pkt, x)

Convert machine value to internal value

size(s)

Get the size of this field

class scapy.contrib.ldp.CommonHelloTLVField(name, default, fmt='H', remain=0)

Bases: scapy.fields.StrField

getfield(pkt, s)

Extract an internal value from a string

Extract from the raw packet s the field value belonging to layer pkt.

Returns a two-element list, first the raw packet string after having removed the extracted field, second the extracted field itself in internal representation.

i2m(pkt, x)

Convert internal value to machine value

islist = 1
m2i(pkt, x)

Convert machine value to internal value

class scapy.contrib.ldp.CommonSessionTLVField(name, default, fmt='H', remain=0)

Bases: scapy.fields.StrField

getfield(pkt, s)

Extract an internal value from a string

Extract from the raw packet s the field value belonging to layer pkt.

Returns a two-element list, first the raw packet string after having removed the extracted field, second the extracted field itself in internal representation.

i2m(pkt, x)

Convert internal value to machine value

islist = 1
m2i(pkt, x)

Convert machine value to internal value

class scapy.contrib.ldp.FecTLVField(name, default, fmt='H', remain=0)

Bases: scapy.fields.StrField

getfield(pkt, s)

Extract an internal value from a string

Extract from the raw packet s the field value belonging to layer pkt.

Returns a two-element list, first the raw packet string after having removed the extracted field, second the extracted field itself in internal representation.

i2m(pkt, x)

Convert internal value to machine value

islist = 1
m2i(pkt, x)

Convert machine value to internal value

size(s)

Get the size of this field

class scapy.contrib.ldp.LDP

Bases: scapy.contrib.ldp._LDP_Packet

aliastypes = [<class 'scapy.contrib.ldp.LDP'>, <class 'scapy.contrib.ldp._LDP_Packet'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (LDP).version>, <Field (LDP).len>, <Field (LDP).id>, <Field (LDP).space>]
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.ldp.LDPAddress

Bases: scapy.contrib.ldp._LDP_Packet

aliastypes = [<class 'scapy.contrib.ldp.LDPAddress'>, <class 'scapy.contrib.ldp._LDP_Packet'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (LDPAddress).u>, <Field (LDPAddress).type>, <Field (LDPAddress).len>, <Field (LDPAddress).id>, <Field (LDPAddress).address>]
class scapy.contrib.ldp.LDPAddressWM

Bases: scapy.contrib.ldp._LDP_Packet

aliastypes = [<class 'scapy.contrib.ldp.LDPAddressWM'>, <class 'scapy.contrib.ldp._LDP_Packet'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (LDPAddressWM).u>, <Field (LDPAddressWM).type>, <Field (LDPAddressWM).len>, <Field (LDPAddressWM).id>, <Field (LDPAddressWM).address>]
class scapy.contrib.ldp.LDPHello

Bases: scapy.contrib.ldp._LDP_Packet

aliastypes = [<class 'scapy.contrib.ldp.LDPHello'>, <class 'scapy.contrib.ldp._LDP_Packet'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (LDPHello).u>, <Field (LDPHello).type>, <Field (LDPHello).len>, <Field (LDPHello).id>, <Field (LDPHello).params>]
class scapy.contrib.ldp.LDPInit

Bases: scapy.contrib.ldp._LDP_Packet

aliastypes = [<class 'scapy.contrib.ldp.LDPInit'>, <class 'scapy.contrib.ldp._LDP_Packet'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (LDPInit).u>, <Field (LDPInit).type>, <Field (LDPInit).len>, <Field (LDPInit).id>, <Field (LDPInit).params>]
class scapy.contrib.ldp.LDPKeepAlive

Bases: scapy.contrib.ldp._LDP_Packet

aliastypes = [<class 'scapy.contrib.ldp.LDPKeepAlive'>, <class 'scapy.contrib.ldp._LDP_Packet'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (LDPKeepAlive).u>, <Field (LDPKeepAlive).type>, <Field (LDPKeepAlive).len>, <Field (LDPKeepAlive).id>]
class scapy.contrib.ldp.LDPLabelARM

Bases: scapy.contrib.ldp._LDP_Packet

aliastypes = [<class 'scapy.contrib.ldp.LDPLabelARM'>, <class 'scapy.contrib.ldp._LDP_Packet'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (LDPLabelARM).u>, <Field (LDPLabelARM).type>, <Field (LDPLabelARM).len>, <Field (LDPLabelARM).id>, <Field (LDPLabelARM).fec>, <Field (LDPLabelARM).labelRMid>]
class scapy.contrib.ldp.LDPLabelMM

Bases: scapy.contrib.ldp._LDP_Packet

aliastypes = [<class 'scapy.contrib.ldp.LDPLabelMM'>, <class 'scapy.contrib.ldp._LDP_Packet'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (LDPLabelMM).u>, <Field (LDPLabelMM).type>, <Field (LDPLabelMM).len>, <Field (LDPLabelMM).id>, <Field (LDPLabelMM).fec>, <Field (LDPLabelMM).label>]
class scapy.contrib.ldp.LDPLabelRelM

Bases: scapy.contrib.ldp._LDP_Packet

aliastypes = [<class 'scapy.contrib.ldp.LDPLabelRelM'>, <class 'scapy.contrib.ldp._LDP_Packet'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (LDPLabelRelM).u>, <Field (LDPLabelRelM).type>, <Field (LDPLabelRelM).len>, <Field (LDPLabelRelM).id>, <Field (LDPLabelRelM).fec>, <Field (LDPLabelRelM).label>]
class scapy.contrib.ldp.LDPLabelReqM

Bases: scapy.contrib.ldp._LDP_Packet

aliastypes = [<class 'scapy.contrib.ldp.LDPLabelReqM'>, <class 'scapy.contrib.ldp._LDP_Packet'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (LDPLabelReqM).u>, <Field (LDPLabelReqM).type>, <Field (LDPLabelReqM).len>, <Field (LDPLabelReqM).id>, <Field (LDPLabelReqM).fec>]
class scapy.contrib.ldp.LDPLabelWM

Bases: scapy.contrib.ldp._LDP_Packet

aliastypes = [<class 'scapy.contrib.ldp.LDPLabelWM'>, <class 'scapy.contrib.ldp._LDP_Packet'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (LDPLabelWM).u>, <Field (LDPLabelWM).type>, <Field (LDPLabelWM).len>, <Field (LDPLabelWM).id>, <Field (LDPLabelWM).fec>, <Field (LDPLabelWM).label>]
class scapy.contrib.ldp.LDPNotification

Bases: scapy.contrib.ldp._LDP_Packet

aliastypes = [<class 'scapy.contrib.ldp.LDPNotification'>, <class 'scapy.contrib.ldp._LDP_Packet'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (LDPNotification).u>, <Field (LDPNotification).type>, <Field (LDPNotification).len>, <Field (LDPNotification).id>, <Field (LDPNotification).status>]
class scapy.contrib.ldp.LabelTLVField(name, default, fmt='H', remain=0)

Bases: scapy.fields.StrField

getfield(pkt, s)

Extract an internal value from a string

Extract from the raw packet s the field value belonging to layer pkt.

Returns a two-element list, first the raw packet string after having removed the extracted field, second the extracted field itself in internal representation.

i2m(pkt, x)

Convert internal value to machine value

m2i(pkt, x)

Convert machine value to internal value

size(s)

Get the size of this field

class scapy.contrib.ldp.StatusTLVField(name, default, fmt='H', remain=0)

Bases: scapy.fields.StrField

getfield(pkt, s)

Extract an internal value from a string

Extract from the raw packet s the field value belonging to layer pkt.

Returns a two-element list, first the raw packet string after having removed the extracted field, second the extracted field itself in internal representation.

i2m(pkt, x)

Convert internal value to machine value

islist = 1
m2i(pkt, x)

Convert machine value to internal value