def __init__(self, record, local_address=None):
"""Given a supported neighbor record, tries to identify the remote
device and port among the ones registered in NAV's database.
If a neighbor can be identified, the identified attribute is set to
True. The netbox and interface attributes will represent the
identified items.
:param record: Some namedtuple instance representing the
neighboring record read from the device.
:param local_address: The management IP address used by the local
system. If supplied, will be used to identify
and ignore possible self-loops.
"""
self.record = record
self._invalid_neighbor_ips = list(INVALID_IPS)
if local_address:
self._invalid_neighbor_ips.append(str(local_address))
self.netbox = self.interfaces = None
self.identified = False
self.identify()
评论列表
文章目录