// convert and inject match
MatchReactor.getInstance().convert(arg0.getMatch(), version, mprFlowRequestBuilder);
-// if(version == OFConstants.OFP_VERSION_1_0){
-// mprFlowRequestBuilder.setMatchV10(MatchConvertor.toMatchV10(arg0.getMatch()));
-// }
//TODO: repeating code
if(version == OFConstants.OFP_VERSION_1_3){
-// MatchBuilder matchBuilder = new MatchBuilder();
-// matchBuilder.setMatchEntries(MatchConvertor.toMatch(arg0.getMatch()));
-// matchBuilder.setType(OxmMatchType.class);
-// mprFlowRequestBuilder.setMatch(matchBuilder.build());
-
mprFlowRequestBuilder.setCookie(arg0.getCookie());
mprFlowRequestBuilder.setCookieMask(arg0.getCookieMask());
mprFlowRequestBuilder.setOutGroup(arg0.getOutGroup());
MatchReactor.getInstance().convert(arg0.getMatch(), version, mprAggregateRequestBuilder);
-// if(version == OFConstants.OFP_VERSION_1_0){
-// mprAggregateRequestBuilder.setMatchV10(MatchConvertor.toMatchV10(arg0.getMatch()));
-// }
//TODO: repeating code
if(version == OFConstants.OFP_VERSION_1_3){
-// MatchBuilder matchBuilder = new MatchBuilder();
-// matchBuilder.setMatchEntries(MatchConvertor.toMatch(arg0.getMatch()));
-// matchBuilder.setType(OxmMatchType.class);
-// mprAggregateRequestBuilder.setMatch(matchBuilder.build());
-
mprAggregateRequestBuilder.setCookie(arg0.getCookie());
mprAggregateRequestBuilder.setCookieMask(arg0.getCookieMask());
mprAggregateRequestBuilder.setOutGroup(arg0.getOutGroup());
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.sw.path.action._case.SwPathActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.address.address.Ipv4Builder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.config.rev130819.Flows;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
flow.setMatch(createPbbMatch().build());
flow.setInstructions(createMeterInstructions().build());
break;
-
case "51":
id += 51;
flow.setMatch(createIPMatch().build());
flow.setMatch(createL4UDPMatch().build());
flow.setInstructions(createDropInstructions().build());
break;
-
+ case "f54":
+ id += 51;
+ flow.setMatch(new MatchBuilder().build());
+ flow.setInstructions(createSentToControllerInstructions().build());
+ break;
default:
LOG.warn("flow type not understood: {}", flowType);
}
isb.setInstruction(instructions);
return isb;
}
+
+ private static InstructionsBuilder createSentToControllerInstructions() {
+ List<Action> actionList = new ArrayList<Action>();
+ ActionBuilder ab = new ActionBuilder();
+
+ OutputActionBuilder output = new OutputActionBuilder();
+ output.setMaxLength(56);
+ Uri value = new Uri("CONTROLLER");
+ output.setOutputNodeConnector(value);
+ ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
+ ab.setOrder(0);
+ ab.setKey(new ActionKey(0));
+ actionList.add(ab.build());
+ // Create an Apply Action
+ ApplyActionsBuilder aab = new ApplyActionsBuilder();
+ aab.setAction(actionList);
+
+ // Wrap our Apply Action in an Instruction
+ InstructionBuilder ib = new InstructionBuilder();
+ ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
+ ib.setOrder(0);
+ ib.setKey(new InstructionKey(0));
+
+ // Put our Instruction in a list of Instructions
+ InstructionsBuilder isb = new InstructionsBuilder();
+ List<Instruction> instructions = new ArrayList<Instruction>();
+ instructions.add(ib.build());
+ isb.setInstruction(instructions);
+ return isb;
+ }
private static InstructionsBuilder createAppyActionInstruction2() {
return match;
}
-
+
private static MatchBuilder createInphyportMatch() {
MatchBuilder match = new MatchBuilder();
match.setInPort(202L);
return match;
}
-
+
/**
* @return
*/