if (isStandard)
lastLldpTime = System.currentTimeMillis();
else
lastBddpTime = System.currentTimeMillis();
LinkInfo newLinkInfo = new LinkInfo(firstSeenTime, lastLldpTime,
lastBddpTime);
addOrUpdateLink(lt, newLinkInfo);
// Check if reverse link exists.
// If it doesn't exist and if the forward link was seen
// first seen within a small interval, send probe on the
// reverse link.
newLinkInfo = links.get(lt);
if (newLinkInfo != null && isStandard && isReverse == false) {
Link reverseLink = new Link(lt.getDst(), lt.getDstPort(),
lt.getSrc(), lt.getSrcPort());
LinkInfo reverseInfo = links.get(reverseLink);
if (reverseInfo == null) {
// the reverse link does not exist.
if (newLinkInfo.getFirstSeenTime() > System.currentTimeMillis()
- LINK_TIMEOUT) {
this.sendDiscoveryMessage(lt.getDst(), lt.getDstPort(),
isStandard, true);
}
}
}
// If the received packet is a BDDP packet, then create a reverse BDDP
// link as well.
if (!isStandard) {
Link reverseLink = new Link(lt.getDst(), lt.getDstPort(),
lt.getSrc(), lt.getSrcPort());
// srcPortState and dstPort state are reversed.
LinkInfo reverseInfo = new LinkInfo(firstSeenTime, lastLldpTime,
lastBddpTime);
addOrUpdateLink(reverseLink, reverseInfo);
}