use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder in project openflowplugin by opendaylight.
the class OFPluginFlowTest method writeFlow.
static void writeFlow(FlowBuilder flow, InstanceIdentifier<FlowCapableNode> flowNodeIdent) {
ReadWriteTransaction modification = dataBroker.newReadWriteTransaction();
final InstanceIdentifier<Flow> path1 = flowNodeIdent.child(Table.class, new TableKey(flow.getTableId())).child(Flow.class, flow.getKey());
modification.merge(LogicalDatastoreType.CONFIGURATION, path1, flow.build(), true);
CheckedFuture<Void, TransactionCommitFailedException> commitFuture = modification.submit();
Futures.addCallback(commitFuture, new FutureCallback<Void>() {
@Override
public void onSuccess(Void aVoid) {
LOG.debug("Write of flow on device succeeded.");
}
@Override
public void onFailure(Throwable throwable) {
LOG.error("Write of flow on device failed.", throwable);
}
}, MoreExecutors.directExecutor());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder in project openflowplugin by opendaylight.
the class ActionConvertorV10Test method testGetActions.
/**
* Test {@link ActionConvertor#convert(List, ActionConvertorData)}}.
*/
@Test
public void testGetActions() {
ActionBuilder actionBuilder = new ActionBuilder();
SetVlanPcpActionCaseBuilder vlanPcpCaseBuilder = new SetVlanPcpActionCaseBuilder();
SetVlanPcpActionBuilder pcpBuilder = new SetVlanPcpActionBuilder();
pcpBuilder.setVlanPcp(new VlanPcp((short) 7));
vlanPcpCaseBuilder.setSetVlanPcpAction(pcpBuilder.build());
actionBuilder.setAction(vlanPcpCaseBuilder.build());
actionBuilder.setOrder(0);
List<Action> salActions = new ArrayList<>();
salActions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
StripVlanActionCaseBuilder stripCaseBuilder = new StripVlanActionCaseBuilder();
StripVlanActionBuilder stripBuilder = new StripVlanActionBuilder();
stripCaseBuilder.setStripVlanAction(stripBuilder.build());
actionBuilder.setAction(stripCaseBuilder.build());
actionBuilder.setOrder(1);
salActions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
SetDlDstActionCaseBuilder dlDstCaseBuilder = new SetDlDstActionCaseBuilder();
SetDlDstActionBuilder dlDstBuilder = new SetDlDstActionBuilder();
dlDstBuilder.setAddress(new MacAddress("00:00:00:00:00:06"));
dlDstCaseBuilder.setSetDlDstAction(dlDstBuilder.build());
actionBuilder.setAction(dlDstCaseBuilder.build());
actionBuilder.setOrder(2);
salActions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
SetDlSrcActionCaseBuilder dlSrcCaseBuilder = new SetDlSrcActionCaseBuilder();
SetDlSrcActionBuilder dlSrcBuilder = new SetDlSrcActionBuilder();
dlSrcBuilder.setAddress(new MacAddress("00:00:00:00:00:05"));
dlSrcCaseBuilder.setSetDlSrcAction(dlSrcBuilder.build());
actionBuilder.setAction(dlSrcCaseBuilder.build());
actionBuilder.setOrder(3);
salActions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
SetNwSrcActionCaseBuilder nwSrcCaseBuilder = new SetNwSrcActionCaseBuilder();
SetNwSrcActionBuilder nwSrcBuilder = new SetNwSrcActionBuilder();
Ipv4Builder ipv4Builder = new Ipv4Builder();
/* Use prefix which is correct in canonical representation in test */
ipv4Builder.setIpv4Address(new Ipv4Prefix("10.0.0.0/24"));
nwSrcBuilder.setAddress(ipv4Builder.build());
nwSrcCaseBuilder.setSetNwSrcAction(nwSrcBuilder.build());
actionBuilder.setAction(nwSrcCaseBuilder.build());
actionBuilder.setOrder(4);
salActions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
SetNwDstActionBuilder nwDstBuilder = new SetNwDstActionBuilder();
ipv4Builder = new Ipv4Builder();
ipv4Builder.setIpv4Address(new Ipv4Prefix("10.0.0.2/32"));
nwDstBuilder.setAddress(ipv4Builder.build());
SetNwDstActionCaseBuilder nwDstCaseBuilder = new SetNwDstActionCaseBuilder();
nwDstCaseBuilder.setSetNwDstAction(nwDstBuilder.build());
actionBuilder.setAction(nwDstCaseBuilder.build());
actionBuilder.setOrder(5);
salActions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
SetTpSrcActionCaseBuilder tpSrcCaseBuilder = new SetTpSrcActionCaseBuilder();
SetTpSrcActionBuilder tpSrcBuilder = new SetTpSrcActionBuilder();
tpSrcBuilder.setPort(new PortNumber(54));
tpSrcCaseBuilder.setSetTpSrcAction(tpSrcBuilder.build());
actionBuilder.setAction(tpSrcCaseBuilder.build());
actionBuilder.setOrder(6);
salActions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
SetTpDstActionCaseBuilder tpDstCaseBuilder = new SetTpDstActionCaseBuilder();
SetTpDstActionBuilder tpDstBuilder = new SetTpDstActionBuilder();
tpDstBuilder.setPort(new PortNumber(45));
tpDstCaseBuilder.setSetTpDstAction(tpDstBuilder.build());
actionBuilder.setAction(tpDstCaseBuilder.build());
actionBuilder.setOrder(7);
salActions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
SetNwTosActionCaseBuilder tosCaseBuilder = new SetNwTosActionCaseBuilder();
SetNwTosActionBuilder tosBuilder = new SetNwTosActionBuilder();
tosBuilder.setTos(18);
tosCaseBuilder.setSetNwTosAction(tosBuilder.build());
actionBuilder.setAction(tosCaseBuilder.build());
actionBuilder.setOrder(8);
salActions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
SetVlanIdActionCaseBuilder vlanIdCaseBuilder = new SetVlanIdActionCaseBuilder();
SetVlanIdActionBuilder vlanIdBuilder = new SetVlanIdActionBuilder();
vlanIdBuilder.setVlanId(new VlanId(22));
vlanIdCaseBuilder.setSetVlanIdAction(vlanIdBuilder.build());
actionBuilder.setAction(vlanIdCaseBuilder.build());
actionBuilder.setOrder(9);
salActions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
PopVlanActionCaseBuilder popVlanActionCaseBuilder = new PopVlanActionCaseBuilder();
actionBuilder.setAction(popVlanActionCaseBuilder.build());
actionBuilder.setOrder(10);
salActions.add(actionBuilder.build());
actionBuilder = new ActionBuilder();
SetFieldCaseBuilder setFieldCaseBuilder = new SetFieldCaseBuilder();
SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
VlanMatchBuilder vlanMatchBuilder = new VlanMatchBuilder();
vlanMatchBuilder.setVlanId(new VlanIdBuilder().setVlanId(new VlanId(22)).build());
setFieldBuilder.setVlanMatch(vlanMatchBuilder.build());
setFieldCaseBuilder.setSetField(setFieldBuilder.build());
actionBuilder.setAction(setFieldCaseBuilder.build());
actionBuilder.setOrder(11);
salActions.add(actionBuilder.build());
IpMatchBuilder ipMatchBld = new IpMatchBuilder().setIpProto(IpVersion.Ipv4);
MatchBuilder matchBld = new MatchBuilder().setIpMatch(ipMatchBld.build());
FlowBuilder flowBld = new FlowBuilder().setMatch(matchBld.build());
Flow flow = flowBld.build();
ActionConvertorData data = new ActionConvertorData(OFConstants.OFP_VERSION_1_0);
data.setDatapathId(new BigInteger("42"));
data.setIpProtocol(FlowConvertorUtil.getIpProtocolFromFlow(flow));
Optional<List<org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action>> actionsOptional = convertorManager.convert(salActions, data);
List<org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action> actions = actionsOptional.orElse(Collections.emptyList());
Assert.assertEquals("Wrong number of actions", 12, actions.size());
org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.action.rev150203.actions.grouping.Action action = actions.get(0);
Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common" + ".action.rev150203.action.grouping.action.choice.SetVlanPcpCase", action.getActionChoice().getImplementedInterface().getName());
SetVlanPcpCase setVlanPcpCase = (SetVlanPcpCase) action.getActionChoice();
Assert.assertEquals("Wrong vlan pcp", 7, setVlanPcpCase.getSetVlanPcpAction().getVlanPcp().intValue());
action = actions.get(1);
Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common" + ".action.rev150203.action.grouping.action.choice.StripVlanCase", action.getActionChoice().getImplementedInterface().getName());
action = actions.get(2);
Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common" + ".action.rev150203.action.grouping.action.choice.SetDlDstCase", action.getActionChoice().getImplementedInterface().getName());
SetDlDstCase setDlDstCase = (SetDlDstCase) action.getActionChoice();
Assert.assertEquals("Wrong dl dst", "00:00:00:00:00:06", setDlDstCase.getSetDlDstAction().getDlDstAddress().getValue());
action = actions.get(3);
Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common" + ".action.rev150203.action.grouping.action.choice.SetDlSrcCase", action.getActionChoice().getImplementedInterface().getName());
SetDlSrcCase setDlSrcCase = (SetDlSrcCase) action.getActionChoice();
Assert.assertEquals("Wrong dl src", "00:00:00:00:00:05", setDlSrcCase.getSetDlSrcAction().getDlSrcAddress().getValue());
action = actions.get(4);
Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common" + ".action.rev150203.action.grouping.action.choice.SetNwSrcCase", action.getActionChoice().getImplementedInterface().getName());
SetNwSrcCase setNwSrcCase = (SetNwSrcCase) action.getActionChoice();
Assert.assertEquals("Wrong nw src", "10.0.0.0", setNwSrcCase.getSetNwSrcAction().getIpAddress().getValue());
action = actions.get(5);
Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common" + ".action.rev150203.action.grouping.action.choice.SetNwDstCase", action.getActionChoice().getImplementedInterface().getName());
SetNwDstCase setNwDstCase = (SetNwDstCase) action.getActionChoice();
Assert.assertEquals("Wrong nw dst", "10.0.0.2", setNwDstCase.getSetNwDstAction().getIpAddress().getValue());
action = actions.get(6);
Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common" + ".action.rev150203.action.grouping.action.choice.SetTpSrcCase", action.getActionChoice().getImplementedInterface().getName());
SetTpSrcCase setTpSrcCase = (SetTpSrcCase) action.getActionChoice();
Assert.assertEquals("Wrong tp src", 54, setTpSrcCase.getSetTpSrcAction().getPort().getValue().intValue());
action = actions.get(7);
Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common" + ".action.rev150203.action.grouping.action.choice.SetTpDstCase", action.getActionChoice().getImplementedInterface().getName());
SetTpDstCase setTpDstCase = (SetTpDstCase) action.getActionChoice();
Assert.assertEquals("Wrong tp dst", 45, setTpDstCase.getSetTpDstAction().getPort().getValue().intValue());
action = actions.get(8);
Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common" + ".action.rev150203.action.grouping.action.choice.SetNwTosCase", action.getActionChoice().getImplementedInterface().getName());
SetNwTosCase setNwTosCase = (SetNwTosCase) action.getActionChoice();
Assert.assertEquals("Wrong nw tos", 18, setNwTosCase.getSetNwTosAction().getNwTos().intValue());
action = actions.get(9);
Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common" + ".action.rev150203.action.grouping.action.choice.SetVlanVidCase", action.getActionChoice().getImplementedInterface().getName());
SetVlanVidCase setVlanVidCase = (SetVlanVidCase) action.getActionChoice();
Assert.assertEquals("Wrong vlan id", 22, setVlanVidCase.getSetVlanVidAction().getVlanVid().intValue());
action = actions.get(10);
Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common" + ".action.rev150203.action.grouping.action.choice.StripVlanCase", action.getActionChoice().getImplementedInterface().getName());
action = actions.get(11);
Assert.assertEquals("Wrong action type", "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common" + ".action.rev150203.action.grouping.action.choice.SetVlanVidCase", action.getActionChoice().getImplementedInterface().getName());
setVlanVidCase = (SetVlanVidCase) action.getActionChoice();
Assert.assertEquals("Wrong vlan id", 22, setVlanVidCase.getSetVlanVidAction().getVlanVid().intValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder in project openflowplugin by opendaylight.
the class FlowConvertorTest method testOnlyModifyStrictCommand.
/**
* Tests {@link FlowConvertor#convert(Flow, VersionDatapathIdConvertorData)} }.
*/
@Test
public void testOnlyModifyStrictCommand() {
UpdatedFlowBuilder flowBuilder = new UpdatedFlowBuilder();
flowBuilder.setStrict(true);
UpdatedFlow flow = flowBuilder.build();
VersionDatapathIdConvertorData data = new VersionDatapathIdConvertorData(OFConstants.OFP_VERSION_1_0);
data.setDatapathId(new BigInteger("42"));
List<FlowModInputBuilder> flowMod = convert(flow, data);
Assert.assertEquals("Wrong version", 1, flowMod.get(0).getVersion().intValue());
Assert.assertEquals("Wrong command", FlowModCommand.OFPFCADD, flowMod.get(0).getCommand());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder in project openflowplugin by opendaylight.
the class FlowUtils method createFwdAllToControllerFlow.
/**
* Returns a{@link FlowBuilder} forwarding all packets to controller port.
*/
public static FlowBuilder createFwdAllToControllerFlow(final Short tableId, final int priority, final FlowId flowId) {
// Create output action -> send to controller
OutputActionBuilder output = new OutputActionBuilder();
output.setMaxLength(Integer.valueOf(0xffff));
Uri controllerPort = new Uri(OutputPortValues.CONTROLLER.toString());
output.setOutputNodeConnector(controllerPort);
ActionBuilder ab = new ActionBuilder();
ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
ab.setOrder(0);
ab.setKey(new ActionKey(0));
List<Action> actionList = new ArrayList<>();
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<>();
instructions.add(ib.build());
isb.setInstruction(instructions);
MatchBuilder matchBuilder = new MatchBuilder();
FlowBuilder allToCtrlFlow = new FlowBuilder().setTableId(tableId).setFlowName("allPacketsToCtrl").setId(flowId).setKey(new FlowKey(flowId));
allToCtrlFlow.setMatch(matchBuilder.build()).setInstructions(isb.build()).setPriority(priority).setBufferId(OFConstants.OFP_NO_BUFFER).setHardTimeout(0).setIdleTimeout(0).setFlags(new FlowModFlags(false, false, false, false, false));
return allToCtrlFlow;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder in project openflowplugin by opendaylight.
the class OpenflowPluginBulkTransactionProvider method createTestFlow.
private FlowBuilder createTestFlow(NodeBuilder nodeBuilder, String flowTypeArg, String tableId) {
FlowBuilder flow = new FlowBuilder();
long id = 123;
String flowType = flowTypeArg;
if (flowType == null) {
flowType = "f1";
}
switch(flowType) {
case "f1":
id += 1;
flow.setMatch(createMatch1().build());
flow.setInstructions(createDecNwTtlInstructions().build());
break;
case "f2":
id += 2;
flow.setMatch(createMatch2().build());
flow.setInstructions(createDropInstructions().build());
break;
case "f3":
id += 3;
flow.setMatch(createMatch3().build());
flow.setInstructions(createDropInstructions().build());
break;
case "f4":
id += 4;
flow.setMatch(createEthernetMatch().build());
flow.setInstructions(createDropInstructions().build());
break;
case "f5":
id += 5;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction().build());
break;
case "f6":
id += 6;
flow.setMatch(createMatch1().build());
flow.setInstructions(createGotoTableInstructions().build());
break;
case "f7":
id += 7;
flow.setMatch(createMatch1().build());
flow.setInstructions(createMeterInstructions().build());
break;
case "f8":
id += 8;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction7().build());
break;
case "f9":
id += 9;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction2().build());
break;
case "f10":
id += 10;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction3().build());
break;
case "f23":
id += 23;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction16().build());
break;
case "f230":
id += 23;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction160().build());
break;
case "f34":
id += 34;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction26().build());
break;
case "f35":
id += 35;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction27().build());
break;
case "f36":
id += 36;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction28().build());
break;
case "f42":
id += 42;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction34().build());
break;
case "f43":
id += 43;
flow.setMatch(createICMPv6Match().build());
flow.setInstructions(createDecNwTtlInstructions().build());
break;
case "f44":
id += 44;
flow.setMatch(createInphyportMatch(nodeBuilder.getId()).build());
flow.setInstructions(createDropInstructions().build());
break;
case "f45":
id += 45;
flow.setMatch(createMetadataMatch().build());
flow.setInstructions(createDropInstructions().build());
break;
case "f46":
id += 46;
flow.setMatch(createL3IPv6Match().build());
flow.setInstructions(createDecNwTtlInstructions().build());
break;
case "f81":
id += 81;
flow.setMatch(createLLDPMatch().build());
flow.setInstructions(createSentToControllerInstructions().build());
break;
case "f82":
id += 1;
flow.setMatch(createMatch1().build());
flow.setInstructions(createDropInstructions().build());
break;
case "f83":
id += 2;
flow.setMatch(createMatch2().build());
flow.setInstructions(createDecNwTtlInstructions().build());
break;
case "f84":
id += 3;
flow.setMatch(createMatch3().build());
flow.setInstructions(createDecNwTtlInstructions().build());
break;
case "f85":
id += 4;
flow.setMatch(createEthernetMatch().build());
flow.setInstructions(createMeterInstructions().build());
break;
case "f86":
id += 6;
flow.setMatch(createMatch1().build());
flow.setInstructions(createDecNwTtlInstructions().build());
break;
case "f87":
id += 12;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction7().build());
break;
case "f88":
id += 13;
flow.setMatch(createEthernetMatch().build());
flow.setInstructions(createAppyActionInstruction6().build());
break;
case "f89":
id += 14;
flow.setMatch(createEthernetMatch().build());
flow.setInstructions(createAppyActionInstruction7().build());
break;
case "f90":
id += 15;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction9().build());
break;
case "f91":
id += 7;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction9().build());
break;
case "f92":
id += 8;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction6().build());
break;
case "f93":
id += 9;
flow.setMatch(createMatch1().build());
flow.setInstructions(createDecNwTtlInstructions().build());
break;
case "f94":
id += 10;
flow.setMatch(createMatch1().build());
flow.setInstructions(createDecNwTtlInstructions().build());
break;
case "f95":
id += 42;
flow.setMatch(createMatch1().build());
flow.setInstructions(createDecNwTtlInstructions().build());
break;
case "f96":
id += 43;
flow.setMatch(createICMPv6Match().build());
flow.setInstructions(createDropInstructions().build());
break;
case "f97":
id += 44;
flow.setMatch(createInphyportMatch(nodeBuilder.getId()).build());
flow.setInstructions(createMeterInstructions().build());
break;
case "f98":
id += 45;
flow.setMatch(createMetadataMatch().build());
flow.setInstructions(createAppyActionInstruction6().build());
break;
case "f99":
id += 34;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction6().build());
break;
case "f100":
id += 35;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction7().build());
break;
case "f101":
id += 36;
flow.setMatch(createMatch1().build());
flow.setInstructions(createAppyActionInstruction8().build());
break;
case "f700":
id += 3;
flow.setMatch(createMatch3().build());
flow.setInstructions(createMeterInstructions().build());
break;
case "f800":
id += 8;
flow.setMatch(createMatch1000().build());
flow.setInstructions(createAppyActionInstruction6().build());
break;
case "f900":
id += 5;
flow.setMatch(createMatch1000().build());
flow.setInstructions(createAppyActionInstruction2().build());
break;
case "f1000":
id += 10;
flow.setMatch(createMatch1000().build());
flow.setInstructions(createAppyActionInstruction3().build());
break;
default:
LOG.warn("flow type not understood: {}", flowType);
}
if (null == flow.isBarrier()) {
flow.setBarrier(Boolean.FALSE);
}
// flow.setBufferId(12L);
BigInteger value = BigInteger.valueOf(10);
BigInteger outputPort = BigInteger.valueOf(4294967295L);
flow.setCookie(new FlowCookie(value));
flow.setCookieMask(new FlowCookie(value));
flow.setHardTimeout(0);
flow.setIdleTimeout(0);
flow.setInstallHw(false);
flow.setStrict(false);
flow.setContainerName(null);
flow.setFlags(new FlowModFlags(false, false, false, false, true));
flow.setId(new FlowId("12"));
flow.setTableId(getTableId(tableId));
flow.setOutGroup(4294967295L);
// set outport to OFPP_NONE (65535) to disable remove restriction for
// flow
flow.setOutPort(outputPort);
FlowKey key = new FlowKey(new FlowId(Long.toString(id)));
flow.setKey(key);
flow.setPriority(2);
flow.setFlowName(originalFlowName + "X" + flowType);
return flow;
}
Aggregations