scapy.contrib.cdp module

class scapy.contrib.cdp.CDPAddrRecord

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.cdp.CDPAddrRecord'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (CDPAddrRecord).ptype>, <Field (CDPAddrRecord).plen>, <Field (CDPAddrRecord).proto>, <Field (CDPAddrRecord).addrlen>, <Field (CDPAddrRecord).addr>]
guess_payload_class(p)

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
class scapy.contrib.cdp.CDPAddrRecordIPv4

Bases: scapy.contrib.cdp.CDPAddrRecord

aliastypes = [<class 'scapy.contrib.cdp.CDPAddrRecordIPv4'>, <class 'scapy.contrib.cdp.CDPAddrRecord'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (CDPAddrRecordIPv4).ptype>, <Field (CDPAddrRecordIPv4).plen>, <Field (CDPAddrRecordIPv4).proto>, <Field (CDPAddrRecordIPv4).addrlen>, <Field (CDPAddrRecordIPv4).addr>]
class scapy.contrib.cdp.CDPAddrRecordIPv6

Bases: scapy.contrib.cdp.CDPAddrRecord

aliastypes = [<class 'scapy.contrib.cdp.CDPAddrRecordIPv6'>, <class 'scapy.contrib.cdp.CDPAddrRecord'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (CDPAddrRecordIPv6).ptype>, <Field (CDPAddrRecordIPv6).plen>, <Field (CDPAddrRecordIPv6).proto>, <Field (CDPAddrRecordIPv6).addrlen>, <Field (CDPAddrRecordIPv6).addr>]
class scapy.contrib.cdp.CDPMsg

Bases: scapy.contrib.cdp.CDPMsgGeneric

aliastypes = [<class 'scapy.contrib.cdp.CDPMsg'>, <class 'scapy.contrib.cdp.CDPMsgGeneric'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (CDPMsg).type>, <Field (CDPMsg).len>, <Field (CDPMsg).val>]
class scapy.contrib.cdp.CDPMsgAddr

Bases: scapy.contrib.cdp.CDPMsgGeneric

aliastypes = [<class 'scapy.contrib.cdp.CDPMsgAddr'>, <class 'scapy.contrib.cdp.CDPMsgGeneric'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (CDPMsgAddr).type>, <Field (CDPMsgAddr,CDPMsgMgmtAddr).len>, <Field (CDPMsgAddr,CDPMsgMgmtAddr).naddr>, <Field (CDPMsgAddr,CDPMsgMgmtAddr).addr>]
post_build(pkt, 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.cdp.CDPMsgCapabilities

Bases: scapy.contrib.cdp.CDPMsgGeneric

aliastypes = [<class 'scapy.contrib.cdp.CDPMsgCapabilities'>, <class 'scapy.contrib.cdp.CDPMsgGeneric'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (CDPMsgCapabilities).type>, <Field (CDPMsgCapabilities).len>, <Field (CDPMsgCapabilities).cap>]
class scapy.contrib.cdp.CDPMsgDeviceID

Bases: scapy.contrib.cdp.CDPMsgGeneric

aliastypes = [<class 'scapy.contrib.cdp.CDPMsgDeviceID'>, <class 'scapy.contrib.cdp.CDPMsgGeneric'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (CDPMsgGeneric,CDPMsgDeviceID).type>, <Field (CDPMsgGeneric,CDPMsgDeviceID,CDPMsgSoftwareVersion,CDPMsgPlatform,CDPMsgVTPMgmtDomain,CDPMsgUnknown19).len>, <Field (CDPMsgGeneric,CDPMsgDeviceID,CDPMsgSoftwareVersion,CDPMsgPlatform,CDPMsgVTPMgmtDomain,CDPMsgUnknown19).val>]
class scapy.contrib.cdp.CDPMsgDuplex

Bases: scapy.contrib.cdp.CDPMsgGeneric

aliastypes = [<class 'scapy.contrib.cdp.CDPMsgDuplex'>, <class 'scapy.contrib.cdp.CDPMsgGeneric'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (CDPMsgDuplex).type>, <Field (CDPMsgDuplex).len>, <Field (CDPMsgDuplex).duplex>]
class scapy.contrib.cdp.CDPMsgGeneric

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.cdp.CDPMsgGeneric'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (CDPMsgGeneric).type>, <Field (CDPMsgGeneric,CDPMsgDeviceID,CDPMsgSoftwareVersion,CDPMsgPlatform,CDPMsgVTPMgmtDomain,CDPMsgUnknown19).len>, <Field (CDPMsgGeneric,CDPMsgDeviceID,CDPMsgSoftwareVersion,CDPMsgPlatform,CDPMsgVTPMgmtDomain,CDPMsgUnknown19).val>]
guess_payload_class(p)

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
class scapy.contrib.cdp.CDPMsgIPPrefix

Bases: scapy.contrib.cdp.CDPMsgGeneric

aliastypes = [<class 'scapy.contrib.cdp.CDPMsgIPPrefix'>, <class 'scapy.contrib.cdp.CDPMsgGeneric'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (CDPMsgIPPrefix).type>, <Field (CDPMsgIPPrefix).len>, <Field (CDPMsgIPPrefix).defaultgw>]
class scapy.contrib.cdp.CDPMsgMTU

Bases: scapy.contrib.cdp.CDPMsgGeneric

aliastypes = [<class 'scapy.contrib.cdp.CDPMsgMTU'>, <class 'scapy.contrib.cdp.CDPMsgGeneric'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (CDPMsgMTU).type>, <Field (CDPMsgMTU).len>, <Field (CDPMsgMTU).mtu>]
class scapy.contrib.cdp.CDPMsgMgmtAddr

Bases: scapy.contrib.cdp.CDPMsgAddr

aliastypes = [<class 'scapy.contrib.cdp.CDPMsgMgmtAddr'>, <class 'scapy.contrib.cdp.CDPMsgAddr'>, <class 'scapy.contrib.cdp.CDPMsgGeneric'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (CDPMsgAddr,CDPMsgMgmtAddr).type>, <Field (CDPMsgAddr,CDPMsgMgmtAddr).len>, <Field (CDPMsgAddr,CDPMsgMgmtAddr).naddr>, <Field (CDPMsgAddr,CDPMsgMgmtAddr).addr>]
class scapy.contrib.cdp.CDPMsgNativeVLAN

Bases: scapy.contrib.cdp.CDPMsgGeneric

aliastypes = [<class 'scapy.contrib.cdp.CDPMsgNativeVLAN'>, <class 'scapy.contrib.cdp.CDPMsgGeneric'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (CDPMsgNativeVLAN).type>, <Field (CDPMsgNativeVLAN).len>, <Field (CDPMsgNativeVLAN).vlan>]
class scapy.contrib.cdp.CDPMsgPlatform

Bases: scapy.contrib.cdp.CDPMsgGeneric

aliastypes = [<class 'scapy.contrib.cdp.CDPMsgPlatform'>, <class 'scapy.contrib.cdp.CDPMsgGeneric'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (CDPMsgGeneric,CDPMsgPlatform).type>, <Field (CDPMsgGeneric,CDPMsgDeviceID,CDPMsgSoftwareVersion,CDPMsgPlatform,CDPMsgVTPMgmtDomain,CDPMsgUnknown19).len>, <Field (CDPMsgGeneric,CDPMsgDeviceID,CDPMsgSoftwareVersion,CDPMsgPlatform,CDPMsgVTPMgmtDomain,CDPMsgUnknown19).val>]
class scapy.contrib.cdp.CDPMsgPortID

Bases: scapy.contrib.cdp.CDPMsgGeneric

aliastypes = [<class 'scapy.contrib.cdp.CDPMsgPortID'>, <class 'scapy.contrib.cdp.CDPMsgGeneric'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (CDPMsgPortID).type>, <Field (CDPMsgPortID).len>, <Field (CDPMsgPortID).iface>]
class scapy.contrib.cdp.CDPMsgPower

Bases: scapy.contrib.cdp.CDPMsgGeneric

aliastypes = [<class 'scapy.contrib.cdp.CDPMsgPower'>, <class 'scapy.contrib.cdp.CDPMsgGeneric'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (CDPMsgPower).type>, <Field (CDPMsgPower).len>, <Field (CDPMsgPower).power>]
class scapy.contrib.cdp.CDPMsgProtoHello

Bases: scapy.contrib.cdp.CDPMsgGeneric

aliastypes = [<class 'scapy.contrib.cdp.CDPMsgProtoHello'>, <class 'scapy.contrib.cdp.CDPMsgGeneric'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (CDPMsgProtoHello).type>, <Field (CDPMsgProtoHello).len>, <Field (CDPMsgProtoHello).oui>, <Field (CDPMsgProtoHello).protocol_id>, <Field (CDPMsgProtoHello).data>]
class scapy.contrib.cdp.CDPMsgSoftwareVersion

Bases: scapy.contrib.cdp.CDPMsgGeneric

aliastypes = [<class 'scapy.contrib.cdp.CDPMsgSoftwareVersion'>, <class 'scapy.contrib.cdp.CDPMsgGeneric'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (CDPMsgGeneric,CDPMsgSoftwareVersion).type>, <Field (CDPMsgGeneric,CDPMsgDeviceID,CDPMsgSoftwareVersion,CDPMsgPlatform,CDPMsgVTPMgmtDomain,CDPMsgUnknown19).len>, <Field (CDPMsgGeneric,CDPMsgDeviceID,CDPMsgSoftwareVersion,CDPMsgPlatform,CDPMsgVTPMgmtDomain,CDPMsgUnknown19).val>]
class scapy.contrib.cdp.CDPMsgTrustBitmap

Bases: scapy.contrib.cdp.CDPMsgGeneric

aliastypes = [<class 'scapy.contrib.cdp.CDPMsgTrustBitmap'>, <class 'scapy.contrib.cdp.CDPMsgGeneric'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (CDPMsgTrustBitmap).type>, <Field (CDPMsgTrustBitmap).len>, <Field (CDPMsgTrustBitmap).trust_bitmap>]
class scapy.contrib.cdp.CDPMsgUnknown19

Bases: scapy.contrib.cdp.CDPMsgGeneric

aliastypes = [<class 'scapy.contrib.cdp.CDPMsgUnknown19'>, <class 'scapy.contrib.cdp.CDPMsgGeneric'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (CDPMsgGeneric,CDPMsgUnknown19).type>, <Field (CDPMsgGeneric,CDPMsgDeviceID,CDPMsgSoftwareVersion,CDPMsgPlatform,CDPMsgVTPMgmtDomain,CDPMsgUnknown19).len>, <Field (CDPMsgGeneric,CDPMsgDeviceID,CDPMsgSoftwareVersion,CDPMsgPlatform,CDPMsgVTPMgmtDomain,CDPMsgUnknown19).val>]
class scapy.contrib.cdp.CDPMsgUntrustedPortCoS

Bases: scapy.contrib.cdp.CDPMsgGeneric

aliastypes = [<class 'scapy.contrib.cdp.CDPMsgUntrustedPortCoS'>, <class 'scapy.contrib.cdp.CDPMsgGeneric'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (CDPMsgUntrustedPortCoS).type>, <Field (CDPMsgUntrustedPortCoS).len>, <Field (CDPMsgUntrustedPortCoS).untrusted_port_cos>]
class scapy.contrib.cdp.CDPMsgVTPMgmtDomain

Bases: scapy.contrib.cdp.CDPMsgGeneric

aliastypes = [<class 'scapy.contrib.cdp.CDPMsgVTPMgmtDomain'>, <class 'scapy.contrib.cdp.CDPMsgGeneric'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (CDPMsgGeneric,CDPMsgVTPMgmtDomain).type>, <Field (CDPMsgGeneric,CDPMsgDeviceID,CDPMsgSoftwareVersion,CDPMsgPlatform,CDPMsgVTPMgmtDomain,CDPMsgUnknown19).len>, <Field (CDPMsgGeneric,CDPMsgDeviceID,CDPMsgSoftwareVersion,CDPMsgPlatform,CDPMsgVTPMgmtDomain,CDPMsgUnknown19).val>]
class scapy.contrib.cdp.CDPMsgVoIPVLANQuery

Bases: scapy.contrib.cdp.CDPMsgGeneric

aliastypes = [<class 'scapy.contrib.cdp.CDPMsgVoIPVLANQuery'>, <class 'scapy.contrib.cdp.CDPMsgGeneric'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (CDPMsgVoIPVLANQuery).type>, <Field (CDPMsgVoIPVLANQuery).len>, <Field (CDPMsgVoIPVLANQuery).unknown1>, <Field (CDPMsgVoIPVLANQuery).vlan>, <Field (CDPMsgVoIPVLANQuery).unknown2>]
class scapy.contrib.cdp.CDPMsgVoIPVLANReply

Bases: scapy.contrib.cdp.CDPMsgGeneric

aliastypes = [<class 'scapy.contrib.cdp.CDPMsgVoIPVLANReply'>, <class 'scapy.contrib.cdp.CDPMsgGeneric'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (CDPMsgVoIPVLANReply).type>, <Field (CDPMsgVoIPVLANReply).len>, <Field (CDPMsgVoIPVLANReply).status?>, <Field (CDPMsgVoIPVLANReply).vlan>]
class scapy.contrib.cdp.CDPv2_HDR

Bases: scapy.contrib.cdp._CDPChecksum, scapy.contrib.cdp.CDPMsgGeneric

aliastypes = [<class 'scapy.contrib.cdp.CDPv2_HDR'>, <class 'scapy.contrib.cdp.CDPMsgGeneric'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (CDPv2_HDR).vers>, <Field (CDPv2_HDR).ttl>, <Field (CDPv2_HDR).cksum>, <Field (CDPv2_HDR).msg>]