private List<OFAction> buildActions() { List<OFAction> acts = new LinkedList<>(); OFAction act; if (treatment == null) { return acts; } for (Instruction i : treatment.immediate()) { switch (i.type()) { case NOACTION: return Collections.emptyList(); case L2MODIFICATION: act = buildL2Modification(i); if (act != null) { acts.add(buildL2Modification(i)); } break; case L3MODIFICATION: act = buildL3Modification(i); if (act != null) { acts.add(buildL3Modification(i)); } break; case OUTPUT: OutputInstruction out = (OutputInstruction) i; OFActionOutput.Builder action = factory().actions().buildOutput() .setPort(OFPort.of((int) out.port().toLong())); if (out.port().equals(PortNumber.CONTROLLER)) { action.setMaxLen(OFPCML_NO_BUFFER); } acts.add(action.build()); break; case QUEUE: SetQueueInstruction queue = (SetQueueInstruction) i; if (queue.port() == null) { log.warn("Required argument 'port' undefined for OFActionEnqueue"); } OFActionEnqueue.Builder queueBuilder = factory().actions().buildEnqueue() .setQueueId(queue.queueId()) .setPort(OFPort.ofInt((int) queue.port().toLong())); acts.add(queueBuilder.build()); break; case L0MODIFICATION: case L1MODIFICATION: case GROUP: case TABLE: case METADATA: log.warn("Instruction type {} not supported with protocol version {}", i.type(), factory().getVersion()); break; default: log.warn("Instruction type {} not yet implemented.", i.type()); } } return acts; }