Module for LLDP (Link Layer Discovery Protocol).
This module is in BETA. APIs that we expose here are subject to change in future minor and patch releases. Feedback is greatly appreciated.
LLDP is a link layer protocol that sends “TLVs” across the link, allowing devices to advertise their identities and properties over a network. The protocol is uni-directional (no acks).
This module provides access to information learned from neighbors directly connected via Ethernet interfaces. It can also provide proprietary information to those neighbors via “Organizationally defined TLVs”. The mandatory info exchanged over the link are the interface’s name, the chassis ID, the system name and the management port address (over which more information can be gleaned via protocols such as SNMP). The protocol has to be enabled per interface and per direction. On EOS, LLDP is disabled by default, but once enabled (cli: “lldp run”), all interfaces are enabled bi-directionally by default.
The type of an LLDP TLV is composed of a 24 bit organization (vendor/manufacturer) number assigned by IEEE (also called OUI: organizationally unique identifier), and a subtype which is managed by that organization. That’s the lldp_tlv_type_t. When you add the payload (of 0-507 octets) you get a TLV.
When enabled, EOS transmits these TLVS on an interface (if they apply)
Handler class to notify of changes in LLDP. In the handler context, “tlv” means received tlv.
Public Functions
Called when a neighbor starts sending LLDP information. `intf` refers to the local interface that this information was received on.
Called when a neighbor’s LLDP information ages out (or is disconnected).
Called when the remote information has changed and all has been updated; this can be used as an alternative to reacting to each single callback provided below.
Called when the remote’s “chassis ID” changed (mandatory TLV).
Called when the remote’s “interface ID” changed (mandatory TLV).
Called when the remote’s “system name” changed.
Called when the remote’s “system description” changed.
Called when the remote’s “interface description” changed.
Called when the remote’s “default vlan” changed.
Called when the remote’s “management vlan” changed.
Called when the remote’s “maximum transmission unit” changed.
Called when the remote’s “management address” changed.
Called when the remote’s “link aggregation config/status” changed.
Called when the remote’s “phy negotiation config/status” changed.
Called when a new TLV type is received, or its content has changed.
Called when a TLV type previously received is now absent from advertisements.
Called when a transmission timer value change became effective.
Called when a hold timer value change became effective.
Called when an LLDP interface status change became effective.
An iterator that yields a intf_id_t for each interface with lldp config.
Private Functions
Friends
An iterator that yields a lldp_remote_system_t for each neighbor on an interface.
Private Functions
Friends
An iterator that yields a lldp_neighbor_t for each neighbor (remote system) A combination of the lldp-remote-system and lldp-intf iterators.
Private Functions
Friends
A manager for LLDP information.
Create one of these via sdk.get_lldp_mgr() prior to starting the agent main loop. When your eos::agent_handler::on_initialized virtual function is called, the manager is valid for use. In manager context, “tlv” means received tlv. What is sent it called tx_tlv.
Public Functions
Enable LLDP on an interface – on by default. LLDP is unidirectional, so enablement can be split by direction.
The LLDP transmit timer specifies how often TLVs are sent (aka “refreshed”), in seconds, default 30s, range 5-32768
The LLDP holding time determines how long the recipient of our TLVs should keep them un-refreshed, in seconds, default 120s, range 10-65535. This is sent to the neighbor as the “ttl” value (this holding time limit is imposed on our neighbor, has no effect locally).
Get the chassisID of the remote interface (< 255 octets).
Get the port ID of the remote interface (< 255 octets).
interface description: max string size 255, empty if not rx-ed
sysname: max string size 255, empty if not rx-ed
sysdescr: max string size 255, empty if not rx-ed
system capabilities bitmap, ‘other’ if not rx-ed
The default vlan ID (vlan-id for untagged packets); 0 if none or not rx-ed.
The vlan-id on which the managment interface is available; 0 if none.
The max frame size on the link; 0 if not rx-ed.
Port-channel this interface is member of (and capability/status) !value returns false if this tlv was not received.
management info (address, snmp-ifindex, sysDescr-oid) !value returns false if this tlv was not received. The type of address (and its encoding) is described using IANA’s AddressFamilyNumbers, which is available here: http://www.iana.org/assignments/ianaaddressfamilynumbers-mib/ ianaaddressfamilynumbers-mib. In EOS’s case, the address family is an IPV4 address.
The mac phy config status info (auto-negotiation) !value returns false if this tlv was not received.
Send a/multiple application defined TLV on a interface. Transmission will occur every tx_timer until revoked.
Get en-block (there is no iterator, cannot be many given mtu limit this includes all “organizationnally defined TLVs” (owned by this app or not)
Protected Functions
Private Members
Friends
Enums
Set of standard TLVs (as a bitmask).
Values:
Set of system capabilities.
Values:
The lldp administrative status of an interface.
Values:
encoding format of the chassis name.
Values:
encoding format of the chassis name.
Values:
An LLDP organizationally defined TLV type.
Public Functions
Getter for ‘organization’: IEEE assigned Organizationally Unique Identifier (OUI), 24 bits.
Setter for ‘organization’.
Getter for ‘subtype’: Subtype under OUI (managed by org.), 8 bits.
Setter for ‘subtype’.
The hash function for type lldp_tlv_type_t.
Returns a string representation of the current object’s values.
Private Members
Friends
A utility stream operator that adds a string representation of lldp_tlv_type_t to the ostream.
Defines a set of remote TLVs (for which we have a value for).
Public Functions
Returns a string representation of the current object’s values.
Private Members
Friends
A utility stream operator that adds a string representation of lldp_std_tlv_type_t to the ostream.
Defines a set of remote system capabilities.
Public Functions
Returns a string representation of the current object’s values.
Private Members
Friends
A utility stream operator that adds a string representation of lldp_syscap_t to the ostream.
Management information of the switch across the link.
Public Functions
Getter for ‘address_family’: Type of address encoded in address field (see IANA Address Family Numbers MIB).
Getter for ‘address’: The address, max size 31 octets (ipv4 or ipv6 most likely).
Getter for ‘snmp_ifindex’: The SNMP interface index of the management interface.
Getter for ‘oid’: The SNMP OID that describes the hardware the management interface is part of.
Returns a string representation of the current object’s values.
Private Members
Friends
A utility stream operator that adds a string representation of lldp_management_address_t to the ostream.
LACP information from the peer.
Public Functions
Getter for ‘capable’: if port can become a member of a port-channel.
Getter for ‘enabled’: if port is a member of a port-channel.
Getter for ‘id’: which port-channel number this interface is part of, (if enabled=true).
Getter for ‘valid’: true if such tlv was received, else other fields are bogus.
invalid lacp_t returned if no such tlv received.
Returns a string representation of the current object’s values.
Private Members
Friends
A utility stream operator that adds a string representation of lldp_lacp_t to the ostream.
PHY information from the peer (related to speed auto-negotiation).
Public Functions
Getter for ‘autonegSupported’: if auto-negotiation supported.
Getter for ‘autonegEnabled’: if auto-negatiation enabled.
Getter for ‘autonegCapabilitiesBm’: capabilities bitmask.
Getter for ‘valid’: if phy-info tlv received from remote.
Returns a string representation of the current object’s values.
Private Members
Friends
A utility stream operator that adds a string representation of lldp_phy_t to the ostream.
The chassis name, as an encoding plus payload.
Public Functions
String representation of a chassisId.
Returns a string representation of the current object’s values.
Private Members
Friends
A utility stream operator that adds a string representation of lldp_chassis_id_t to the ostream.
The interface name, as an encoding plus payload.
Public Functions
String representation of a chassisId.
Returns a string representation of the current object’s values.
Private Members
Friends
A utility stream operator that adds a string representation of lldp_intf_id_t to the ostream.
Identifies a remote system as seen across an LLDP interface.
Public Functions
Getter for ‘chassis’: The chassis-id of the remote system.
Setter for ‘chassis’.
Getter for ‘port’: The port-id of the remote system.
Setter for ‘port’.
String representation of a chassisId.
The hash function for type lldp_remote_system_t.
Returns a string representation of the current object’s values.
Friends
A utility stream operator that adds a string representation of lldp_remote_system_t to the ostream.
Identifies a remote system seen from the local switch.
Public Functions
Getter for ‘intf’: The local interface that sees this neighbor.
Setter for ‘intf’.
Getter for ‘remote_system’: The id of the remote system (an interface can see more than one).
Setter for ‘remote_system’.
String representation of a chassisId.
The hash function for type lldp_neighbor_t.
Returns a string representation of the current object’s values.
Friends
A utility stream operator that adds a string representation of lldp_neighbor_t to the ostream.