BUG-4825: BGP L3VPN yang data module 96/34396/4
authorIveta Halanova <ihalanov@cisco.com>
Wed, 10 Feb 2016 14:23:13 +0000 (15:23 +0100)
committerIveta Halanova <ihalanov@cisco.com>
Thu, 11 Feb 2016 10:33:52 +0000 (11:33 +0100)
Created new subproject l3vpn under BGP.
Created module and defined NLRI grouping.
Augmented update message and RIBs.

ref.: https://tools.ietf.org/html/rfc4364#section-4.3.4

Change-Id: I30d9b6bc974e5762eae76476db7a28d00a88cfc3
Signed-off-by: Iveta Halanova <ihalanov@cisco.com>
bgp/l3vpn/pom.xml [new file with mode: 0644]
bgp/l3vpn/src/main/yang/bgp-vpn-ipv4.yang [new file with mode: 0644]
bgp/pom.xml

diff --git a/bgp/l3vpn/pom.xml b/bgp/l3vpn/pom.xml
new file mode 100644 (file)
index 0000000..46faece
--- /dev/null
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vi: set et smarttab sw=4 tabstop=4: -->
+<!--
+ Copyright (c) 2016 Cisco Systems, Inc. and others.  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
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+    <scm>
+        <connection>scm:git:ssh://git.opendaylight.org:29418/bgpcep.git</connection>
+        <developerConnection>scm:git:ssh://git.opendaylight.org:29418/bgpcep.git</developerConnection>
+        <url>https://wiki.opendaylight.org/view/BGP_LS_PCEP:Main</url>
+        <tag>HEAD</tag>
+    </scm>
+    <parent>
+        <groupId>org.opendaylight.bgpcep</groupId>
+        <artifactId>bgp-parent</artifactId>
+        <version>0.6.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>bgp-l3vpn</artifactId>
+    <description>BGP L3 VPN</description>
+    <packaging>bundle</packaging>
+    <name>${project.artifactId}</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.google.guava</groupId>
+            <artifactId>guava</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.mdsal.model</groupId>
+            <artifactId>ietf-inet-types</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>bgp-parser-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.yangtools</groupId>
+            <artifactId>concepts</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>bgp-rib-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>bgp-concepts</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.yangtools</groupId>
+            <artifactId>yang-common</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.mdsal</groupId>
+            <artifactId>yang-binding</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>bgp-bmp-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>bgp-labeled-unicast</artifactId>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.opendaylight.yangtools</groupId>
+                <artifactId>yang-maven-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>
diff --git a/bgp/l3vpn/src/main/yang/bgp-vpn-ipv4.yang b/bgp/l3vpn/src/main/yang/bgp-vpn-ipv4.yang
new file mode 100644 (file)
index 0000000..535fa6a
--- /dev/null
@@ -0,0 +1,115 @@
+module bgp-vpn-ipv4 {
+    namespace "urn:opendaylight:bgp-vpn-ipv4";
+    prefix "bgp-vpn";
+
+    import bgp-labeled-unicast { prefix bgp-lu; revision-date 2015-05-25; }
+    import bgp-types { prefix bgp-t; revision-date 2013-09-19; }
+    import bgp-message { prefix bgp-msg; revision-date 2013-09-19; }
+    import bgp-multiprotocol { prefix bgp-mp; revision-date 2013-09-19; }
+    import ietf-inet-types { prefix inet; revision-date 2010-09-24; }
+    import bgp-rib { prefix bgp-rib; revision-date 2013-09-25; }
+    import bmp-monitor { prefix bmp-mon; revision-date 2015-05-12; }
+
+    organization "Cisco Systems, Inc.";
+    contact "Iveta Halanova <ihalanov@cisco.com>";
+
+    description
+        "This module contains the base data model of a BGP message.
+        It rolls up the definitions contained in RFC4364.
+
+        Copyright (c)2016 Cisco Systems, Inc. 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";
+
+    revision 2016-02-10 {
+        description "Initial revision";
+    }
+
+    grouping vpn-ipv4 {
+        reference "https://tools.ietf.org/html/rfc4364#section-4.3.4";
+        uses bgp-lu:labeled-unicast;
+        leaf route-distinguisher {
+            type bgp-t:route-distinguisher;
+        }
+    }
+
+    grouping vpn-ipv4-destination {
+        list c-vpn-ipv4-destination {
+            uses vpn-ipv4;
+        }
+    }
+
+    grouping vpn-ipv4-routes {
+        container vpn-ipv4-routes {
+            list vpn-ipv4-route {
+                leaf route-key {
+                    type binary;
+                }
+                key "route-key";
+                uses vpn-ipv4;
+                uses bgp-rib:route;
+            }
+        }
+    }
+
+    augment "/bgp-msg:update/bgp-msg:attributes/bgp-mp:mp-reach-nlri/bgp-mp:advertized-routes/bgp-mp:destination-type" {
+        case destination-vpn-ipv4-case {
+            container destination-vpn-ipv4 {
+                uses vpn-ipv4-destination;
+            }
+        }
+    }
+
+    augment "/bgp-msg:update/bgp-msg:attributes/bgp-mp:mp-unreach-nlri/bgp-mp:withdrawn-routes/bgp-mp:destination-type" {
+        case destination-vpn-ipv4-case {
+            container destination-vpn-ipv4 {
+                uses vpn-ipv4-destination;
+            }
+        }
+    }
+
+    augment "/bgp-rib:application-rib/bgp-rib:tables/bgp-rib:routes" {
+        case vpn-ipv4-routes-case {
+            uses vpn-ipv4-routes;
+        }
+    }
+
+    augment "/bgp-rib:bgp-rib/bgp-rib:rib/bgp-rib:loc-rib/bgp-rib:tables/bgp-rib:routes" {
+        case vpn-ipv4-routes-case {
+            uses vpn-ipv4-routes;
+        }
+    }
+
+    augment "/bgp-rib:bgp-rib/bgp-rib:rib/bgp-rib:peer/bgp-rib:adj-rib-in/bgp-rib:tables/bgp-rib:routes" {
+        case vpn-ipv4-routes-case {
+            uses vpn-ipv4-routes;
+        }
+    }
+
+    augment "/bgp-rib:bgp-rib/bgp-rib:rib/bgp-rib:peer/bgp-rib:effective-rib-in/bgp-rib:tables/bgp-rib:routes" {
+        case vpn-ipv4-routes-case {
+            uses vpn-ipv4-routes;
+        }
+    }
+
+    augment "/bgp-rib:bgp-rib/bgp-rib:rib/bgp-rib:peer/bgp-rib:adj-rib-out/bgp-rib:tables/bgp-rib:routes" {
+        case vpn-ipv4-routes-case {
+            uses vpn-ipv4-routes;
+        }
+    }
+
+    augment "/bmp-mon:bmp-monitor/bmp-mon:monitor/bmp-mon:router/bmp-mon:peer/bmp-mon:pre-policy-rib/bmp-mon:tables/bmp-mon:routes" {
+        case vpn-ipv4-routes-case {
+            uses vpn-ipv4-routes;
+        }
+    }
+
+    augment "/bmp-mon:bmp-monitor/bmp-mon:monitor/bmp-mon:router/bmp-mon:peer/bmp-mon:post-policy-rib/bmp-mon:tables/bmp-mon:routes" {
+        case vpn-ipv4-routes-case {
+            uses vpn-ipv4-routes;
+        }
+    }
+}
\ No newline at end of file
index 15b074e40c1c9c44fae214b0857e677b28858a1a..80a3dbce353caa42608103895cedd1d6fda8781b 100644 (file)
@@ -34,6 +34,7 @@
         <module>inet</module>
         <module>linkstate</module>
         <module>flowspec</module>
+        <module>l3vpn</module>
         <module>labeled-unicast</module>
         <module>parser-api</module>
         <module>parser-spi</module>