use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber in project lispflowmapping by opendaylight.
the class LispNotificationHelperTest method getTransportAddressFromRlocTest_withApplicationDataIpv4Address.
/**
* Tests {@link LispNotificationHelper#getTransportAddressFromRloc} method with ApplicationData type Ipv4 address.
*/
@Test
public void getTransportAddressFromRlocTest_withApplicationDataIpv4Address() {
final TransportAddress result = new TransportAddressBuilder().setIpAddress(new IpAddressBinary(ADDRESS_IPV4_BINARY)).setPort(new PortNumber(PORT)).build();
assertEquals(result, LispNotificationHelper.getTransportAddressFromRloc(RLOC_APPLICATION_DATA_IPV4));
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber in project lispflowmapping by opendaylight.
the class LispNotificationHelperTest method getTransportAddressFromRlocTest_withIpv4Address.
/**
* Tests {@link LispNotificationHelper#getTransportAddressFromRloc} method with Ipv4 type address.
*/
@Test
public void getTransportAddressFromRlocTest_withIpv4Address() {
final TransportAddress result = new TransportAddressBuilder().setIpAddress(new IpAddressBinary(ADDRESS_IPV4_BINARY)).setPort(new PortNumber(LispMessage.PORT_NUM)).build();
assertEquals(result, LispNotificationHelper.getTransportAddressFromRloc(RLOC_IPV4));
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber in project lispflowmapping by opendaylight.
the class LispNotificationHelperTest method getTransportAddressFromRlocTest_withKeyValueAddress.
/**
* Tests {@link LispNotificationHelper#getTransportAddressFromRloc} method with KeyValueAddress type address.
*/
@Test
public void getTransportAddressFromRlocTest_withKeyValueAddress() {
final TransportAddress result = new TransportAddressBuilder().setIpAddress(new IpAddressBinary(ADDRESS_IPV4_BINARY)).setPort(new PortNumber(PORT)).build();
assertEquals(result, LispNotificationHelper.getTransportAddressFromRloc(RLOC_KEYVALUE_ADDRESS));
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber in project lispflowmapping by opendaylight.
the class LispNotificationHelperTest method getTransportAddressFromRlocTest_withDistinguishedNameAddress.
/**
* Tests {@link LispNotificationHelper#getTransportAddressFromRloc} method with DistinguishedName type address.
*/
@Test
public void getTransportAddressFromRlocTest_withDistinguishedNameAddress() {
final TransportAddress result = new TransportAddressBuilder().setIpAddress(new IpAddressBinary(ADDRESS_IPV4_BINARY)).setPort(new PortNumber(PORT)).build();
assertEquals(result, LispNotificationHelper.getTransportAddressFromRloc(RLOC_DISTINGUISHED_NAME_ADDRESS));
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber in project lispflowmapping by opendaylight.
the class LispMappingService method onAddMapping.
@Override
public void onAddMapping(AddMapping mapRegisterNotification) {
Pair<MapNotify, List<TransportAddress>> result = handleMapRegister(mapRegisterNotification.getMapRegister());
if (result != null && result.getLeft() != null) {
MapNotify mapNotify = result.getLeft();
List<TransportAddress> rlocs = result.getRight();
if (rlocs == null) {
TransportAddressBuilder tab = new TransportAddressBuilder();
tab.setIpAddress(mapRegisterNotification.getTransportAddress().getIpAddress());
tab.setPort(new PortNumber(LispMessage.PORT_NUM));
sendMapNotify(mapNotify, tab.build());
} else {
for (TransportAddress ta : rlocs) {
sendMapNotify(mapNotify, ta);
}
}
} else {
LOG.debug("Not sending Map-Notify");
}
}
Aggregations