本文整理汇总了Java中org.projectfloodlight.openflow.protocol.oxm.OFOxmIpv4Src类的典型用法代码示例。如果您正苦于以下问题:Java OFOxmIpv4Src类的具体用法?Java OFOxmIpv4Src怎么用?Java OFOxmIpv4Src使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OFOxmIpv4Src类属于org.projectfloodlight.openflow.protocol.oxm包,在下文中一共展示了OFOxmIpv4Src类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: buildOFMatchV3
import org.projectfloodlight.openflow.protocol.oxm.OFOxmIpv4Src; //导入依赖的package包/类
private OFMatchV3 buildOFMatchV3() {
OFFactory of13Factory = OFFactories.getFactory(OFVersion.OF_13);
OFOxms oxms = of13Factory.oxms();
OFOxmEthType ofOxmEthType = oxms.buildEthType().setValue(EthType.IPv4).build();
OFOxmIpv4Src ofOxmIpv4Src = oxms.buildIpv4Src().setValue(IPv4Address.of(multicastGroup.sourceIP)).build();
OFOxmIpProto ofOxmIpProto = oxms.buildIpProto().setValue(IpProtocol.UDP).build();
OFOxmIpv4Dst ofOxmIpv4Dst = oxms.buildIpv4Dst().setValue(IPv4Address.of(multicastGroup.groupIP)).build();
OFOxmList oxmList = OFOxmList.of(ofOxmEthType, ofOxmIpv4Src, ofOxmIpv4Dst, ofOxmIpProto);
OFMatchV3 of13Match = of13Factory.buildMatchV3().setOxmList(oxmList).build();
return of13Match;
}
开发者ID:hksoni,项目名称:SDN-Multicast,代码行数:13,代码来源:MulticastTree.java
示例2: testGetCanonicalNoMask
import org.projectfloodlight.openflow.protocol.oxm.OFOxmIpv4Src; //导入依赖的package包/类
@Test
public void testGetCanonicalNoMask() {
IPv4AddressWithMask fullIp = IPv4AddressWithMask.of("1.2.3.4/32");
assertEquals(IPv4Address.NO_MASK, fullIp.getMask());
OFOxmIpv4SrcMasked ipv4SrcMasked = oxms.ipv4SrcMasked(fullIp.getValue(), fullIp.getMask());
assertTrue(ipv4SrcMasked.isMasked());
assertEquals(IPv4Address.NO_MASK, ipv4SrcMasked.getMask());
// canonicalize should convert the masked oxm to the non-masked one
OFOxm<IPv4Address> canonical = ipv4SrcMasked.getCanonical();
assertThat(canonical, CoreMatchers.instanceOf(OFOxmIpv4Src.class));
assertFalse(canonical.isMasked());
}
开发者ID:floodlight,项目名称:loxigen-artifacts,代码行数:14,代码来源:OFOxmTest.java
注:本文中的org.projectfloodlight.openflow.protocol.oxm.OFOxmIpv4Src类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论