• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java OFFlowDeleteStrict类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:19,代码来源:FlowModBuilderVer13.java


示例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();
}
 
开发者ID:fp7-netide,项目名称:Engine,代码行数:24,代码来源:FlowModBuilderVer13.java


示例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;
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:20,代码来源:FlowModBuilderVer13.java


示例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;
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:31,代码来源:StaticFlowEntryPusher.java


示例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();
	}
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:38,代码来源:FlowModUtils.java


示例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;
}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:32,代码来源:StaticFlowEntryPusher.java


示例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);
	}
}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:40,代码来源:OFSwitchHandshakeHandler.java


示例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);
	}
}
 
开发者ID:rizard,项目名称:fast-failover-demo,代码行数:42,代码来源:OFSwitchHandshakeHandler.java


示例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);
	}
}
 
开发者ID:DaiDongLiang,项目名称:DSC,代码行数:42,代码来源:OFSwitchHandshakeHandler.java



注:本文中的org.projectfloodlight.openflow.protocol.OFFlowDeleteStrict类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java PyTuple类代码示例发布时间:2022-05-21
下一篇:
Java FMLServerStartedEvent类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap