use of org.openkilda.rulemanager.action.SwapFieldAction in project open-kilda by telstra.
the class FlowEntryConverter method addAction.
private void addAction(FlowApplyActionsBuilder builder, Action action) {
switch(action.getType()) {
case GROUP:
GroupAction groupAction = (GroupAction) action;
builder.group(String.valueOf(groupAction.getGroupId().getValue()));
return;
case PORT_OUT:
PortOutAction portOutAction = (PortOutAction) action;
builder.flowOutput(portOutAction.getPortNumber().toString());
return;
case POP_VLAN:
builder.popVlan("");
return;
case PUSH_VLAN:
builder.pushVlan("");
return;
case POP_VXLAN_NOVIFLOW:
case POP_VXLAN_OVS:
// todo handle pop vxlan
return;
case PUSH_VXLAN_NOVIFLOW:
case PUSH_VXLAN_OVS:
PushVxlanAction pushVxlanAction = (PushVxlanAction) action;
builder.pushVxlan(String.valueOf(pushVxlanAction.getVni()));
return;
case METER:
MeterAction meterAction = (MeterAction) action;
builder.meter(String.valueOf(meterAction.getMeterId().getValue()));
return;
case NOVI_COPY_FIELD:
CopyFieldAction copyFieldAction = (CopyFieldAction) action;
builder.copyFieldAction(FlowCopyFieldAction.builder().bits(String.valueOf(copyFieldAction.getNumberOfBits())).srcOffset(String.valueOf(copyFieldAction.getSrcOffset())).dstOffset(String.valueOf(copyFieldAction.getDstOffset())).srcOxm(copyFieldAction.getOxmSrcHeader().toString()).dstOxm(copyFieldAction.getOxmDstHeader().toString()).build());
return;
case NOVI_SWAP_FIELD:
case KILDA_SWAP_FIELD:
SwapFieldAction swapFieldAction = (SwapFieldAction) action;
builder.swapFieldAction(FlowSwapFieldAction.builder().bits(String.valueOf(swapFieldAction.getNumberOfBits())).srcOffset(String.valueOf(swapFieldAction.getSrcOffset())).dstOffset(String.valueOf(swapFieldAction.getDstOffset())).srcOxm(swapFieldAction.getOxmSrcHeader().toString()).dstOxm(swapFieldAction.getOxmDstHeader().toString()).build());
return;
case SET_FIELD:
SetFieldAction setFieldAction = (SetFieldAction) action;
builder.setFieldAction(FlowSetFieldAction.builder().fieldName(setFieldAction.getField().toString()).fieldValue(String.valueOf(setFieldAction.getValue())).build());
return;
default:
throw new IllegalStateException(format("Unknown action type %s", action.getType()));
}
}
Aggregations