2 * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.protocol.bgp.flowspec;
10 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.bgp.rib.rib.loc.rib.tables.routes.FlowspecIpv6RoutesCase;
11 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.flowspec.ipv6.routes.FlowspecIpv6Routes;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.flowspec.ipv6.routes.flowspec.ipv6.routes.FlowspecRoute;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.update.attributes.mp.reach.nlri.advertized.routes.destination.type.destination.flowspec.ipv6._case.DestinationFlowspec;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev130925.rib.tables.Routes;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.AddressFamily;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.Ipv6AddressFamily;
17 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
18 import org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode;
19 import org.opendaylight.yangtools.yang.data.impl.schema.Builders;
20 import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
22 public class FlowspecIpv6RIBSupport extends AbstractFlowspecRIBSupport {
24 private static final FSIpv6NlriParser FS_PARSER = new FSIpv6NlriParser();
26 private static final FlowspecIpv6RIBSupport SINGLETON = new FlowspecIpv6RIBSupport();
28 private final NodeIdentifier destinationNid = new NodeIdentifier(DestinationFlowspec.QNAME);
29 private final NodeIdentifier routeNid = new NodeIdentifier(FlowspecRoute.QNAME);
30 private final ChoiceNode emptyRoutes = Builders.choiceBuilder()
31 .withNodeIdentifier(new NodeIdentifier(Routes.QNAME))
32 .addChild(Builders.containerBuilder()
33 .withNodeIdentifier(new NodeIdentifier(FlowspecIpv6Routes.QNAME))
34 .addChild(ImmutableNodes.mapNodeBuilder(FlowspecRoute.QNAME).build()).build()).build();
36 private FlowspecIpv6RIBSupport() {
37 super(FlowspecIpv6RoutesCase.class, FlowspecIpv6Routes.class, FlowspecRoute.class);
40 static FlowspecIpv6RIBSupport getInstance() {
45 public ChoiceNode emptyRoutes() {
46 return this.emptyRoutes;
50 protected NodeIdentifier destinationContainerIdentifier() {
51 return this.destinationNid;
55 protected NodeIdentifier routeIdentifier() {
60 protected AbstractFSNlriParser getParser() {
65 protected Class<? extends AddressFamily> getAfiClass() {
66 return Ipv6AddressFamily.class;