@Test public void testL2Flow() { MacAddress macAddress = new MacAddress(MAC_0); NodeConnectorId connectorId = new NodeConnectorId(CONNECTOR_0); MatchBuilder matchBuilder = new MatchBuilder(); matchBuilder.setEthernetMatch(FlowUtils.ethernetMatch(macAddress, null, null)) .setInPort(connectorId); Match match = matchBuilder.build(); Flow testFlow = buildFlow(FlowIdUtils.newFlowId(tableId, L2, match), tableId, 100, match, FlowUtils.gotoTableInstructions((short) 2)).build(); flows.l2flow((short) 2, new NodeConnectorId(CONNECTOR_0), new MacAddress(MAC_0), 100, ofWriter); verify(ofWriter, times(1)).writeFlow(NODE_ID, tableId, testFlow); }
void l2flow(short goToTable, NodeConnectorId connectorId, MacAddress macAddress, int priority, OfWriter ofWriter) { Match match = new MatchBuilder() .setEthernetMatch(FlowUtils.ethernetMatch(macAddress, null, null)) .setInPort(connectorId) .build(); FlowId flowid = FlowIdUtils.newFlowId(tableId, "L2", match); FlowBuilder flowBuilder = FlowUtils.base(tableId) .setPriority(priority) .setId(flowid) .setMatch(match) .setInstructions(FlowUtils.gotoTableInstructions(goToTable)); ofWriter.writeFlow(nodeId, tableId, flowBuilder.build()); }
PortSecurityFlows { void l2flow(short goToTable, NodeConnectorId connectorId, MacAddress macAddress, int priority, OfWriter ofWriter) { Match match = new MatchBuilder() .setEthernetMatch(FlowUtils.ethernetMatch(macAddress, null, null)) .setInPort(connectorId) .build(); FlowId flowid = FlowIdUtils.newFlowId(tableId, "L2", match); FlowBuilder flowBuilder = FlowUtils.base(tableId) .setPriority(priority) .setId(flowid) .setMatch(match) .setInstructions(FlowUtils.gotoTableInstructions(goToTable)); ofWriter.writeFlow(nodeId, tableId, flowBuilder.build()); } }
PortSecurityFlows { void l2flow(short goToTable, NodeConnectorId connectorId, MacAddress macAddress, int priority, OfWriter ofWriter) { Match match = new MatchBuilder() .setEthernetMatch(FlowUtils.ethernetMatch(macAddress, null, null)) .setInPort(connectorId) .build(); FlowId flowid = FlowIdUtils.newFlowId(tableId, "L2", match); FlowBuilder flowBuilder = FlowUtils.base(tableId) .setPriority(priority) .setId(flowid) .setMatch(match) .setInstructions(FlowUtils.gotoTableInstructions(goToTable)); ofWriter.writeFlow(nodeId, tableId, flowBuilder.build()); } PortSecurityFlows(NodeId nodeId, Short tableId); }
PortSecurityFlows { void l2flow(short goToTable, NodeConnectorId connectorId, MacAddress macAddress, int priority, OfWriter ofWriter) { Match match = new MatchBuilder() .setEthernetMatch(FlowUtils.ethernetMatch(macAddress, null, null)) .setInPort(connectorId) .build(); FlowId flowid = FlowIdUtils.newFlowId(tableId, "L2", match); FlowBuilder flowBuilder = FlowUtils.base(tableId) .setPriority(priority) .setId(flowid) .setMatch(match) .setInstructions(FlowUtils.gotoTableInstructions(goToTable)); ofWriter.writeFlow(nodeId, tableId, flowBuilder.build()); } PortSecurityFlows(NodeId nodeId, Short tableId);  }
PortSecurityFlows { void l2flow(short goToTable, NodeConnectorId connectorId, MacAddress macAddress, int priority, OfWriter ofWriter) { Match match = new MatchBuilder() .setEthernetMatch(FlowUtils.ethernetMatch(macAddress, null, null)) .setInPort(connectorId) .build(); FlowId flowid = FlowIdUtils.newFlowId(tableId, "L2", match); FlowBuilder flowBuilder = FlowUtils.base(tableId) .setPriority(priority) .setId(flowid) .setMatch(match) .setInstructions(FlowUtils.gotoTableInstructions(goToTable)); ofWriter.writeFlow(nodeId, tableId, flowBuilder.build()); } PortSecurityFlows(NodeId nodeId, Short tableId);   }