本文整理汇总了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());
}
示例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());
}