/** * Match by UDP. * @param match * @return the result of match. */ public boolean mathcUdp(UdpMatch match) { return (match == null) || (match.getUdpSourcePort() == null && match.getUdpDestinationPort() == null); }
if (other.getUdpDestinationPort() != null) { return false; } else if(!_udpDestinationPort.equals(other.getUdpDestinationPort())) { return false; if (other.getUdpSourcePort() != null) { return false; } else if(!_udpSourcePort.equals(other.getUdpSourcePort())) { return false; if (!e.getValue().equals(other.getAugmentation(e.getKey()))) { return false;
private static boolean convertL4UdpDstMatch(final MatchV10Builder matchBuilder, final UdpMatch udpMatch) { if (udpMatch.getUdpDestinationPort() != null) { matchBuilder.setTpDst(udpMatch.getUdpDestinationPort().getValue()); return false; } return true; }
private static boolean convertL4UdpSrcMatch(final MatchV10Builder matchBuilder, final UdpMatch udpMatch) { if (udpMatch.getUdpSourcePort() != null) { matchBuilder.setTpSrc(udpMatch.getUdpSourcePort().getValue()); return false; } return true; }
public UdpMatchBuilder(UdpMatch base) { this._udpDestinationPort = base.getUdpDestinationPort(); this._udpSourcePort = base.getUdpSourcePort(); if (base instanceof UdpMatchImpl) { UdpMatchImpl _impl = (UdpMatchImpl) base; this.augmentation = new HashMap<>(_impl.augmentation); } }
private static void fillTransportLayer(Match target, UdpMatch source) { PortNumber udpSourcePort = source.getUdpSourcePort(); if (udpSourcePort != null) { Integer udpSourcePortValue = udpSourcePort.getValue(); if (udpSourcePortValue != null) { target.setField(TP_SRC, udpSourcePortValue.shortValue()); } } PortNumber udpDestPort = source.getUdpDestinationPort(); if (udpDestPort != null) { Integer udpDestPortValue = udpDestPort.getValue(); if (udpDestPortValue != null) { target.setField(TP_DST, udpDestPortValue.shortValue()); } } target.setField(NW_PROTO, UDP); }
private Set<UdpMatch> createUdpMatches(UdpMatch udpMatch, Set<Long> sPorts, Set<Long> dPorts) { Set<UdpMatch> udpMatches = new HashSet<>(); if (!sPorts.isEmpty() && dPorts.isEmpty()) { for (Long srcPort : sPorts) { equalOrNotSetValidation(udpMatch.getUdpSourcePort(), srcPort.longValue()); udpMatches .add(new UdpMatchBuilder(udpMatch).setUdpSourcePort(new PortNumber(srcPort.intValue())).build()); } } else if (sPorts.isEmpty() && !dPorts.isEmpty()) { for (Long dstPort : dPorts) { equalOrNotSetValidation(udpMatch.getUdpDestinationPort(), dstPort.longValue()); udpMatches.add(new UdpMatchBuilder(udpMatch).setUdpDestinationPort(new PortNumber(dstPort.intValue())) .build()); } } else if (!sPorts.isEmpty() && !dPorts.isEmpty()) { for (Long srcPort : sPorts) { for (Long dstPort : dPorts) { equalOrNotSetValidation(udpMatch.getUdpSourcePort(), srcPort.longValue()); equalOrNotSetValidation(udpMatch.getUdpDestinationPort(), dstPort.longValue()); udpMatches.add(new UdpMatchBuilder(udpMatch).setUdpSourcePort(new PortNumber(srcPort.intValue())) .setUdpDestinationPort(new PortNumber(dstPort.intValue())) .build()); } } } return udpMatches; }
List<MatchEntry> result = new ArrayList<>(); if (source.getUdpSourcePort() != null) { MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder(); matchEntryBuilder.setOxmClass(OpenflowBasicClass.class); udpSrcBuilder.setPort(source.getUdpSourcePort()); udpSrcCaseBuilder.setUdpSrc(udpSrcBuilder.build()); matchEntryBuilder.setMatchEntryValue(udpSrcCaseBuilder.build()); if (source.getUdpDestinationPort() != null) { MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder(); matchEntryBuilder.setOxmClass(OpenflowBasicClass.class); udpDstBuilder.setPort(source.getUdpDestinationPort()); udpDstCaseBuilder.setUdpDst(udpDstBuilder.build()); matchEntryBuilder.setMatchEntryValue(udpDstCaseBuilder.build());