MVPN RFC6514 Extendend communities
[bgpcep.git] / bgp / l3vpn / src / main / java / org / opendaylight / protocol / bgp / l3vpn / ipv4 / BgpIpv4Activator.java
1 /*
2  * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.protocol.bgp.l3vpn.ipv4;
9
10 import java.util.ArrayList;
11 import java.util.List;
12 import org.opendaylight.protocol.bgp.parser.spi.AbstractBGPExtensionProviderActivator;
13 import org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderContext;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.Ipv4AddressFamily;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.MplsLabeledVpnSubsequentAddressFamily;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.next.hop.c.next.hop.Ipv4NextHopCase;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.ipv4.rev180329.l3vpn.ipv4.routes.VpnIpv4Routes;
18
19 public final class BgpIpv4Activator extends AbstractBGPExtensionProviderActivator {
20
21     @Override
22     protected List<AutoCloseable> startImpl(final BGPExtensionProviderContext context) {
23         final List<AutoCloseable> regs = new ArrayList<>();
24
25         final VpnIpv4NlriParser nlriParser = new VpnIpv4NlriParser();
26         final VpnIpv4NextHopParserSerializer nextHopParser = new VpnIpv4NextHopParserSerializer();
27
28         regs.add(context.registerNlriParser(Ipv4AddressFamily.class, MplsLabeledVpnSubsequentAddressFamily.class,
29             nlriParser, nextHopParser, Ipv4NextHopCase.class));
30         regs.add(context.registerNlriSerializer(VpnIpv4Routes.class, nlriParser));
31
32         return regs;
33     }
34
35 }