/** * Equals does not take direction of connection into account id1 -> id2 and id2 -> id1 are equal */ @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final BGPSessionId bGPSessionId = (BGPSessionId) o; if (!this.from.equals(bGPSessionId.from) && !this.from.equals(bGPSessionId.to)) { return false; } if (!this.to.equals(bGPSessionId.to) && !this.to.equals(bGPSessionId.from)) { return false; } return true; }
return false; } else if(!_ipv4Address.equals(other._ipv4Address)) { return false;
if (other.arpRequestSourceIp != null) return false; } else if (!arpRequestSourceIp.equals(other.arpRequestSourceIp)) return false; if (externalNetworkBridgeDpid == null) { if (other.gatewayIpAddress != null) return false; } else if (!gatewayIpAddress.equals(other.gatewayIpAddress)) return false; if (periodicRefresh != other.periodicRefresh)
return false; } else if(!_ipv4Address.equals(other._ipv4Address)) { return false;
return false; } else if(!_routerId.equals(other.getRouterId())) { return false;
/** * Search the Operational Datastore for a specific OvsdbNode. * @param dataBroker The dataBroker instance to create transactions * @param uni The UNI's data * @return The Optional OvsdbNode */ public static Optional<Node> findOvsdbNode(DataBroker dataBroker, UniAugmentation uni) { final List<Node> ovsdbNodes = getOvsdbNodes(dataBroker); Optional<Node> optionalOvsdb; if (!ovsdbNodes.isEmpty()) { for (final Node ovsdbNode : ovsdbNodes) { final OvsdbNodeAugmentation ovsdbNodeAugmentation = ovsdbNode .getAugmentation(OvsdbNodeAugmentation.class); if (ovsdbNodeAugmentation.getConnectionInfo() .getRemoteIp() .getIpv4Address() .equals(uni.getIpAddress().getIpv4Address())) { LOG.info("Found ovsdb node"); optionalOvsdb = Optional.of(ovsdbNode); return optionalOvsdb; } } } return Optional.absent(); }
return false; } else if(!_routerId.equals(other.getRouterId())) { return false;
public void writeFlow(Ipv4Address srcIp, Ipv4Address dstIp, NodeConnectorRef dstNodeConnectorRef, Long meterId) { LOG.info("in flowManager.addFlow"); if(srcIp != null && dstIp.equals(srcIp)) { LOG.info("In addIpv4ToIpv4Flow: No flows added. Source and Destination mac are same."); return; } TableKey flowTableKey = new TableKey(flowTableId); InstanceIdentifier<Flow> flowPath = buildFlowPath(createIpv4Match(srcIp, dstIp), dstNodeConnectorRef, flowTableKey); FlowId flowId = flowPath.firstKeyOf(Flow.class).getId(); LOG.info("flowPath: " + flowPath.toString()); LOG.info("flowId: " + flowId.toString()); Flow flowBody = createIpv4ToIpv4Flow(flowId, flowTableKey.getId(), DEFAULT_PRIORITY, srcIp, dstIp, meterId, dstNodeConnectorRef); LOG.info("flowBody: " + flowBody.toString()); WriteTransaction writeTransaction = dataBroker.newWriteOnlyTransaction(); writeTransaction.put(LogicalDatastoreType.CONFIGURATION, flowPath, flowBody, true); try { writeTransaction.submit().checkedGet(); } catch (TransactionCommitFailedException e) { LOG.error("Transaction failed: {}", e.toString()); } LOG.info("Transaction succeed"); }
public ServiceFunctionForwarder getExistingSFF(String ipAddress) { ServiceFunctionForwarders existingSffs = mdsalUtils.read(LogicalDatastoreType.CONFIGURATION, sffIid); if (existingSffs != null && existingSffs.getServiceFunctionForwarder() != null && !existingSffs.getServiceFunctionForwarder().isEmpty()) { List<ServiceFunctionForwarder> existingSffList = existingSffs.getServiceFunctionForwarder(); for (ServiceFunctionForwarder sff : existingSffList) { if (sff.getIpMgmtAddress().getIpv4Address().equals(new Ipv4Address(ipAddress))) { return sff; } } } return null; }
if (ipAddress != null && ipAddress.getIpv4Address().equals(sfcNshHeader.getNshTunIpDst())) { Integer newPort = returnOfPortFromNodeConnector(tunPort); outputAction = FlowUtils.createActionResubmit(newPort, policyManager.getTABLEID_SFC_EGRESS());