use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.mp.capabilities.ll.graceful.restart.capability.Tables in project netvirt by opendaylight.
the class ElanMacEntryListener method add.
// Using mac entry clustered listener instead of elan interface listener to avoid race conditions
// always use clustered listener to programme l2gw device
@Override
public void add(InstanceIdentifier<MacEntry> identifier, MacEntry add) {
LOG.trace("ElanMacEntryListener add : {}", add);
elanClusterUtils.runOnlyInOwnerNode("Adding dpn macs to remote ucast mac tables", () -> {
String elanName = identifier.firstKeyOf(MacTable.class).getElanInstanceName();
ElanInstance elanInstance = elanInstanceCache.get(elanName).orElse(null);
if (ElanUtils.isVxlanNetworkOrVxlanSegment(elanInstance)) {
Uint64 dpId = elanL2GatewayUtils.getDpidFromInterface(add.getInterface());
elanL2GatewayUtils.scheduleAddDpnMacInExtDevices(elanName, dpId, Lists.newArrayList(add.getMacAddress()));
}
});
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.mp.capabilities.ll.graceful.restart.capability.Tables 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.multiprotocol.rev180329.mp.capabilities.ll.graceful.restart.capability.Tables in project bgpcep by opendaylight.
the class BmpRouterPeerImpl method setPeerTables.
private static Set<TablesKey> setPeerTables(final ReceivedOpen open) {
final Set<TablesKey> tables = Sets.newHashSet(DEFAULT_TABLE);
for (final BgpParameters param : open.getBgpParameters()) {
for (final OptionalCapabilities optCapa : param.getOptionalCapabilities()) {
final CParameters cParam = optCapa.getCParameters();
if (cParam.getAugmentation(CParameters1.class) == null || cParam.getAugmentation(CParameters1.class).getMultiprotocolCapability() == null) {
continue;
}
final MultiprotocolCapability multi = cParam.getAugmentation(CParameters1.class).getMultiprotocolCapability();
final TablesKey tt = new TablesKey(multi.getAfi(), multi.getSafi());
tables.add(tt);
}
}
return tables;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.mp.capabilities.ll.graceful.restart.capability.Tables in project bgpcep by opendaylight.
the class BaseAbstractRouteEntry method removePathFromDataStore.
@SuppressWarnings("unchecked")
private void removePathFromDataStore(final RouteEntryDependenciesContainer entryDep, final Identifier routeKey, final WriteTransaction tx) {
LOG.trace("Best Path removed {}", this.removedBestPath);
final KeyedInstanceIdentifier<Tables, TablesKey> locRibTarget = entryDep.getLocRibTableTarget();
final RIBSupport ribSup = entryDep.getRibSupport();
Identifier newRouteKey = ribSup.createNewRouteKey(this.removedBestPath.getPathId(), routeKey);
if (newRouteKey == null) {
newRouteKey = routeKey;
}
final InstanceIdentifier routeTarget = ribSup.createRouteIdentifier(locRibTarget, newRouteKey);
LOG.debug("Delete route from LocRib {}", routeTarget);
tx.delete(LogicalDatastoreType.OPERATIONAL, routeTarget);
fillAdjRibsOut(null, null, newRouteKey, this.removedBestPath.getPeerId(), entryDep, tx);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.mp.capabilities.ll.graceful.restart.capability.Tables in project bgpcep by opendaylight.
the class BaseAbstractRouteEntry method addPathToDataStore.
@SuppressWarnings("unchecked")
private void addPathToDataStore(final RouteEntryDependenciesContainer entryDep, final Identifier routeKey, final WriteTransaction tx) {
final RIBSupport ribSup = entryDep.getRibSupport();
Identifier newRouteKey = ribSup.createNewRouteKey(this.bestPath.getPathId(), routeKey);
if (newRouteKey == null) {
newRouteKey = routeKey;
}
final Route route = createRoute(ribSup, newRouteKey, this.bestPath.getPathId(), this.bestPath);
LOG.trace("Selected best route {}", route);
final KeyedInstanceIdentifier<Tables, TablesKey> locRibTarget = entryDep.getLocRibTableTarget();
final InstanceIdentifier routeTarget = ribSup.createRouteIdentifier(locRibTarget, newRouteKey);
LOG.debug("Write route to LocRib {}", route);
tx.put(LogicalDatastoreType.OPERATIONAL, routeTarget, route);
fillAdjRibsOut(this.bestPath.getAttributes(), route, newRouteKey, this.bestPath.getPeerId(), entryDep, tx);
}
Aggregations