本文整理汇总了Java中org.projectfloodlight.openflow.protocol.OFFlowDeleteStrict类的典型用法代码示例。如果您正苦于以下问题:Java OFFlowDeleteStrict类的具体用法?Java OFFlowDeleteStrict怎么用?Java OFFlowDeleteStrict使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OFFlowDeleteStrict类属于org.projectfloodlight.openflow.protocol包,在下文中一共展示了OFFlowDeleteStrict类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildFlowDel
import org.projectfloodlight.openflow.protocol.OFFlowDeleteStrict; //导入依赖的package包/类
@Override
public OFFlowMod buildFlowDel() {
Match match = buildMatch();
long cookie = flowRule().id().value();
OFFlowDeleteStrict fm = factory().buildFlowDeleteStrict()
.setXid(xid)
.setCookie(U64.of(cookie))
.setBufferId(OFBufferId.NO_BUFFER)
.setMatch(match)
.setFlags(Collections.singleton(OFFlowModFlags.SEND_FLOW_REM))
.setPriority(flowRule().priority())
.setTableId(TableId.of(flowRule().tableId()))
.build();
return fm;
}
示例2: buildFlowDel
import org.projectfloodlight.openflow.protocol.OFFlowDeleteStrict; //导入依赖的package包/类
@Override
public OFFlowMod buildFlowDel() {
Match match = buildMatch();
long cookie = flowRule().id().value();
OFFlowDeleteStrict.Builder fm = factory().buildFlowDeleteStrict()
.setXid(xid)
.setCookie(U64.of(cookie))
.setBufferId(OFBufferId.NO_BUFFER)
.setMatch(match)
.setFlags(Collections.singleton(OFFlowModFlags.SEND_FLOW_REM))
.setPriority(flowRule().priority())
.setTableId(TableId.of(flowRule().tableId()));
if (flowRule().timeout() != 0) {
fm.setIdleTimeout(flowRule().timeout());
} else {
fm.setHardTimeout(flowRule().hardTimeout());
}
return fm.build();
}
示例3: buildFlowDel
import org.projectfloodlight.openflow.protocol.OFFlowDeleteStrict; //导入依赖的package包/类
@Override
public OFFlowMod buildFlowDel() {
Match match = buildMatch();
long cookie = flowRule().id().value();
OFFlowDeleteStrict fm = factory().buildFlowDeleteStrict()
.setXid(xid)
.setCookie(U64.of(cookie))
.setBufferId(OFBufferId.NO_BUFFER)
.setMatch(match)
.setFlags(Collections.singleton(OFFlowModFlags.SEND_FLOW_REM))
.setPriority(flowRule().priority())
.setTableId(TableId.of(flowRule().tableId()))
.setHardTimeout(flowRule().hardTimeout())
.build();
return fm;
}
示例4: deleteStaticFlowEntry
import org.projectfloodlight.openflow.protocol.OFFlowDeleteStrict; //导入依赖的package包/类
private void deleteStaticFlowEntry(String entryName) {
String dpid = entry2dpid.remove(entryName);
if (dpid == null) {
// assume state has been cleared by deleteFlowsForSwitch() or
// deleteAllFlows()
return;
}
if (log.isDebugEnabled()) {
log.debug("Sending delete flow mod for flow {} for switch {}", entryName, dpid);
}
// send flow_mod delete
if (switchService.getSwitch(DatapathId.of(dpid)) != null) {
OFFlowDeleteStrict flowMod = FlowModUtils.toFlowDeleteStrict(entriesFromStorage.get(dpid).get(entryName));
if (entriesFromStorage.containsKey(dpid) && entriesFromStorage.get(dpid).containsKey(entryName)) {
entriesFromStorage.get(dpid).remove(entryName);
} else {
log.debug("Tried to delete non-existent entry {} for switch {}", entryName, dpid);
return;
}
writeFlowModToSwitch(DatapathId.of(dpid), flowMod);
} else {
log.debug("Not sending flow delete for disconnected switch.");
}
return;
}
示例5: toFlowDeleteStrict
import org.projectfloodlight.openflow.protocol.OFFlowDeleteStrict; //导入依赖的package包/类
public static OFFlowDeleteStrict toFlowDeleteStrict(OFFlowMod fm) {
OFVersion version = fm.getVersion();
OFFlowDeleteStrict.Builder b = OFFactories.getFactory(version).buildFlowDeleteStrict();
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();
}
}
示例6: deleteStaticFlowEntry
import org.projectfloodlight.openflow.protocol.OFFlowDeleteStrict; //导入依赖的package包/类
@LogMessageDoc(level="ERROR",
message="inconsistent internal state: no switch has rule {rule}",
explanation="Inconsistent internat state discovered while " +
"deleting a static flow rule",
recommendation=LogMessageDoc.REPORT_CONTROLLER_BUG)
private void deleteStaticFlowEntry(String entryName) {
String dpid = entry2dpid.remove(entryName);
if (dpid == null) {
// assume state has been cleared by deleteFlowsForSwitch() or
// deleteAllFlows()
return;
}
if (log.isDebugEnabled()) {
log.debug("Sending delete flow mod for flow {} for switch {}", entryName, dpid);
}
// send flow_mod delete
OFFlowDeleteStrict flowMod = FlowModUtils.toFlowDeleteStrict(entriesFromStorage.get(dpid).get(entryName));
if (entriesFromStorage.containsKey(dpid) && entriesFromStorage.get(dpid).containsKey(entryName)) {
entriesFromStorage.get(dpid).remove(entryName);
} else {
log.debug("Tried to delete non-existent entry {} for switch {}", entryName, dpid);
return;
}
writeFlowModToSwitch(DatapathId.of(dpid), flowMod);
return;
}
示例7: addDefaultFlows
import org.projectfloodlight.openflow.protocol.OFFlowDeleteStrict; //导入依赖的package包/类
/**
* Adds an initial table-miss flow to each
* and every table on the switch. This replaces the default behavior of
* forwarding table-miss packets to the controller. The table-miss flows
* inserted will forward all packets that do not match a flow to the
* controller for processing.
*
* Adding the default flow only applies to OpenFlow 1.3+ switches, which
* remove the default forward-to-controller behavior of flow tables.
*/
private void addDefaultFlows() {
/*
* Only for OF1.3+, insert the default forward-to-controller flow for
* each table. This is priority=0 with no Match.
*/
if (this.sw.getOFFactory().getVersion().compareTo(OFVersion.OF_13) >= 0) {
/*
* Remove the default flow if it's present.
*/
OFFlowDeleteStrict deleteFlow = this.factory.buildFlowDeleteStrict()
.setTableId(TableId.ALL)
.setOutPort(OFPort.CONTROLLER)
.build();
this.sw.write(deleteFlow);
ArrayList<OFAction> actions = new ArrayList<OFAction>(1);
actions.add(factory.actions().output(OFPort.CONTROLLER, 0xffFFffFF));
ArrayList<OFMessage> flows = new ArrayList<OFMessage>();
for (int tableId = 0; tableId < this.sw.getTables(); tableId++) {
OFFlowAdd defaultFlow = this.factory.buildFlowAdd()
.setTableId(TableId.of(tableId))
.setPriority(0)
.setActions(actions)
.build();
flows.add(defaultFlow);
}
this.sw.write(flows);
}
}
示例8: addDefaultFlows
import org.projectfloodlight.openflow.protocol.OFFlowDeleteStrict; //导入依赖的package包/类
/**
* Adds an initial table-miss flow to tables on the switch.
* This replaces the default behavior of forwarding table-miss packets
* to the controller. The table-miss flows inserted will forward all
* packets that do not match a flow to the controller for processing.
*
* The OFSwitchManager is checked for used-defined behavior and default
* max table to try to use.
*
* Adding the default flow only applies to OpenFlow 1.3+ switches, which
* remove the default forward-to-controller behavior of flow tables.
*/
private void addDefaultFlows() {
/*
* Only for OF1.3+, insert the default forward-to-controller flow for
* each table. This is priority=0 with no Match.
*/
if (this.sw.getOFFactory().getVersion().compareTo(OFVersion.OF_13) >= 0) {
/*
* Remove the default flow if it's present.
*/
OFFlowDeleteStrict deleteFlow = this.factory.buildFlowDeleteStrict()
.setTableId(TableId.ALL)
.setOutPort(OFPort.CONTROLLER)
.build();
this.sw.write(deleteFlow);
ArrayList<OFAction> actions = new ArrayList<OFAction>(1);
actions.add(factory.actions().output(OFPort.CONTROLLER, 0xffFFffFF));
ArrayList<OFMessage> flows = new ArrayList<OFMessage>();
for (int tableId = 0; tableId <= this.sw.getMaxTableForTableMissFlow().getValue(); tableId++) {
OFFlowAdd defaultFlow = this.factory.buildFlowAdd()
.setTableId(TableId.of(tableId))
.setPriority(0)
.setActions(actions)
.build();
flows.add(defaultFlow);
}
this.sw.write(flows);
}
}
示例9: addDefaultFlows
import org.projectfloodlight.openflow.protocol.OFFlowDeleteStrict; //导入依赖的package包/类
/**
* Adds an initial table-miss flow to each
* and every table on the switch. This replaces the default behavior of
* forwarding table-miss packets to the controller. The table-miss flows
* inserted will forward all packets that do not match a flow to the
* controller for processing.
*
* Adding the default flow only applies to OpenFlow 1.3+ switches, which
* remove the default forward-to-controller behavior of flow tables.
*
* 下发table-miss
*/
private void addDefaultFlows() {
/*
* Only for OF1.3+, insert the default forward-to-controller flow for
* each table. This is priority=0 with no Match.
*/
if (this.sw.getOFFactory().getVersion().compareTo(OFVersion.OF_13) >= 0) {
/*
* Remove the default flow if it's present.
*/
OFFlowDeleteStrict deleteFlow = this.factory.buildFlowDeleteStrict()
.setTableId(TableId.ALL)
.setOutPort(OFPort.CONTROLLER)
.build();
this.sw.write(deleteFlow);
ArrayList<OFAction> actions = new ArrayList<OFAction>(1);
actions.add(factory.actions().output(OFPort.CONTROLLER, 0xffFFffFF));
ArrayList<OFMessage> flows = new ArrayList<OFMessage>();
for (int tableId = 0; tableId < this.sw.getTables(); tableId++) {
OFFlowAdd defaultFlow = this.factory.buildFlowAdd()
.setTableId(TableId.of(tableId))
.setPriority(0)
.setActions(actions)
.build();
flows.add(defaultFlow);
}
this.sw.write(flows);
}
}