use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.PathId in project bgpcep by opendaylight.
the class PrefixesBuilder method createAttributes.
private static Attributes createAttributes(final List<String> extCom, final boolean multiPathSupport, final Ipv4Prefix addressPrefix) {
final AttributesBuilder attBuilder = new AttributesBuilder();
attBuilder.setOrigin(new OriginBuilder().setValue(BgpOrigin.Egp).build());
attBuilder.setAsPath(new AsPathBuilder().setSegments(Collections.emptyList()).build());
attBuilder.setMultiExitDisc(new MultiExitDiscBuilder().setMed((long) 0).build());
attBuilder.setLocalPref(new LocalPrefBuilder().setPref(100L).build());
attBuilder.setExtendedCommunities(createExtComm(extCom));
attBuilder.setUnrecognizedAttributes(Collections.emptyList());
final Ipv4PrefixesBuilder prefixes = new Ipv4PrefixesBuilder().setPrefix(addressPrefix);
if (multiPathSupport) {
prefixes.setPathId(new PathId(5L));
}
attBuilder.addAugmentation(Attributes1.class, new Attributes1Builder().setMpReachNlri(new MpReachNlriBuilder().setCNextHop(NEXT_HOP).setAfi(Ipv4AddressFamily.class).setSafi(UnicastSubsequentAddressFamily.class).setAdvertizedRoutes(new AdvertizedRoutesBuilder().setDestinationType(new DestinationIpv4CaseBuilder().setDestinationIpv4(new DestinationIpv4Builder().setIpv4Prefixes(Collections.singletonList(prefixes.build())).build()).build()).build()).build()).build());
return attBuilder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.PathId in project bgpcep by opendaylight.
the class FlowspecIpv6RIBSupportTest 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));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.PathId in project bgpcep by opendaylight.
the class FlowspecL3vpnIpv4RIBSupportTest method testRouteIdAddPath.
@Test
public void testRouteIdAddPath() {
final FlowspecL3vpnRouteKey oldKey = new FlowspecL3vpnRouteKey(new PathId(100L), ROUTE_KEY.getRouteKey());
Assert.assertEquals(ROUTE_KEY, RIB_SUPPORT.createNewRouteKey(1L, oldKey));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.PathId 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());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.PathId in project bgpcep by opendaylight.
the class AddPathAbstractRouteEntry method selectBest.
private void selectBest(final RouteKey key, final AddPathSelector selector) {
final int offset = this.offsets.offsetOf(key);
final Attributes attributes = this.offsets.getValue(this.values, offset);
final long pathId = this.offsets.getValue(this.pathsId, offset);
LOG.trace("Processing router key {} attributes {}", key, attributes);
selector.processPath(attributes, key, offset, pathId);
}
Aggregations