public SctpMatchBuilder(SctpMatch base) { this._sctpDestinationPort = base.getSctpDestinationPort(); this._sctpSourcePort = base.getSctpSourcePort(); if (base instanceof SctpMatchImpl) { SctpMatchImpl _impl = (SctpMatchImpl) base; this.augmentation = new HashMap<>(_impl.augmentation); } }
/** * Match by SCTP. * @param match * @return the result of match. */ public boolean matchSctp(SctpMatch match) { return (match == null) || (match.getSctpSourcePort() == null && match.getSctpDestinationPort() == null); }
if (other.getSctpSourcePort() != null) { return false; } else if(!_sctpSourcePort.equals(other.getSctpSourcePort())) { return false;
private Set<SctpMatch> createSctpMatches(SctpMatch sctpMatch, Set<Long> sPorts, Set<Long> dPorts) { Set<SctpMatch> sctpMatches = new HashSet<>(); if (!sPorts.isEmpty() && dPorts.isEmpty()) { for (Long srcPort : sPorts) { equalOrNotSetValidation(sctpMatch.getSctpSourcePort(), srcPort.longValue()); sctpMatches .add(new SctpMatchBuilder(sctpMatch).setSctpSourcePort(new PortNumber(srcPort.intValue())).build()); } } else if (sPorts.isEmpty() && !dPorts.isEmpty()) { for (Long dstPort : dPorts) { equalOrNotSetValidation(sctpMatch.getSctpDestinationPort(), dstPort.longValue()); sctpMatches.add(new SctpMatchBuilder(sctpMatch) .setSctpDestinationPort(new PortNumber(dstPort.intValue())).build()); } } else if (!sPorts.isEmpty() && !dPorts.isEmpty()) { for (Long srcPort : sPorts) { for (Long dstPort : dPorts) { equalOrNotSetValidation(sctpMatch.getSctpSourcePort(), srcPort.longValue()); equalOrNotSetValidation(sctpMatch.getSctpDestinationPort(), dstPort.longValue()); sctpMatches .add(new SctpMatchBuilder(sctpMatch).setSctpSourcePort(new PortNumber(srcPort.intValue())) .setSctpDestinationPort(new PortNumber(dstPort.intValue())) .build()); } } } return sctpMatches; }
private static void fillTransportLayer(Match target, SctpMatch source) { PortNumber sctpSourcePort = source.getSctpSourcePort(); if (sctpSourcePort != null) { Integer sctpSourcePortValue = sctpSourcePort.getValue(); if (sctpSourcePortValue != null) { target.setField(TP_SRC, sctpSourcePortValue.shortValue()); } } PortNumber sctpDestPort = source.getSctpDestinationPort(); if (sctpDestPort != null) { Integer sctpDestPortValue = sctpDestPort.getValue(); if (sctpDestPortValue != null) { target.setField(TP_DST, sctpDestPortValue.shortValue()); } } target.setField(NW_PROTO, CRUDP); }
List<MatchEntry> result = new ArrayList<>(); if (source.getSctpSourcePort() != null) { MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder(); matchEntryBuilder.setOxmClass(OpenflowBasicClass.class); sctpSrcBuilder.setPort(source.getSctpSourcePort()); sctpSrcCaseBuilder.setSctpSrc(sctpSrcBuilder.build()); matchEntryBuilder.setMatchEntryValue(sctpSrcCaseBuilder.build());