use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid in project lispflowmapping by opendaylight.
the class InstanceIdSerializerTest method deserialize__Simple.
@Test
public void deserialize__Simple() throws Exception {
Eid address = LispAddressSerializer.getInstance().deserializeEid(hexToByteBuffer(//
"40 03 00 00 " + //
"02 20 00 0A " + // instance ID
"00 BB CC DD " + // AFI=1, IP=0x11223344
"00 01 11 22 33 44"), new LispAddressSerializerContext(null));
assertEquals(Ipv4BinaryAfi.class, address.getAddressType());
Ipv4Binary ipv4 = (Ipv4Binary) address.getAddress();
assertArrayEquals(new byte[] { 0x11, 0x22, 0x33, 0x44 }, ipv4.getIpv4Binary().getValue());
assertEquals(0x00BBCCDD, address.getVirtualNetworkId().getValue().longValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid in project lispflowmapping by opendaylight.
the class KeyValueAddressSerializerTest method deserialize__Simple.
@Test
public void deserialize__Simple() throws Exception {
Eid address = LispAddressSerializer.getInstance().deserializeEid(hexToByteBuffer(//
"40 03 00 00 " + //
"0F 20 00 0C " + // AFI=1, IP=0x11223344
"00 01 11 22 33 44 " + "00 01 22 33 44 55"), // AFI=1, IP=0x22334455
null);
assertEquals(KeyValueAddressLcaf.class, address.getAddressType());
KeyValueAddress srcDestAddress = (KeyValueAddress) address.getAddress();
assertEquals("17.34.51.68", String.valueOf(srcDestAddress.getKeyValueAddress().getKey().getValue()));
assertEquals("34.51.68.85", String.valueOf(srcDestAddress.getKeyValueAddress().getValue().getValue()));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid in project lispflowmapping by opendaylight.
the class SourceDestKeySerializerTest method deserialize__Simple.
@Test
public void deserialize__Simple() throws Exception {
Eid address = LispAddressSerializer.getInstance().deserializeEid(hexToByteBuffer(//
"40 03 00 00 " + //
"0C 20 00 10 " + // reserved + masks
"00 00 10 18 " + // AFI=1, IP=0x11223344
"00 01 11 22 33 44 " + // AFI=1, IP=0x22334455
"00 01 22 33 44 55"), new LispAddressSerializerContext(null));
assertEquals(SourceDestKeyLcaf.class, address.getAddressType());
SourceDestKey srcDestAddress = (SourceDestKey) address.getAddress();
assertEquals((byte) 0x10, MaskUtil.getMaskForAddress(srcDestAddress.getSourceDestKey().getSource()));
assertEquals((byte) 0x18, MaskUtil.getMaskForAddress(srcDestAddress.getSourceDestKey().getDest()));
assertEquals("17.34.51.68/16", String.valueOf(srcDestAddress.getSourceDestKey().getSource().getValue()));
assertEquals("34.51.68.85/24", String.valueOf(srcDestAddress.getSourceDestKey().getDest().getValue()));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid in project lispflowmapping by opendaylight.
the class AuthKeyDb method removeAuthenticationKey.
@Override
public void removeAuthenticationKey(Eid eid) {
Eid key = MaskUtil.normalize(eid);
ILispDAO table = getVniTable(key);
if (table == null) {
return;
}
table.removeSpecific(key, SubKeys.AUTH_KEY);
if (table.isEmpty()) {
removeVniTable(eid);
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid in project lispflowmapping by opendaylight.
the class AuthKeyDb method addAuthenticationKey.
@Override
public void addAuthenticationKey(Eid eid, MappingAuthkey authKey) {
Eid key = MaskUtil.normalize(eid);
ILispDAO table = getOrInstantiateVniTable(key);
table.put(key, new MappingEntry<>(SubKeys.AUTH_KEY, authKey));
}
Aggregations