Search in sources :

Example 96 with Route

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.Route in project bgpcep by opendaylight.

the class FlowspecIpv4RIBSupportTest method testPutRoutes.

@Test
public void testPutRoutes() {
    RIB_SUPPORT.putRoutes(this.tx, getTablePath(), createNlriAdvertiseRoute(REACH_NLRI), createAttributes());
    final FlowspecRoute route = (FlowspecRoute) this.insertedRoutes.get(0).getValue();
    assertEquals(ROUTE, route);
}
Also used : FlowspecRoute(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.flowspec.ipv4.route.FlowspecRoute) AbstractRIBSupportTest(org.opendaylight.protocol.bgp.rib.spi.AbstractRIBSupportTest) Test(org.junit.Test)

Example 97 with Route

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.Route in project bgpcep by opendaylight.

the class FlowspecIpv6RIBSupportTest method testPutRoutes.

@Test
public void testPutRoutes() {
    RIB_SUPPORT.putRoutes(this.tx, getTablePath(), createNlriAdvertiseRoute(REACH_NLRI), createAttributes());
    final FlowspecRoute route = (FlowspecRoute) this.insertedRoutes.get(0).getValue();
    assertEquals(ROUTE, route);
}
Also used : FlowspecRoute(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.flowspec.ipv6.route.FlowspecRoute) AbstractRIBSupportTest(org.opendaylight.protocol.bgp.rib.spi.AbstractRIBSupportTest) Test(org.junit.Test)

Example 98 with Route

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.Route in project bgpcep by opendaylight.

the class ComplexRouteEntry method createRoute.

@Override
public Route createRoute(final RIBSupport ribSup, final Identifier routeKey, final long pathId, final AddPathBestPath path) {
    final OffsetMap map = getOffsets();
    final Route route = map.getValue(this.values, map.offsetOf(path.getRouteKey()));
    return ribSup.createRoute(route, routeKey, pathId, path.getAttributes());
}
Also used : OffsetMap(org.opendaylight.protocol.bgp.mode.impl.add.OffsetMap) Route(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.Route)

Example 99 with Route

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.Route in project bgpcep by opendaylight.

the class BaseAbstractRouteEntry method addRoute.

@Override
public int addRoute(final UnsignedInteger routerId, final long remotePathId, final Route route) {
    final Attributes advertisedAttrs = route.getAttributes();
    int offset = this.offsets.offsetOf(routerId);
    if (offset < 0) {
        final OffsetMap newOffsets = this.offsets.with(routerId);
        offset = newOffsets.offsetOf(routerId);
        this.values = newOffsets.expand(this.offsets, this.values, offset);
        this.offsets = newOffsets;
    }
    this.offsets.setValue(this.values, offset, advertisedAttrs);
    LOG.trace("Added route from {} attributes {}", routerId, advertisedAttrs);
    return offset;
}
Also used : Attributes(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.Attributes)

Example 100 with Route

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.Route in project bgpcep by opendaylight.

the class BaseAbstractRouteEntry method initializeBestPaths.

@Override
@SuppressWarnings("unchecked")
public void initializeBestPaths(final RouteEntryDependenciesContainer entryDep, final RouteEntryInfo entryInfo, final WriteTransaction tx) {
    if (this.bestPath == null) {
        return;
    }
    final TablesKey localTK = entryDep.getLocalTablesKey();
    final Peer toPeer = entryInfo.getToPeer();
    if (!filterRoutes(this.bestPath.getPeerId(), toPeer, localTK)) {
        return;
    }
    final Identifier oldRouteKey = entryInfo.getRouteKey();
    final RIBSupport ribSupport = entryDep.getRibSupport();
    Identifier newRouteKey = ribSupport.createNewRouteKey(this.bestPath.getPathId(), oldRouteKey);
    if (newRouteKey == null) {
        newRouteKey = oldRouteKey;
    }
    final BGPRouteEntryExportParameters routeEntry = new BGPRouteEntryExportParametersImpl(this.peerTracker.getPeer(this.bestPath.getPeerId()), toPeer);
    final Optional<Attributes> effAttrib = entryDep.getRoutingPolicies().applyExportPolicies(routeEntry, this.bestPath.getAttributes());
    final Route route = createRoute(ribSupport, newRouteKey, this.bestPath.getPathId(), this.bestPath);
    InstanceIdentifier ribOutIId = ribSupport.createRouteIdentifier(toPeer.getRibOutIId(localTK), newRouteKey);
    if (effAttrib.isPresent() && route != null) {
        LOG.debug("Write route {} to peer AdjRibsOut {}", route, toPeer.getPeerId());
        tx.put(LogicalDatastoreType.OPERATIONAL, ribOutIId, route);
        tx.put(LogicalDatastoreType.OPERATIONAL, ribOutIId.child(Attributes.class), effAttrib.get());
    }
}
Also used : TablesKey(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.rib.TablesKey) InstanceIdentifier(org.opendaylight.yangtools.yang.binding.InstanceIdentifier) KeyedInstanceIdentifier(org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier) Identifier(org.opendaylight.yangtools.yang.binding.Identifier) RIBSupport(org.opendaylight.protocol.bgp.rib.spi.RIBSupport) Peer(org.opendaylight.protocol.bgp.rib.spi.Peer) Attributes(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.Attributes) InstanceIdentifier(org.opendaylight.yangtools.yang.binding.InstanceIdentifier) KeyedInstanceIdentifier(org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier) BGPRouteEntryExportParametersImpl(org.opendaylight.protocol.bgp.mode.impl.BGPRouteEntryExportParametersImpl) BGPRouteEntryExportParameters(org.opendaylight.protocol.bgp.rib.spi.policy.BGPRouteEntryExportParameters) Route(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.Route)

Aggregations

ArrayList (java.util.ArrayList)82 VpnInstanceOpDataEntry (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.vpn.instance.op.data.VpnInstanceOpDataEntry)57 ExecutionException (java.util.concurrent.ExecutionException)55 VrfEntry (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.vrfentries.VrfEntry)55 Uint32 (org.opendaylight.yangtools.yang.common.Uint32)51 Uint64 (org.opendaylight.yangtools.yang.common.Uint64)45 Test (org.junit.Test)44 InstanceIdentifier (org.opendaylight.yangtools.yang.binding.InstanceIdentifier)43 Uuid (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid)40 BigInteger (java.math.BigInteger)33 List (java.util.List)33 VrfTablesKey (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.fibentries.VrfTablesKey)33 Logger (org.slf4j.Logger)33 LoggerFactory (org.slf4j.LoggerFactory)33 Singleton (javax.inject.Singleton)32 Inject (javax.inject.Inject)30 RouteOrigin (org.opendaylight.netvirt.fibmanager.api.RouteOrigin)30 Collections (java.util.Collections)29 Prefixes (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.prefix.to._interface.vpn.ids.Prefixes)29 Routes (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.vpn.to.extraroutes.vpn.extra.routes.Routes)29