Search in sources :

Example 6 with IngressFlowSegmentInstallCommand

use of org.openkilda.floodlight.command.flow.ingress.IngressFlowSegmentInstallCommand in project open-kilda by telstra.

the class IngressFlowSegmentInstallFlowModFactoryTest method testMakeSingleVlanForwardMessageVxLanEncoded.

private void testMakeSingleVlanForwardMessageVxLanEncoded(MeterConfig meter) {
    IngressFlowSegmentInstallCommand command = makeCommand(endpointSingleVlan, meter, encapsulationVxLan);
    FlowEndpoint endpoint = command.getEndpoint();
    RoutingMetadata metadata = RoutingMetadata.builder().outerVlanId(endpoint.getOuterVlanId()).build(Collections.emptySet());
    OFFlowAdd expected = makeVxLanForwardingMessage(command, 0, of.buildMatch().setExact(MatchField.IN_PORT, OFPort.of(endpoint.getPortNumber())).setMasked(MatchField.METADATA, OFMetadata.of(metadata.getValue()), OFMetadata.of(metadata.getMask())).build(), getTargetIngressTableId(), Collections.emptyList());
    IngressFlowModFactory factory = makeFactory(command);
    verifyOfMessageEquals(expected, factory.makeSingleVlanForwardMessage(new EffectiveIds(getEffectiveMeterId(command.getMeterConfig()), null)));
}
Also used : IngressFlowSegmentInstallCommand(org.openkilda.floodlight.command.flow.ingress.IngressFlowSegmentInstallCommand) FlowEndpoint(org.openkilda.model.FlowEndpoint) EffectiveIds(org.openkilda.floodlight.model.EffectiveIds) RoutingMetadata(org.openkilda.floodlight.utils.metadata.RoutingMetadata) OFFlowAdd(org.projectfloodlight.openflow.protocol.OFFlowAdd)

Example 7 with IngressFlowSegmentInstallCommand

use of org.openkilda.floodlight.command.flow.ingress.IngressFlowSegmentInstallCommand in project open-kilda by telstra.

the class IngressFlowSegmentInstallFlowModFactoryTest method testMakeOuterOnlyVlanForwardMessageVxLanEncoded.

private void testMakeOuterOnlyVlanForwardMessageVxLanEncoded(MeterConfig meter) {
    IngressFlowSegmentInstallCommand command = makeCommand(endpointSingleVlan, meter, encapsulationVxLan);
    List<OFAction> vlanTransformation = OfAdapter.INSTANCE.makeVlanReplaceActions(of, command.getEndpoint().getVlanStack(), Collections.emptyList());
    OFFlowAdd expected = makeVxLanForwardingMessage(command, 0, OfAdapter.INSTANCE.matchVlanId(of, of.buildMatch(), command.getEndpoint().getOuterVlanId()).setExact(MatchField.IN_PORT, OFPort.of(command.getEndpoint().getPortNumber())).build(), getTargetIngressTableId(), vlanTransformation);
    IngressFlowModFactory factory = makeFactory(command);
    verifyOfMessageEquals(expected, factory.makeOuterOnlyVlanForwardMessage(new EffectiveIds(getEffectiveMeterId(command.getMeterConfig()), null)));
}
Also used : IngressFlowSegmentInstallCommand(org.openkilda.floodlight.command.flow.ingress.IngressFlowSegmentInstallCommand) EffectiveIds(org.openkilda.floodlight.model.EffectiveIds) OFAction(org.projectfloodlight.openflow.protocol.action.OFAction) OFFlowAdd(org.projectfloodlight.openflow.protocol.OFFlowAdd)

Example 8 with IngressFlowSegmentInstallCommand

use of org.openkilda.floodlight.command.flow.ingress.IngressFlowSegmentInstallCommand in project open-kilda by telstra.

the class IngressFlowSegmentInstallFlowModFactoryTest method makeDefaultPortForwardMessageConnectedDevices.

@Test
public void makeDefaultPortForwardMessageConnectedDevices() {
    FlowEndpoint endpoint = new FlowEndpoint(endpointSingleVlan.getSwitchId(), endpointSingleVlan.getPortNumber(), endpointSingleVlan.getOuterVlanId(), 0, true, true);
    IngressFlowSegmentInstallCommand command = makeCommand(endpoint, meterConfig, encapsulationVlan);
    IngressFlowModFactory factory = makeFactory(command);
    verifyGoToTableInstruction(factory.makeDefaultPortForwardMessage(new EffectiveIds(meterConfig.getId(), null)));
}
Also used : IngressFlowSegmentInstallCommand(org.openkilda.floodlight.command.flow.ingress.IngressFlowSegmentInstallCommand) FlowEndpoint(org.openkilda.model.FlowEndpoint) EffectiveIds(org.openkilda.floodlight.model.EffectiveIds) Test(org.junit.Test)

Example 9 with IngressFlowSegmentInstallCommand

use of org.openkilda.floodlight.command.flow.ingress.IngressFlowSegmentInstallCommand in project open-kilda by telstra.

the class IngressFlowSegmentInstallFlowModFactoryTest method makeDefaultPortForwardMessageMeteredVxLanEncoded.

@Test
public void makeDefaultPortForwardMessageMeteredVxLanEncoded() {
    IngressFlowSegmentInstallCommand command = makeCommand(endpointZeroVlan, meterConfig, encapsulationVxLan);
    testMakeDefaultPortForwardMessageVxLan(command);
}
Also used : IngressFlowSegmentInstallCommand(org.openkilda.floodlight.command.flow.ingress.IngressFlowSegmentInstallCommand) Test(org.junit.Test)

Example 10 with IngressFlowSegmentInstallCommand

use of org.openkilda.floodlight.command.flow.ingress.IngressFlowSegmentInstallCommand in project open-kilda by telstra.

the class IngressFlowSegmentInstallFlowModFactoryTest method makeDefaultPortForwardMessageMeteredVlanEncoded.

@Test
public void makeDefaultPortForwardMessageMeteredVlanEncoded() {
    IngressFlowSegmentInstallCommand command = makeCommand(endpointZeroVlan, meterConfig, encapsulationVlan);
    testMakeDefaultPortForwardMessageVlan(command);
}
Also used : IngressFlowSegmentInstallCommand(org.openkilda.floodlight.command.flow.ingress.IngressFlowSegmentInstallCommand) Test(org.junit.Test)

Aggregations

IngressFlowSegmentInstallCommand (org.openkilda.floodlight.command.flow.ingress.IngressFlowSegmentInstallCommand)12 EffectiveIds (org.openkilda.floodlight.model.EffectiveIds)8 FlowEndpoint (org.openkilda.model.FlowEndpoint)8 OFFlowAdd (org.projectfloodlight.openflow.protocol.OFFlowAdd)6 Test (org.junit.Test)5 OFAction (org.projectfloodlight.openflow.protocol.action.OFAction)5 RoutingMetadata (org.openkilda.floodlight.utils.metadata.RoutingMetadata)4 FlowSegmentWrapperCommand (org.openkilda.floodlight.command.flow.FlowSegmentWrapperCommand)1 RulesContext (org.openkilda.floodlight.model.RulesContext)1 MeterConfig (org.openkilda.model.MeterConfig)1 OFMeterConfig (org.projectfloodlight.openflow.protocol.OFMeterConfig)1