@Override protected Integer featureValueOf(Flow flow) { return flow.getDstPort(); } }
/** * Creates a return {@link Flow} for the input {@param forwardFlow}. Swaps the source/destination * IPs/ports, and sets the ingress node/vrf/interface. */ static Flow returnFlow( Flow forwardFlow, String returnIngressNode, @Nullable String returnIngressVrf, @Nullable String returnIngressIface) { checkArgument( returnIngressVrf == null ^ returnIngressIface == null, "Either returnIngressVrf or returnIngressIface required, but not both"); return forwardFlow .toBuilder() .setDstIp(forwardFlow.getSrcIp()) .setDstPort(forwardFlow.getSrcPort()) .setSrcIp(forwardFlow.getDstIp()) .setSrcPort(forwardFlow.getDstPort()) .setIngressNode(returnIngressNode) .setIngressVrf(returnIngressVrf) .setIngressInterface(returnIngressIface) .build(); }
return false; if (!_dstPorts.isEmpty() && !rangesContain(_dstPorts, flow.getDstPort())) { return false; if (!_notDstPorts.isEmpty() && rangesContain(_notDstPorts, flow.getDstPort())) { return false; match = true; Integer dstPort = dstProtocol.getPort(); if (dstPort != null && !dstPort.equals(flow.getDstPort())) { match = false; match = true; Integer dstPort = notDstProtocol.getPort(); if (dstPort != null && !dstPort.equals(flow.getDstPort())) { match = false; || rangesContain(_srcOrDstPorts, flow.getDstPort()))) { return false; match = true; Integer port = protocol.getPort(); if (port != null && !port.equals(flow.getDstPort()) && !port.equals(flow.getSrcPort())) { match = false;
fb.setSrcIp(forwardFlow.getDstIp()); fb.setDstIp(forwardFlow.getSrcIp()); fb.setSrcPort(forwardFlow.getDstPort()); fb.setDstPort(forwardFlow.getSrcPort()); Flow backwardFlow = fb.build();
match5Tuple( newTransformedFlow.getDstIp(), newTransformedFlow.getDstPort(), newTransformedFlow.getSrcIp(), newTransformedFlow.getSrcPort(),
&& !rangesContain(headerSpace.getDstPorts(), _flow.getDstPort())) { return false; && rangesContain(headerSpace.getNotDstPorts(), _flow.getDstPort())) { return false; match = true; Integer dstPort = dstProtocol.getPort(); if (dstPort != null && !dstPort.equals(_flow.getDstPort())) { match = false; match = true; Integer dstPort = notDstProtocol.getPort(); if (dstPort != null && !dstPort.equals(_flow.getDstPort())) { match = false; || rangesContain(headerSpace.getSrcOrDstPorts(), _flow.getDstPort()))) { return false; Integer port = protocol.getPort(); if (port != null && !port.equals(_flow.getDstPort()) && !port.equals(_flow.getSrcPort())) { match = false;