@Override public boolean equals(Object o) { if (this == o) { return true; } if (o instanceof OpenstackFloatingIP) { OpenstackFloatingIP that = (OpenstackFloatingIP) o; return this.status.equals(that.status) && this.id.equals(that.id) && this.tenantId.equals(that.tenantId) && this.networkId.equals(that.networkId) && this.fixedIpAddress.equals(that.fixedIpAddress) && this.floatingIpAddress.equals(that.floatingIpAddress) && this.portId.equals(that.portId) && this.routerId.equals(that.routerId); } return false; }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o instanceof OpenstackFloatingIP) { OpenstackFloatingIP that = (OpenstackFloatingIP) o; return this.status.equals(that.status) && this.id.equals(that.id) && this.tenantId.equals(that.tenantId) && this.networkId.equals(that.networkId) && this.fixedIpAddress.equals(that.fixedIpAddress) && this.floatingIpAddress.equals(that.floatingIpAddress) && this.portId.equals(that.portId) && this.routerId.equals(that.routerId); } return false; }
/** * Checks whether to form adjacency or not. * * @return true indicates form adjacency, else false */ private boolean formAdjacencyOrNot() { boolean formAdjacency = false; if (ospfInterface.interfaceType() == OspfInterfaceType.POINT_TO_POINT.value()) { formAdjacency = true; } else if (ospfInterface.interfaceType() == OspfInterfaceType.BROADCAST.value()) { if (ospfInterface.ipAddress().equals(this.neighborDr) || ospfInterface.ipAddress().equals(this.neighborBdr)) { formAdjacency = true; } else if (neighborBdr.equals(neighborIpAddr) || neighborDr.equals(neighborIpAddr)) { formAdjacency = true; } } log.debug("FormAdjacencyOrNot - neighborDR: {}, neighborBDR: {}, neighborIPAddr: {}, formAdjacencyOrNot {}", neighborDr, neighborBdr, neighborIpAddr, formAdjacency); return formAdjacency; }
private void getLinksToDelete(Set<Ip4Address> list, Ip4Address value, OspfArea ospfArea) { Iterator iterator = list.iterator(); while (iterator.hasNext()) { Ip4Address secondValue = (Ip4Address) iterator.next(); if (!value.equals("0.0.0.0")) { if ((!value.equals(secondValue))) { if ((!secondValue.equals(ospfArea.routerId()))) { String key = "link:" + value.toString() + "-" + secondValue.toString(); String key1 = "link:" + secondValue.toString() + "-" + value.toString(); LinkInformation linkDetails = getLinkInformation(key); LinkInformation linkDetailsOther = getLinkInformation(key1); linkInformationMapForPointToPoint.put(key, linkDetails); linkInformationMapForPointToPoint.put(key1, linkDetailsOther); } } } } }
for (OspfLsaLink link : ospfLsaLinkList) { if (link.linkType == 1 || link.linkType == 2) { if ((routerLsa.advertisingRouter().equals(ospfArea.routerId())) || (link.equals(ospfArea.routerId()))) { log.debug("OspfInterface information will not display in web ");
for (OspfLsaLink link : ospfLsaLinkList) { if (link.linkType == 1 || link.linkType == 2) { if ((routerLsa.advertisingRouter().equals(ospfArea.routerId())) || (link.equals(ospfArea.routerId()))) { log.debug("OspfInterface information will not display in web ");
private void constructDeviceForBroadCastTopology(OspfArea ospfArea) { for (Map.Entry<Ip4Address, List<Ip4Address>> entry : networkLsaMap.entrySet()) { Ip4Address key = entry.getKey(); DeviceInformation deviceInformationForDr = createDeviceInformation(false, key, key, key, key, ospfArea.areaId(), true); String dr = "device:" + key; setDeviceInformationMap(dr, deviceInformationForDr); List<Ip4Address> value = entry.getValue(); for (Ip4Address connectedRouter : value) { if (!connectedRouter.equals(ospfArea.routerId())) { DeviceInformation deviceInformationAttachedRouters = createDeviceInformation(false, connectedRouter, key, connectedRouter, key, ospfArea.areaId(), false); String attachedRouters = "device:" + connectedRouter; setDeviceInformationMap(attachedRouters, deviceInformationAttachedRouters); String linkIdKey = "linkId:" + key + "-" + connectedRouter; addLocalLink(linkIdKey, key, key, connectedRouter, true, false); } } } }
if (ipAddress != null && !ipAddress.equals(IsisConstants.DEFAULTIP)) { isisInterface.setInterfaceIpAddress(ipAddress); } else {
Ip4Address drToReplace = null; for (Ip4Address drIp : drList) { if (!drIp.equals(linkStateId)) { if (OspfUtil.sameNetwork(drIp, linkStateId, networkLsa.networkMask())) { drToReplace = drIp;
if (interfaceIp.equals(OspfUtil.DEFAULTIP)) { return null;
Ip4Address linkData = Ip4Address.valueOf(ospfLsaLink.linkData()); if (ospfLsaLink.linkType() == 1) { if ((advertisingRouterId.equals(ospfArea.routerId())) || (linkId.equals(ospfArea.routerId()))) { if (!advertisingRouterId.equals(ospfArea.routerId())) { DeviceInformation deviceInformationPointToPoint = createDeviceInformation(false, linkId, linkId, advertisingRouterId, linkData,
if (!header.sourceIp().equals(ipAddress()) && !header.routerId().equals( ospfArea.routerId())) { return false; if (!((OspfPacketHeader) ospfMessage).areaId().equals(ospfArea.areaId())) { log.debug("Received ospf packets are from different area than our Area ID. " + "Received Area ID {}, Our AreaId {} ", if (((OspfPacketHeader) ospfMessage).areaId().equals(Ip4Address.valueOf("0.0.0.0"))) { log.debug("ABR should receive packets from backbone 0.0.0.0 as we are not acting as " + "ABR we are rejecting the ospf packet");
if (recLsa.advertisingRouter().equals((String) neighborIP)) { continue;
router.setRouterId(nbr.neighborId()); router.setRouterPriority(nbr.routerPriority()); if (nbr.neighborDr().equals(nbr.neighborIpAddr()) || electedDr.getIpAddress().equals(nbr.neighborIpAddr())) { router.setIsDr(true); } else if (nbr.neighborBdr().equals(nbr.neighborIpAddr())) { router.setIsBdr(true); router.setRouterId(ospfArea.routerId()); router.setRouterPriority(routerPriority()); if (dr().equals(ipAddress()) || electedDr.getIpAddress().equals(ipAddress())) { router.setIsDr(true); } else if (bdr().equals(ipAddress()) && !dr().equals(ipAddress())) { router.setIsBdr(true);
setDr(electedDr.getIpAddress()); if (electedBdr.getIpAddress().equals(ipAddress()) && !electedBdr.getIpAddress().equals(currentBdr)) { setState(OspfInterfaceState.BDR); if (electedDr.getIpAddress().equals(ipAddress()) && !electedDr.getIpAddress().equals(currentDr)) { setState(OspfInterfaceState.DR); if (electedBdr.getIpAddress().equals(ipAddress()) && !electedBdr.getIpAddress().equals(currentBdr)) { setState(OspfInterfaceState.BDR); ospfArea.refreshArea(this); if (electedDr.getIpAddress().equals(ipAddress()) && !electedDr.getIpAddress().equals(currentDr)) { setState(OspfInterfaceState.DR);
MacAddress srcMac = MacAddress.valueOf(arp.getSenderHardwareAddress()); OpenstackPortInfo portInfo = openstackPortInfoCollection.stream() .filter(p -> p.ip().equals(sourceIp) && p.mac().equals(srcMac)).findFirst().orElse(null); IpAddress targetIp = Ip4Address.valueOf(arp.getTargetProtocolAddress());
while (iter.hasNext()) { ospfInterface = (OspfInterfaceImpl) iter.next(); if (ospfInterface.ipAddress().equals(interfaceIp)) { break;
if (nextHopAddress.equals(bgpSession.localInfo().ip4Address())) {