Search in sources :

Example 1 with DestinationType

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev171207.destination.DestinationType in project bgpcep by opendaylight.

the class AbstractFlowspecRIBSupport method buildDestination.

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

Example 2 with DestinationType

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev171207.destination.DestinationType in project bgpcep by opendaylight.

the class FlowspecL3vpnIpv6NlriParser 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.DestinationFlowspecL3vpnIpv6CaseBuilder().setDestinationFlowspecL3vpnIpv6(new DestinationFlowspecL3vpnIpv6Builder().setRouteDistinguisher(rd).setFlowspec(flowspecList).setPathId(pathId).build()).build();
}
Also used : DestinationFlowspecL3vpnIpv6Builder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.flowspec.l3vpn.destination.ipv6.DestinationFlowspecL3vpnIpv6Builder) RouteDistinguisher(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.RouteDistinguisher) Flowspec(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.flowspec.destination.Flowspec) List(java.util.List)

Example 3 with DestinationType

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev171207.destination.DestinationType in project bgpcep by opendaylight.

the class FlowspecL3vpnIpv6NlriParser method serializeMpReachNlri.

@Override
protected void serializeMpReachNlri(final DestinationType dstType, final ByteBuf byteAggregator) {
    if (dstType instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationFlowspecL3vpnIpv6Case) {
        final DestinationFlowspecL3vpnIpv6 destFlowspec = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationFlowspecL3vpnIpv6Case) dstType).getDestinationFlowspecL3vpnIpv6();
        serializeNlri(new Object[] { destFlowspec.getRouteDistinguisher(), destFlowspec.getFlowspec() }, destFlowspec.getPathId(), byteAggregator);
    }
}
Also used : DestinationFlowspecL3vpnIpv6(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.flowspec.l3vpn.destination.ipv6.DestinationFlowspecL3vpnIpv6)

Example 4 with DestinationType

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev171207.destination.DestinationType in project bgpcep by opendaylight.

the class FlowspecL3vpnIpv6NlriParser method serializeMpUnreachNlri.

@Override
protected void serializeMpUnreachNlri(final DestinationType dstType, final ByteBuf byteAggregator) {
    if (dstType instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecL3vpnIpv6Case) {
        final DestinationFlowspecL3vpnIpv6 destFlowspec = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecL3vpnIpv6Case) dstType).getDestinationFlowspecL3vpnIpv6();
        serializeNlri(new Object[] { destFlowspec.getRouteDistinguisher(), destFlowspec.getFlowspec() }, destFlowspec.getPathId(), byteAggregator);
    }
}
Also used : DestinationFlowspecL3vpnIpv6(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.flowspec.l3vpn.destination.ipv6.DestinationFlowspecL3vpnIpv6)

Example 5 with DestinationType

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev171207.destination.DestinationType in project bgpcep by opendaylight.

the class SimpleFlowspecIpv4NlriParser method serializeMpUnreachNlri.

@Override
protected void serializeMpUnreachNlri(final DestinationType dstType, final ByteBuf byteAggregator) {
    if (dstType instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecCase) {
        final DestinationFlowspec destFlowspec = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecCase) dstType).getDestinationFlowspec();
        serializeNlri(new Object[] { destFlowspec.getFlowspec() }, destFlowspec.getPathId(), byteAggregator);
    }
}
Also used : DestinationFlowspec(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.flowspec.destination.ipv4.DestinationFlowspec)

Aggregations

RouteDistinguisher (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.RouteDistinguisher)6 List (java.util.List)4 Flowspec (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.flowspec.destination.Flowspec)4 PathId (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.PathId)4 DestinationType (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev171207.destination.DestinationType)4 MapEntryNode (org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode)4 Preconditions (com.google.common.base.Preconditions)3 Nonnull (javax.annotation.Nonnull)3 Map (java.util.Map)2 RouteDistinguisherUtil.extractRouteDistinguisher (org.opendaylight.bgp.concepts.RouteDistinguisherUtil.extractRouteDistinguisher)2 BgpTableTypeImpl (org.opendaylight.protocol.bgp.parser.BgpTableTypeImpl)2 DestinationFlowspec (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.flowspec.destination.ipv4.DestinationFlowspec)2 DestinationFlowspec (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.flowspec.destination.ipv6.DestinationFlowspec)2 DestinationFlowspecL3vpnIpv4 (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.flowspec.l3vpn.destination.ipv4.DestinationFlowspecL3vpnIpv4)2 DestinationFlowspecL3vpnIpv4Builder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.flowspec.l3vpn.destination.ipv4.DestinationFlowspecL3vpnIpv4Builder)2 DestinationFlowspecL3vpnIpv6 (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.flowspec.l3vpn.destination.ipv6.DestinationFlowspecL3vpnIpv6)2 DestinationFlowspecL3vpnIpv6Builder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.flowspec.l3vpn.destination.ipv6.DestinationFlowspecL3vpnIpv6Builder)2 CLabeledUnicastDestination (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev171207.labeled.unicast.destination.CLabeledUnicastDestination)2 DestinationIpv6LabeledUnicastCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev171207.update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationIpv6LabeledUnicastCaseBuilder)2 DestinationIpv6LabeledUnicastBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev171207.update.attributes.mp.reach.nlri.advertized.routes.destination.type.destination.ipv6.labeled.unicast._case.DestinationIpv6LabeledUnicastBuilder)2