use of org.openkilda.model.FlowEndpoint in project open-kilda by telstra.
the class SpeakerFlowSegmentRequestBuilderTest method verifyReverseEgressRequest.
private void verifyReverseEgressRequest(Flow flow, FlowSegmentRequest rawRequest) {
FlowPath path = Objects.requireNonNull(flow.getReversePath());
EgressFlowSegmentRequest request = verifyCommonEgressRequest(flow, path, rawRequest);
FlowEndpoint expectedEndpoint = new FlowEndpoint(flow.getSrcSwitchId(), flow.getSrcPort(), flow.getSrcVlan());
assertEquals(expectedEndpoint, request.getEndpoint());
FlowEndpoint expectedIngressEndpoint = new FlowEndpoint(flow.getDestSwitchId(), flow.getDestPort(), flow.getDestVlan());
assertEquals(expectedIngressEndpoint, request.getIngressEndpoint());
}
use of org.openkilda.model.FlowEndpoint in project open-kilda by telstra.
the class SpeakerFlowSegmentRequestBuilderTest method verifyReverseOneSwitchRequest.
private void verifyReverseOneSwitchRequest(Flow flow, FlowSegmentRequest rawRequest) {
FlowPath path = Objects.requireNonNull(flow.getReversePath());
OneSwitchFlowRequest request = verifyCommonOneSwitchRequest(flow, path, rawRequest);
assertEquals(new FlowEndpoint(flow.getDestSwitchId(), flow.getDestPort(), flow.getDestVlan()), request.getEndpoint());
assertEquals(new FlowEndpoint(flow.getSrcSwitchId(), flow.getSrcPort(), flow.getSrcVlan()), request.getEgressEndpoint());
}
use of org.openkilda.model.FlowEndpoint in project open-kilda by telstra.
the class SpeakerFlowSegmentRequestBuilderTest method verifyForwardOneSwitchRequest.
private void verifyForwardOneSwitchRequest(Flow flow, FlowSegmentRequest rawRequest) {
FlowPath path = Objects.requireNonNull(flow.getForwardPath());
OneSwitchFlowRequest request = verifyCommonOneSwitchRequest(flow, path, rawRequest);
assertEquals(new FlowEndpoint(flow.getSrcSwitchId(), flow.getSrcPort(), flow.getSrcVlan()), request.getEndpoint());
assertEquals(new FlowEndpoint(flow.getDestSwitchId(), flow.getDestPort(), flow.getDestVlan()), request.getEgressEndpoint());
}
use of org.openkilda.model.FlowEndpoint in project open-kilda by telstra.
the class SpeakerFlowSegmentRequestBuilderTest method verifyForwardIngressRequest.
private IngressFlowSegmentRequest verifyForwardIngressRequest(Flow flow, FlowSegmentRequest rawRequest) {
FlowPath path = Objects.requireNonNull(flow.getForwardPath());
IngressFlowSegmentRequest request = verifyCommonIngressRequest(flow, path, rawRequest);
assertEquals(flow.getSrcSwitchId(), request.getSwitchId());
FlowEndpoint endpoint = new FlowEndpoint(flow.getSrcSwitchId(), flow.getSrcPort(), flow.getSrcVlan());
assertEquals(endpoint, request.getEndpoint());
return request;
}
use of org.openkilda.model.FlowEndpoint in project open-kilda by telstra.
the class IngressFlowModFactory method makeDoubleVlanForwardMessage.
/**
* Make rule to match inner VLAN tag and forward in in ISL (or out port in case one-switch flow).
*/
public OFFlowMod makeDoubleVlanForwardMessage(EffectiveIds effectiveIds) {
FlowEndpoint endpoint = command.getEndpoint();
RoutingMetadata metadata = RoutingMetadata.builder().outerVlanId(endpoint.getOuterVlanId()).build(switchFeatures);
OFFlowMod.Builder builder = flowModBuilderFactory.makeBuilder(of, TableId.of(SwitchManager.INGRESS_TABLE_ID), 10).setMatch(of.buildMatch().setExact(MatchField.IN_PORT, OFPort.of(endpoint.getPortNumber())).setExact(MatchField.VLAN_VID, OFVlanVidMatch.ofVlan(endpoint.getInnerVlanId())).setMasked(MatchField.METADATA, OFMetadata.of(metadata.getValue()), OFMetadata.of(metadata.getMask())).build());
return makeForwardMessage(builder, effectiveIds, FlowEndpoint.makeVlanStack(endpoint.getInnerVlanId()));
}
Aggregations