use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.rib.tables.Routes in project netvirt by opendaylight.
the class NeutronRouterChangeListener method update.
@Override
protected void update(InstanceIdentifier<Router> identifier, Router original, Router update) {
LOG.trace("Updating Router : key: {}, original value={}, update value={}", identifier, original, update);
neutronvpnUtils.addToRouterCache(update);
Uuid routerId = update.getUuid();
neutronvpnUtils.addToRouterCache(update);
Uuid vpnId = neutronvpnUtils.getVpnForRouter(routerId, true);
// internal vpn always present in case external vpn not found
if (vpnId == null) {
vpnId = routerId;
}
List<Routes> oldRoutes = original.getRoutes() != null ? original.getRoutes() : new ArrayList<>();
List<Routes> newRoutes = update.getRoutes() != null ? update.getRoutes() : new ArrayList<>();
if (!oldRoutes.equals(newRoutes)) {
newRoutes.removeIf(oldRoutes::remove);
handleChangedRoutes(vpnId, newRoutes, NwConstants.ADD_FLOW);
if (!oldRoutes.isEmpty()) {
handleChangedRoutes(vpnId, oldRoutes, NwConstants.DEL_FLOW);
}
}
nvpnNatManager.handleExternalNetworkForRouter(original, update);
gwMacResolver.sendArpRequestsToExtGateways(update);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.rib.tables.Routes in project bgpcep by opendaylight.
the class LabeledUnicastIpv4RIBSupportTest method testBuildMpReachNlriUpdate.
@Test
public void testBuildMpReachNlriUpdate() {
final Update update = RIB_SUPPORT.buildUpdate(createRoutes(ROUTES), Collections.emptyList(), ATTRIBUTES);
assertEquals(REACH_NLRI, update.getAttributes().getAugmentation(Attributes1.class).getMpReachNlri().getAdvertizedRoutes().getDestinationType());
assertNull(update.getAttributes().getAugmentation(Attributes2.class));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.rib.tables.Routes in project bgpcep by opendaylight.
the class LabeledUnicastIpv4RIBSupportTest method testEmptyRoute.
@Test
public void testEmptyRoute() throws Exception {
final Routes empty = new LabeledUnicastRoutesCaseBuilder().setLabeledUnicastRoutes(new LabeledUnicastRoutesBuilder().setLabeledUnicastRoute(Collections.emptyList()).build()).build();
final ChoiceNode emptyRoutes = RIB_SUPPORT.emptyRoutes();
assertEquals(createRoutes(empty), emptyRoutes);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.rib.tables.Routes in project bgpcep by opendaylight.
the class LabeledUnicastIpv6RIBSupportTest method testEmptyRoute.
@Test
public void testEmptyRoute() {
final Routes empty = new LabeledUnicastIpv6RoutesCaseBuilder().setLabeledUnicastIpv6Routes(new LabeledUnicastIpv6RoutesBuilder().setLabeledUnicastRoute(Collections.emptyList()).build()).build();
final ChoiceNode emptyRoutes = RIB_SUPPORT.emptyRoutes();
assertEquals(createRoutes(empty), emptyRoutes);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.rib.tables.Routes in project bgpcep by opendaylight.
the class LabeledUnicastIpv6RIBSupportTest method testBuildMpReachNlriUpdate.
@Test
public void testBuildMpReachNlriUpdate() {
final Update update = RIB_SUPPORT.buildUpdate(createRoutes(ROUTES), Collections.emptyList(), ATTRIBUTES);
assertEquals(REACH_NLRI, update.getAttributes().getAugmentation(Attributes1.class).getMpReachNlri().getAdvertizedRoutes().getDestinationType());
assertNull(update.getAttributes().getAugmentation(Attributes2.class));
}
Aggregations