<groupId>${project.groupId}</groupId>
<artifactId>bgp-parser-spi</artifactId>
</dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>bgp-inet</artifactId>
+ </dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>bgp-bmp-api</artifactId>
import org.opendaylight.protocol.bgp.mvpn.impl.attributes.extended.community.VrfRouteImportHandler;
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.mvpn.rev180417.McastVpnSubsequentAddressFamily;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.rev180417.bgp.rib.route.attributes.extended.communities.extended.community.SourceAs4ExtendedCommunityCase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.rev180417.bgp.rib.route.attributes.extended.communities.extended.community.SourceAsExtendedCommunityCase;
*/
public final class BGPActivator extends AbstractBGPExtensionProviderActivator {
@VisibleForTesting
- static final int MVPN_SAFI = 5;
+ private static final int MVPN_SAFI = 5;
private static void registerAttributesHandler(
final BGPExtensionProviderContext context,
regs.add(context.registerExtendedCommunitySerializer(SourceAsExtendedCommunityCase.class, sourceASHandler));
}
+ private static void registerAfiSafi(final BGPExtensionProviderContext context, final List<AutoCloseable> regs) {
+ regs.add(context.registerSubsequentAddressFamily(McastVpnSubsequentAddressFamily.class, MVPN_SAFI));
+ }
+
@Override
protected List<AutoCloseable> startImpl(final BGPExtensionProviderContext context) {
final List<AutoCloseable> regs = new ArrayList<>();
TunnelIdentifierActivator.registerTunnelIdentifierHandlers(context, regs);
+ registerAfiSafi(context, regs);
registerNlriHandler(context, regs);
registerExtendedCommunities(context, regs);
registerAttributesHandler(context, regs);
--- /dev/null
+/*
+ * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * 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.mvpn.impl;
+
+import com.google.common.collect.Lists;
+import java.util.List;
+import org.opendaylight.protocol.bgp.openconfig.spi.AbstractBGPTableTypeRegistryProviderActivator;
+import org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryProvider;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.rev180417.McastVpnSubsequentAddressFamily;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180329.IPV4MCASTVPN;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180329.IPV6MCASTVPN;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.Ipv4AddressFamily;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.Ipv6AddressFamily;
+import org.opendaylight.yangtools.concepts.AbstractRegistration;
+
+/**
+ * Registers MCast VPN Family types.
+ *
+ * @author Claudio D. Gasparini
+ */
+public final class TableTypeActivator extends AbstractBGPTableTypeRegistryProviderActivator {
+ @Override
+ protected List<AbstractRegistration> startBGPTableTypeRegistryProviderImpl(
+ final BGPTableTypeRegistryProvider provider) {
+ return Lists.newArrayList(
+ provider.registerBGPTableType(
+ Ipv4AddressFamily.class, McastVpnSubsequentAddressFamily.class, IPV4MCASTVPN.class),
+ provider.registerBGPTableType(
+ Ipv6AddressFamily.class, McastVpnSubsequentAddressFamily.class, IPV6MCASTVPN.class)
+ );
+ }
+}
public void serializeAttribute(final DataObject attribute, final ByteBuf byteAggregator) {
Preconditions.checkArgument(attribute instanceof Attributes,
"Attribute parameter is not a PathAttribute object.");
- final PeDistinguisherLabelsAttributeAugmentation ipv4Att =
+ final PeDistinguisherLabelsAttributeAugmentation att =
((Attributes) attribute).getAugmentation(PeDistinguisherLabelsAttributeAugmentation.class);
- if (ipv4Att == null) {
+ if (att == null) {
return;
}
final List<PeDistinguisherLabelAttribute> distinguishers
- = ipv4Att.getPeDistinguisherLabelsAttribute().getPeDistinguisherLabelAttribute();
+ = att.getPeDistinguisherLabelsAttribute().getPeDistinguisherLabelAttribute();
final ByteBuf buffer = Unpooled.buffer();
for (final PeDistinguisherLabelAttribute peDist : distinguishers) {
if (peDist.getPeAddress().getIpv4Address() != null) {
public static final int NO_TUNNEL_INFORMATION_PRESENT = 0;
private static final SimpleTunnelIdentifierRegistry SINGLETON = new SimpleTunnelIdentifierRegistry();
private static final Logger LOG = LoggerFactory.getLogger(SimpleTunnelIdentifierRegistry.class);
- private static final String SKIP_SERIALIZATION = "Skipping serialization of PMSI Tunnel Attribute {}";
- private static final String SKIP_PARSE = "Skipping parsing of PMSI Tunnel Attribute type {}";
private final HandlerRegistry<DataContainer, TunnelIdentifierParser, TunnelIdentifierSerializer> handlers =
new HandlerRegistry<>();
public TunnelIdentifier parse(final int tunnelType, final ByteBuf buffer) {
final TunnelIdentifierParser parser = this.handlers.getParser(tunnelType);
if (!buffer.isReadable() || parser == null) {
- LOG.debug(SKIP_PARSE, tunnelType);
+ LOG.debug("Skipping parsing of PMSI Tunnel Attribute type {}", tunnelType);
return null;
}
return parser.parse(buffer);
public int serialize(final TunnelIdentifier tunnel, final ByteBuf tunnelBuffer) {
if (tunnel == null) {
- LOG.debug(SKIP_SERIALIZATION);
+ LOG.debug("Skipping serialization of PMSI Tunnel Attribute {}");
return NO_TUNNEL_INFORMATION_PRESENT;
}
final TunnelIdentifierSerializer serializer = this.handlers.getSerializer(tunnel.getImplementedInterface());
if (serializer == null) {
- LOG.debug(SKIP_SERIALIZATION, tunnel);
+ LOG.debug("Skipping serialization of PMSI Tunnel Attribute {}", tunnel);
return NO_TUNNEL_INFORMATION_PRESENT;
}
return serializer.serialize(tunnel, tunnelBuffer);
--- /dev/null
+# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+#
+# This program and the accompanying materials are made available
+# under the terms of the Eclipse Public License v1.0 which
+# accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+org.opendaylight.protocol.bgp.mvpn.impl.TableTypeActivator
\ No newline at end of file
<service ref="BGPActivator" interface="org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderActivator"
odl:type="org.opendaylight.protocol.bgp.mvpn.impl.BGPActivator"/>
+
+ <bean id="TableTypeActivator" class="org.opendaylight.protocol.bgp.mvpn.impl.TableTypeActivator"/>
+
+ <service ref="TableTypeActivator"
+ interface="org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryProviderActivator"
+ odl:type="org.opendaylight.protocol.bgp.mvpn.impl.TableTypeActivator"/>
</blueprint>
\ No newline at end of file
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.rev180417.pe.distinguisher.labels.attribute.pe.distinguisher.labels.attribute.PeDistinguisherLabelAttributeBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.network.concepts.rev131125.MplsLabel;
-public class PEDistinguisherLabelsAttributeHandlerTest {
+public final class PEDistinguisherLabelsAttributeHandlerTest {
/**
* ATT - TYPE - ATT LENGTH.
* PE ADDRESS - MPLS LABEL
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.Attributes;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.AttributesBuilder;
-public class PMSITunnelAttributeHandlerTest {
+public final class PMSITunnelAttributeHandlerTest {
private AttributeRegistry handler;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev180329.pmsi.tunnel.pmsi.tunnel.tunnel.identifier.mldp.p2mp.lsp.mldp.p2mp.lsp.OpaqueValue;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev180329.pmsi.tunnel.pmsi.tunnel.tunnel.identifier.mldp.p2mp.lsp.mldp.p2mp.lsp.OpaqueValueBuilder;
-public class OpaqueUtilTest {
+public final class OpaqueUtilTest {
private static final byte[] OPAQUE_WRONG = {
(byte) 0xfc, (byte) 0x00, (byte) 0x03, // Opaque Type - Length
(byte) 0xb5, (byte) 0xeb, (byte) 0x2d, //Value
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev180329.PAddressPMulticastGroup;
import org.opendaylight.yangtools.yang.binding.DataContainer;
-public class PAddressPMulticastGroupUtilTest {
+public final class PAddressPMulticastGroupUtilTest {
private static final String IPV6_MODEL = "2001::1";
private static final IpAddress IPV6 = new IpAddress(new Ipv6Address(IPV6_MODEL));
private static final byte[] IPV4_ADDRESS_EXPECTED = {(byte) 0x01, (byte) 0x01, (byte) 0x01, (byte) 0x01};
<groupId>${project.groupId}</groupId>
<artifactId>bgp-evpn</artifactId>
</dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>odl-bgpcep-bgp-mvpn</artifactId>
+ <type>xml</type>
+ <classifier>features</classifier>
+ </dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>odl-bgpcep-bgp-parser</artifactId>
<type>xml</type>
<classifier>features</classifier>
</dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>odl-bgpcep-bgp-inet</artifactId>
+ <type>xml</type>
+ <classifier>features</classifier>
+ </dependency>
</dependencies>
</project>
\ No newline at end of file
<classifier>features</classifier>
<type>xml</type>
</dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>odl-bgpcep-bgp-mvpn</artifactId>
+ <classifier>features</classifier>
+ <type>xml</type>
+ </dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>odl-bgpcep-bgp-l3vpn</artifactId>