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


Java OFPortDescProp类代码示例

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


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

示例1: getTargetPowerRange

import org.projectfloodlight.openflow.protocol.OFPortDescProp; //导入依赖的package包/类
@Override
public Optional<Range<Long>> getTargetPowerRange(PortNumber port, T component) {
    for (OFPortDesc pd : getPortDescs()) {
        if (pd.getPortNo().getPortNumber() == port.toLong()) {
            for (OFPortDescProp prop : pd.getProperties()) {
                if (prop instanceof OFPortDescPropOptical) {
                    OFPortDescPropOptical oprop = (OFPortDescPropOptical) prop;
                    long txMin = oprop.getTxPwrMin();
                    long txMax = oprop.getTxPwrMax();
                    return Optional.of(Range.closed(txMin, txMax));
                }
            }
        }
    }
    return Optional.empty();
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:17,代码来源:OpenFlowPowerConfig.java

示例2: getPorts

import org.projectfloodlight.openflow.protocol.OFPortDescProp; //导入依赖的package包/类
@Override
public List<PortNumber> getPorts(T component) {
    List<PortNumber> ports = new ArrayList<>();
    for (OFPortDesc pd : getPortDescs()) {
        for (OFPortDescProp prop : pd.getProperties()) {
            // Note: Power monitor detection can actually be more complex
            // than this. It is possible that the power is not
            // configurable, but it is readable. In this case, the best
            // bet is probably to check rx/tx power info valid in the
            // port stats reply, unfortunately.
            if (prop instanceof OFPortDescPropOptical) {
                ports.add(PortNumber.portNumber(pd.getPortNo().getPortNumber()));
                break;
            }
        }
    }
    return ports;
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:19,代码来源:OpenFlowPowerConfig.java

示例3: testGenerationIdSet

import org.projectfloodlight.openflow.protocol.OFPortDescProp; //导入依赖的package包/类
@Test
public void testGenerationIdSet() {
    OFFactory factory = OFFactories.getFactory(OFVersion.OF_14);
    OFPortDesc desc = factory.buildPortDesc()
      .setProperties(ImmutableList.<OFPortDescProp>of(
              factory.portDescPropBsnGenerationId(U64.of(1234))))
      .build();

   assertThat(desc.getBsnGenerationId(), equalTo(U64.of(1234)));
}
 
开发者ID:floodlight,项目名称:loxigen-artifacts,代码行数:11,代码来源:OFPortDescTest.java


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