use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.RouteDistinguisher 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);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.RouteDistinguisher in project bgpcep by opendaylight.
the class FlowspecL3vpnIpv4NlriParser method createAdvertizedRoutesDestinationType.
@Override
public DestinationType createAdvertizedRoutesDestinationType(@Nonnull final Object[] nlriFields, @Nullable final PathId pathId) {
final RouteDistinguisher rd = (RouteDistinguisher) nlriFields[0];
final List<Flowspec> flowspecList = (List<Flowspec>) nlriFields[1];
return new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationFlowspecL3vpnIpv4CaseBuilder().setDestinationFlowspecL3vpnIpv4(new DestinationFlowspecL3vpnIpv4Builder().setRouteDistinguisher(rd).setFlowspec(flowspecList).setPathId(pathId).build()).build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.RouteDistinguisher in project bgpcep by opendaylight.
the class FlowspecL3vpnIpv4NlriParser method createWithdrawnDestinationType.
@Override
public DestinationType createWithdrawnDestinationType(@Nonnull final Object[] nlriFields, @Nullable final PathId pathId) {
final RouteDistinguisher rd = (RouteDistinguisher) nlriFields[0];
final List<Flowspec> flowspecList = (List<Flowspec>) nlriFields[1];
return new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecL3vpnIpv4CaseBuilder().setDestinationFlowspecL3vpnIpv4(new DestinationFlowspecL3vpnIpv4Builder().setRouteDistinguisher(rd).setFlowspec(flowspecList).setPathId(pathId).build()).build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.RouteDistinguisher in project bgpcep by opendaylight.
the class FlowspecL3vpnIpv6NlriParser method createAdvertizedRoutesDestinationType.
@Override
public DestinationType createAdvertizedRoutesDestinationType(@Nonnull final Object[] nlriFields, @Nullable final PathId pathId) {
final RouteDistinguisher rd = (RouteDistinguisher) nlriFields[0];
final List<Flowspec> flowspecList = (List<Flowspec>) nlriFields[1];
return new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationFlowspecL3vpnIpv6CaseBuilder().setDestinationFlowspecL3vpnIpv6(new DestinationFlowspecL3vpnIpv6Builder().setRouteDistinguisher(rd).setFlowspec(flowspecList).setPathId(pathId).build()).build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.RouteDistinguisher in project netvirt by opendaylight.
the class BgpUtil method getVrfFromRd.
/**
* get the vrf with the RouterDistinguisher pass in param.
* @param rd is the RouteDistinguisher of vrf
* @return the vrf of rd or null if no exist
*/
public Vrfs getVrfFromRd(String rd) {
Vrfs vrfs = null;
KeyedInstanceIdentifier<Vrfs, VrfsKey> id = InstanceIdentifier.create(Bgp.class).child(Vrfs.class, new VrfsKey(rd));
Optional<Vrfs> vrfsFromDs = MDSALUtil.read(dataBroker, LogicalDatastoreType.CONFIGURATION, id);
if (vrfsFromDs.isPresent()) {
vrfs = vrfsFromDs.get();
}
return vrfs;
}
Aggregations