/** * Write a drop flow for the given ethertype at the given priority. If the ethertype is null, then * drop all traffic */ public Flow dropFlow(Integer priority, Long etherType, Short tableId) { FlowId flowid; FlowBuilder flowb = base().setPriority(priority).setInstructions(FlowUtils.dropInstructions()); if (etherType != null) { MatchBuilder mb = new MatchBuilder().setEthernetMatch(FlowUtils.ethernetMatch(null, null, etherType)); Match match = mb.build(); flowid = FlowIdUtils.newFlowId(tableId, "drop", match); flowb.setMatch(match); } else { flowid = FlowIdUtils.newFlowId("dropAll"); } flowb.setId(flowid); return flowb.build(); }