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.DecNwTtlCaseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.DropActionCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.OutputActionCase;
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.SetFieldCaseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetNwDstActionCaseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Instructions;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.InstructionsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCaseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.GoToTableCaseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.apply.actions._case.ApplyActionsBuilder;
String bridgeUUID = null;
String tunnelBridgeName = AdminConfigManager.getManager().getIntegrationBridgeName();
OVSDBConfigService ovsdbTable = (OVSDBConfigService)ServiceHelper.getGlobalInstance(OVSDBConfigService.class, this);
- Map<String, org.opendaylight.ovsdb.lib.table.internal.Table<?>> bridgeTable = ovsdbTable.getRows(node, Bridge.NAME.getName());
+ Map<String, org.opendaylight.ovsdb.lib.table.Table<?>> bridgeTable = ovsdbTable.getRows(node, Bridge.NAME.getName());
if (bridgeTable != null) {
for (String uuid : bridgeTable.keySet()) {
Bridge bridge = (Bridge)bridgeTable.get(uuid);
* Action: Drop w/ a low priority
*/
- // TODO : Drop flows causing problems with other existing flows. Commenting them out for now till it is fixed.
-
- // writeDropSrcIface(dpid, localPort);
+ writeDropSrcIface(dpid, localPort);
/*
* Table(2) Rule #1
* table=2,priority=8192,tun_id=0x5 actions=drop
*/
- // TODO : Drop flows causing problems with other existing flows. Commenting them out for now till it is fixed.
- // writeLocalTableMiss(dpid, TABLE_2_LOCAL_FORWARD, segmentationId);
+ writeLocalTableMiss(dpid, TABLE_2_LOCAL_FORWARD, segmentationId);
}
private void programLocalIngressTunnelBridgeRules(Node node, Long dpid, String segmentationId, String attachedMac, long tunnelOFPort, long localPort) {
*/
writeTunnelIn(dpid, TABLE_0_DEFAULT_INGRESS, TABLE_2_LOCAL_FORWARD, segmentationId, tunnelOFPort);
+
+ /*
+ * Table(1) Rule #2
+ * ----------------
+ * Match: Match Tunnel ID and L2 ::::FF:FF Flooding
+ * Action: Flood to selected destination TEPs
+ * -------------------------------------------
+ * table=1,priority=16384,tun_id=0x5,dl_dst=ff:ff:ff:ff:ff:ff \
+ * actions=output:10,output:11,goto_table:2
+ */
+
+ writeTunnelFloodOut(dpid, TABLE_1_ISOLATE_TENANT, TABLE_2_LOCAL_FORWARD, segmentationId, tunnelOFPort);
+
}
private void programRemoteEgressTunnelBridgeRules(Node node, Long dpid, String segmentationId, String attachedMac, long tunnelOFPort, long localPort) {
*/
writeTunnelOut(dpid, TABLE_1_ISOLATE_TENANT, TABLE_2_LOCAL_FORWARD, segmentationId, tunnelOFPort, attachedMac);
-
- /*
- * Table(1) Rule #2
- * ----------------
- * Match: Match Tunnel ID and L2 ::::FF:FF Flooding
- * Action: Flood to selected destination TEPs
- * -------------------------------------------
- * table=1,priority=16384,tun_id=0x5,dl_dst=ff:ff:ff:ff:ff:ff \
- * actions=output:10,output:11,goto_table:2
- */
-
- writeTunnelFloodOut(dpid, TABLE_1_ISOLATE_TENANT, TABLE_2_LOCAL_FORWARD, segmentationId, tunnelOFPort);
}
private Long getIntegrationBridgeOFDPID (Node node) {
return;
}
- Map<String, org.opendaylight.ovsdb.lib.table.internal.Table<?>> intfs = ovsdbTable.getRows(node, Interface.NAME.getName());
+ Map<String, org.opendaylight.ovsdb.lib.table.Table<?>> intfs = ovsdbTable.getRows(node, Interface.NAME.getName());
if (intfs != null) {
- for (org.opendaylight.ovsdb.lib.table.internal.Table<?> row : intfs.values()) {
+ for (org.opendaylight.ovsdb.lib.table.Table<?> row : intfs.values()) {
Interface tunIntf = (Interface)row;
if (tunIntf.getName().equals(this.getTunnelName(tunnelType, dst))) {
of_ports = tunIntf.getOfport();
if (ofNodes != null) {
for (Node ofNode : ofNodes) {
if (ofNode.toString().contains(dpid+"")) {
- logger.info("Identified the Openflow node via toString {}", ofNode);
+ logger.debug("Identified the Openflow node via toString {}", ofNode);
ofNodeFound = true;
break;
}
this.programLocalRules(tunnelType, tunnelKey, srcNode, intf);
for (Node dstNode : nodes) {
- Status status = getTunnelReadinessStatus(dstNode, tunnelKey);
- if (!status.isSuccess()) continue;
InetAddress src = AdminConfigManager.getManager().getTunnelEndPoint(srcNode);
InetAddress dst = AdminConfigManager.getManager().getTunnelEndPoint(dstNode);
- status = addTunnelPort(srcNode, tunnelType, src, dst);
+ Status status = addTunnelPort(srcNode, tunnelType, src, dst);
if (status.isSuccess()) {
this.programTunnelRules(tunnelType, tunnelKey, dst, srcNode, intf, true);
}
private Status triggerInterfaceUpdates(Node node) {
try {
OVSDBConfigService ovsdbTable = (OVSDBConfigService)ServiceHelper.getGlobalInstance(OVSDBConfigService.class, this);
- Map<String, org.opendaylight.ovsdb.lib.table.internal.Table<?>> intfs = ovsdbTable.getRows(node, Interface.NAME.getName());
+ Map<String, org.opendaylight.ovsdb.lib.table.Table<?>> intfs = ovsdbTable.getRows(node, Interface.NAME.getName());
if (intfs != null) {
- for (org.opendaylight.ovsdb.lib.table.internal.Table<?> row : intfs.values()) {
+ for (org.opendaylight.ovsdb.lib.table.Table<?> row : intfs.values()) {
Interface intf = (Interface)row;
NeutronNetwork network = TenantNetworkManager.getManager().getTenantNetworkForInterface(intf);
logger.debug("Trigger Interface update for {}", intf);
}
@Override
- public Status deleteTunnels(String tunnelType, String tunnelKey, Node source, Interface intf) {
+ public Status handleInterfaceDelete(String tunnelType, String tunnelKey, Node source, Interface intf,
+ boolean isLastInstanceOnNode) {
// TODO Auto-generated method stub
return null;
}
// Call the InstructionBuilder Methods Containing Actions
createSendToControllerInstructions(ib);
+ ib.setOrder(0);
+ ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
// Add InstructionBuilder to the Instruction(s)Builder List
// Call the InstructionBuilder Methods Containing Actions
createGotoTableInstructions(ib, goToTableId);
+ ib.setOrder(0);
+ ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
// Add InstructionBuilder to the Instruction(s)Builder List
// Add Flow Attributes
flowBuilder.setId(new FlowId(flowId));
FlowKey key = new FlowKey(new FlowId(flowId));
+ flowBuilder.setStrict(true);
flowBuilder.setBarrier(false);
flowBuilder.setTableId(writeTable);
flowBuilder.setKey(key);
// TODO Broken In_Port Match
flowBuilder.setMatch(createInPortMatch(matchBuilder, dpidLong, inPort).build());
+ String flowId = "LocalMac_"+segmentationId+"_"+inPort+"_"+attachedMac;
+ // Add Flow Attributes
+ flowBuilder.setId(new FlowId(flowId));
+ FlowKey key = new FlowKey(new FlowId(flowId));
+ flowBuilder.setStrict(true);
+ flowBuilder.setBarrier(false);
+ flowBuilder.setTableId(writeTable);
+ flowBuilder.setKey(key);
+ flowBuilder.setFlowName(flowId);
+ flowBuilder.setHardTimeout(0);
+ flowBuilder.setIdleTimeout(0);
+
// Instantiate the Builders for the OF Actions and Instructions
InstructionBuilder ib = new InstructionBuilder();
InstructionsBuilder isb = new InstructionsBuilder();
// GOTO Instuctions Need to be added first to the List
createGotoTableInstructions(ib, goToTableId);
+ ib.setOrder(0);
+ ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
// TODO Broken SetTunID
createSetTunnelIdInstructions(ib, new BigInteger(segmentationId));
+ ib.setOrder(1);
+ ib.setKey(new InstructionKey(1));
instructions.add(ib.build());
// Add InstructionBuilder to the Instruction(s)Builder List
// Add InstructionsBuilder to FlowBuilder
flowBuilder.setInstructions(isb.build());
- String flowId = "LocalMac_"+segmentationId+"_"+inPort+"_"+attachedMac;
- // Add Flow Attributes
- flowBuilder.setId(new FlowId(flowId));
- FlowKey key = new FlowKey(new FlowId(flowId));
- flowBuilder.setBarrier(false);
- flowBuilder.setTableId(writeTable);
- flowBuilder.setKey(key);
- flowBuilder.setFlowName(flowId);
- flowBuilder.setHardTimeout(0);
- flowBuilder.setIdleTimeout(0);
writeFlow(flowBuilder, nodeBuilder);
}
// Call the InstructionBuilder Methods Containing Actions
createDropInstructions(ib);
+ ib.setOrder(0);
+ ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
// Add InstructionBuilder to the Instruction(s)Builder List
// Add Flow Attributes
flowBuilder.setId(new FlowId(flowId));
FlowKey key = new FlowKey(new FlowId(flowId));
+ flowBuilder.setStrict(true);
flowBuilder.setBarrier(false);
flowBuilder.setTableId((short) 0);
flowBuilder.setKey(key);
flowBuilder.setMatch(createTunnelIDMatch(matchBuilder, new BigInteger(segmentationId)).build());
flowBuilder.setMatch(createDestEthMatch(matchBuilder, new MacAddress(attachedMac), null).build());
+ String flowId = "TunnelOut_"+segmentationId+"_"+OFPortOut+"_"+attachedMac;
+ // Add Flow Attributes
+ flowBuilder.setId(new FlowId(flowId));
+ FlowKey key = new FlowKey(new FlowId(flowId));
+ flowBuilder.setStrict(true);
+ flowBuilder.setBarrier(false);
+ flowBuilder.setTableId(writeTable);
+ flowBuilder.setKey(key);
+ flowBuilder.setFlowName(flowId);
+ flowBuilder.setHardTimeout(0);
+ flowBuilder.setIdleTimeout(0);
// Instantiate the Builders for the OF Actions and Instructions
InstructionBuilder ib = new InstructionBuilder();
InstructionsBuilder isb = new InstructionsBuilder();
// GOTO Instuctions
createGotoTableInstructions(ib, goToTableId);
+ ib.setOrder(0);
+ ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
// Set the Output Port/Iface
createOutputPortInstructions(ib, dpidLong, OFPortOut);
+ ib.setOrder(1);
+ ib.setKey(new InstructionKey(1));
instructions.add(ib.build());
// Add InstructionBuilder to the Instruction(s)Builder List
// Add InstructionsBuilder to FlowBuilder
flowBuilder.setInstructions(isb.build());
- String flowId = "TunnelOut_"+segmentationId+"_"+OFPortOut+"_"+attachedMac;
- // Add Flow Attributes
- flowBuilder.setId(new FlowId(flowId));
- FlowKey key = new FlowKey(new FlowId(flowId));
- flowBuilder.setBarrier(false);
- flowBuilder.setTableId(writeTable);
- flowBuilder.setKey(key);
- flowBuilder.setFlowName(flowId);
- flowBuilder.setHardTimeout(0);
- flowBuilder.setIdleTimeout(0);
writeFlow(flowBuilder, nodeBuilder);
}
flowBuilder.setMatch(createDestEthMatch(matchBuilder, new MacAddress("01:00:00:00:00:00"), new MacAddress("01:00:00:00:00:00")).build());
+ String flowId = "TunnelFloodOut_"+segmentationId;
+ // Add Flow Attributes
+ flowBuilder.setId(new FlowId(flowId));
+ FlowKey key = new FlowKey(new FlowId(flowId));
+ flowBuilder.setBarrier(true);
+ flowBuilder.setTableId(writeTable);
+ flowBuilder.setKey(key);
+ flowBuilder.setPriority(16384);
+ flowBuilder.setFlowName(flowId);
+ flowBuilder.setHardTimeout(0);
+ flowBuilder.setIdleTimeout(0);
+
+ Flow flow = this.getFlow(flowBuilder, nodeBuilder);
// Instantiate the Builders for the OF Actions and Instructions
InstructionBuilder ib = new InstructionBuilder();
InstructionsBuilder isb = new InstructionsBuilder();
-
- // Instructions List Stores Individual Instructions
List<Instruction> instructions = new ArrayList<Instruction>();
-
+ List<Instruction> existingInstructions = null;
+ if (flow != null) {
+ Instructions ins = flow.getInstructions();
+ if (ins != null) {
+ existingInstructions = ins.getInstruction();
+ }
+ }
// GOTO Instuction
createGotoTableInstructions(ib, localTable);
+ ib.setOrder(0);
+ ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
// Set the Output Port/Iface
- createOutputPortInstructions(ib, dpidLong, OFPortOut);
+ createOutputPortInstructions(ib, dpidLong, OFPortOut, existingInstructions);
+ ib.setOrder(1);
+ ib.setKey(new InstructionKey(1));
instructions.add(ib.build());
// Add InstructionBuilder to the Instruction(s)Builder List
// Add InstructionsBuilder to FlowBuilder
flowBuilder.setInstructions(isb.build());
- String flowId = "TunnelFloodOut_"+segmentationId;
- // Add Flow Attributes
- flowBuilder.setId(new FlowId(flowId));
- FlowKey key = new FlowKey(new FlowId(flowId));
- flowBuilder.setBarrier(true);
- flowBuilder.setTableId(writeTable);
- flowBuilder.setKey(key);
- flowBuilder.setPriority(16384);
- flowBuilder.setFlowName(flowId);
- flowBuilder.setHardTimeout(0);
- flowBuilder.setIdleTimeout(0);
writeFlow(flowBuilder, nodeBuilder);
}
// Call the InstructionBuilder Methods Containing Actions
createGotoTableInstructions(ib, goToTableId);
+ ib.setOrder(0);
+ ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
// Add InstructionBuilder to the Instruction(s)Builder List
// Add Flow Attributes
flowBuilder.setId(new FlowId(flowId));
FlowKey key = new FlowKey(new FlowId(flowId));
+ flowBuilder.setStrict(true);
flowBuilder.setBarrier(false);
flowBuilder.setTableId(writeTable);
flowBuilder.setKey(key);
flowBuilder.setMatch(createTunnelIDMatch(matchBuilder, new BigInteger(segmentationId)).build());
flowBuilder.setMatch(createDestEthMatch(matchBuilder, new MacAddress(attachedMac), null).build());
+ String flowId = "UcastOut_"+segmentationId+"_"+localPort+"_"+attachedMac;
+ // Add Flow Attributes
+ flowBuilder.setId(new FlowId(flowId));
+ FlowKey key = new FlowKey(new FlowId(flowId));
+ flowBuilder.setStrict(true);
+ flowBuilder.setBarrier(false);
+ flowBuilder.setTableId(writeTable);
+ flowBuilder.setKey(key);
+ flowBuilder.setFlowName(flowId);
+ flowBuilder.setHardTimeout(0);
+ flowBuilder.setIdleTimeout(0);
+
// Instantiate the Builders for the OF Actions and Instructions
InstructionBuilder ib = new InstructionBuilder();
InstructionsBuilder isb = new InstructionsBuilder();
// Set the Output Port/Iface
createOutputPortInstructions(ib, dpidLong, localPort);
+ ib.setOrder(0);
+ ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
// Add InstructionBuilder to the Instruction(s)Builder List
// Add InstructionsBuilder to FlowBuilder
flowBuilder.setInstructions(isb.build());
-
- String flowId = "UcastOut_"+segmentationId+"_"+localPort+"_"+attachedMac;
- // Add Flow Attributes
- flowBuilder.setId(new FlowId(flowId));
- FlowKey key = new FlowKey(new FlowId(flowId));
- flowBuilder.setBarrier(false);
- flowBuilder.setTableId(writeTable);
- flowBuilder.setKey(key);
- flowBuilder.setFlowName(flowId);
- flowBuilder.setHardTimeout(0);
- flowBuilder.setIdleTimeout(0);
writeFlow(flowBuilder, nodeBuilder);
}
flowBuilder.setMatch(createTunnelIDMatch(matchBuilder, new BigInteger(segmentationId)).build());
flowBuilder.setMatch(createDestEthMatch(matchBuilder, new MacAddress("01:00:00:00:00:00"), new MacAddress("01:00:00:00:00:00")).build());
+ String flowId = "BcastOut_"+segmentationId;
+ // Add Flow Attributes
+ flowBuilder.setId(new FlowId(flowId));
+ FlowKey key = new FlowKey(new FlowId(flowId));
+ flowBuilder.setStrict(true);
+ flowBuilder.setBarrier(false);
+ flowBuilder.setTableId(writeTable);
+ flowBuilder.setKey(key);
+ flowBuilder.setPriority(16384);
+ flowBuilder.setFlowName(flowId);
+ flowBuilder.setHardTimeout(0);
+ flowBuilder.setIdleTimeout(0);
+ Flow flow = this.getFlow(flowBuilder, nodeBuilder);
// Instantiate the Builders for the OF Actions and Instructions
InstructionBuilder ib = new InstructionBuilder();
InstructionsBuilder isb = new InstructionsBuilder();
-
- // Instructions List Stores Individual Instructions
List<Instruction> instructions = new ArrayList<Instruction>();
+ List<Instruction> existingInstructions = null;
+ if (flow != null) {
+ Instructions ins = flow.getInstructions();
+ if (ins != null) {
+ existingInstructions = ins.getInstruction();
+ }
+ }
// Broken OutPort TODO: localPort needs to be a list of Ports)
- createOutputPortInstructions(ib, dpidLong, localPort);
+ createOutputPortInstructions(ib, dpidLong, localPort, existingInstructions);
+ ib.setOrder(0);
+ ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
// Add InstructionBuilder to the Instruction(s)Builder List
// Add InstructionsBuilder to FlowBuilder
flowBuilder.setInstructions(isb.build());
- String flowId = "BcastOut_"+segmentationId;
- // Add Flow Attributes
- flowBuilder.setId(new FlowId(flowId));
- FlowKey key = new FlowKey(new FlowId(flowId));
- flowBuilder.setBarrier(false);
- flowBuilder.setTableId(writeTable);
- flowBuilder.setKey(key);
- flowBuilder.setPriority(16384);
- flowBuilder.setFlowName(flowId);
- flowBuilder.setHardTimeout(0);
- flowBuilder.setIdleTimeout(0);
writeFlow(flowBuilder, nodeBuilder);
}
// Call the InstructionBuilder Methods Containing Actions
createDropInstructions(ib);
+ ib.setOrder(0);
+ ib.setKey(new InstructionKey(0));
instructions.add(ib.build());
// Add InstructionBuilder to the Instruction(s)Builder List
// Add Flow Attributes
flowBuilder.setId(new FlowId(flowId));
FlowKey key = new FlowKey(new FlowId(flowId));
+ flowBuilder.setStrict(true);
flowBuilder.setBarrier(false);
flowBuilder.setTableId(writeTable);
flowBuilder.setKey(key);
writeFlow(flowBuilder, nodeBuilder);
}
+ private Flow getFlow(FlowBuilder flowBuilder, NodeBuilder nodeBuilder) {
+ IMDSALConsumer mdsalConsumer = (IMDSALConsumer) ServiceHelper.getInstance(IMDSALConsumer.class, "default", this);
+ if (mdsalConsumer == null) {
+ logger.error("ERROR finding MDSAL Service. Its possible that writeFlow is called too soon ?");
+ return null;
+ }
+
+ dataBrokerService = mdsalConsumer.getDataBrokerService();
+
+ if (dataBrokerService == null) {
+ logger.error("ERROR finding reference for DataBrokerService. Please check out the MD-SAL support on the Controller.");
+ return null;
+ }
+
+ InstanceIdentifier<Flow> path1 = InstanceIdentifier.builder(Nodes.class).child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory
+ .rev130819.nodes.Node.class, nodeBuilder.getKey()).augmentation(FlowCapableNode.class).child(Table.class,
+ new TableKey(flowBuilder.getTableId())).child(Flow.class, flowBuilder.getKey()).build();
+ return (Flow)dataBrokerService.readConfigurationData(path1);
+ }
+
private void writeFlow(FlowBuilder flowBuilder, NodeBuilder nodeBuilder) {
IMDSALConsumer mdsalConsumer = (IMDSALConsumer) ServiceHelper.getInstance(IMDSALConsumer.class, "default", this);
if (mdsalConsumer == null) {
// Wrap our Apply Action in an Instruction
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
- ib.setOrder(0);
- ib.setKey(new InstructionKey(0));
return ib;
}
oab.setOutputNodeConnector(ncid);
ab.setAction(new OutputActionCaseBuilder().setOutputAction(oab.build()).build());
- ab.setOrder(5);
- ab.setKey(new ActionKey(5));
+ ab.setOrder(0);
+ ab.setKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
return ib;
}
+ /**
+ * Create Output Port Instruction
+ *
+ * @param ib Map InstructionBuilder without any instructions
+ * @param dpidLong Long the datapath ID of a switch/node
+ * @param port Long representing a port on a switch/node
+ * @return ib InstructionBuilder Map with instructions
+ */
+ protected static InstructionBuilder createOutputPortInstructions(InstructionBuilder ib, Long dpidLong, Long port , List<Instruction> instructions) {
+
+ NodeConnectorId ncid = new NodeConnectorId("openflow:" + dpidLong + ":" + port);
+ logger.debug("createOutputPortInstructions() Node Connector ID is - Type=openflow: DPID={} port={} existingInstructions={}", dpidLong, port, instructions);
+
+ List<Action> actionList = new ArrayList<Action>();
+ ActionBuilder ab = new ActionBuilder();
+
+ List<Action> existingActions = null;
+ if (instructions != null) {
+ for (Instruction in : instructions) {
+ if (in.getInstruction() instanceof ApplyActionsCase) {
+ existingActions = (((ApplyActionsCase) in.getInstruction()).getApplyActions().getAction());
+ actionList.addAll(existingActions);
+ }
+ }
+ }
+
+ OutputActionBuilder oab = new OutputActionBuilder();
+ oab.setOutputNodeConnector(ncid);
+ ab.setAction(new OutputActionCaseBuilder().setOutputAction(oab.build()).build());
+ ab.setOrder(0);
+ ab.setKey(new ActionKey(0));
+ Action newAction = ab.build();
+ boolean addNew = true;
+ for (Action action : actionList) {
+ if (action.getAction() instanceof OutputActionCase) {
+ OutputActionCase opAction = (OutputActionCase)action.getAction();
+ if (opAction.getOutputAction().getOutputNodeConnector().equals(new Uri(ncid))) {
+ addNew = false;
+ break;
+ }
+ }
+ }
+ if (addNew) actionList.add(newAction);
+
+ // Create an Apply Action
+ ApplyActionsBuilder aab = new ApplyActionsBuilder();
+ aab.setAction(actionList);
+ ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
+
+ return ib;
+ }
+
/**
* Create Set Vlan ID Instruction
*
// Wrap our Apply Action in an Instruction
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
- ib.setOrder(0);
- ib.setKey(new InstructionKey(0));
return ib;
}
// Wrap our Apply Action in an Instruction
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
- ib.setOrder(0);
- ib.setKey(new InstructionKey(0));
return ib;
}
// Wrap our Apply Action in an InstructionBuilder
ib.setInstruction(new GoToTableCaseBuilder().setGoToTable(gttb.build()).build());
- ib.setOrder(0);
- ib.setKey(new InstructionKey(0));
return ib;
}
aab.setAction(actionList);
// Wrap the Apply Action in an InstructionBuilder and return
- ib.setOrder(0);
- ib.setKey(new InstructionKey(0));
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
return ib;
ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
- ib.setKey(new InstructionKey(1));
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
return ib;
ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
- ib.setKey(new InstructionKey(1));
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
return ib;
ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
- ib.setKey(new InstructionKey(1));
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
return ib;
ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
- ib.setKey(new InstructionKey(1));
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
return ib;
aab.setAction(actionList);
// Wrap our Apply Action in an Instruction
- ib.setKey(new InstructionKey(0));
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
return ib;
aab.setAction(actionList);
// Wrap our Apply Action in an Instruction
- ib.setKey(new InstructionKey(1));
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
return ib;
// Wrap our Apply Action in an Instruction
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
- ib.setKey(new InstructionKey(0));
- ib.setOrder(0);
return ib;
}
for (Node ovsNode : ovsNodes) {
Long dpid = this.getIntegrationBridgeOFDPID(ovsNode);
logger.debug("Compare openflowNode to OVS br-int node {} vs {}", openflowNode.getID(), dpid);
- String openflowID = (String)openflowNode.getID();
+ String openflowID = ""+openflowNode.getID();
if (openflowID.contains(""+dpid)) {
this.initializeFlowRules(ovsNode, AdminConfigManager.getManager().getIntegrationBridgeName());
this.triggerInterfaceUpdates(ovsNode);