Search in sources :

Example 1 with NotImplementedEncapsulationException

use of org.openkilda.floodlight.error.NotImplementedEncapsulationException in project open-kilda by telstra.

the class IngressFlowSegmentInstallFlowModFactory method makeTransformActions.

@Override
protected List<OFAction> makeTransformActions(List<Integer> vlanStack, boolean groupIsPresent) {
    List<OFAction> actions = new ArrayList<>();
    FlowTransitEncapsulation encapsulation = command.getEncapsulation();
    switch(encapsulation.getType()) {
        case TRANSIT_VLAN:
            actions.addAll(makeVlanEncapsulationTransformActions(vlanStack, groupIsPresent));
            break;
        case VXLAN:
            actions.addAll(makeVxLanEncapsulationTransformActions(vlanStack, groupIsPresent));
            break;
        default:
            throw new NotImplementedEncapsulationException(getClass(), encapsulation.getType(), command.getSwitchId(), command.getMetadata().getFlowId());
    }
    return actions;
}
Also used : NotImplementedEncapsulationException(org.openkilda.floodlight.error.NotImplementedEncapsulationException) OFAction(org.projectfloodlight.openflow.protocol.action.OFAction) ArrayList(java.util.ArrayList) FlowTransitEncapsulation(org.openkilda.model.FlowTransitEncapsulation)

Example 2 with NotImplementedEncapsulationException

use of org.openkilda.floodlight.error.NotImplementedEncapsulationException in project open-kilda by telstra.

the class IngressFlowSegmentInstallFlowModFactory method makeServer42IngressFlowTransformActions.

@Override
protected List<OFAction> makeServer42IngressFlowTransformActions(List<Integer> vlanStack) {
    List<OFAction> actions = new ArrayList<>();
    FlowTransitEncapsulation encapsulation = command.getEncapsulation();
    switch(encapsulation.getType()) {
        case TRANSIT_VLAN:
            MacAddress ethSrc = MacAddress.of(sw.getId());
            MacAddress ethDst = MacAddress.of(command.getEgressSwitchId().toLong());
            actions.add(of.actions().setField(of.oxms().ethSrc(ethSrc)));
            actions.add(of.actions().setField(of.oxms().ethDst(ethDst)));
            if (!getCommand().getMetadata().isMultiTable()) {
                actions.add(of.actions().setField(of.oxms().udpSrc(TransportPort.of(SERVER_42_FLOW_RTT_FORWARD_UDP_PORT))));
                actions.add(of.actions().setField(of.oxms().udpDst(TransportPort.of(SERVER_42_FLOW_RTT_FORWARD_UDP_PORT))));
                if (switchFeatures.contains(NOVIFLOW_COPY_FIELD)) {
                    actions.add(buildServer42CopyFirstTimestamp(of));
                }
            }
            actions.addAll(makeVlanEncapsulationTransformActions(vlanStack, false));
            break;
        case VXLAN:
            if (!getCommand().getMetadata().isMultiTable() && switchFeatures.contains(NOVIFLOW_COPY_FIELD)) {
                actions.add(buildServer42CopyFirstTimestamp(of));
            }
            actions.addAll(OfAdapter.INSTANCE.makeVlanReplaceActions(of, vlanStack, Collections.emptyList()));
            actions.add(pushVxlanAction(SERVER_42_FLOW_RTT_FORWARD_UDP_PORT));
            break;
        default:
            throw new NotImplementedEncapsulationException(getClass(), encapsulation.getType(), command.getSwitchId(), command.getMetadata().getFlowId());
    }
    return actions;
}
Also used : NotImplementedEncapsulationException(org.openkilda.floodlight.error.NotImplementedEncapsulationException) OFAction(org.projectfloodlight.openflow.protocol.action.OFAction) ArrayList(java.util.ArrayList) FlowTransitEncapsulation(org.openkilda.model.FlowTransitEncapsulation) MacAddress(org.projectfloodlight.openflow.types.MacAddress)

Aggregations

ArrayList (java.util.ArrayList)2 NotImplementedEncapsulationException (org.openkilda.floodlight.error.NotImplementedEncapsulationException)2 FlowTransitEncapsulation (org.openkilda.model.FlowTransitEncapsulation)2 OFAction (org.projectfloodlight.openflow.protocol.action.OFAction)2 MacAddress (org.projectfloodlight.openflow.types.MacAddress)1