Java 类org.projectfloodlight.openflow.types.IPv6AddressWithMask 实例源码

项目:loxigen-artifacts    文件:OFOxmListTest.java   
@Test
public void testCanonicalize() {
    OFOxmList.Builder builder = new OFOxmList.Builder();
    IPv6AddressWithMask fullMasked = IPv6AddressWithMask.of("::/0");
    OFOxmIpv6DstMasked  fullMaskedOxm = oxms.ipv6DstMasked(fullMasked.getValue(), fullMasked.getMask());
    builder.set(fullMaskedOxm);

    IPv6AddressWithMask address= IPv6AddressWithMask.of("1:2:3:4:5:6::8");
    OFOxmIpv6SrcMasked  addressSrcOxm = oxms.ipv6SrcMasked(address.getValue(), address.getMask());
    builder.set(addressSrcOxm);

    OFOxmList list = builder.build();
    assertThat(list.get(MatchField.IPV6_DST), CoreMatchers.nullValue());
    assertFalse(list.get(MatchField.IPV6_SRC).isMasked());
}