<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">NAME
    Net::SNMP::Mixin::Dot1abLldp - mixin class for the Link Layer Discovery
    Protocol

SYNOPSIS
    A Net::SNMP mixin class for LLDP (Link Layer Discovery Protocol) based
    info.

      use Net::SNMP;
      use Net::SNMP::Mixin;

      #...

      my $session = Net::SNMP-&gt;session( -hostname =&gt; 'foo.bar.com' );

      $session-&gt;mixer('Net::SNMP::Mixin::Dot1abLldp');
      $session-&gt;init_mixins;
      snmp_dispatcher();
      $session-&gt;init_ok();
      die $session-&gt;errors if $session-&gt;errors;

      printf "Local ChassisID: %s\n",
        $session-&gt;get_lldp_local_system_data-&gt;{lldpLocChassisId};

      $lldp_loc_port_tbl = $session-&gt;get_lldp_loc_port_table;
      $lldp_rem_tbl      = $session-&gt;get_lldp_rem_table;

      foreach $lport ( keys %$lldp_rem_tbl ) {
        foreach $idx ( keys %{ $lldp_rem_tbl-&gt;{$lport} } ) {
          my $lldpRemSysName   = $lldp_rem_tbl-&gt;{$lport}{$idx}{lldpRemSysName};
          my $lldpRemPortId    = $lldp_rem_tbl-&gt;{$lport}{$idx}{lldpRemPortId};
          my $lldpRemPortDesc  = $lldp_rem_tbl-&gt;{$lport}{$idx}{lldpRemPortDesc};
          my $lldpRemChassisId = $lldp_rem_tbl-&gt;{$lport}{$idx}{lldpRemChassisId};
          my $ldesc            = $lldp_loc_port_tbl-&gt;{$lport}{lldpLocPortDesc};

          printf "$lport:$ldesc =&gt; $lldpRemSysName:$lldpRemPortId:$lldpRemPortDesc:$lldpRemChassisId\n";
        }
      }

DESCRIPTION
    With this mixin it's simple to explore the Layer-2 topologie of the
    network.

    The LLDP (Link Layer Discovery Protocol) is an IEEE (Draft?) standard
    for vendor-independent Layer-2 discovery, similar to the proprietary CDP
    (Cisco Discovery Protocol) from Cisco. It's defined in the IEEE 802.1AB
    documents, therefore the name of this module.

    This mixin reads data from the lldpLocalSystemData, lldpLocPortTable and
    the lldpRemTable out of the LLDP-MIB. At least these values are in the
    mandatory set of the LLDP-MIB.

MIXIN METHODS
  OBJ-&gt;get_lldp_local_system_data()
    Returns the LLDP lldpLocalSystemData group as a hash reference:

      {
        lldpLocChassisIdSubtype =&gt; Integer,
        lldpLocChassisId        =&gt; OCTET_STRING,
        lldpLocSysName          =&gt; OCTET_STRING,
        lldpLocSysDesc          =&gt; OCTET_STRING,
        lldpLocSysCapSupported  =&gt; BITS,
        lldpLocSysCapEnabled    =&gt; BITS,
      }

  OBJ-&gt;get_lldp_loc_port_table()
    Returns the LLDP lldp_loc_port_table as a hash reference. The table is
    indexed by the LLDP local port numbers:

      {
         lldpLocPortNum =&gt; {
            lldpLocPortIdSubtype =&gt; INTEGER,
            lldpLocPortId        =&gt; OCTET_STRING,
            lldpLocPortDesc      =&gt; OCTET_STRING,
         }
      }

    The LLDP portnumber isn't necessarily the ifIndex of the switch. See the
    TEXTUAL-CONVENTION from the LLDP-MIB:

      "A port number has no mandatory relationship to an
      InterfaceIndex object (of the interfaces MIB, IETF RFC 2863).
      If the LLDP agent is a IEEE 802.1D, IEEE 802.1Q bridge, the
      LldpPortNumber will have the same value as the dot1dBasePort
      object (defined in IETF RFC 1493) associated corresponding
      bridge port.  If the system hosting LLDP agent is not an
      IEEE 802.1D or an IEEE 802.1Q bridge, the LldpPortNumber
      will have the same value as the corresponding interface's
      InterfaceIndex object."

    See also the Net::SNMP::Mixin::Dot1dBase for a mixin to get the mapping
    between the ifIndexes and the dot1dBasePorts if needed.

  OBJ-&gt;get_lldp_rem_table()
    Returns the LLDP lldp_rem_table as a hash reference. The table is
    indexed by the LLDP local port numbers on which the remote system
    information is received and an index for multiple neighbors on one port:

      {
        lldpRemLocalPortNum =&gt; {
          lldpRemIndex =&gt; {
            lldpRemChassisIdSubtype =&gt; INTEGER,
            lldpRemChassisId        =&gt; OCTET_STRING,
            lldpRemPortIdSubtype    =&gt; INTEGER,
            lldpRemPortId           =&gt; OCTET_STRING,
            lldpRemPortDesc         =&gt; OCTET_STRING,
            lldpRemSysName          =&gt; OCTET_STRING,
            lldpRemSysDesc          =&gt; OCTET_STRING,
            lldpRemSysCapSupported  =&gt; BITS,
            lldpRemSysCapEnabled    =&gt; BITS,
          }
        }
      }

INITIALIZATION
  OBJ-&gt;_init($reload)
    Fetch the LLDP related snmp values from the host. Don't call this method
    direct!

PRIVATE METHODS
    Only for developers or maintainers.

  _fetch_lldp_local_system_data($session)
    Fetch the local system data from the lldpMIB once during object
    initialization.

  _lldp_local_system_data_cb($session)
    The callback for _fetch_lldp_local_system_data.

  _fetch_lldp_loc_port_tbl($session)
    Fetch the lldpLocPortTable once during object initialization.

  _lldp_loc_port_tbl_cb($session)
    The callback for _fetch_lldp_loc_port_tbl_cb().

  _fetch_lldp_rem_tbl($session)
    Fetch the lldpRemTable once during object initialization.

  _lldp_rem_tbl_cb($session)
    The callback for _fetch_lldp_rem_tbl_cb().

SEE ALSO
    Net::SNMP::Mixin::Dot1dBase

REQUIREMENTS
    Net::SNMP, Net::SNMP::Mixin

BUGS, PATCHES &amp; FIXES
    There are no known bugs at the time of this release. However, if you
    spot a bug or are experiencing difficulties that are not explained
    within the POD documentation, please submit a bug to the RT system (see
    link below). However, it would help greatly if you are able to pinpoint
    problems or even supply a patch.

    Fixes are dependant upon their severity and my availablity. Should a fix
    not be forthcoming, please feel free to (politely) remind me by sending
    an email to gaissmai@cpan.org .

      RT: http://rt.cpan.org/Public/Dist/Display.html?Name=Net-SNMP-Mixin-Dot1abLldp

AUTHOR
    Karl Gaissmaier &lt;karl.gaissmaier at uni-ulm.de&gt;

COPYRIGHT &amp; LICENSE
    Copyright 2008-2016 Karl Gaissmaier, all rights reserved.

    This program is free software; you can redistribute it and/or modify it
    under the same terms as Perl itself.

</pre></body></html>