@Override protected Integer featureValueOf(Flow flow) { return flow.getSrcPort(); } }
/** * 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(); }
&& !(rangesContain(_srcOrDstPorts, flow.getSrcPort()) || 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; return false; if (!_srcPorts.isEmpty() && !rangesContain(_srcPorts, flow.getSrcPort())) { return false; if (!_notSrcPorts.isEmpty() && rangesContain(_notSrcPorts, flow.getSrcPort())) { return false; match = true; Integer srcPort = srcProtocol.getPort(); if (srcPort != null && !srcPort.equals(flow.getSrcPort())) { match = false; match = true; Integer srcPort = notSrcProtocol.getPort(); if (srcPort != null && !srcPort.equals(flow.getSrcPort())) { match = false;
fb.setDstIp(forwardFlow.getSrcIp()); fb.setSrcPort(forwardFlow.getDstPort()); fb.setDstPort(forwardFlow.getSrcPort()); Flow backwardFlow = fb.build(); traces = tracerouteEngine.computeTraces(ImmutableSet.of(backwardFlow), false);
newTransformedFlow.getDstPort(), newTransformedFlow.getSrcIp(), newTransformedFlow.getSrcPort(), newTransformedFlow.getIpProtocol()), sessionTransformation(inputFlow, newTransformedFlow)));
&& !(rangesContain(headerSpace.getSrcOrDstPorts(), _flow.getSrcPort()) || rangesContain(headerSpace.getSrcOrDstPorts(), _flow.getDstPort()))) { return false; if (port != null && !port.equals(_flow.getDstPort()) && !port.equals(_flow.getSrcPort())) { match = false; && !rangesContain(headerSpace.getSrcPorts(), _flow.getSrcPort())) { return false; && rangesContain(headerSpace.getNotSrcPorts(), _flow.getSrcPort())) { return false; match = true; Integer srcPort = srcProtocol.getPort(); if (srcPort != null && !srcPort.equals(_flow.getSrcPort())) { match = false; match = true; Integer srcPort = notSrcProtocol.getPort(); if (srcPort != null && !srcPort.equals(_flow.getSrcPort())) { match = false;