BUG-4826: BGP Evpn Nlri's handlers
[bgpcep.git] / bgp / evpn / src / main / java / org / opendaylight / protocol / bgp / evpn / impl / BGPActivator.java
similarity index 81%
rename from bgp/evpn/src/main/java/org/opendaylight/protocol/bgp/evpn/BGPActivator.java
rename to bgp/evpn/src/main/java/org/opendaylight/protocol/bgp/evpn/impl/BGPActivator.java
index 6ec8eaefc5f7ae1eed5a7e4e81f8eec01373ce31..8ebe42514551df0ec0f60bf95b8d17c5c07bda0f 100644 (file)
@@ -5,7 +5,8 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-package org.opendaylight.protocol.bgp.evpn;
+
+package org.opendaylight.protocol.bgp.evpn.impl;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -14,19 +15,28 @@ import org.opendaylight.protocol.bgp.evpn.impl.extended.communities.DefaultGatew
 import org.opendaylight.protocol.bgp.evpn.impl.extended.communities.ESILabelExtCom;
 import org.opendaylight.protocol.bgp.evpn.impl.extended.communities.ESImpRouteTargetExtCom;
 import org.opendaylight.protocol.bgp.evpn.impl.extended.communities.MACMobExtCom;
+import org.opendaylight.protocol.bgp.evpn.impl.nlri.NlriActivator;
 import org.opendaylight.protocol.bgp.parser.spi.AbstractBGPExtensionProviderActivator;
 import org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderContext;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev160321.EvpnSubsequentAddressFamily;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev160321.L2vpnAddressFamily;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev160321.evpn.routes.evpn.routes.evpn.route.attributes.extended.communities.extended.community.DefaultGatewayExtendedCommunityCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev160321.update.attributes.extended.communities.extended.community.EsImportRouteExtendedCommunityCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev160321.update.attributes.extended.communities.extended.community.EsiLabelExtendedCommunityCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev160321.update.attributes.extended.communities.extended.community.MacMobilityExtendedCommunityCase;
 
+public final class BGPActivator extends AbstractBGPExtensionProviderActivator {
+    private static final int L2VPN_AFI = 25;
+    private static final int EVPN_SAFI = 70;
 
-public class BGPActivator extends AbstractBGPExtensionProviderActivator {
     @Override
     protected List<AutoCloseable> startImpl(final BGPExtensionProviderContext context) {
         final List<AutoCloseable> regs = new ArrayList<>();
 
+        regs.add(context.registerSubsequentAddressFamily(EvpnSubsequentAddressFamily.class, EVPN_SAFI));
+        regs.add(context.registerAddressFamily(L2vpnAddressFamily.class, L2VPN_AFI));
+
+        NlriActivator.registerNlriParsers(regs);
         registerExtendedCommunities(context, regs);
         ESIActivator.registerEsiTypeParsers(regs);
         return regs;
@@ -49,4 +59,6 @@ public class BGPActivator extends AbstractBGPExtensionProviderActivator {
         regs.add(context.registerExtendedCommunityParser(macEC.getType(true), macEC.getSubType(), macEC));
         regs.add(context.registerExtendedCommunitySerializer(MacMobilityExtendedCommunityCase.class, macEC));
     }
-}
\ No newline at end of file
+
+
+}