/** * Rewrite actions to use LINC OF optical extensions. * * @param actions original actions * @return rewritten actions */ private List<OFAction> rewriteActions(List<OFAction> actions) { List<OFAction> newActions = new LinkedList<>(); for (OFAction action : actions) { if (!(action instanceof OFActionSetField)) { newActions.add(action); continue; } OFActionSetField sf = (OFActionSetField) action; if (!(sf.getField() instanceof OFOxmExpOchSigId)) { newActions.add(action); continue; } OFOxmExpOchSigId oxm = (OFOxmExpOchSigId) sf.getField(); CircuitSignalID signalId = oxm.getValue(); newActions.add( factory().actions().circuit(factory().oxms().ochSigid(signalId))); } return newActions; }