/** * Comparation by Ethernet */ @Override public boolean areObjectsEqual(Match statsMatch, Match storedMatch) { if (storedMatch == null) return false; if (storedMatch.getEthernetMatch() == null) { if (statsMatch.getEthernetMatch() != null) { return false; } } else if (!MatchComparatorHelper.ethernetMatchEquals(statsMatch.getEthernetMatch(), storedMatch.getEthernetMatch())) { return false; } return true; } };
final int prime = 31; int result = 1; result = prime * result + ((m.getEthernetMatch() == null) ? 0 : m.getEthernetMatch().hashCode()); result = prime * result + ((m.getIcmpv4Match() == null) ? 0 : m.getIcmpv4Match().hashCode()); result = prime * result + ((m.getIcmpv6Match() == null) ? 0 : m.getIcmpv6Match().hashCode());
if (match.getEthernetMatch() != null) { if (first) { first = false; builder.append(MATCH_SEPARATOR); builder.append(match.getEthernetMatch());
if (!Objects.equals(m1.getMetadata(), m2.getMetadata())) { return false; } if (!Objects.equals(m1.getTunnel(), m2.getTunnel())) { return false; } if (!Objects.equals(m1.getEthernetMatch(), m2.getEthernetMatch())) { return false; } if (!Objects.equals(m1.getVlanMatch(), m2.getVlanMatch())) { return false; } if (!Objects.equals(m1.getIpMatch(), m2.getIpMatch())) { return false; }
@Override protected boolean doEquivalent(Match a, Match b) { if (!Objects.equals(a.getEthernetMatch(), b.getEthernetMatch())) { return false;
if (other.getEthernetMatch() != null) { return false; } else if(!_ethernetMatch.equals(other.getEthernetMatch())) { return false;
String destination = flowBuilder.getMatch().getEthernetMatch().getEthernetDestination().getAddress().getValue(); String source = flowBuilder.getMatch().getEthernetMatch().getEthernetSource().getAddress().getValue(); String logFlowId = L2_Rule_NAME + source + destination; if (table != null) {
public MatchBuilder(Match base) { this._ethernetMatch = base.getEthernetMatch(); this._icmpv4Match = base.getIcmpv4Match(); this._icmpv6Match = base.getIcmpv6Match(); this._inPhyPort = base.getInPhyPort(); this._inPort = base.getInPort(); this._ipMatch = base.getIpMatch(); this._layer3Match = base.getLayer3Match(); this._layer4Match = base.getLayer4Match(); this._metadata = base.getMetadata(); this._protocolMatchFields = base.getProtocolMatchFields(); this._tcpFlagMatch = base.getTcpFlagMatch(); this._tunnel = base.getTunnel(); this._vlanMatch = base.getVlanMatch(); if (base instanceof MatchImpl) { MatchImpl _impl = (MatchImpl) base; this.augmentation = new HashMap<>(_impl.augmentation); } }
return; final String srcMacAddress = flowRemoved.getMatch().getEthernetMatch() .getEthernetSource().getAddress().getValue().toUpperCase(); int portTag = MetaDataUtil.getLportFromMetadata(metadata).intValue();
if (storedFlow.getEthernetMatch() == null) { if (statsFlow.getEthernetMatch() != null) { return false; } else if(!ethernetMatchEquals(statsFlow.getEthernetMatch(),storedFlow.getEthernetMatch())) { return false;
/** * Verify the condition of the flow match. * * @return {@code true} if the flow match is valid. * {@code false} otherwise. */ private boolean isMatchValid() { boolean result = (flowMatch == null); if (!result) { result = (flowMatch.getInPhyPort() == null && flowMatch.getMetadata() == null && flowMatch.getTunnel() == null && flowMatch.getEthernetMatch() == null && flowMatch.getVlanMatch() == null && flowMatch.getIpMatch() == null && flowMatch.getLayer3Match() == null && flowMatch.getLayer4Match() == null && flowMatch.getIcmpv4Match() == null && flowMatch.getIcmpv6Match() == null && flowMatch.getProtocolMatchFields() == null && flowMatch.getTcpFlagsMatch() == null); } return result; }
/** * @param match is the original fields should be matched. * @param matchFields are the target fields should be compared. * @return the result of match. */ public boolean match(Match match, MatchFields matchFields) { log.info("Flow Entry Matching Start"); return (match == null) || ((matchInPort(match.getInPort(), matchFields) && matchInPhyPort(match.getInPhyPort(), matchFields) && matchIp(match.getIpMatch(), matchFields) && matchVlan(match.getVlanMatch(), matchFields) && matchTunnel(match.getTunnel(), matchFields) && matchMetadata(match.getMetadata(), matchFields) && matchEthernet(match.getEthernetMatch(), matchFields) && matchLayer3(match.getLayer3Match(), matchFields) && matchLayer4(match.getLayer4Match(), matchFields) && matchIcmpv4Match(match.getIcmpv4Match(), matchFields) && matchIcmpv6Match(match.getIcmpv6Match(), matchFields) && matchProtocolMatchFields(match.getProtocolMatchFields(), matchFields) && matchTcpFlag(match.getTcpFlagsMatch(), matchFields))); }