SNMP::Info::LLDP(3pm)

πŸ’– SNMP::Info::LLDP πŸ’–

okay bestie, so this is SNMP::Info::LLDP β€” it's part of the User Contributed Perl Documentation situation (a 3pm page, iykyk), and it's literally the SNMP interface to the Link Layer Discovery Protocol, aka LLDP ✨

Written by Eric Miller. Give them their flowers πŸ’


🌈 SYNOPSIS 🌈

 my $lldp = new SNMP::Info (
                             AutoSpecify => 1,
                             Debug       => 1,
                             DestHost    => 'router',
                             Community   => 'public',
                             Version     => 2
                           );

 my $class = $lldp->class();
 print " Using device sub class : $class\n";

 $haslldp   = $lldp->hasLLDP() ? 'yes' : 'no';

 # Print out a map of device ports with LLDP neighbors:
 my $interfaces    = $lldp->interfaces();
 my $lldp_if       = $lldp->lldp_if();
 my $lldp_ip       = $lldp->lldp_ip();
 my $lldp_port     = $lldp->lldp_port();

 foreach my $lldp_key (keys %$lldp_ip){
    my $iid           = $lldp_if->{$lldp_key};
    my $port          = $interfaces->{$iid};
    my $neighbor      = $lldp_ip->{$lldp_key};
    my $neighbor_port = $lldp_port->{$lldp_key};
    print "Port : $port connected to $neighbor / $neighbor_port\n";
 }

✨ DESCRIPTION ✨

SNMP::Info::LLDP is a subclass of SNMP::Info that hands you a whole object oriented interface to LLDP info through SNMP. no cap 🫢

LLDP is a Layer 2 protocol that lets a network device advertise its identity and capabilities on the local network, which gives you topology info. The protocol is defined in the IEEE standard 802.1AB. iconic behavior honestly.

Create or use a device subclass that inherits this class. Do not use directly. fr fr. πŸ’…

🧬 Inherited Classes

None. that's it, that's the list πŸ’€

πŸ“š Required MIBs

  • LLDP-MIB
  • LLDP-EXT-MED-MIB
  • LLDP-EXT-DOT1-MIB
  • LLDP-EXT-DOT3-MIB

πŸ‘‘ GLOBALS πŸ‘‘

these are methods that return scalar values from SNMP 🌸

  • $lldp->hasLLDP() β€” is LLDP actually active in this device?
Note: LLDP may be active, but nothing in lldpRemoteSystemsData Tables so the device would not return any useful topology information. so like… it's awake but it's not giving anything 😭
  • $lldp->lldp_sysname() β€” the string value used to identify the system name of the local system. If the local agent supports IETF RFC 3418, lldpLocSysName object should have the same value of sysName object.

Nulls are removed before the value is returned.

(lldpLocSysName)

  • $lldp->lldp_sysdesc() β€” the string value used to identify the system description of the local system. If the local agent supports IETF RFC 3418, lldpLocSysDesc object should have the same value of sysDesc object.

Nulls are removed before the value is returned.

(lldpLocSysDesc)

  • $lldp->lldp_sys_cap() β€” returns which system capabilities are enabled on the local system. Results are munged into an ascii binary string, LSB. Each digit represents a bit from the table below:
    • Bit other(0) indicates that the system has capabilities other than those listed below.
    • Bit repeater(1) indicates that the system has repeater capability.
    • Bit bridge(2) indicates that the system has bridge capability.
    • Bit wlanAccessPoint(3) indicates that the system has WLAN access point capability.
    • Bit router(4) indicates that the system has router capability.
    • Bit telephone(5) indicates that the system has telephone capability.
    • Bit docsisCableDevice(6) indicates that the system has DOCSIS Cable Device capability (IETF RFC 2669 & 2670).
    • Bit stationOnly(7) indicates that the system has only station capability and nothing else."

(lldpLocSysCapEnabled)

  • $lldp->lldp_loc_id() β€” the string value used to identify the chassis component associated with the local system.

(lldpLocChassisId)

  • $lldp->lldp_loc_id_type() β€” the type of encoding used to identify the chassis associated with the local system.

This is used by the above method to decode the octet string in lldpLocChassisId

(lldpLocChassisIdSubtype)


πŸ¦‹ TABLE METHODS πŸ¦‹

these ones return tables of info as a reference to a hash. group chat energy but make it data structures πŸ’œ

  • $lldp->lldp_id() β€” returns the string value used to identify the chassis component associated with the remote system.

(lldpRemChassisId)

  • $lldp->lldp_if() β€” returns the mapping to the SNMP Interface Table. Tries to cross reference (lldpLocPortDesc) with (ifDescr) and (ifAlias) to get (ifIndex), if unable defaults to (lldpRemLocalPortNum). it's doing its best okay πŸ₯Ί
  • $lldp->lldp_ip() β€” returns remote IPv4 address. Returns for all other address types, use lldp_addr if you want any return address type.
  • $lldp->lldp_ipv6() β€” returns remote IPv6 address, if known. Returns for all other address types, use lldp_addr if you don't care about return address type.
  • $lldp->lldp_mac() β€” returns remote (management) MAC address, if known. Returns for all other address types, use lldp_addr if you don't care about return address type.
  • $lldp->lldp_addr() β€” returns remote address. Type may be any IANA Address Family Number. Currently only returns IPv4, IPv6 or MAC addresses. If the remote device returns more than one address type, this method will give only one. Which one is returned is decided by chance, phase of the moon and Perl hash ordering. πŸ’€ not me getting my networking data from astrology

Use lldp_mac, lldp_ip or lldp_ipv6 if you want a specific address type.

  • $lldp->lldp_port() β€” returns remote port ID
  • $lldp->lldp_platform() β€” tries to return something useful from lldp_rem_sysdesc() or lldp_rem_sysname(). bestie it is trying 🫢
  • $lldp->lldp_cap() β€” returns hash of arrays with each array containing the system capabilities supported by the remote system. Possible elements in the array are enumerated from LldpSystemCapabilitiesMap.
  • $lldp->lldp_media_cap() β€” returns hash of arrays with each array containing the media capabilities supported by the remote system. Possible elements in the array are enumerated from LldpXMedCapabilities.

πŸ“‘ LLDP Remote Table (lldpRemTable)

  • $lldp->lldp_rem_id_type() β€” returns the type of encoding used to identify the chassis associated with the remote system.

(lldpRemChassisIdSubtype)

  • $lldp->lldp_rem_id() β€” returns the string value used to identify the chassis component associated with the remote system.

(lldpRemChassisId)

  • $lldp->lldp_rem_pid_type() β€” returns the type of port identifier encoding used in the associated lldpRemPortId object.

(lldpRemPortIdSubtype)

  • $lldp->lldp_rem_pid() β€” returns the string value used to identify the port component associated with the remote system.

(lldpRemPortId)

  • $lldp->lldp_rem_desc() β€” returns the string value used to identify the description of the given port associated with the remote system.

Nulls are removed before the value is returned.

(lldpRemPortDesc)

  • $lldp->lldp_rem_sysname() β€” returns the string value used to identify the system name of the remote system.

Nulls are removed before the value is returned.

(lldpRemSysName)

  • $lldp->lldp_rem_sysdesc() β€” returns the string value used to identify the system description of the remote system.

Nulls are removed before the value is returned.

(lldpRemSysDesc)

  • $lldp->lldp_rem_hw_rev() β€” returns the string value used to identify the hardware revision of the remote system. Nulls are removed before the value is returned.

(lldpXMedRemHardwareRev)

  • $lldp->lldp_rem_fw_rev() β€” returns the string value used to identify the firmware revision of the remote system. Nulls are removed before the value is returned.

(lldpXMedRemHardwareRev)

  • $lldp->lldp_rem_sw_rev() β€” returns the string value used to identify the software revision of the remote system. Nulls are removed before the value is returned.

(lldpXMedRemSoftwareRev)

  • $lldp->lldp_rem_serial() β€” returns the string value used to identify the serial number of the remote system. Nulls are removed before the value is returned.

(lldpXMedRemSerialNum)

  • $lldp->lldp_rem_vendor() β€” returns the string value used to identify the manufacturer of the remote system. Nulls are removed before the value is returned.

(lldpXMedRemMfgName)

  • $lldp->lldp_rem_asset() β€” returns the string value used to identify the asset number of the remote system. Nulls are removed before the value is returned.

(lldpXMedRemAssetID)

  • $lldp->lldp_rem_model() β€” returns the string value used to identify the model of the remote system. Nulls are removed before the value is returned.

(lldpXMedRemModelName)

  • $lldp->lldp_rem_media_cap_spt() β€” returns which media capabilities are supported on the remote system. Results are munged into an ascii binary string, LSB.
  • $lldp->lldp_rem_media_cap() β€” returns which media capabilities are enabled on the remote system. Results are munged into an ascii binary string, LSB.
  • $lldp->lldp_rem_sys_cap() β€” returns which system capabilities are enabled on the remote system. Results are munged into an ascii binary string, LSB. Each digit represents a bit from the table below:
    • Bit other(0) indicates that the system has capabilities other than those listed below.
    • Bit repeater(1) indicates that the system has repeater capability.
    • Bit bridge(2) indicates that the system has bridge capability.
    • Bit wlanAccessPoint(3) indicates that the system has WLAN access point capability.
    • Bit router(4) indicates that the system has router capability.
    • Bit telephone(5) indicates that the system has telephone capability.
    • Bit docsisCableDevice(6) indicates that the system has DOCSIS Cable Device capability (IETF RFC 2669 & 2670).
    • Bit stationOnly(7) indicates that the system has only station capability and nothing else."

(lldpRemSysCapEnabled)


and that's the whole page bestie, you ate πŸ’…βœ¨

cute little sign-off: this was perl v5.40.1, dated 2026-02-28, and it's the SNMP::Info::LLDP(3pm) page. go map some topology, you've got this πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from