public static OFFlowModifyStrict toFlowModifyStrict(OFFlowMod fm) { OFVersion version = fm.getVersion(); OFFlowModifyStrict.Builder b = OFFactories.getFactory(version).buildFlowModifyStrict(); if (b.getVersion().compareTo(OFVersion.OF_10) == 0) { return b.setActions(fm.getActions()) .setBufferId(fm.getBufferId()) .setCookie(fm.getCookie()) // cookie-mask not supported .setFlags(fm.getFlags()) .setHardTimeout(fm.getHardTimeout()) .setIdleTimeout(fm.getIdleTimeout()) // instructions not supported .setMatch(fm.getMatch()) // out-group not supported .setOutPort(fm.getOutPort()) .setPriority(fm.getPriority()) // table-id not supported .setXid(fm.getXid()) .build(); } else { return b.setActions(fm.getActions()) .setBufferId(fm.getBufferId()) .setCookie(fm.getCookie()) .setCookieMask(fm.getCookieMask()) // added in OF1.1 .setFlags(fm.getFlags()) .setHardTimeout(fm.getHardTimeout()) .setIdleTimeout(fm.getIdleTimeout()) .setInstructions(fm.getInstructions()) // added in OF1.1 .setMatch(fm.getMatch()) .setOutGroup(fm.getOutGroup()) // added in OF1.1 .setOutPort(fm.getOutPort()) .setPriority(fm.getPriority()) .setTableId(fm.getTableId()) .setXid(fm.getXid()) .build(); } }