本文整理汇总了Java中org.projectfloodlight.openflow.protocol.OFFlowDelete.Builder方法的典型用法代码示例。如果您正苦于以下问题:Java OFFlowDelete.Builder方法的具体用法?Java OFFlowDelete.Builder怎么用?Java OFFlowDelete.Builder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.projectfloodlight.openflow.protocol.OFFlowDelete
的用法示例。
在下文中一共展示了OFFlowDelete.Builder方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildFlowDel
import org.projectfloodlight.openflow.protocol.OFFlowDelete; //导入方法依赖的package包/类
@Override
public OFFlowDelete buildFlowDel() {
Match match = buildMatch();
long cookie = flowRule().id().value();
OFFlowDelete.Builder fm = factory().buildFlowDelete()
.setXid(xid)
.setCookie(U64.of(cookie))
.setBufferId(OFBufferId.NO_BUFFER)
.setMatch(match)
.setFlags(Collections.singleton(OFFlowModFlags.SEND_FLOW_REM))
.setPriority(flowRule().priority());
if (flowRule().timeout() != 0) {
fm.setIdleTimeout(flowRule().timeout());
} else {
fm.setHardTimeout(flowRule().hardTimeout());
}
return fm.build();
}
示例2: toFlowDelete
import org.projectfloodlight.openflow.protocol.OFFlowDelete; //导入方法依赖的package包/类
public static OFFlowDelete toFlowDelete(OFFlowMod fm) {
OFVersion version = fm.getVersion();
OFFlowDelete.Builder b = OFFactories.getFactory(version).buildFlowDelete();
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();
}
}