import org.eclipse.osgi.framework.console.CommandInterpreter;
import org.eclipse.osgi.framework.console.CommandProvider;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
+import org.opendaylight.openflowplugin.api.OFConstants;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.OutputActionCaseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.output.action._case.OutputActionBuilder;
packet_out.setNode(ref);
packet_out.setIngress(nIngressConRef);
packet_out.setEgress(nEngressConRef);
- packet_out.setBufferId(Long.valueOf(0xffffffffL));
+ packet_out.setBufferId(OFConstants.OFP_NO_BUFFER);
packetProcessingService.transmitPacket(packet_out.build());
} else {
public static final Integer DEFAULT_HARD_TIMEOUT = 10 * 60;
/** Default priority */
public static final Integer DEFAULT_PRIORITY = Integer.parseInt("8000", 16);
- private static final Long DEFAULT_BUFFER_ID = Long.parseLong("ffffffff", 16);
+ private static final Long DEFAULT_BUFFER_ID = OFConstants.OFP_NO_BUFFER;
private static final Long OFPP_ANY = Long.parseLong("ffffffff", 16);
private static final Long DEFAULT_OUT_PORT = OFPP_ANY;
private static final Long OFPG_ANY = Long.parseLong("ffffffff", 16);
flowMod.setOutGroup(DEFAULT_OUT_GROUP);
}
-
+
// convert and inject flowFlags
FlowFlagReactor.getInstance().convert(flow.getFlags(), version, flowMod,datapathid);
flowMod.setAction(getActions(version,datapathid, flow));
}
flowMod.setVersion(version);
-
+
return flowMod;
}
}
return instructionsList;
}
-
+
/*private static List<Action> getActions(
org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Instructions instructions,
short version,BigInteger datapathid) {*/
private static List<Action> getActions(short version,BigInteger datapathid, Flow flow) {
-
+
org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Instructions instructions = flow.getInstructions();
List<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction> sortedInstructions =
Ordering.from(OrderComparator.<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction>build())
org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionBuilder instructionBuilder =
new org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionBuilder();
-
+
for (int i=0; i < srcInstructionList.size(); i++) {
- org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction srcInstruction =
+ org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction srcInstruction =
srcInstructionList.get(i);
- org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.Instruction curSrcInstruction =
+ org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.Instruction curSrcInstruction =
srcInstruction.getInstruction();
-
+
if (curSrcInstruction instanceof ApplyActionsCase) {
ApplyActionsCase applyActionscase = (ApplyActionsCase) curSrcInstruction;
ApplyActions applyActions = applyActionscase.getApplyActions();
actionBuilder.setOrder(actionItem.getOrder() + offset);
actionItem = actionBuilder.build();
}
-
+
targetActionList.add(actionItem);
}
ApplyActionsBuilder applyActionsBuilder = new ApplyActionsBuilder();
applyActionsBuilder.setAction(targetActionList);
applyActionsCaseBuilder.setApplyActions(applyActionsBuilder.build());
-
+
instructionBuilder.setInstruction(applyActionsCaseBuilder.build());
} else {
instructionBuilder.setInstruction(curSrcInstruction);
}
-
+
instructionBuilder
.setKey(srcInstruction.getKey())
.setOrder(srcInstruction.getOrder());
targetInstructionList.add(instructionBuilder.build());
-
+
}
return targetInstructionList;
import java.util.ArrayList;
import java.util.List;
+import org.opendaylight.openflowplugin.api.OFConstants;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.OutputActionCaseBuilder;
.setInstruction(ImmutableList.of(applyActionsInstruction)) //
.build()) //
.setPriority(priority) //
- .setBufferId(0L) //
+ .setBufferId(OFConstants.OFP_NO_BUFFER) //
.setHardTimeout(0) //
.setIdleTimeout(0) //
.setFlags(new FlowModFlags(false, false, false, false, false));
.setMatch(matchBuilder.build()) //
.setInstructions(isb.build()) //
.setPriority(priority) //
- .setBufferId(0L) //
+ .setBufferId(OFConstants.OFP_NO_BUFFER) //
.setHardTimeout(0) //
.setIdleTimeout(0) //
.setFlags(new FlowModFlags(false, false, false, false, false));