use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.rib.tables.Routes in project bgpcep by opendaylight.
the class VpnIpv6RIBSupportTest method testEmptyRoute.
@Test
public void testEmptyRoute() {
final Routes empty = new VpnIpv6RoutesCaseBuilder().setVpnIpv6Routes(new VpnIpv6RoutesBuilder().setVpnRoute(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.rev180329.rib.tables.Routes in project bgpcep by opendaylight.
the class VpnIpv4RIBSupportTest 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.rev180329.rib.tables.Routes in project bgpcep by opendaylight.
the class VpnIpv4RIBSupportTest method testBuildMpUnreachNlriUpdate.
@Test
public void testBuildMpUnreachNlriUpdate() {
final Update update = RIB_SUPPORT.buildUpdate(Collections.emptyList(), createRoutes(ROUTES), ATTRIBUTES);
assertEquals(UNREACH_NLRI, update.getAttributes().getAugmentation(Attributes2.class).getMpUnreachNlri().getWithdrawnRoutes().getDestinationType());
assertNull(update.getAttributes().getAugmentation(Attributes1.class));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.rib.tables.Routes in project bgpcep by opendaylight.
the class LocRibWriter method update.
@SuppressWarnings("unchecked")
private Map<RouteUpdateKey, RouteEntry> update(final WriteTransaction tx, final Collection<DataTreeModification<Tables>> changes) {
final Map<RouteUpdateKey, RouteEntry> ret = new HashMap<>();
for (final DataTreeModification<Tables> tc : changes) {
final DataObjectModification<Tables> table = tc.getRootNode();
final DataTreeIdentifier<Tables> rootPath = tc.getRootPath();
final KeyedInstanceIdentifier<Peer, PeerKey> peerKIid = (KeyedInstanceIdentifier<Peer, PeerKey>) rootPath.getRootIdentifier().firstIdentifierOf(Peer.class);
final UnsignedInteger peerUuid = RouterIds.routerIdForPeerId(peerKIid.getKey().getPeerId());
/*
Initialize Peer with routes under loc rib
*/
if (!this.routeEntries.isEmpty() && table.getDataBefore() == null) {
final org.opendaylight.protocol.bgp.rib.spi.Peer peer = this.peerTracker.getPeer(peerKIid.getKey().getPeerId());
if (peer != null && peer.supportsTable(this.entryDep.getLocalTablesKey())) {
LOG.debug("Peer {} table has been created, inserting existent routes", peer.getPeerId());
this.routeEntries.forEach((key, value) -> value.initializeBestPaths(this.entryDep, new RouteEntryInfoImpl(peer, key), tx));
}
}
/*
Process new routes from Peer
*/
updateNodes(table, peerUuid, tx, ret);
}
return ret;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.rib.tables.Routes in project bgpcep by opendaylight.
the class LinkstateRIBSupportTest method testEmptyRoute.
@Test
public void testEmptyRoute() throws Exception {
final Routes empty = new LinkstateRoutesCaseBuilder().setLinkstateRoutes(new LinkstateRoutesBuilder().setLinkstateRoute(Collections.emptyList()).build()).build();
final ChoiceNode emptyRoutes = RIB_SUPPORT.emptyRoutes();
assertEquals(createRoutes(empty), emptyRoutes);
}
Aggregations