Search in sources :

Example 21 with PathId

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.PathId in project bgpcep by opendaylight.

the class FlowspecL3vpnIpv6RIBSupportTest method testRouteIdAddPath.

@Test
public void testRouteIdAddPath() {
    final FlowspecL3vpnRouteKey oldRouteKey = new FlowspecL3vpnRouteKey(new PathId(10L), ROUTE_KEY.getRouteKey());
    Assert.assertEquals(ROUTE_KEY, RIB_SUPPORT.createNewRouteKey(1L, oldRouteKey));
}
Also used : PathId(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.PathId) FlowspecL3vpnRouteKey(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.flowspec.l3vpn.ipv6.route.FlowspecL3vpnRouteKey) AbstractRIBSupportTest(org.opendaylight.protocol.bgp.rib.spi.AbstractRIBSupportTest) Test(org.junit.Test)

Example 22 with PathId

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.PathId in project bgpcep by opendaylight.

the class FlowspecIpv4RIBSupportTest method testRouteIdAddPath.

@Test
public void testRouteIdAddPath() {
    final FlowspecRouteKey oldKey = new FlowspecRouteKey(new PathId(100L), ROUTE_KEY.getRouteKey());
    Assert.assertEquals(ROUTE_KEY, RIB_SUPPORT.createNewRouteKey(1L, oldKey));
}
Also used : PathId(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.PathId) FlowspecRouteKey(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.flowspec.ipv4.route.FlowspecRouteKey) AbstractRIBSupportTest(org.opendaylight.protocol.bgp.rib.spi.AbstractRIBSupportTest) Test(org.junit.Test)

Example 23 with PathId

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.PathId in project bgpcep by opendaylight.

the class IPv4RIBSupportTest method testRouteIdAddPath.

@Test
public void testRouteIdAddPath() {
    final Ipv4RouteKey expected = new Ipv4RouteKey(new PathId(1L), PREFIX);
    final Ipv4RouteKey oldKey = new Ipv4RouteKey(new PathId(100L), PREFIX);
    assertEquals(expected, RIB_SUPPORT.createNewRouteKey(expected.getPathId().getValue(), oldKey));
}
Also used : PathId(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.PathId) Ipv4RouteKey(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev171207.ipv4.routes.ipv4.routes.Ipv4RouteKey) AbstractRIBSupportTest(org.opendaylight.protocol.bgp.rib.spi.AbstractRIBSupportTest) Test(org.junit.Test)

Example 24 with PathId

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.PathId in project bgpcep by opendaylight.

the class IPv6RIBSupportTest method testRouteIdAddPath.

@Test
public void testRouteIdAddPath() {
    final Ipv6RouteKey expected = new Ipv6RouteKey(new PathId(1L), PREFIX);
    final Ipv6RouteKey oldKey = new Ipv6RouteKey(new PathId(100L), PREFIX);
    assertEquals(expected, RIB_SUPPORT.createNewRouteKey(expected.getPathId().getValue(), oldKey));
}
Also used : PathId(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.PathId) Ipv6RouteKey(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev171207.ipv6.routes.ipv6.routes.Ipv6RouteKey) AbstractRIBSupportTest(org.opendaylight.protocol.bgp.rib.spi.AbstractRIBSupportTest) Test(org.junit.Test)

Example 25 with PathId

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.PathId in project bgpcep by opendaylight.

the class AbstractFlowspecL3vpnRIBSupport method buildDestination.

@Nonnull
@Override
protected DestinationType buildDestination(@Nonnull final Collection<MapEntryNode> routes) {
    final MapEntryNode routesCont = Iterables.getOnlyElement(routes);
    final PathId pathId = PathIdUtil.buildPathId(routesCont, routePathIdNid());
    final RouteDistinguisher rd = extractRouteDistinguisher(routesCont, this.routeDistinguisherNID);
    return this.nlriParser.createAdvertizedRoutesDestinationType(new Object[] { rd, this.nlriParser.extractFlowspec(routesCont) }, pathId);
}
Also used : PathId(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.PathId) RouteDistinguisherUtil.extractRouteDistinguisher(org.opendaylight.bgp.concepts.RouteDistinguisherUtil.extractRouteDistinguisher) RouteDistinguisher(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.RouteDistinguisher) MapEntryNode(org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode) Nonnull(javax.annotation.Nonnull)

Aggregations

PathId (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.PathId)21 Test (org.junit.Test)12 AbstractRIBSupportTest (org.opendaylight.protocol.bgp.rib.spi.AbstractRIBSupportTest)8 RouteDistinguisher (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.RouteDistinguisher)6 List (java.util.List)4 Ipv4Prefix (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix)4 Flowspec (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.flowspec.destination.Flowspec)4 Route (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.Route)4 MapEntryNode (org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode)4 Nonnull (javax.annotation.Nonnull)3 UpdateBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.UpdateBuilder)3 AttributesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.AttributesBuilder)3 AdvertizedRoutesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev171207.update.attributes.mp.reach.nlri.AdvertizedRoutesBuilder)3 ByteBuf (io.netty.buffer.ByteBuf)2 Before (org.junit.Before)2 RouteDistinguisherUtil.extractRouteDistinguisher (org.opendaylight.bgp.concepts.RouteDistinguisherUtil.extractRouteDistinguisher)2 OffsetMap (org.opendaylight.protocol.bgp.mode.impl.add.OffsetMap)2 PeerSpecificParserConstraint (org.opendaylight.protocol.bgp.parser.spi.PeerSpecificParserConstraint)2 Ipv4Address (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address)2 DestinationFlowspecL3vpnIpv4Builder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.flowspec.l3vpn.destination.ipv4.DestinationFlowspecL3vpnIpv4Builder)2