BUG-46: initial model for RIB 23/1423/5
authorRobert Varga <rovarga@cisco.com>
Fri, 27 Sep 2013 10:03:01 +0000 (12:03 +0200)
committerGerrit Code Review <gerrit@opendaylight.org>
Fri, 27 Sep 2013 20:53:14 +0000 (20:53 +0000)
Change-Id: Iebd3168012708a896a178ac089c88518729aeb2f
Signed-off-by: Robert Varga <rovarga@cisco.com>
bgp/rib-api/pom.xml
bgp/rib-api/src/main/yang/bgp-rib.yang [new file with mode: 0644]

index 096cfc8bf0e55d6850c2599e5911fcf1f1ace8e6..c3e6c76d92ad5766b8ae52cec4a1de017efbef5e 100644 (file)
                        <groupId>com.google.guava</groupId>
                        <artifactId>guava</artifactId>
                        <version>${guava.version}</version>
-               </dependency>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.yangtools</groupId>
+            <artifactId>yang-binding</artifactId>
+            <version>${yangtools.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.yangtools</groupId>
+            <artifactId>yang-common</artifactId>
+            <version>${yangtools.version}</version>
+        </dependency>
                <dependency>
                        <groupId>junit</groupId>
                        <artifactId>junit</artifactId>
 
        <build>
                <plugins>
+            <plugin>
+                <groupId>org.opendaylight.yangtools</groupId>
+                <artifactId>yang-maven-plugin</artifactId>
+                <version>${yangtools.version}</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>generate-sources</goal>
+                        </goals>
+                        <configuration>
+                            <yangFilesRootDir>src/main/yang</yangFilesRootDir>
+                            <codeGenerators>
+                                <generator>
+                                    <codeGeneratorClass>
+                                        org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl
+                                    </codeGeneratorClass>
+                                    <outputBaseDir>
+                                        target/generated-sources/sal
+                                    </outputBaseDir>
+                                </generator>
+                            </codeGenerators>
+                            <inspectDependencies>true</inspectDependencies>
+                        </configuration>
+                    </execution>
+                </executions>
+                <dependencies>
+                    <dependency>
+                        <groupId>org.opendaylight.yangtools</groupId>
+                        <artifactId>maven-sal-api-gen-plugin</artifactId>
+                        <version>${yangtools.version}</version>
+                        <type>jar</type>
+                    </dependency>
+                </dependencies>
+            </plugin>
                        <plugin>
                                <groupId>org.apache.felix</groupId>
                                <artifactId>maven-bundle-plugin</artifactId>
diff --git a/bgp/rib-api/src/main/yang/bgp-rib.yang b/bgp/rib-api/src/main/yang/bgp-rib.yang
new file mode 100644 (file)
index 0000000..816979c
--- /dev/null
@@ -0,0 +1,103 @@
+module bgp-rib {
+        yang-version 1;
+        namespace "urn:opendaylight:params:xml:ns:yang:bgp-rib";
+        prefix "rib";
+
+       import bgp-types { prefix bgp-t; revision-date 2013-09-19; }
+       import bgp-message { prefix bgp-msg; revision-date 2013-09-18; }
+       import bgp-multiprotocol { prefix bgp-mp; revision-date 2013-09-18; }
+       import ietf-inet-types { prefix inet; revision-date 2010-09-24; }
+
+        organization "Cisco Systems, Inc.";
+        contact "Robert Varga <rovarga@cisco.com>";
+
+        description
+                "This module contains the concept of a Routing Information Base,
+               as defined by RFC4271.
+
+                Copyright (c)2013 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 "2013-09-25" {
+                description
+                        "Initial revision.";
+                reference "RFC4271";
+        }
+
+       grouping route {
+               container next-hop {
+                       uses bgp-t:next-hop;
+               }
+
+               container attributes {
+                       uses bgp-msg:path-attributes;
+               }
+       }
+
+       grouping rib {
+               list tables {
+                       uses bgp-mp:bgp-table-type;
+                       key "afi safi";
+
+                       leaf uptodate {
+                               type boolean;
+                               default false;
+                       }
+
+                       choice routes {
+                               list ipv4-routes {
+                                       when "../../afi = ipv4";
+
+                                       leaf prefix {
+                                               type inet:ipv4-prefix;
+                                       }
+                                       key prefix;
+
+                                       uses route;
+                               }
+                               list ipv6-routes {
+                                       when "../../afi = ipv6";
+
+                                       leaf prefix {
+                                               type inet:ipv4-prefix;
+                                       }
+                                       key prefix;
+
+                                       uses route;
+                               }
+                               case link-state {
+                                       list link-state-links {
+                                               // FIXME: fill this out
+
+                                               uses route;
+                                       }
+                                       list link-state-nodes {
+                                               // FIXME: fill this out
+
+                                               uses route;
+                                       }
+                                       list link-state-ipv4-prefixes {
+                                               // FIXME: fill this out
+
+                                               uses route;
+                                       }
+                                       list link-state-ipv6-prefixes {
+                                               // FIXME: fill this out
+
+                                               uses route;
+                                       }
+                               }
+                       }
+               }
+       }
+
+       container loc-rib {
+               config false;
+               uses rib;
+       }
+}
+