use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.rloc.container.Rloc in project lispflowmapping by opendaylight.
the class AfiListSerializerTest method deserialize__Simple.
@Test
public void deserialize__Simple() throws Exception {
Rloc address = LispAddressSerializer.getInstance().deserializeRloc(hexToByteBuffer(//
"40 03 00 00 " + //
"01 00 00 18 " + // IPv4
"00 01 AA BB CC DD " + // IPv6
"00 02 11 22 33 44 11 22 33 44 11 22 33 44 11 22 33 44"));
assertEquals(AfiListLcaf.class, address.getAddressType());
AfiList afiList = (AfiList) address.getAddress();
List<SimpleAddress> addressList = afiList.getAfiList().getAddressList();
assertEquals(2, addressList.size());
assertEquals("170.187.204.221", String.valueOf(addressList.get(0).getValue()));
assertEquals("1122:3344:1122:3344:1122:3344:1122:3344", String.valueOf(addressList.get(1).getValue()));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.rloc.container.Rloc in project lispflowmapping by opendaylight.
the class AfiListSerializerTest method deserialize__NoAddresses.
@Test
public void deserialize__NoAddresses() throws Exception {
Rloc address = LispAddressSerializer.getInstance().deserializeRloc(hexToByteBuffer(//
"40 03 00 00 " + "01 00 00 00 "));
assertEquals(AfiListLcaf.class, address.getAddressType());
AfiList afiList = (AfiList) address.getAddress();
List<SimpleAddress> addressList = afiList.getAfiList().getAddressList();
assertEquals(0, addressList.size());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.rloc.container.Rloc in project lispflowmapping by opendaylight.
the class LispAuthenticationTest method validate__SHA256.
@Test
public void validate__SHA256() throws Exception {
// LISP(Type = 3 Map-Register, P=1, M=1
// Record Counter: 1
// Nonce: (something)
// Key ID: 0x0002
// AuthDataLength: 32 Data:
// 70 30 d4 c6 10 44 0d 83 be 4d bf fd a9 8c 57 6d 68 a5 bf 32 11 c9 7b
// 58 c4 b9 9f 06 11 23 b9 38
// EID prefix: 153.16.254.1/32 (EID=0x9910FE01), TTL: 10, Authoritative,
// No-Action
// Local RLOC: 192.168.136.10 (RLOC=0xC0A8880A), Reachable,
// Priority/Weight: 1/100, Multicast Priority/Weight: 255/0
//
final ByteBuffer byteBuffer = hexToByteBuffer("38 00 01 01 FF BB " + "00 00 00 00 00 00 00 02 00 20 " + "70 30 d4 c6 10 44 0d 83 be 4d bf fd a9 8c 57 6d " + "68 a5 bf 32 11 c9 7b 58 c4 b9 9f 06 11 23 b9 38 " + "00 00 " + "00 0a 01 20 10 00 00 00 00 01 99 10 fe 01 01 64 " + "ff 00 00 05 00 01 c0 a8 88 0a");
MapRegister mapRegister = MapRegisterSerializer.getInstance().deserialize(byteBuffer, null);
assertTrue(validate(mapRegister, byteBuffer, EID, 2, PASSWORD));
assertFalse(validate(mapRegister, byteBuffer, EID, 2, WRONG_PASSWORD));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.rloc.container.Rloc in project lispflowmapping by opendaylight.
the class LispAuthenticationTest method validate__SHA1.
@Test
public void validate__SHA1() throws Exception {
// LISP(Type = 3 Map-Register, P=1, M=1
// Record Counter: 1
// Nonce: (something)
// Key ID: 0x0001
// AuthDataLength: 20 Data:
// b2:dd:1a:25:c0:60:b1:46:e8:dc:6d:a6:ae:2e:92:92:a6:ca:b7:9d
// EID prefix: 153.16.254.1/32 (EID=0x9910FE01), TTL: 10, Authoritative,
// No-Action
// Local RLOC: 192.168.136.10 (RLOC=0xC0A8880A), Reachable,
// Priority/Weight: 1/100, Multicast Priority/Weight: 255/0
//
final ByteBuffer byteBuffer = hexToByteBuffer("38 00 01 01 FF BB " + "00 00 00 00 00 00 00 01 00 14 2c 61 b9 c9 9a 20 ba d8 f5 40 d3 55 6f 5f 6e 5a b2 0a bf b5 00 00 " + "00 0a 01 20 10 00 00 00 00 01 99 10 fe 01 01 64 " + "ff 00 00 05 00 01 c0 a8 88 0a");
MapRegister mapRegister = MapRegisterSerializer.getInstance().deserialize(byteBuffer, null);
assertTrue(validate(mapRegister, byteBuffer, EID, 1, PASSWORD));
assertFalse(validate(mapRegister, byteBuffer, EID, 1, WRONG_PASSWORD));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.rloc.container.Rloc in project lispflowmapping by opendaylight.
the class LispAuthenticationTest method validate_WrongAuthentication.
@Test
public void validate_WrongAuthentication() throws Exception {
// LISP(Type = 3 Map-Register, P=1, M=1
// Record Counter: 1
// Nonce: (something)
// Key ID: 0x0001
// AuthDataLength: 20 Data:
// e8:f5:0b:c5:c5:f2:b0:21:27:a8:21:41:04:f3:46:5a:5a:5b:5c:5d
// EID prefix: 153.16.254.1/32 (EID=0x9910FE01), TTL: 10, Authoritative,
// No-Action
// Local RLOC: 192.168.136.10 (RLOC=0xC0A8880A), Reachable,
// Priority/Weight: 1/100, Multicast Priority/Weight: 255/0
final ByteBuffer byteBuffer = hexToByteBuffer("38 00 01 01 FF BB " + "00 00 00 00 00 00 00 01 00 14 e8 f5 0b c5 c5 f2 " + "b0 21 27 a8 21 41 04 f3 46 5a 5a 5b 5c 5d 00 00 " + "00 0a 01 20 10 00 00 00 00 01 99 10 fe 01 01 64 " + "ff 00 00 05 00 01 c0 a8 88 0a");
MapRegister mapRegister = MapRegisterSerializer.getInstance().deserialize(byteBuffer, null);
assertFalse(validate(mapRegister, byteBuffer, EID, 1, PASSWORD));
}
Aggregations