scapy.contrib.lldp
LLDP - Link Layer Discovery Protocol
- author:
Thomas Tannhaeuser, hecke@naberius.de
- description:
This module provides Scapy layers for the LLDP protocol.
- normative references:
IEEE 802.1AB 2016 - LLDP protocol, topology and MIB description
- TODO:
- organization specific TLV e.g. ProfiNet(see LLDPDUGenericOrganisationSpecific for a starting point)
Ignore everything after EndofLLDPDUTLV
- NOTES:
you can find the layer configuration options at the end of this file
default configuration enforces standard conform:
- frame structure(ChassisIDTLV/PortIDTLV/TimeToLiveTLV/…)
multiplicity of TLVs (if given by the standard)
min sizes of strings used by the TLVs
conf.contribs[‘LLDP’].strict_mode_disable() -> disable strict mode
- class scapy.contrib.lldp.LLDPConfiguration[source]
Bases:
object
basic configuration for LLDP layer
- class scapy.contrib.lldp.LLDPDU(_pkt, /)[source]
Bases:
Packet
base class for all LLDP data units
- DOT1Q_HEADER_LEN = 4
- ETHER_FRAME_MIN_LEN = 64
- ETHER_FSC_LEN = 4
- ETHER_HEADER_LEN = 14
- IANA_ADDRESS_FAMILY_NUMBERS = {0: 'other', 1: 'IPv4', 2: 'IPv6', 3: 'NSAP', 4: 'HDLC', 5: 'BBN', 6: '802', 7: 'E.163', 8: 'E.164', 9: 'F.69', 10: 'X.121', 11: 'IPX', 12: 'Appletalk', 13: 'Decnet IV', 14: 'Banyan Vines', 15: 'E.164 with NSAP', 16: 'DNS', 17: 'Distinguished Name', 18: 'AS Number', 19: 'XTP over IPv4', 20: 'XTP over IPv6', 21: 'XTP native mode XTP', 22: 'Fiber Channel World-Wide Port Name', 23: 'Fiber Channel World-Wide Node Name', 24: 'GWID', 25: 'AFI for L2VPN', 26: 'MPLS-TP Section Endpoint ID', 27: 'MPLS-TP LSP Endpoint ID', 28: 'MPLS-TP Pseudowire Endpoint ID', 29: 'MT IP Multi-Topology IPv4', 30: 'MT IP Multi-Topology IPv6'}
- LAYER_MULTIPLICITIES = {}
- LAYER_STACK = []
- TYPES = {0: 'end of LLDPDU', 1: 'chassis id', 2: 'port id', 3: 'time to live', 4: 'port description', 5: 'system name', 6: 'system description', 7: 'system capabilities', 8: 'management address', 127: 'organisation specific TLV'}
- aliastypes
- class scapy.contrib.lldp.LLDPDUChassisID(_pkt, /, *, _type=1, _length=None, subtype=0, family=0, id=None)[source]
Bases:
LLDPDU
ieee 802.1ab-2016 - sec. 8.5.2 / p. 26
- LLDP_CHASSIS_ID_TLV_SUBTYPES = {0: 'reserved', 1: 'chassis component', 2: 'interface alias', 3: 'port component', 4: 'MAC address', 5: 'network address', 6: 'interface name', 7: 'locally assigned'}
- SUBTYPE_CHASSIS_COMPONENT = 1
- SUBTYPE_INTERFACE_ALIAS = 2
- SUBTYPE_INTERFACE_NAME = 6
- SUBTYPE_LOCALLY_ASSIGNED = 7
- SUBTYPE_MAC_ADDRESS = 4
- SUBTYPE_NETWORK_ADDRESS = 5
- SUBTYPE_PORT_COMPONENT = 3
- SUBTYPE_RESERVED = 0
- 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TYPE | LENGTH | SUBTYPE | FAMILY | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. LLDPDUChassisID
_type
1
_length
BitFieldLenField
(9 bits)None
subtype
0
family
ByteEnumField
(Cond)0
id
MultipleTypeField
(MACField, IPField, IP6Field, StrLenField)b''
- class scapy.contrib.lldp.LLDPDUEndOfLLDPDU(_pkt, /, *, _type=0, _length=0)[source]
Bases:
LLDPDU
ieee 802.1ab-2016 - sec. 8.5.1 / p. 26
- aliastypes
- class scapy.contrib.lldp.LLDPDUGenericOrganisationSpecific(_pkt, /, *, _type=127, _length=None, org_code=0, subtype=0, data=b'')[source]
Bases:
LLDPDU
- ORG_UNIQUE_CODES = {3791: 'PROFIBUS International (PNO)', 4623: 'IEEE 802.3', 4795: 'TIA TR-41 Committee . Media Endpoint Discovery', 32962: 'IEEE 802.1', 3191318: 'Hytec Geraetebau GmbH'}
- ORG_UNIQUE_CODE_HYTEC = 3191318
- ORG_UNIQUE_CODE_IEEE_802_1 = 32962
- ORG_UNIQUE_CODE_IEEE_802_3 = 4623
- ORG_UNIQUE_CODE_PNO = 3791
- ORG_UNIQUE_CODE_TIA_TR_41_MED = 4795
- 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TYPE | LENGTH | ORG CODE | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | SUBTYPE | DATA | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | +-+-+-+-+-+-+-+-+ Fig. LLDPDUGenericOrganisationSpecific
_type
127
_length
BitFieldLenField
(9 bits)None
org_code
0
subtype
0
data
b''
- class scapy.contrib.lldp.LLDPDUManagementAddress(_pkt, /, *, _type=8, _length=None, _management_address_string_length=None, management_address_subtype=0, management_address=b'', interface_numbering_subtype=1, interface_number=0, _oid_string_length=None, object_id=b'')[source]
Bases:
LLDPDU
ieee 802.1ab-2016 - sec. 8.5.9 / p. 32
currently only 0x00..0x1e are used by standards, no way to use anything > 0xff as management address subtype is only one octet wide
see https://www.iana.org/assignments/address-family-numbers/address-family-numbers.xhtml # noqa: E501
- INTERFACE_NUMBERING_SUBTYPES = {1: 'unknown', 2: 'ifIndex', 3: 'system port number'}
- SUBTYPE_INTERFACE_NUMBER_IF_INDEX = 2
- SUBTYPE_INTERFACE_NUMBER_SYSTEM_PORT_NUMBER = 3
Note - calculation of _length field:
_length = 1@_management_address_string_length + 1@management_address_subtype + management_address.len + 1@interface_numbering_subtype + 4@interface_number + 1@_oid_string_length + object_id.len
- SUBTYPE_INTERFACE_NUMBER_UNKNOWN = 1
- SUBTYPE_MANAGEMENT_ADDRESS_802 = 6
- SUBTYPE_MANAGEMENT_ADDRESS_AFI_FOR_L2VPN = 25
- SUBTYPE_MANAGEMENT_ADDRESS_APPLETALK = 12
- SUBTYPE_MANAGEMENT_ADDRESS_AS_NUMBER = 18
- SUBTYPE_MANAGEMENT_ADDRESS_BANYAN_VINES = 14
- SUBTYPE_MANAGEMENT_ADDRESS_BBN = 5
- SUBTYPE_MANAGEMENT_ADDRESS_DECNET_IV = 13
- SUBTYPE_MANAGEMENT_ADDRESS_DISTINGUISHED_NAME = 17
- SUBTYPE_MANAGEMENT_ADDRESS_DNS = 16
- SUBTYPE_MANAGEMENT_ADDRESS_E_163 = 7
- SUBTYPE_MANAGEMENT_ADDRESS_E_164 = 8
- SUBTYPE_MANAGEMENT_ADDRESS_E_164_WITH_NSAP = 15
- SUBTYPE_MANAGEMENT_ADDRESS_FIBER_CHANNEL_WORLD_WIDE_NODE_NAME = 23
- SUBTYPE_MANAGEMENT_ADDRESS_FIBER_CHANNEL_WORLD_WIDE_PORT_NAME = 22
- SUBTYPE_MANAGEMENT_ADDRESS_F_69 = 9
- SUBTYPE_MANAGEMENT_ADDRESS_GWID = 24
- SUBTYPE_MANAGEMENT_ADDRESS_HDLC = 4
- SUBTYPE_MANAGEMENT_ADDRESS_IPV4 = 1
- SUBTYPE_MANAGEMENT_ADDRESS_IPV6 = 2
- SUBTYPE_MANAGEMENT_ADDRESS_IPX = 11
- SUBTYPE_MANAGEMENT_ADDRESS_MPLS_TP_LSP_ENDPOINT_ID = 27
- SUBTYPE_MANAGEMENT_ADDRESS_MPLS_TP_PSEUDOWIRE_ENDPOINT_ID = 28
- SUBTYPE_MANAGEMENT_ADDRESS_MPLS_TP_SECTION_ENDPOINT_ID = 26
- SUBTYPE_MANAGEMENT_ADDRESS_MT_IP_MULTI_TOPOLOGY_IPV4 = 29
- SUBTYPE_MANAGEMENT_ADDRESS_MT_IP_MULTI_TOPOLOGY_IPV6 = 30
- SUBTYPE_MANAGEMENT_ADDRESS_NSAP = 3
- SUBTYPE_MANAGEMENT_ADDRESS_OTHER = 0
- SUBTYPE_MANAGEMENT_ADDRESS_XTP_NATIVE_MODE_XTP = 21
- SUBTYPE_MANAGEMENT_ADDRESS_XTP_OVER_IPV4 = 19
- SUBTYPE_MANAGEMENT_ADDRESS_XTP_OVER_IPV6 = 20
- SUBTYPE_MANAGEMENT_ADDRESS_X_121 = 10
- 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TYPE | LENGTH | MANAGEMENT ADD|MANAGEMENT ADDR| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | MANAGEMENT ADDRESS |INTERFACE NUMBE|INTERFACE NUMBE| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | OID STRING LEN| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | OBJECT ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. LLDPDUManagementAddress
_type
8
_length
BitFieldLenField
(9 bits)None
_management_address_string_length
BitFieldLenField
(8 bits)None
management_address_subtype
0
management_address
b''
interface_numbering_subtype
1
interface_number
BitField
(32 bits)0
_oid_string_length
BitFieldLenField
(8 bits)None
object_id
b''
- class scapy.contrib.lldp.LLDPDUPortDescription(_pkt, /, *, _type=4, _length=None, description=b'')[source]
Bases:
LLDPDU
ieee 802.1ab-2016 - sec. 8.5.5 / p. 29
- 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TYPE | LENGTH | DESCRIPTION | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. LLDPDUPortDescription
_type
4
_length
BitFieldLenField
(9 bits)None
description
b''
- class scapy.contrib.lldp.LLDPDUPortID(_pkt, /, *, _type=2, _length=None, subtype=0, family=0, id=None)[source]
Bases:
LLDPDU
ieee 802.1ab-2016 - sec. 8.5.3 / p. 26
- LLDP_PORT_ID_TLV_SUBTYPES = {0: 'reserved', 1: 'interface alias', 2: 'port component', 3: 'MAC address', 4: 'network address', 5: 'interface name', 6: 'agent circuit ID', 7: 'locally assigned'}
- SUBTYPE_AGENT_CIRCUIT_ID = 6
- SUBTYPE_INTERFACE_ALIAS = 1
- SUBTYPE_INTERFACE_NAME = 5
- SUBTYPE_LOCALLY_ASSIGNED = 7
- SUBTYPE_MAC_ADDRESS = 3
- SUBTYPE_NETWORK_ADDRESS = 4
- SUBTYPE_PORT_COMPONENT = 2
- SUBTYPE_RESERVED = 0
- 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TYPE | LENGTH | SUBTYPE | FAMILY | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. LLDPDUPortID
_type
2
_length
BitFieldLenField
(9 bits)None
subtype
0
family
ByteEnumField
(Cond)0
id
MultipleTypeField
(MACField, IPField, IP6Field, StrLenField)b''
- class scapy.contrib.lldp.LLDPDUPowerViaMDI(_pkt, /, *, _type=127, _length=7, org_code=4623, subtype=2, MDI_power_support=<Flag 0 ()>, PSE_power_pair=1, power_class=1)[source]
Bases:
LLDPDUGenericOrganisationSpecific
Legacy PoE TLV originally defined in IEEE Std 802.1AB-2005 Annex G.3.
IEEE802.3bt-2018 - sec. 79.3.2.
- MDI_POWER_SUPPORT = {1: 'port class PSE', 2: 'PSE MDI power supported', 4: 'PSE MDI power enabled', 8: 'PSE pairs controlled'}
- POWER_CLASS = {1: 'class 0', 2: 'class 1', 3: 'class 2', 4: 'class 3', 5: 'class 4 and above'}
- PSE_POWER_PAIR = {1: 'alt A', 2: 'alt B'}
- 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TYPE | LENGTH | ORG CODE | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | SUBTYPE |MDI POWER SUPPO| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | PSE POWER PAIR| POWER CLASS | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. LLDPDUPowerViaMDI
_type
127
_length
BitField
(9 bits)7
org_code
4623
subtype
2
MDI_power_support
<Flag 0 ()>
PSE_power_pair
1
power_class
1
- class scapy.contrib.lldp.LLDPDUPowerViaMDIDDL(_pkt, /, *, _type=127, _length=12, org_code=4623, subtype=2, MDI_power_support=<Flag 0 ()>, PSE_power_pair=1, power_class=1, power_type_no=1, power_type_dir=1, power_source=None, PD_4PID=None, power_prio=0, PD_requested_power=0, PSE_allocated_power=0)[source]
Bases:
LLDPDUPowerViaMDI
PoE TLV with DLL classification extension specified in IEEE802.3at-2009
Note: power values are expressed in units of Watts, converted to tenth of Watts internally
IEEE802.3bt-2018 - sec. 79.3.2
- PD_4PID_SUP = {0: 'not supported', 1: 'supported'}
- POWER_PRIO = {0: 'unknown', 1: 'critical', 2: 'high', 3: 'low'}
- POWER_SOURCE_PD = {0: 'unknown', 1: 'PSE', 2: 'reserved', 3: 'PSE and local'}
- POWER_SOURCE_PSE = {0: 'unknown', 1: 'primary source', 2: 'backup source', 3: 'reserved'}
- POWER_TYPE_DIR = {0: 'PSE', 1: 'PD'}
- POWER_TYPE_NO = {0: 'type 2', 1: 'type 1'}
- 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TYPE | LENGTH | ORG CODE | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | SUBTYPE |MDI POWER SUPPO| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | PSE POWER PAIR| POWER CLASS |P|P|POW|PD |POW|PD REQUESTED PO| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | PSE ALLOCATED POWER | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. LLDPDUPowerViaMDIDDL
_type
127
_length
BitField
(9 bits)12
org_code
4623
subtype
2
MDI_power_support
<Flag 0 ()>
PSE_power_pair
1
power_class
1
power_type_no
1
power_type_dir
1
power_source
MultipleTypeField
(BitEnumField, BitEnumField)1
PD_4PID
MultipleTypeField
(BitEnumField, BitField)0
power_prio
0
PD_requested_power
0
PSE_allocated_power
0
- class scapy.contrib.lldp.LLDPDUPowerViaMDIMeasure(_pkt, /, *, _type=127, _length=26, org_code=4623, subtype=8, support=<Flag 0 ()>, source=0, request=<Flag 0 ()>, valid=<Flag 0 ()>, voltage_uncertainty=0, current_uncertainty=0, power_uncertainty=0, energy_uncertainty=0, voltage_measurement=0, current_measurement=0, power_measurement=0, energy_measurement=0, power_price_index=65535)[source]
Bases:
LLDPDUGenericOrganisationSpecific
PoE TLV measurements in IEEE802.3bt-2018
Note: power values are expressed in units of Watts, converted to hundredths of Watts internally; energy values are expressed in units of Joules, converted to tenths of kilo-Joules internally; voltage values are expressed in units of Volts, converted to milli-Volts internally; current values are expressed in units of Amperes, converted to tenths of milli-Amperes internally. PSE price index is converted internally.
IEEE802.3bt-2018 - sec. 79.3.8
- MEASURE_SOURCE = {0: 'no request', 1: 'mode A', 2: 'mode B', 3: 'port total'}
- MEASURE_TYPE = {1: 'energy', 2: 'power', 4: 'current', 8: 'voltage'}
- POWER_PRICE_INDEX = {65535: 'not available'}
- 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TYPE | LENGTH | ORG CODE | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | SUBTYPE |SUPPORT| SOURCE| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |REQUEST| VALID | VOLTAGE UNCERTAINTY |CURRENT UNCERTA| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | POWER UNCERTAINTY |ENERGY UNCERTAI| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | VOLTAGE MEASUREMENT |CURRENT MEASURE| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | POWER MEASUREMENT |ENERGY MEASUREM| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |POWER PRICE IND| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | +-+-+-+-+-+-+-+-+ Fig. LLDPDUPowerViaMDIMeasure
_type
127
_length
BitField
(9 bits)26
org_code
4623
subtype
8
support
<Flag 0 ()>
source
0
request
<Flag 0 ()>
valid
<Flag 0 ()>
voltage_uncertainty
0
current_uncertainty
0
power_uncertainty
0
energy_uncertainty
0
voltage_measurement
0
current_measurement
0
power_measurement
0
energy_measurement
0
power_price_index
65535
- class scapy.contrib.lldp.LLDPDUPowerViaMDIType34(_pkt, /, *, _type=127, _length=29, org_code=4623, subtype=2, MDI_power_support=<Flag 0 ()>, PSE_power_pair=1, power_class=1, power_type_no=1, power_type_dir=1, power_source=None, PD_4PID=None, power_prio=0, PD_requested_power=0, PSE_allocated_power=0, PD_requested_power_mode_A=0, PD_requested_power_mode_B=0, PD_allocated_power_alt_A=0, PD_allocated_power_alt_B=0, PSE_powering_status=0, PD_powered_status=0, PD_power_pair_ext=0, dual_signature_class_mode_A=7, dual_signature_class_mode_B=7, power_class_ext=0, power_type_ext=0, PD_load=0, PSE_max_available_power=0, autoclass=<Flag 0 ()>, power_down_req=0, power_down_time=0)[source]
Bases:
LLDPDUPowerViaMDIDDL
PoE TLV with DLL classification and type 3 and 4 extensions specified in IEEE802.3bt-2018
Note: power values are expressed in units of Watts, converted to tenth of Watts internally
IEEE802.3bt-2018 - sec. 79.3.2
- AUTOCLASS = {1: 'autoclass request', 2: 'autoclass completed', 4: 'PSE autoclass support'}
- DUAL_SIGNATURE_POWER_CLASS = {0: 'ignore', 1: 'class 1', 2: 'class 2', 3: 'class 3', 4: 'class 4', 5: 'class 5', 6: 'ignore', 7: 'single-signature PD or 2-pair only PSE'}
- PD_LOAD = {0: 'single-signature or not electrically isolated', 1: 'dual-signature and electrically isolated'}
- PD_POWERED_STATUS = {0: 'ignore', 1: 'powered single-signature PD', 2: '2-pair powered dual-signature PD', 3: '4-pair powered dual-signature PD'}
- POWER_CLASS_EXT = {0: 'ignore', 1: 'class 1', 2: 'class 2', 3: 'class 3', 4: 'class 4', 5: 'class 5', 6: 'class 6', 7: 'class 7', 8: 'class 8', 9: 'ignore', 10: 'ignore', 11: 'ignore', 12: 'ignore', 13: 'ignore', 14: 'ignore', 15: 'dual-signature pd'}
- POWER_DOWN_REQ = {0: 'ignore', 29: 'power down'}
- POWER_TYPE_EXT = {0: 'type 3 PSE', 1: 'type 4 PSE', 2: 'type 3 single-signature PD', 3: 'type 3 dual-signature PD', 4: 'type 4 single-signature PD', 5: 'type 4 dual-signature PD', 6: 'ignore', 7: 'ignore'}
- PSE_POWERING_STATUS = {0: 'ignore', 1: '2-pair powering', 2: '4-pair powering single-signature PD', 3: '4-pair powering dual-signature PD'}
- PSE_POWER_PAIRS_EXT = {0: 'ignore', 1: 'alt B', 2: 'alt A', 3: 'both alts'}
- 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TYPE | LENGTH | ORG CODE | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | SUBTYPE |MDI POWER SUPPO| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | PSE POWER PAIR| POWER CLASS |P|P|POW|PD |POW|PD REQUESTED PO| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | PSE ALLOCATED POWER |PD REQUESTED PO| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | PD REQUESTED POWER MODE B |PD ALLOCATED PO| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | PD ALLOCATED POWER ALT B |PSE|PD |PD |DUA| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |DUAL |POWER C|POWER TYPE EX|P| PSE MAX AVAILABLE POWER | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | AUTOCLASS |POWER DOWN | POWER DOWN TIME | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. LLDPDUPowerViaMDIType34
_type
127
_length
BitField
(9 bits)29
org_code
4623
subtype
2
MDI_power_support
<Flag 0 ()>
PSE_power_pair
1
power_class
1
power_type_no
1
power_type_dir
1
power_source
MultipleTypeField
(BitEnumField, BitEnumField)1
PD_4PID
MultipleTypeField
(BitEnumField, BitField)0
power_prio
0
PD_requested_power
0
PSE_allocated_power
0
PD_requested_power_mode_A
0
PD_requested_power_mode_B
0
PD_allocated_power_alt_A
0
PD_allocated_power_alt_B
0
PSE_powering_status
0
PD_powered_status
0
PD_power_pair_ext
0
dual_signature_class_mode_A
7
dual_signature_class_mode_B
7
power_class_ext
0
power_type_ext
0
PD_load
0
PSE_max_available_power
0
autoclass
<Flag 0 ()>
power_down_req
0
power_down_time
BitScalingField
(18 bits)0
- class scapy.contrib.lldp.LLDPDUSystemCapabilities(_pkt, /, *, _type=7, _length=4, reserved_5_available=0, reserved_4_available=0, reserved_3_available=0, reserved_2_available=0, reserved_1_available=0, two_port_mac_relay_available=0, s_vlan_component_available=0, c_vlan_component_available=0, station_only_available=0, docsis_cable_device_available=0, telephone_available=0, router_available=0, wlan_access_point_available=0, mac_bridge_available=0, repeater_available=0, other_available=0, reserved_5_enabled=0, reserved_4_enabled=0, reserved_3_enabled=0, reserved_2_enabled=0, reserved_1_enabled=0, two_port_mac_relay_enabled=0, s_vlan_component_enabled=0, c_vlan_component_enabled=0, station_only_enabled=0, docsis_cable_device_enabled=0, telephone_enabled=0, router_enabled=0, wlan_access_point_enabled=0, mac_bridge_enabled=0, repeater_enabled=0, other_enabled=0)[source]
Bases:
LLDPDU
ieee 802.1ab-2016 - sec. 8.5.8 / p. 31
- 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TYPE | LENGTH |R|R|R|R|R|T|S|C|S|D|T|R|W|M|R|O| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |R|R|R|R|R|T|S|C|S|D|T|R|W|M|R|O| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. LLDPDUSystemCapabilities
_type
7
_length
BitFieldLenField
(9 bits)4
reserved_5_available
BitField
(1 bit)0
reserved_4_available
BitField
(1 bit)0
reserved_3_available
BitField
(1 bit)0
reserved_2_available
BitField
(1 bit)0
reserved_1_available
BitField
(1 bit)0
two_port_mac_relay_available
BitField
(1 bit)0
s_vlan_component_available
BitField
(1 bit)0
c_vlan_component_available
BitField
(1 bit)0
station_only_available
BitField
(1 bit)0
docsis_cable_device_available
BitField
(1 bit)0
telephone_available
BitField
(1 bit)0
router_available
BitField
(1 bit)0
wlan_access_point_available
BitField
(1 bit)0
mac_bridge_available
BitField
(1 bit)0
repeater_available
BitField
(1 bit)0
other_available
BitField
(1 bit)0
reserved_5_enabled
BitField
(1 bit)0
reserved_4_enabled
BitField
(1 bit)0
reserved_3_enabled
BitField
(1 bit)0
reserved_2_enabled
BitField
(1 bit)0
reserved_1_enabled
BitField
(1 bit)0
two_port_mac_relay_enabled
BitField
(1 bit)0
s_vlan_component_enabled
BitField
(1 bit)0
c_vlan_component_enabled
BitField
(1 bit)0
station_only_enabled
BitField
(1 bit)0
docsis_cable_device_enabled
BitField
(1 bit)0
telephone_enabled
BitField
(1 bit)0
router_enabled
BitField
(1 bit)0
wlan_access_point_enabled
BitField
(1 bit)0
mac_bridge_enabled
BitField
(1 bit)0
repeater_enabled
BitField
(1 bit)0
other_enabled
BitField
(1 bit)0
- class scapy.contrib.lldp.LLDPDUSystemDescription(_pkt, /, *, _type=6, _length=None, description=b'')[source]
Bases:
LLDPDU
ieee 802.1ab-2016 - sec. 8.5.7 / p. 31
- 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TYPE | LENGTH | DESCRIPTION | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. LLDPDUSystemDescription
_type
6
_length
BitFieldLenField
(9 bits)None
description
b''
- class scapy.contrib.lldp.LLDPDUSystemName(_pkt, /, *, _type=5, _length=None, system_name=b'')[source]
Bases:
LLDPDU
ieee 802.1ab-2016 - sec. 8.5.6 / p. 30
- 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TYPE | LENGTH | SYSTEM NAME | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. LLDPDUSystemName
_type
5
_length
BitFieldLenField
(9 bits)None
system_name
b''
- class scapy.contrib.lldp.LLDPDUTimeToLive(_pkt, /, *, _type=3, _length=2, ttl=20)[source]
Bases:
LLDPDU
ieee 802.1ab-2016 - sec. 8.5.4 / p. 29
- 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TYPE | LENGTH | TTL | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. LLDPDUTimeToLive
_type
3
_length
BitField
(9 bits)2
ttl
20
- exception scapy.contrib.lldp.LLDPInvalidFieldValue[source]
Bases:
Scapy_Exception
field value is out of allowed range
- exception scapy.contrib.lldp.LLDPInvalidFrameStructure[source]
Bases:
Scapy_Exception
basic frame structure not standard conform (missing TLV, invalid order or multiplicity)
- exception scapy.contrib.lldp.LLDPInvalidLengthField[source]
Bases:
Scapy_Exception
invalid value of length field
- exception scapy.contrib.lldp.LLDPInvalidTLVCount[source]
Bases:
Scapy_Exception
invalid number of entries for a specific TLV type
- exception scapy.contrib.lldp.LLDPMissingLowerLayer[source]
Bases:
Scapy_Exception
first layer below first LLDPDU must be Ethernet or Dot1q
- class scapy.contrib.lldp.ThreeBytesEnumField(name, default, enum)[source]
Bases:
EnumField
,ThreeBytesField