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