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

Java OFActionVendor类代码示例

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

本文整理汇总了Java中org.openflow.protocol.action.OFActionVendor的典型用法代码示例。如果您正苦于以下问题:Java OFActionVendor类的具体用法?Java OFActionVendor怎么用?Java OFActionVendor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



OFActionVendor类属于org.openflow.protocol.action包,在下文中一共展示了OFActionVendor类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: readFrom

import org.openflow.protocol.action.OFActionVendor; //导入依赖的package包/类
@Override
public OFActionVendor readFrom(ChannelBuffer data) {
    data.markReaderIndex();
    OFActionBigSwitchVendor demux = new OFActionBigSwitchVendorDemux();
    demux.readFrom(data);
    data.resetReaderIndex();

    switch(demux.getSubtype()) {
        case OFActionMirror.BSN_ACTION_MIRROR:
            OFActionMirror mirrorAction = new OFActionMirror((short) 0);
            mirrorAction.readFrom(data);
            return mirrorAction;
        case OFActionTunnelDstIP.SET_TUNNEL_DST_SUBTYPE:
            OFActionTunnelDstIP tunnelAction = new OFActionTunnelDstIP();
            tunnelAction.readFrom(data);
            return tunnelAction;
        default:
            logger.error("Unknown BSN vendor action subtype: "+demux.getSubtype());
            return null;
    }
}
 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:22,代码来源:OFBigSwitchVendorActionFactory.java


示例2: readFrom

import org.openflow.protocol.action.OFActionVendor; //导入依赖的package包/类
@Override
public OFActionVendor readFrom(ChannelBuffer data) {
    data.markReaderIndex();
    OFActionNiciraVendorDemux demux = new OFActionNiciraVendorDemux();
    demux.readFrom(data);
    data.resetReaderIndex();

    switch(demux.getSubtype()) {
        case OFActionNiciraTtlDecrement.TTL_DECREMENT_SUBTYPE:
            OFActionNiciraTtlDecrement ttlAction = new OFActionNiciraTtlDecrement();
            ttlAction.readFrom(data);
            return ttlAction;
        default:
            logger.error("Unknown Nicira vendor action subtype: "+demux.getSubtype());
            return null;
    }
}
 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:18,代码来源:OFNiciraVendorActionFactory.java


示例3: testAction

import org.openflow.protocol.action.OFActionVendor; //导入依赖的package包/类
@Test
public void testAction() {
    ChannelBuffer buf = ChannelBuffers.buffer(32);
    
    OFActionNiciraTtlDecrement act = new OFActionNiciraTtlDecrement();
    
    assertEquals(true, act instanceof OFActionNiciraVendor);
    assertEquals(true, act instanceof OFActionVendor);
    assertEquals(true, act instanceof OFAction);
    
    act.writeTo(buf);
    
    ChannelBuffer buf2 = buf.copy();
    
    assertEquals(16, buf.readableBytes());
    byte fromBuffer[] = new byte[16]; 
    buf.readBytes(fromBuffer);
    assertArrayEquals(expectedWireFormat, fromBuffer);
    
    // Test parsing. TODO: we don't really have the proper parsing
    // infrastructure....
    OFActionNiciraVendor act2 = new OFActionNiciraTtlDecrement();
    act2.readFrom(buf2);
    assertEquals(act, act2);
    assertNotSame(act, act2);
    
    assertEquals(OFActionType.VENDOR, act2.getType());
    assertEquals(16, act2.getLength());
    assertEquals(OFActionNiciraVendor.NICIRA_VENDOR_ID, act2.getVendor());
    assertEquals((short)18, act2.getSubtype());
}
 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:32,代码来源:OFActionNiciraTtlDecrementTest.java


示例4: parseActionOne

import org.openflow.protocol.action.OFActionVendor; //导入依赖的package包/类
private OFAction parseActionOne(final OFActionType type,
        final ChannelBuffer data) {
    OFAction ofa;
    data.markReaderIndex();
    ofa = this.getAction(type);
    ofa.readFrom(data);

    if (type == OFActionType.VENDOR) {
        final OFActionVendor vendorAction = (OFActionVendor) ofa;

        final OFVendorActionFactory vendorActionFactory = this.vendorActionRegistry
                .get(vendorAction.getVendor());

        if (vendorActionFactory != null) {
            // if we have a specific vendorActionFactory for this vendor id,
            // delegate to it for vendor-specific reparsing of the message
            data.resetReaderIndex();
            final OFActionVendor newAction = vendorActionFactory
                    .readFrom(data);
            if (newAction != null) {
                ofa = newAction;
            }
        }
    }

    if (OFAction.class.equals(ofa.getClass())) {
        // advance the position for un-implemented messages
        data.readerIndex(data.readerIndex() + ofa.getLengthU()
                - OFAction.MINIMUM_LENGTH);
    }
    return ofa;
}
 
开发者ID:CoVisor,项目名称:CoVisor,代码行数:33,代码来源:BasicFactory.java


示例5: parseActionOne

import org.openflow.protocol.action.OFActionVendor; //导入依赖的package包/类
private OFAction parseActionOne(OFActionType type, ChannelBuffer data) {
    OFAction ofa;
    data.markReaderIndex();
    ofa = getAction(type);
    ofa.readFrom(data);

    if(type == OFActionType.VENDOR) {
        OFActionVendor vendorAction = (OFActionVendor) ofa;

        OFVendorActionFactory vendorActionFactory = vendorActionRegistry.get(vendorAction.getVendor());

        if(vendorActionFactory != null) {
            // if we have a specific vendorActionFactory for this vendor id,
            // delegate to it for vendor-specific reparsing of the message
            data.resetReaderIndex();
            OFActionVendor newAction = vendorActionFactory.readFrom(data);
            if(newAction != null)
                ofa = newAction;
        }
    }

    if (OFAction.class.equals(ofa.getClass())) {
        // advance the position for un-implemented messages
        data.readerIndex(data.readerIndex()+(ofa.getLengthU() -
                OFAction.MINIMUM_LENGTH));
    }
    return ofa;
}
 
开发者ID:opendaylight,项目名称:archived-net-virt-platform,代码行数:29,代码来源:BasicFactory.java


示例6: rereadAndCheck

import org.openflow.protocol.action.OFActionVendor; //导入依赖的package包/类
protected void rereadAndCheck(OFVendorActionFactory factory, OFActionVendor action) {
    ChannelBuffer buf= ChannelBuffers.buffer(action.getLengthU());
    action.writeTo(buf);
    OFActionVendor readAction = factory.readFrom(buf);
    assertBeansEqual(action, readAction);
}
 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:7,代码来源:OFVendorActionFactoriesTest.java


示例7: readFrom

import org.openflow.protocol.action.OFActionVendor; //导入依赖的package包/类
/** parse the data from the wire, create and return a vendor-specific action.
 *
 * @param data contains a serialized vendor action at the current readerPosition.
 *    The full message is guaranteed to be available in the buffer.
 *
 * @return upon success returns a newly allocated vendor-specific
 *   action instance, and advances the readerPosition in data for the
 *   entire length. Upon failure, returns null and leaves the readerPosition
 *   in data unmodified.
 */
OFActionVendor readFrom(ChannelBuffer data);
 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:12,代码来源:OFVendorActionFactory.java


示例8: readFrom

import org.openflow.protocol.action.OFActionVendor; //导入依赖的package包/类
/**
 * parse the data from the wire, create and return a vendor-specific action.
 *
 * @param data
 *            contains a serialized vendor action at the current
 *            readerPosition. The full message is guaranteed to be available
 *            in the buffer.
 *
 * @return upon success returns a newly allocated vendor-specific action
 *         instance, and advances the readerPosition in data for the entire
 *         length. Upon failure, returns null and leaves the readerPosition
 *         in data unmodified.
 */
OFActionVendor readFrom(ChannelBuffer data);
 
开发者ID:CoVisor,项目名称:CoVisor,代码行数:15,代码来源:OFVendorActionFactory.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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