当前位置: 首页>>代码示例>>Java>>正文


Java OFMetadata类代码示例

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


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

示例1: getOFBsnPktinFlags

import org.projectfloodlight.openflow.types.OFMetadata; //导入依赖的package包/类
/**
 * This function is used in BVS T5/6 to decode the multiple packet in
 * reasons in Match.MetaData field.
 * */
public static Set<OFBsnPktinFlag> getOFBsnPktinFlags(OFPacketIn pktIn) {
    if(pktIn.getVersion() != OFVersion.OF_13) {
        throw new IllegalArgumentException("multiple pkt in reasons are "
                                           + "only supported by BVS using "
                                           + "openflow 1.3");
    }

    Match match = pktIn.getMatch();
    if(match == null) {
        return ImmutableSet.<OFBsnPktinFlag>of();
    }
    OFMetadata metaData = match.get(MatchField.METADATA);
    if(metaData == null) {
        return ImmutableSet.<OFBsnPktinFlag>of();
    }
    U64 metaDataValue = metaData.getValue();
    if(metaDataValue == null) {
        return ImmutableSet.<OFBsnPktinFlag>of();
    }
    return OFBsnPktinFlagSerializerVer13.ofWireValue(metaDataValue
                                                           .getValue());
}
 
开发者ID:o3project,项目名称:openflowj-otn,代码行数:27,代码来源:MultiplePktInReasonUtil.java

示例2: getOFBsnPktinFlags

import org.projectfloodlight.openflow.types.OFMetadata; //导入依赖的package包/类
/**
 * This function is used in BVS T5/6 to decode the multiple packet in
 * reasons in Match.MetaData field.
 *
 * @param pktIn the packet in message
 * @return the set of packet in reasons
 */
public static Set<OFBsnPktinFlag> getOFBsnPktinFlags(OFPacketIn pktIn) {
    if(pktIn.getVersion().compareTo(OFVersion.OF_13) < 0) {
        throw new IllegalArgumentException("multiple pkt in reasons are "
                                           + "only supported by BVS using "
                                           + "openflow version >= 1.3");
    }

    Match match = pktIn.getMatch();
    if(match == null) {
        return ImmutableSet.<OFBsnPktinFlag>of();
    }
    OFMetadata metaData = match.get(MatchField.METADATA);
    if(metaData == null) {
        return ImmutableSet.<OFBsnPktinFlag>of();
    }
    U64 metaDataValue = metaData.getValue();
    if(metaDataValue == null) {
        return ImmutableSet.<OFBsnPktinFlag>of();
    }
    return OFBsnPktinFlagSerializerVer13.ofWireValue(metaDataValue
                                                           .getValue());
}
 
开发者ID:floodlight,项目名称:loxigen-artifacts,代码行数:30,代码来源:MultiplePktInReasonUtil.java


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