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


Java OFVlanVidMatch.ofRawVid方法代码示例

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


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

示例1: mapSelector

import org.projectfloodlight.openflow.types.OFVlanVidMatch; //导入方法依赖的package包/类
@Override
public OFOxm<?> mapSelector(OFFactory factory, ExtensionSelector extensionSelector) {
    ExtensionSelectorType type = extensionSelector.type();
    if (type.equals(ExtensionSelectorType.ExtensionSelectorTypes.OFDPA_MATCH_VLAN_VID.type())) {
        VlanId vlanId = ((OfdpaMatchVlanVid) extensionSelector).vlanId();
        // Special VLAN 0x0000/0x1FFF required by OFDPA
        if (vlanId.equals(VlanId.NONE)) {
            OFVlanVidMatch vid = OFVlanVidMatch.ofRawVid((short) 0x0000);
            OFVlanVidMatch mask = OFVlanVidMatch.ofRawVid((short) 0x1FFF);
            return factory.oxms().vlanVidMasked(vid, mask);
        // Normal case
        } else if (vlanId.equals(VlanId.ANY)) {
            return factory.oxms().vlanVidMasked(OFVlanVidMatch.PRESENT, OFVlanVidMatch.PRESENT);
        } else {
            return factory.oxms().vlanVid(OFVlanVidMatch.ofVlanVid(VlanVid.ofVlan(vlanId.toShort())));
        }
    }
    throw new UnsupportedOperationException(
            "Unexpected ExtensionSelector: " + extensionSelector.toString());
}
 
开发者ID:shlee89,项目名称:athena,代码行数:21,代码来源:OfdpaExtensionSelectorInterpreter.java

示例2: mapInstruction

import org.projectfloodlight.openflow.types.OFVlanVidMatch; //导入方法依赖的package包/类
@Override
public OFAction mapInstruction(OFFactory factory, ExtensionTreatment extensionTreatment) {
    ExtensionTreatmentType type = extensionTreatment.type();
    if (type.equals(ExtensionTreatmentType.ExtensionTreatmentTypes.OFDPA_SET_VLAN_ID.type())) {
        VlanId vlanId = ((OfdpaSetVlanVid) extensionTreatment).vlanId();
        // NOTE: OFDPA requires isPresent bit set to zero.
        OFVlanVidMatch match = OFVlanVidMatch.ofRawVid(vlanId.toShort());
        return factory.actions().setField(factory.oxms().vlanVid(match));
    }
    throw new UnsupportedOperationException(
            "Unexpected ExtensionTreatment: " + extensionTreatment.toString());
}
 
开发者ID:shlee89,项目名称:athena,代码行数:13,代码来源:OfdpaExtensionTreatmentInterpreter.java


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