PalisadoesFoundation / switchmap-ng

A Python 3 inventory system that tabulates the status of network ports.
Apache License 2.0
16 stars 7 forks source link

Make LLDP detection work for routers and switches. #64

Closed palisadoes closed 7 years ago

palisadoes commented 7 years ago

The MIB is indexed differently depending on whether the device views itself as a router or switch. The failsafe determination of router or switch must be done without reference to the LLDP capabilities string as this may not be adhered to by all manufacturers.

https://www.iana.org/assignments/ianaiftype-mib/ianaiftype-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.