use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid in project lispflowmapping by opendaylight.
the class MaskUtilTest method normalizeTest_withIpv6Prefix.
/**
* Tests {@link MaskUtil#normalize} method with Ipv6Prefix.
*/
@Test
public void normalizeTest_withIpv6Prefix() {
// input ip: 1111:2222:3333:4444:5555:6666:7777:8888, mask: 66
final Eid result = MaskUtil.normalize(EID_IPV6_PREFIX);
final org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv6Prefix resultPrefix = (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.Ipv6Prefix) result.getAddress();
// expected result
final String expectedResult = "1111:2222:3333:4444:4000::" + MASK_3;
assertEquals(expectedResult, resultPrefix.getIpv6Prefix().getValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid in project lispflowmapping by opendaylight.
the class SourceDestKeyHelperTest method getDstBinaryTest_sourceDestKey.
/**
* Tests {@link SourceDestKeyHelper#getDstBinary} method with SourceDestKey address type.
*/
@Test
public void getDstBinaryTest_sourceDestKey() {
final Eid expectedResult = new EidBuilder().setAddress(IPV4_DEST_PREFIX_BINARY).setVirtualNetworkId(INSTANCE_ID).setAddressType(Ipv4PrefixBinaryAfi.class).build();
assertEquals(expectedResult, SourceDestKeyHelper.getDstBinary(EID_SOURCE_DEST_KEY));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid in project lispflowmapping by opendaylight.
the class SourceDestKeyHelperTest method getSrcBinaryTest_sourceDestKey.
/**
* Tests {@link SourceDestKeyHelper#getSrcBinary} method with SourceDestKey address type.
*/
@Test
public void getSrcBinaryTest_sourceDestKey() {
final Eid expectedResult = new EidBuilder().setAddress(IPV4_SOURCE_PREFIX_BINARY).setVirtualNetworkId(INSTANCE_ID).setAddressType(Ipv4PrefixBinaryAfi.class).build();
assertEquals(expectedResult, SourceDestKeyHelper.getSrcBinary(EID_SOURCE_DEST_KEY));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid in project lispflowmapping by opendaylight.
the class SourceDestKeyHelperTest method getSrcTest_sourceDestKey.
/**
* Tests {@link SourceDestKeyHelper#getSrc} method with SourceDestKey address type.
*/
@Test
public void getSrcTest_sourceDestKey() {
final Eid expectedResult = new EidBuilder().setAddress(new Ipv4PrefixBuilder().setIpv4Prefix(IPV4_PREFIX_SOURCE).build()).setVirtualNetworkId(INSTANCE_ID).setAddressType(Ipv4PrefixAfi.class).build();
assertEquals(expectedResult, SourceDestKeyHelper.getSrc(EID_SOURCE_DEST_KEY));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid in project lispflowmapping by opendaylight.
the class MapNotifySerializationTest method deserialize__MultipleRecords.
@Test
public void deserialize__MultipleRecords() throws Exception {
// LISP(Type = 4 Map-Notify, I=1
// Record Counter: 4
// EID prefixes: 153.16.254.1 -- 152.16.254.1 -- 151.16.254.1 --
// 150.16.254.1
// Local RLOCs: 192.168.136.10 -- 192.168.136.11 -- 192.168.136.12 --
// 192.168.136.13
//
MapNotify mn = MapNotifySerializer.getInstance().deserialize(hexToByteBuffer("40 00 00 " + // Record count
"04 " + "FF BB 00 00 00 00 00 00 00 01 00 14 87 c1 33 cd " + "d1 1e bc 80 fd 3e 71 11 81 17 40 74 26 25 44 bd " + // Record
"00 00 00 0a 01 20 10 00 00 00 00 01 99 10 fe 01 01 64 " + // 1
"ff 00 00 05 00 01 c0 a8 88 0a " + // contd
"00 00 00 0a 01 20 10 00 00 00 00 01 98 10 fe 01 01 64 " + // 2
"ff 00 00 05 00 01 c0 a8 88 0b " + // contd
"00 00 00 0a 01 20 10 00 00 00 00 01 97 10 fe 01 01 64 " + // 3
"ff 00 00 05 00 01 c0 a8 88 0c " + // contd
"00 00 00 0a 01 20 10 00 00 00 00 01 96 10 fe 01 01 64 " + // 4
"ff 00 00 05 00 01 c0 a8 88 0d "));
assertEquals(4, mn.getMappingRecordItem().size());
assertEquals(LispAddressUtil.asIpv4PrefixBinaryEid("153.16.254.1/32"), mn.getMappingRecordItem().get(0).getMappingRecord().getEid());
assertEquals(LispAddressUtil.asIpv4PrefixBinaryEid("151.16.254.1/32"), mn.getMappingRecordItem().get(2).getMappingRecord().getEid());
assertEquals(LispAddressUtil.asIpv4Rloc("192.168.136.11"), mn.getMappingRecordItem().get(1).getMappingRecord().getLocatorRecord().get(0).getRloc());
assertEquals(LispAddressUtil.asIpv4Rloc("192.168.136.13"), mn.getMappingRecordItem().get(3).getMappingRecord().getLocatorRecord().get(0).getRloc());
}
Aggregations