import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.flowflag.FlowFlagReactor;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.match.MatchReactor;
import org.opendaylight.openflowplugin.openflow.md.util.ByteUtil;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.ActionList;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.flow.update.UpdatedFlow;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.MeterIdInstructionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.TableIdInstruction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.augments.rev131002.TableIdInstructionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev130731.actions.ActionsList;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.Instructions;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.InstructionsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowModCommand;
if (flow.getInstructions() != null) {
flowMod.setInstructions(toInstructions(flow.getInstructions(), version));
+ flowMod.setActionsList(getActionsList(flow.getInstructions(), version));
}
flowMod.setVersion(version);
+
return flowMod.build();
}
}
return instructionsList;
}
+
+ private static List<ActionsList> getActionsList(
+ org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Instructions instructions,
+ short version) {
+
+ for (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction instruction : instructions
+ .getInstruction()) {
+ org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.Instruction curInstruction = instruction
+ .getInstruction();
+
+ if (curInstruction instanceof ApplyActionsCase) {
+ ApplyActionsCase applyActionscase = (ApplyActionsCase) curInstruction;
+ ApplyActions applyActions = applyActionscase.getApplyActions();
+ return ActionConvertor.getActionList(applyActions.getAction(), version);
+ }
+
+ }
+ return null;
+ }
}
\ No newline at end of file
flow.setMatch(createVlanMatch().build());
flow.setInstructions(createMeterInstructions().build());
break;
-
case "f50":
id += 50;
flow.setMatch(createPbbMatch().build());
flow.setInstructions(createMeterInstructions().build());
break;
- case "51":
+ case "f51":
id += 51;
- flow.setMatch(createIPMatch().build());
+ flow.setMatch(createVlanMatch().build());
flow.setInstructions(createDropInstructions().build());
break;
-
- case "52":
+ case "f52":
id += 52;
flow.setMatch(createL4TCPMatch().build());
flow.setInstructions(createDropInstructions().build());
break;
- case "53":
+ case "f53":
id += 53;
flow.setMatch(createL4UDPMatch().build());
flow.setInstructions(createDropInstructions().build());
flow.setMatch(new MatchBuilder().build());
flow.setInstructions(createSentToControllerInstructions().build());
break;
+ case "f55":
+ id += 55;
+ flow.setMatch(createToSMatch().build());
+ flow.setInstructions(createDropInstructions().build());
+ break;
+
+
default:
LOG.warn("flow type not understood: {}", flowType);
}
return match;
}
+
+ /**
+ * @return
+ */
+ private static MatchBuilder createToSMatch() {
+ MatchBuilder match = new MatchBuilder();
+ EthernetMatchBuilder ethmatch = new EthernetMatchBuilder();
+ EthernetTypeBuilder ethtype = new EthernetTypeBuilder();
+ EtherType type = new EtherType(0x0800L);
+ ethmatch.setEthernetType(ethtype.setType(type).build());
+ match.setEthernetMatch(ethmatch.build());
+
+ IpMatchBuilder ipmatch = new IpMatchBuilder(); // ipv4 version
+ ipmatch.setIpProtocol((short) 6);
+ Dscp dscp = new Dscp((short) 8);
+ ipmatch.setIpDscp(dscp);
+ match.setIpMatch(ipmatch.build());
+ return match;
+ }
+
/**
* @return