Model changes for vpnservice 49/16249/2
authorDeepthi V V <deepthi.v.v@ericsson.com>
Tue, 10 Mar 2015 10:58:12 +0000 (16:28 +0530)
committerDeepthi V V <deepthi.v.v@ericsson.com>
Mon, 16 Mar 2015 04:48:48 +0000 (04:48 +0000)
1. Support for l3vpn, bgp standard yang models.
2. Add .gitignore file to ignore ide data.

Signed-off-by: Deepthi V V <deepthi.v.v@ericsson.com>
Change-Id: Ibaac01c98f43f693a16cfa27b5e24d9f92374ae7

.gitignore [new file with mode: 0644]
features/src/main/features/features.xml
model-bgp/pom.xml [new file with mode: 0644]
model-bgp/src/main/yang/bgp.yang [new file with mode: 0644]
pom.xml
vpnmanager-api/pom.xml
vpnmanager-api/src/main/yang/l3vpn.yang [new file with mode: 0644]
vpnmanager-api/src/main/yang/odl-l3vpn.yang [new file with mode: 0644]
vpnmanager-api/src/main/yang/vpnservice.yang [deleted file]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..44cd214
--- /dev/null
@@ -0,0 +1,17 @@
+#
+# Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. 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
+#
+.classpath
+.project
+.settings
+target
+*.iml
+.idea
+bin
+xtend-gen
+target
+.DS_Store
index a896fdf81847022049e65a22f1f41336587e1c73..bef5e3deba0599912dca789246d1aa1f9476c523 100644 (file)
@@ -15,6 +15,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   <repository>mvn:org.opendaylight.controller/features-restconf/${mdsal.version}/xml/features</repository>
   <feature name='odl-vpnservice-api' version='${project.version}' description='OpenDaylight :: vpnservice :: api '>
     <feature version='${yangtools.version}'>odl-yangtools-models</feature>
   <repository>mvn:org.opendaylight.controller/features-restconf/${mdsal.version}/xml/features</repository>
   <feature name='odl-vpnservice-api' version='${project.version}' description='OpenDaylight :: vpnservice :: api '>
     <feature version='${yangtools.version}'>odl-yangtools-models</feature>
+    <bundle>mvn:org.opendaylight.yangtools/model-bgp/2013.07.15.7-SNAPSHOT</bundle>
     <bundle>mvn:org.opendaylight.vpnservice/vpnmanager-api/${project.version}</bundle>
   </feature>
   <feature name='odl-vpnservice-impl' version='${project.version}' description='OpenDaylight :: vpnservice :: impl '>
     <bundle>mvn:org.opendaylight.vpnservice/vpnmanager-api/${project.version}</bundle>
   </feature>
   <feature name='odl-vpnservice-impl' version='${project.version}' description='OpenDaylight :: vpnservice :: impl '>
diff --git a/model-bgp/pom.xml b/model-bgp/pom.xml
new file mode 100644 (file)
index 0000000..bf9e814
--- /dev/null
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vi: set et smarttab sw=4 tabstop=4: -->
+<!--
+ Copyright (c) 2013 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">
+
+    <parent>
+        <groupId>org.opendaylight.yangtools</groupId>
+        <artifactId>binding-parent</artifactId>
+        <version>0.7.0-SNAPSHOT</version>
+        <relativePath/>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>model-bgp</artifactId>
+    <version>2013.07.15.7-SNAPSHOT</version>
+    <name>${project.artifactId}</name>
+    <description>${project.artifactId}</description>
+    <packaging>bundle</packaging>
+
+    <properties>
+        <!-- ODL -->
+        <ietf.inet.types.version>2010.09.24.7-SNAPSHOT</ietf.inet.types.version>
+        <ietf.yang.types.version>2010.09.24.7-SNAPSHOT</ietf.yang.types.version>
+        <yangtools.version>0.7.0-SNAPSHOT</yangtools.version>
+    </properties>
+
+    <dependencies>
+        <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>org.opendaylight.yangtools.model</groupId>
+            <artifactId>ietf-inet-types</artifactId>
+            <version>${ietf.inet.types.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.yangtools.model</groupId>
+            <artifactId>ietf-yang-types</artifactId>
+            <version>${ietf.yang.types.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+</project>
diff --git a/model-bgp/src/main/yang/bgp.yang b/model-bgp/src/main/yang/bgp.yang
new file mode 100644 (file)
index 0000000..cced35d
--- /dev/null
@@ -0,0 +1,1281 @@
+module bgp {
+  namespace "urn:cisco:params:xml:ns:yang:bgp";
+  // replace with IANA namespace when assigned
+  prefix bgp;
+
+  import ietf-inet-types {
+    prefix inet;
+  }
+  import ietf-yang-types {
+    prefix yang;
+  }
+
+  organization
+    "Cisco Systems
+     170 West Tasman Drive
+     San Jose, CA 95134-1706
+     USA";
+  contact
+    "Aleksandr Zhdankin azhdanki@cisco.com
+     Keyur Patel keyupate@cisco.com
+     Alexander Clemm alex@cisco.com";
+  description
+    "This YANG module defines the generic configuration
+     data for BGP, which is common across all of the vendor
+     implementations of the protocol. It is intended that the module
+     will be extended by vendors to define vendor-specific
+     BGP configuration parameters and policies,
+     for example route maps or route policies.
+
+
+     Terms and Acronyms
+
+     BGP (bgp): Border Gateway Protocol
+
+     IP (ip): Internet Protocol
+
+     IPv4 (ipv4):Internet Protocol Version 4
+
+     IPv6 (ipv6): Internet Protocol Version 6
+
+     MED(med): Multi Exit Discriminator
+
+     IGP (igp): Interior Gateway Protocol
+
+     MTU (mtu) Maximum Transmission Unit
+    ";
+
+  revision 2013-07-15 {
+    description
+      "Initial revision.";
+  }
+
+  typedef prefix-list-ref {
+    description
+      "A reference to the prefix list which a bgp-neighbor can use.";
+    type leafref {
+      path "/prefix-lists/prefix-list/prefix-list-name";
+    }
+  }
+
+  typedef neigbour-ref {
+    description
+      "A reference to the bgp-neighbor.";
+    type leafref {
+      path "/bgp-neighbors/bgp-neighbor/as-number";
+    }
+  }
+
+  typedef bgp-peer-admin-status {
+    description
+      "Administartive status of a BGP peer.";
+    type enumeration {
+      enum "unknown";
+      enum "up";
+      enum "down";
+    }
+  }
+
+  typedef actions-enum {
+    description
+      "Permit/deny action.";
+    type enumeration {
+      enum "permit";
+      enum "deny";
+    }
+  }
+
+  grouping ACTIONS {
+    description
+      "Permit/deny action.";
+    leaf action {
+      type actions-enum;
+      mandatory true;
+    }
+  }
+
+  grouping slow-peer-config {
+    description
+      "Configure a slow-peer.";
+    container detection {
+      leaf enable {
+        type boolean;
+        default "true";
+      }
+      leaf threshold {
+        type uint16 {
+          range "120..3600";
+        }
+      }
+    }
+    leaf split-update-group {
+      type enumeration {
+        enum "dynamic";
+        enum "static";
+      }
+    }
+  }
+  grouping update-group-management {
+    description
+      "Manage peers in BGP update group.";
+    leaf split-as-override {
+      description
+        "Keeps peers with as-override in different update groups.";
+      type boolean;
+    }
+  }
+
+  grouping neighbour-base-af-config {
+    description
+      "A set of configuration parameters that is applicable to all neighbour address families.";
+    leaf active {
+      description
+        "Enable the address family for this neighbor.";
+      type boolean;
+      default "false";
+    }
+    leaf advertisement-interval {
+      description
+        "Minimum interval between sending BGP routing updates.";
+      type uint32;
+    }
+    leaf allowas-in {
+      description
+        "Accept as-path with my AS present in it.";
+      type boolean;
+      default "false";
+    }
+    leaf maximum-prefix {
+      description
+        "Maximum number of prefixes accepted from this peer.";
+      type uint32;
+    }
+    leaf next-hop-self {
+      description
+        "Enable the next hop calculation for this neighbor.";
+      type boolean;
+      default "true";
+    }
+    leaf next-hop-unchanged {
+      description
+        "Propagate next hop unchanged for iBGP paths to this neighbour.";
+      type boolean;
+      default "true";
+    }
+    container remove-private-as {
+      leaf remove-private-as-number {
+        description
+          "Remove private AS number from outbound updates.";
+        type boolean;
+      }
+      leaf replace-with-local-as {
+        description
+          "Replace private AS number with local AS.";
+        type boolean;
+      }
+    }
+    leaf route-reflector-client {
+      description
+        "Configure a neighbor as Route Reflector client.";
+      type boolean;
+      default "false";
+    }
+    leaf send-community {
+      description
+        "Send Community attribute to this neighbor.";
+      type enumeration {
+        enum "both";
+        enum "extended";
+        enum "standard";
+      }
+      default "standard";
+    }
+    uses slow-peer-config;
+    leaf soo {
+      description
+        "Site-of-Origin extended community. Format is ASN:nn or IP-address:nn";
+      type string;
+    }
+    leaf weight {
+      description
+        "Set default weight for routes from this neighbor.";
+      type uint16;
+    }
+  }
+
+  grouping neighbour-common-af-config {
+    description
+      "A set of configuration parameters that is applicable to all neighbour address families,
+       except of nsap and rtfilter.";
+    uses neighbour-base-af-config;
+    leaf prefix-list {
+      description
+        "Reference to the prefix list of this neighbour.";
+      type prefix-list-ref;
+    }
+    leaf soft-reconfiguration {
+      description
+        "Allow inbound soft reconfiguration.";
+      type boolean;
+    }
+  }
+
+  grouping neighbour-cast-af-config {
+    description
+      "A set of configuration parameters that is applicable to both unicast and multicast sub-address families.";
+    uses neighbour-common-af-config;
+    leaf propagate-dmzlink-bw {
+      description
+        "Propagate the DMZ link bandwidth.";
+      type boolean;
+    }
+    container default-originate {
+      description
+        "Originate default route to this neighbor.";
+      leaf enable {
+        type boolean;
+        default "false";
+      }
+    }
+  }
+
+  grouping neighbour-ip-multicast-af-config {
+    description
+      "A set of configuration parameters that is applicable to ip multicast.";
+    uses neighbour-cast-af-config;
+    leaf route-server-client-context {
+      description
+        "Specifies Route Server client context name.";
+      type string;
+    }
+  }
+
+  grouping neighbour-ip-unicast-af-config {
+    description
+      "A set of configuration parameters that is applicable to ip unicast.
+       This grouping is intended to be extended by vendors as necessary to describe the vendor-specific configuration parameters.";
+    uses neighbour-ip-multicast-af-config;
+  }
+
+  grouping bgp-af-config {
+    description
+      "A set of configuration parameters that is applicable to all address families of the BFP router.";
+    leaf additional-paths {
+      description
+        "Additional paths in the BGP table.";
+      type enumeration {
+        enum "all";
+        enum "best-n";
+        enum "group-best";
+      }
+    }
+    leaf advertise-best-external {
+      description
+        "Advertise best external path to internal peers.";
+      type boolean;
+    }
+    container aggregate-timer {
+      description
+        "Configure aggregation timer.";
+      leaf enable {
+        type boolean;
+        default "true";
+      }
+      leaf threshold {
+        type uint16 {
+          range "6..60";
+        }
+      }
+    }
+    container bestpath {
+      description
+        "Change the default bestpath selection.";
+      choice bestpath-selection {
+        case as-path {
+          description
+            "Configures a BGP routrer to not consider the autonomous system (AS) path during best path route selection.";
+          leaf ignore-as-path {
+            type boolean;
+            default "false";
+          }
+        }
+        case compare-routerid {
+          description
+            "Configures a BGP routrer to compare identical routes received from different external peers
+             during the best path selection process and to select the route with the lowest router ID as the best path.";
+          leaf ignore-routerid {
+            type boolean;
+            default "false";
+          }
+        }
+        case cost-community {
+          description
+            "Configures a BGP router to not evaluate the cost community attribute
+             during the best path selection process.";
+          leaf ignore-cost-community {
+            type boolean;
+            default "false";
+          }
+        }
+        case igp-metric {
+          description
+            "Configures the system to ignore the IGP metric during BGP best path selection.";
+          leaf ignore-igp-metric {
+            type boolean;
+            default "false";
+          }
+        }
+        case mad-confed {
+          description
+            "Configure a BGP routing process to compare the Multi Exit Discriminator (MED)
+             between paths learned from confederation peers.";
+          leaf enable {
+            type boolean;
+            default "false";
+          }
+          leaf missing-as-worst {
+            description
+              "Assigns a value of infinity to routes that are missing
+               the Multi Exit Discriminator (MED) attribute,
+               making the path without a MED value the least desirable path";
+            type boolean;
+            default "false";
+          }
+        }
+      }
+    }
+    leaf dampening {
+      description
+        "Enable route-flap dampening.";
+      type boolean;
+      default "false";
+    }
+    leaf propagate-dmzlink-bw {
+      description
+        "Use DMZ Link Bandwidth as weight for BGP multipaths.";
+      type boolean;
+    }
+    leaf redistribute-internal {
+      description
+        "Allow redistribution of iBGP into IGPs (dangerous)";
+      type boolean;
+    }
+    leaf scan-time {
+      description
+        "Configure background scanner interval in seconds.";
+      type uint8 {
+        range "5..60";
+      }
+    }
+    uses slow-peer-config;
+    leaf soft-reconfig-backup {
+      description
+        "Use soft-reconfiguration inbound only when route-refresh is not negotiated.";
+      type boolean;
+    }
+  }
+
+  grouping bgp-af-vpn-config {
+    description
+      "A set of configuration parameters that is applicable to vpn sub-address family on the BGP router.";
+    uses bgp-af-config;
+    uses update-group-management;
+  }
+
+  grouping bgp-af-mvpn-config {
+    description
+      "A set of configuration parameters that is applicable to mvpn sub-address family on the BGP router.";
+    leaf scan-time {
+      description
+        "Configure background scanner interval in seconds.";
+      type uint8 {
+        range "5..60";
+      }
+    }
+    uses slow-peer-config;
+    leaf soft-reconfig-backup {
+      description
+        "Use soft-reconfiguration inbound only when route-refresh is not negotiated.";
+      type boolean;
+    }
+    leaf propagate-dmzlink-bw {
+      description
+        "Use DMZ Link Bandwidth as weight for BGP multipaths.";
+      type boolean;
+    }
+    leaf rr-group {
+      description
+        "Extended community list name.";
+      type string;
+    }
+    uses update-group-management;
+  }
+
+  grouping redistribute {
+    description
+      "Redistribute information from another routing protocol.
+       This grouping is intended to be augmented by vendors to implement vendor-specific protocol redistribution configuration options.";
+    choice protocol {
+      case bgp {
+        leaf enable-bgp {
+          type boolean;
+        }
+      }
+      case ospf {
+        leaf enable-ospf {
+          type boolean;
+        }
+      }
+      case isis {
+        leaf enable-isis {
+          type boolean;
+        }
+      }
+      case connected {
+        leaf enable-connected {
+          type boolean;
+        }
+      }
+      case eigrp {
+        leaf enable-eigrp {
+          type boolean;
+        }
+      }
+      case mobile {
+        leaf enable-mobile {
+          type boolean;
+        }
+      }
+      case static {
+        leaf enable-static {
+          type boolean;
+        }
+      }
+      case rip {
+        leaf enable-rip {
+          type boolean;
+        }
+      }
+    }
+  }
+
+  grouping router-af-config {
+    description
+      "A set of configuration parameters that is applicable to all address families on the BGP router.";
+    leaf aggregate-address {
+      description
+        "Configure BGP aggregate address.";
+      type inet:ip-address;
+    }
+    leaf distance {
+      description
+        "Define an administrative distance.";
+      type uint8 {
+        range "1..255";
+      }
+    }
+    leaf network {
+      description
+        "Specify a network to announce via BGP.";
+      type inet:ip-address;
+    }
+    uses redistribute;
+  }
+
+  grouping maximum-paths {
+    description
+      "Configures packet forwarding over multiple paths.";
+    leaf number-of-path {
+      type uint8 {
+        range "1..32";
+      }
+    }
+    leaf ibgp-number-of-path {
+      type uint8 {
+        range "1..32";
+      }
+    }
+  }
+
+  container bgp-router {
+    description
+      "This is a top-level container for the BGP router.";
+    leaf local-as-number {
+      type uint32;
+    }
+    leaf local-as-identifier {
+      type inet:ip-address;
+    }
+    container rpki-config {
+      description
+        "RPKI configuration parameters.";
+      container cache-server-config {
+        description
+          "Configure the RPKI cache-server parameters in rpki-server configuration mode.";
+        choice server {
+          case ip-address {
+            leaf ip-address {
+              type inet:ip-address;
+              mandatory true;
+            }
+          }
+          case host-name {
+            leaf ip-host-address {
+              type inet:host;
+              mandatory true;
+            }
+          }
+        }
+        choice transport {
+          description
+            "Specifies a transport method for the RPKI cache.";
+          case tcp {
+            leaf tcp-port {
+              type uint32;
+            }
+          }
+          case ssh {
+            leaf ssh-port {
+              type uint32;
+            }
+          }
+        }
+        leaf user-name {
+          type string;
+        }
+        leaf password {
+          type string;
+        }
+        leaf preference-value {
+          description
+            "Specifies a preference value for the RPKI cache.
+             Setting a lower preference value is better.";
+          type uint8 {
+            range "1..10";
+          }
+        }
+        leaf purge-time {
+          description
+            "Configures the time BGP waits to keep routes from a cache after the cache session drops. Set purge time in seconds.";
+          type uint16 {
+            range "30..360";
+          }
+        }
+        choice refresh-time {
+          description
+            "Configures the time BGP waits in between sending periodic serial queries to the cache. Set refresh-time in seconds.";
+          case disable {
+            leaf refresh-time-disable {
+              type boolean;
+            }
+          }
+          case set-time {
+            leaf refresh-interval {
+              type uint16 {
+                range "15..3600";
+              }
+            }
+          }
+        }
+        choice responce-time {
+          description
+            "Configures the time BGP waits for a response after sending a serial or reset query. Set response-time in seconds.";
+          case disable {
+            leaf responce-time-disable {
+              type boolean;
+            }
+          }
+          case set-time {
+            leaf responce-interval {
+              type uint16 {
+                range "15..3600";
+              }
+            }
+          }
+        }
+      }
+      container validation-config {
+        description
+          "Controls the behavior of RPKI prefix validation processing.";
+        leaf enable {
+          description
+            "Enables RPKI origin-AS validation.";
+          type boolean;
+          default "true";
+        }
+        leaf enable-ibgp {
+          description
+            "Enables the iBGP signaling of validity state through an extended-community.";
+          type boolean;
+        }
+        choice validation-time {
+          description
+            "Sets prefix validation time (in seconds) or to set off the automatic prefix validation after an RPKI update.";
+          case validation-off {
+            leaf disable {
+              type boolean;
+            }
+          }
+          case set-time {
+            leaf prefix-validation-time {
+              description
+                "Range in seconds.";
+              type uint16 {
+                range "5..60";
+              }
+            }
+          }
+        }
+      }
+      container bestpath-computation {
+        description
+          "Configures RPKI bestpath computation options.";
+        leaf enable {
+          description
+            "Enables the validity states of BGP paths to affect the path's preference in the BGP bestpath process.";
+          type boolean;
+        }
+        leaf allow-invalid {
+          description
+            "Allows all 'invalid' paths to be considered for BGP bestpath computation.";
+          type boolean;
+        }
+      }
+    }
+    container af-configuration {
+      description
+        "Top level container for address families specific configuration of the BGP router.";
+      container ipv4 {
+        container mdt {
+          container bgp {
+            description
+              "BGP specific commands for ipv4-mdt address family/sub-addess family combination.";
+            leaf dampening {
+              description
+                "Enable route-flap dampening.";
+              type boolean;
+              default "false";
+            }
+            leaf scan-time {
+              description
+                "Configure background scanner interval in seconds.";
+              type uint8 {
+                range "5..60";
+              }
+            }
+            uses slow-peer-config;
+            leaf soft-reconfig-backup {
+              description
+                "Use soft-reconfiguration inbound only when route-refresh is not negotiated.";
+              type boolean;
+            }
+            leaf propagate-dmzlink-bw {
+              description
+                "Use DMZ Link Bandwidth as weight for BGP multipaths.";
+              type boolean;
+            }
+          }
+        }
+        container multicast {
+          container bgp {
+            description
+              "BGP specific commands for ipv4-multicast address family/sub-addess family combination.";
+            uses bgp-af-config;
+          }
+          leaf auto-summary {
+            description
+              "Enable automatic network number summarization";
+            type boolean;
+          }
+          uses router-af-config;
+          leaf default-metric {
+            description
+              "Set metric of redistributed routes.";
+            type uint32;
+          }
+        }
+        container unicast {
+          container bgp {
+            description
+              "BGP specific commands for ipv4-unicast address family/sub-addess family combination.";
+            uses bgp-af-config;
+            leaf always-compare-med {
+              description
+                "Allow comparing MED from different neighbors.";
+              type boolean;
+              default "false";
+            }
+            leaf enforce-first-as {
+              description
+                "Enforce the first AS for EBGP routes(default).";
+              type boolean;
+              default "true";
+            }
+            leaf fast-external-fallover {
+              description
+                "Immediately reset session if a link to a directly connected external peer goes down.";
+              type boolean;
+              default "true";
+            }
+            leaf suppress-inactive {
+              description
+                "Suppress routes that are not in the routing table.";
+              type boolean;
+            }
+            leaf asnotation {
+              description
+                "Sets the default asplain notation.";
+              type enumeration {
+                enum "asplain";
+                enum "dot";
+              }
+            }
+            leaf enable-client-to-client-reflection {
+              description
+                "Manages client to client route reflection.";
+              type boolean;
+              default "true";
+            }
+            leaf cluster-id {
+              description
+                "Configure Route-Reflector Cluster-id.";
+              type string;
+            }
+            container confederation {
+              description
+                "AS confederation parameters.";
+              leaf identifier {
+                description
+                  "Confederation identifier.";
+                type string;
+              }
+              list peers {
+                description
+                  "Confederation peers.";
+                key "as-name";
+                leaf as-name {
+                  type string;
+                }
+              }
+            }
+            container consistency-checker {
+              description
+                "Consistency-checker configuration.";
+              leaf enable {
+                type boolean;
+              }
+              leaf interval {
+                description
+                  "Check interval in minutes.";
+                type uint16 {
+                  range "5..1440";
+                }
+              }
+              choice inconsistency-action {
+                case error-message {
+                  description
+                    "Specifies that when an inconsistency is found, the system will only generate a syslog message.";
+                  leaf generate-error-message-only {
+                    type boolean;
+                  }
+                }
+                case autorepair {
+                  description
+                    "Specifies that when an inconsistency is found,
+                     the system will generate a syslog message and take action
+                     based on the type of inconsistency found.";
+                  leaf perform-autorepair {
+                    type boolean;
+                  }
+                }
+              }
+            }
+            leaf deterministic-med {
+              description
+                "If enabled it enforce the deterministic comparison of the MED value between
+                 all paths received from within the same autonomous system.";
+              type boolean;
+            }
+            container graceful-restart {
+              description
+                "Controls the BGP graceful restart capability.";
+              leaf enable {
+                type boolean;
+              }
+              leaf restart-time {
+                description
+                  "Sets the maximum time period (in seconds) that the local router will wait
+                   for a graceful-restart-capable neighbor to return to normal operation after a restart event occurs.";
+                type uint16 {
+                  range "1..3600";
+                }
+                default "120";
+              }
+              leaf stalepath-time {
+                description
+                  "Sets the maximum time period that the local router will hold stale paths for a restarting peer.";
+                type uint16 {
+                  range "5..3600";
+                }
+                default "360";
+              }
+            }
+            container listener-congfig {
+              description
+                "Associates a subnet range with a BGP peer group and activate the BGP dynamic neighbors feature.";
+              leaf enable {
+                type boolean;
+              }
+              leaf limit {
+                description
+                  "Sets a maximum limit number of BGP dynamic subnet range neighbors.";
+                type uint16 {
+                  range "1..5000";
+                }
+                default "100";
+              }
+              leaf range {
+                description
+                  "Specifies a subnet range that is to be associated with a specified peer group.";
+                type uint16 {
+                  range "0..32";
+                }
+              }
+              leaf peer-group {
+                description
+                  "Specifies a BGP peer group that is to be associated with the specified subnet range.";
+                type string;
+              }
+            }
+            leaf log-neighbor-changes {
+              description
+                "Log neighbor up/down and reset reason.";
+              type boolean;
+            }
+            leaf max-as-limit {
+              description
+                "Configures BGP to discard routes that have a number of autonomous system numbers in AS-path that exceed the specified value.";
+              type uint16 {
+                range "1..254";
+              }
+            }
+            container router-id {
+              description
+                "Configures a fixed router ID for the local BGP routing process.";
+              leaf enable {
+                type boolean;
+              }
+              choice config-type {
+                case static {
+                  leaf ip-address {
+                    type boolean;
+                  }
+                }
+                case auto-config {
+                  leaf enable-auto-config {
+                    type boolean;
+                  }
+                }
+              }
+            }
+            container transport {
+              description
+                "Manages transport session parameters.";
+              leaf enable-path-mtu-discovery {
+                description
+                  "Enables transport path MTU discovery.";
+                type boolean;
+                default "true";
+              }
+            }
+          }
+          leaf auto-summary {
+            description
+              "Enable automatic network number summarization";
+            type boolean;
+          }
+          uses router-af-config;
+          uses maximum-paths;
+          leaf synchronization {
+            description
+              "Perform IGP synchronization.";
+            type boolean;
+          }
+        }
+        container mvpn {
+          container bgp {
+            description
+              "BGP specific commands for ipv4-mvpn address family/sub-addess family combination.";
+            uses bgp-af-mvpn-config;
+          }
+          leaf auto-summary {
+            description
+              "Enable automatic network number summarization.";
+            type boolean;
+          }
+        }
+      }
+      container ipv6 {
+        container multicast {
+          container bgp {
+            description
+              "BGP specific commands for ipv6-multicast address family/sub-addess family combination.";
+            uses bgp-af-config;
+          }
+          uses router-af-config;
+        }
+        container unicast {
+          container bgp {
+            description
+              "BGP specific commands for ipv6-unicast address family/sub-addess family combination.";
+            uses bgp-af-config;
+          }
+          uses router-af-config;
+          leaf default-metric {
+            description
+              "Set metric of redistributed routes.";
+            type uint32;
+          }
+          uses maximum-paths;
+          leaf synchronization {
+            description
+              "Perform IGP synchronization.";
+            type boolean;
+          }
+        }
+        container mvpn {
+          container bgp {
+            description
+              "BGP specific commands for ipv6-mvpn address family/sub-addess family combination.";
+            uses bgp-af-mvpn-config;
+          }
+        }
+      }
+      container l2vpn {
+        container vpls {
+          container bgp {
+            description
+              "BGP specific commands for l2vpn-vpls address family/sub-addess family combination.";
+            leaf scan-time {
+              description
+                "Configure background scanner interval in seconds.";
+              type uint8 {
+                range "5..60";
+              }
+            }
+            uses slow-peer-config;
+          }
+        }
+      }
+      container nsap {
+        container unicast {
+          container bgp {
+            description
+              "BGP specific commands for nsap-unicast address family/sub-addess family combination.";
+            container aggregate-timer {
+              description
+                "Configure Aggregation Timer.";
+              leaf enable {
+                type boolean;
+                default "true";
+              }
+              leaf threshold {
+                type uint16 {
+                  range "6..60";
+                }
+              }
+            }
+            leaf dampening {
+              description
+                "Enable route-flap dampening.";
+              type boolean;
+              default "false";
+            }
+            leaf propagate-dmzlink-bw {
+              description
+                "Use DMZ Link Bandwidth as weight for BGP multipaths.";
+              type boolean;
+            }
+            leaf redistribute-internal {
+              description
+                "Allow redistribution of iBGP into IGPs (dangerous)";
+              type boolean;
+            }
+            leaf scan-time {
+              description
+                "Configure background scanner interval in seconds.";
+              type uint8 {
+                range "5..60";
+              }
+            }
+            uses slow-peer-config;
+            leaf soft-reconfig-backup {
+              description
+                "Use soft-reconfiguration inbound only when route-refresh is not negotiated.";
+              type boolean;
+            }
+          }
+          leaf default-metric {
+            description
+              "Set metric of redistributed routes.";
+            type uint32;
+          }
+          uses maximum-paths;
+          leaf network {
+            description
+              "Specify a network to announce via BGP.";
+            type inet:ip-address;
+          }
+          uses redistribute;
+          leaf synchronization {
+            description
+              "Perform IGP synchronization.";
+            type boolean;
+          }
+        }
+      }
+    }
+    container rtfilter {
+      container unicast {
+        container bgp {
+          description
+            "BGP specific commands for rtfilter-unicast address family/sub-addess family combination.";
+          uses slow-peer-config;
+        }
+        uses maximum-paths;
+      }
+    }
+    container vpnv4 {
+      container unicast {
+        container bgp {
+          description
+            "BGP specific commands for vpnv4-unicast address family/sub-addess family combination.";
+          uses bgp-af-vpn-config;
+        }
+        uses maximum-paths;
+      }
+      container multicast {
+        container bgp {
+          description
+            "BGP specific commands for vpnv4-multicast address family/sub-addess family combination.";
+          uses bgp-af-vpn-config;
+        }
+        uses maximum-paths;
+      }
+    }
+    container vpnv6 {
+      container unicast {
+        container bgp {
+          description
+            "BGP specific commands for vpnv6-unicast address family/sub-addess family combination.";
+          uses bgp-af-vpn-config;
+        }
+      }
+    }
+  }
+  container bgp-neighbors {
+    description
+      "The top level container for the list of neighbours of the BGP router.";
+    list bgp-neighbor {
+      key "as-number";
+      leaf as-number {
+        type uint32;
+      }
+      choice peer-address-type {
+        case ip-address {
+          leaf ip-address {
+            type inet:ip-address;
+            mandatory true;
+          }
+        }
+        case prefix {
+          leaf prefix {
+            type inet:ip-prefix;
+            mandatory true;
+          }
+        }
+        case host {
+          leaf ip-host-address {
+            type inet:host;
+            mandatory true;
+          }
+        }
+      }
+      leaf prefix-list {
+        type prefix-list-ref;
+      }
+      leaf default-action {
+        type actions-enum;
+      }
+      container af-specific-config {
+        description
+          "Address family specific configuration parameters for the neighbours.";
+        container ipv4 {
+          container mdt {
+            uses neighbour-common-af-config;
+          }
+          container unicast {
+            uses neighbour-ip-unicast-af-config;
+          }
+          container multicast {
+            uses neighbour-ip-multicast-af-config;
+          }
+          container mvpn {
+            uses neighbour-cast-af-config;
+          }
+        }
+        container ipv6 {
+          container unicast {
+            uses neighbour-ip-unicast-af-config;
+          }
+          container multicast {
+            uses neighbour-ip-multicast-af-config;
+          }
+          container mvpn {
+            uses neighbour-common-af-config;
+          }
+        }
+        container l2vpn {
+          container evpn {
+            uses neighbour-common-af-config;
+          }
+          container vpls {
+            uses neighbour-common-af-config;
+          }
+        }
+        container nsap {
+          container unicast {
+            uses neighbour-base-af-config;
+            leaf prefix-list {
+              type prefix-list-ref;
+            }
+          }
+        }
+        container rtfilter {
+          container unicast {
+            uses neighbour-base-af-config;
+            leaf soft-reconfiguration {
+              description
+                "Allow inbound soft reconfiguration.";
+              type boolean;
+            }
+          }
+        }
+        container vpnv4 {
+          container unicast {
+            uses neighbour-cast-af-config;
+          }
+          container multicast {
+            uses neighbour-cast-af-config;
+          }
+        }
+        container vpnv6 {
+          container unicast {
+            uses neighbour-cast-af-config;
+          }
+          container multicast {
+            uses neighbour-cast-af-config;
+          }
+        }
+      }
+      container bgp-neighbor-state {
+        description
+          "The operational parameters describing the neighbour state.
+           It is intended that this container may be augmented by vendors to reflect the vendor-specific operational state parameters.";
+        leaf adminStatus {
+          type bgp-peer-admin-status;
+        }
+        leaf in-lastupdatetime {
+          type yang:timestamp;
+        }
+      }
+      container bgp-neighbor-statistics {
+        description
+          "The operational parameters describing the neighbour statistics.
+           It is intended that this container may be augmented by vendors to reflect the vendor-specific staistical parameters.";
+        leaf nr-in-updates {
+          type uint32;
+        }
+        leaf nr-out-updates {
+          type uint32;
+        }
+      }
+    }
+  }
+  container prefix-lists {
+    description
+      "Contains all prefix lists defined
+       on a router.";
+    list prefix-list {
+      key "prefix-list-name";
+      description
+        "A prefix list.";
+      leaf prefix-list-name {
+        type string;
+      }
+      container prefixes {
+        list prefix {
+          key "seq-nr";
+          description
+            "A prefix is a rule with a BGP filter.
+             The left hand side of the rule is the prefix filter.
+                        It specifies a set of IP addresses.
+             If a BGP announcement contains an address that matches, the
+             rule is applied.  The right hand side of the rule specifies
+             the action that is to be applied.";
+          leaf seq-nr {
+            type uint16;
+            description
+              "Sequence number of the rule.
+               The sequence number is included for compatibility purposes
+               with CLI; from a machine-to-machine interface perspective,
+               it would strictly speaking not be required as list elements
+               can be arranged in a particular order.";
+          }
+          container prefix-filter {
+            choice ip-address-group {
+              case ip-address {
+                leaf ip-address {
+                  type inet:ip-address;
+                  mandatory true;
+                }
+              }
+              case prefix {
+                leaf prefix {
+                  type inet:ip-prefix;
+                  mandatory true;
+                }
+              }
+              case host {
+                leaf ip-host-address {
+                  type inet:host;
+                  mandatory true;
+                }
+              }
+              case ip-range {
+                leaf lower {
+                  type inet:ip-address;
+                }
+                leaf upper {
+                  type inet:ip-address;
+                }
+              }
+            }
+            leaf action {
+              type actions-enum;
+              mandatory true;
+              description
+                "permit/deny action";
+            }
+                       container statistics {
+              leaf prefix-hit-count {
+                type uint32;
+                config false;
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+}
diff --git a/pom.xml b/pom.xml
index d856c7286d100f3c529792386fbaed38a078a981..4227d1e1495aad3b1ac8273c9427c99e3e57be49 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -16,6 +16,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
     <maven>3.1.1</maven>
   </prerequisites>
   <modules>
     <maven>3.1.1</maven>
   </prerequisites>
   <modules>
+    <module>model-bgp</module>
     <module>vpnmanager-api</module>
     <module>vpnmanager-impl</module>
     <module>distribution/karaf</module>
     <module>vpnmanager-api</module>
     <module>vpnmanager-impl</module>
     <module>distribution/karaf</module>
index b738bc6a9f0f6509992807dd2a08cda430da2ec1..21ad102c2a597ab024bdf50b4cc17f422adb40cc 100644 (file)
@@ -49,5 +49,15 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
       <artifactId>ietf-yang-types</artifactId>
       <version>${ietf.yang.types.version}</version>
     </dependency>
       <artifactId>ietf-yang-types</artifactId>
       <version>${ietf.yang.types.version}</version>
     </dependency>
+    <dependency>
+      <groupId>org.opendaylight.yangtools.model</groupId>
+      <artifactId>ietf-interfaces</artifactId>
+      <version>2014.05.08.7-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.yangtools</groupId>
+      <artifactId>model-bgp</artifactId>
+      <version>2013.07.15.7-SNAPSHOT</version>
+    </dependency>
   </dependencies>
 </project>
   </dependencies>
 </project>
diff --git a/vpnmanager-api/src/main/yang/l3vpn.yang b/vpnmanager-api/src/main/yang/l3vpn.yang
new file mode 100644 (file)
index 0000000..534b774
--- /dev/null
@@ -0,0 +1,887 @@
+module l3vpn {
+  namespace "urn:huawei:params:xml:ns:yang:l3vpn";
+// replace with IANA namespace when assigned
+  prefix "l3vpn";
+
+  import bgp {
+    prefix bgp;
+    //draft-zhdankin-netmod-bgp-cfg
+  }
+  import ietf-interfaces {
+    prefix if;
+    //rfc7223-YANG Interface Management
+  }
+
+  import ietf-inet-types {
+    prefix inet;
+    //RFC6991
+  }
+
+  import ietf-yang-types {
+    prefix yang;
+    //RFC6991
+  }
+
+  description
+    "This YANG module defines the generic configuration data for L3VPN service.
+
+     Terms and Acronyms
+
+     BGP (bgp): Border Gateway Protocol
+     IPv4 (ipv4):Internet Protocol Version 4
+     IPv6 (ipv6): Internet Protocol Version 6
+
+    ";
+
+  revision 2014-08-15 {
+    description
+      "Initial revision.";
+      reference "RFC4271, RFC4364, RFC4760";
+  }
+
+  grouping augment-bgp-af-vpn-config {
+    description
+      "A set of configuration parameters that is applicable to both BGP-VPNv4
+      and BGP-VPNv6 address family.";
+
+    leaf apply-label-per-nexthop {
+      description
+        "The apply-label per-nexthop command enables the ASBR to allocate
+         labels for IPv4 VPN routes or IPv6 VPN routes based on the next hop.";
+
+
+
+      config "true";
+      type boolean;
+      default "false";
+    }
+
+    leaf upeEnable {
+      description
+        "Specify peer as UPE.";
+
+      config "true";
+      type boolean;
+      default "false";
+    }
+
+  }
+
+
+  grouping bgp-af-vpn-instance-config {
+
+    container router-id {
+      description
+        "The router-id command configures router ID for BGP VPN instance IPv4
+        or IPv6 address family.
+        By default, no router ID is configured for BGP VPN instance IPv4 or
+        IPv6 address family, and the BGP router ID is used as the router ID.";
+
+      leaf enable {
+        type boolean;
+      }
+
+      choice config-type {
+        case static {
+          leaf ip-address {
+            description
+              "Specifies the router ID of a BGP VPN instance IPv4 address
+               family. The router ID is expressed in the IPv4 address format.
+               ";
+
+            config "true";
+            type inet:ip-address;
+          }
+        }
+        case auto-select {
+          leaf enable-auto-select {
+            description
+              "Configures automatic route ID selection for the current BGP VPN
+               instance address family.";
+
+
+            config "true";
+            type boolean;
+          }
+        }
+      }
+    }
+
+    leaf auto-frr {
+      description
+        "The auto-frr command enables BGP Auto FRR.";
+
+      config "true";
+      type boolean;
+      default "false";
+    }
+
+    container bgpPeers {
+      list bgpPeer {
+      key "peerAddr";
+      max-elements "unbounded";
+      min-elements "0";
+        description
+          "BGP Peer configure class";
+
+        leaf peerAddr {
+          description
+            "The nerighbor address";
+            config "true";
+            type inet:ip-address;
+            mandatory true;
+        }
+
+          leaf groupName {
+            description "peerGroupName";
+            config "true";
+            type string {
+              length "1..47";
+            }
+          }
+          leaf remoteAs {
+            description "Specifies the AS number of the peer.";
+            config "true";
+            type string {
+              length "1..11";
+            }
+          }
+
+          leaf description {
+
+            description
+              "specifies the description. The description is a string of letters
+               or figures. The value ranges from 1 to 80 characters without
+               spaces.";
+          config "true";
+            type string {
+              length "1..80";
+              pattern "([^?]*)";
+            }
+          }
+
+          leaf soo {
+            description
+              "The peer soo command configures the Site of Origin (SoO)
+               attribute for an EBGP peer in a BGP VPN instance. Format is ASN:nn
+               or IP-address:nn.";
+
+          config "true";
+          type string {
+            length "3..21";
+          }
+        }
+
+        leaf substituteAsEnable {
+          description
+            "Using the peer substitute-as command, you can substitute the AS
+             number of the specified peer in the as-path with the local AS
+             number.";
+
+          config "true";
+          type boolean;
+            default "false";
+        }
+
+      }
+    }
+
+  }
+
+  grouping vpn-af-config {
+    description
+      "A set of configuration parameters that is applicable to both IPv4 and
+       IPv6 address family for a VPN instance .";
+
+    leaf route-distinguisher {
+      description
+        "The route-distinguisher command configures a route distinguisher (RD)
+         for the IPv4 or IPv6 address family of a VPN instance.
+
+         Format is ASN:nn or IP-address:nn.";
+
+      config "true";
+      type string {
+        length "3..21";
+      }
+    }
+
+    container vpnTargets {
+      description
+        "The vpn-target command configures the export or import VPN target
+         extended community attribute for the VPN instance IPv4/IPv6 address
+         family.
+         Format is ASN:nn or IP-address:nn.";
+
+      list vpnTarget {
+        key "vrfRTValue";
+        max-elements "unbounded";
+        min-elements "0";
+        description
+          "L3vpn vpntarget configure class";
+
+        leaf vrfRTValue {
+
+          description
+            "Vpn-target: adds VPN target extended community attribute to the
+             export or import VPN target extended community list. The
+             vpn-target can be expressed in either of the following formats:
+             (1)16-bit AS number:32-bit user-defined number
+                 For example, 1:3. The AS number ranges from 0 to 65535. The
+                 user-defined number ranges from 0 to 4294967295. The AS number
+                 and the user-defined number cannot be 0s at the same time.
+                 That is, a VPN target cannot be 0:0.
+             (2)32-bit IP address:16-bit user-defined number
+                For example, 192.168.122.15:1. The IP address ranges from
+                0.0.0.0 to 255.255.255.255. The user-defined number ranges from
+                0 to 65535.
+             (3)32-bit IP address:16-bit user-defined number
+                For example, 192.168.122.15:1. An IP address ranges from
+                0.0.0.0 to 255.255.255.255. A user-defined number ranges from 0
+                to 65535.";
+
+          config "true";
+          mandatory "true";
+          type string {
+            length "3..21";
+          }
+        }
+
+        leaf vrfRTType {
+          description
+            "Specifies the vpn target type, export-extcommunity:
+             specifies the extended community attributes carried in routing
+             information to be sent. import-extcommunity: receives routing
+             information carrying specified extended community attributes.";
+
+            mandatory "true";
+            type enumeration {
+            enum export_extcommunity {
+              value "0";
+              description "export-extcommunity:";
+            }
+            enum import_extcommunity {
+              value "1";
+              description "import-extcommunity:";
+            }
+            enum both {
+              value "2";
+              description "export-extcommunity & import-extcommunity:";
+            }
+          }
+        }
+      }
+    }
+
+    container apply-label {
+      description
+        "Apply one label mode for the VPN instance route.";
+
+      choice apply-label-mode {
+        case per-route {
+          description
+            "The apply-label per-route command enables the one-label-per-route
+             mode. The VPN instance IPv4/IPv6 address family assigns a unique
+             label to each route to be sent to the peer PE.";
+
+          leaf apply-label-per-route {
+            type boolean;
+            default "true";
+          }
+        }
+        case per-instance {
+          description
+            "The apply-label per-instance command applies one label to all VPN
+             instance IPv4 address family or IPv6 address family routes to a
+             peer PE.";
+
+        leaf apply-label-per-instance {
+            type boolean;
+            default "false";
+          }
+        }
+      }
+    }//End of "container apply-label"
+
+    leaf import-route-policy {
+      description
+        "The import route-policy command associates a VPN instance enabled
+         with the IPv4 or IPv6 address family with an import routing policy.
+         Only one import routing policy can be associated with a VPN instance
+         enabled with the IPv4 or IPv6 address family. If the import
+         route-policy command is run more than once, the latest configuration
+         overrides the previous ones.";
+
+        config "true";
+        type string {
+          length "1..40";
+        }
+    }
+
+    leaf export-route-policy {
+      description
+        "The export route-policy command associates a VPN instance enabled
+         with the IPv4 or IPv6 address family with an export routing policy.
+         Only one export routing policy can be associated with a VPN instance
+         enabled with the IPv4 or IPv6 address family. If the export
+         route-policy command is run more than once, the latest configuration
+         overrides the previous ones.";
+
+      config "true";
+      type string {
+        length "1..40";
+      }
+    }
+
+
+    container prefix-limit {
+      description
+        "The prefix limit command sets a limit on the maximum number of
+         prefixes supported in the existing VPN instance, preventing the
+         PE from importing excessive VPN route prefixes.";
+
+      leaf prefix-limit-number {
+        description
+          "Specifies the maximum number of prefixes supported in the VPN
+
+
+           instance IPv4 or IPv6 address family.";
+
+        type uint32 {
+          range "1..4294967295";
+        }
+      }
+
+      choice prefix-limit-action {
+        case enable-alert-percent {
+          leaf alert-percent-value {
+            description
+              "Specifies the proportion of the alarm threshold to the maximum
+               number of prefixes.";
+            type uint8 {
+              range "1..100";
+            }
+          }
+          leaf route-unchanged {
+            description
+              "Indicates that the routing table remains unchanged. By default,
+               route-unchanged is not configured. When the number of prefixes
+               in the routing table is greater than the value of the parameter
+               number, routes are processed as follows:
+               (1)If route-unchanged is configured, routes in the routing table
+                  remain unchanged.
+               (2)If route-unchanged is not configured, all routes in the
+                  routing table are deleted and then re-added.";
+
+            config "true";
+            type boolean;
+            default "false";
+          }
+        }
+        case enable-simple-alert {
+          leaf simple-alert {
+            description
+              "Indicates that when the number of VPN route prefixes exceeds
+               number, prefixes can still join the VPN routing table and
+               alarms are displayed.";
+
+            config "true";
+            type boolean;
+            default "false";
+          }
+        }
+      }
+    }
+
+
+
+   container routing-table-limit {
+      description
+        "The routing-table limit command sets a limit on the maximum number of
+        routes that the IPv4 or IPv6 address family of a VPN instance can
+        support.
+        By default, there is no limit on the maximum number of routes that the
+        IPv4 or IPv6 address family of a VPN instance can support, but the
+        total number of private network and public network routes on a device
+        cannot exceed the allowed maximum number of unicast routes.";
+
+      leaf routing-table-limit-number {
+        description
+          "Specifies the maximum number of routes supported by a VPN instance.
+          ";
+
+        config "true";
+        type uint32 {
+          range "1..4294967295";
+        }
+      }
+      choice routing-table-limit-action {
+        case enable-alert-percent {
+          leaf alert-percent-value {
+            description
+              "Specifies the percentage of the maximum number of routes. When
+               the maximum number of routes that join the VPN instance is up
+               to the value (number*alert-percent)/100, the system prompts
+               alarms. The VPN routes can be still added to the routing table,
+               but after the number of routes reaches number, the subsequent
+               routes are dropped.";
+
+            config "true";
+            type uint8 {
+              range "1..100";
+            }
+          }
+        }
+        case enable-simple-alert {
+          leaf simple-alert {
+            description
+              "Indicates that when VPN routes exceed number, routes can still
+               be added into the routing table, but the system prompts alarms.
+               However, after the total number of VPN routes and network public
+               routes reaches the unicast route limit specified in the License,
+               the subsequent VPN routes are dropped.";
+
+            config "true";
+            type boolean;
+           
+          }
+        }
+      }
+    }
+
+    leaf vpn-frr {
+      description
+        "Enable VPN FRR in the VPN instance address family view.
+         If a PE is connected to two other PEs, running the vpn frr command in
+         the VPN instance address family view of the PE enables VPN FRR and
+         improves network reliability. After VPN FRR is configured, traffic can
+         switch to the secondary LSP immediately after the primary LSP becomes
+         faulty.";
+
+      type boolean;
+      default "false";
+    }
+
+
+   /*
+    * VPN QoS.
+    */
+    container l3vpnVrfPipe {
+      description
+        "The diffserv-mode command configures the mode of the MPLS
+        differentiated service (Diff-Serv) for ensuring end-to-end QoS.";
+
+      leaf pipeMode {
+        description
+          "Pipe mode";
+
+    type enumeration {
+      enum pipe {
+        value "0";
+        description
+          "pipe: Indicates that the Pipe MPLS Diff-Serv mode is adopted.";
+      }
+      enum shortPipe {
+        value "1";
+        description
+          "shortPipe: Indicates that the Short-pipe MPLS Diff-Serv mode
+          is adopted.";
+      }
+      enum uniform {
+        value "2";
+        description
+          "uniform: Indicates that the Uniform MPLS Diff-Serv mode is
+          adopted.";
+   }
+    }
+    default "uniform";
+
+      }
+
+      leaf serviceClass {
+        description
+          "Service Class, Specifies the service type when the packet enters the
+          public network from the private network. The values are cs7, cs6, ef,
+          af4, af3, af2, af1, be.";
+
+          type enumeration {
+            enum be {
+              value "0";
+              description "be:";
+            }
+            enum af1 {
+              value "1";
+              description "af1:";
+            }
+            enum af2 {
+              value "2";
+              description "af2:";
+            }
+            enum af3 {
+              value "3";
+              description "af3:";
+            }
+            enum af4 {
+              value "4";
+              description "af4:";
+            }
+            enum ef {
+              value "5";
+              description "ef:";
+            }
+            enum cs6 {
+              value "6";
+              description "cs6:";
+            }
+            enum cs7 {
+              value "7";
+              description "cs7:";
+            }
+          }
+          default "be";
+      }
+
+
+      leaf color {
+        description
+          "Specifies a color for marking the discard priority of a packet
+          transferred from a private network to a public network. The values
+          are green, yellow, and red.";
+
+        type enumeration {
+          enum green {
+            value "0";
+            description "green:";
+          }
+          enum yellow {
+            value "1";
+            description "yellow:";
+          }
+          enum red {
+            value "2";
+            description "red:";
+          }
+        }
+        default "green";
+      }
+
+      leaf dsName {
+        description
+          "Specifies the DS domain name of the specified Per-Hop Behavior (PHB)
+          applied to the egress in Short pipe mode. It is a string of 1 to 31
+          characters.";
+
+        type string;
+        default "default";
+      }
+    }
+
+    container l3vpnTtlMode {
+      description
+        "The ttl-mode command enables MPLS to process the TTL in a specified
+        mode. By default, MPLS processes the TTL in pipe mode.";
+
+      leaf ttlMode {
+        description "TTL mode";
+        default "pipe";
+        type enumeration {
+          enum pipe {
+            value "0";
+            description
+              "pipe: Enables MPLS to process the TTL in pipe mode.";
+          }
+
+
+          enum uniform {
+            value "1";
+            description
+              "uniform: Enables MPLS to process the TTL in uniform mode.";
+          }
+        }
+      }
+    }
+
+    leaf tunnel-policy {
+      description
+        "The tnl-policy command associates the IPv4 or IPv6 address family of
+         a VPN instance with a tunnel policy.";
+
+      type string {
+        length "1..39";
+      }
+    }
+
+    container importRibs {
+      description
+        "Import route class";
+
+      leaf protocol {
+        description
+          "Specifies the protocol from which routes are imported.
+          At present, In the IPv4 unicast address family view, the protocol
+          can be IS-IS,static, direct and BGP.";
+
+        type enumeration {
+          enum ALL {
+            value "0";
+            description "ALL:";
+          }
+          enum Direct {
+            value "1";
+            description "Direct:";
+          }
+          enum OSPF {
+            value "2";
+            description "OSPF:";
+          }
+          enum ISIS {
+            value "3";
+            description "ISIS:";
+          }
+          enum Static {
+            value "4";
+
+
+            description "Static:";
+          }
+          enum RIP {
+            value "5";
+            description "RIP:";
+          }
+          enum BGP {
+            value "6";
+            description "BGP:";
+          }
+          enum OSPFV3 {
+            value "7";
+            description "OSPFV3:";
+          }
+          enum RIPNG {
+            value "8";
+            description "RIPNG:";
+          }
+          enum INVALID {
+            value "9";
+            description "INVALID:";
+          }
+        }
+      }
+
+      leaf processId {
+        description
+          "Specifies the process ID if the protocol from routes are imported is
+           IS-IS.";
+
+        default "0";
+        type uint32 {
+          range "0..4294967295";
+        }
+      }
+
+      leaf bgp-valid-route {
+        type boolean;
+      }
+
+      leaf policyName {
+        description
+          "Policy Id for import routes";
+        type string {
+        }
+      }
+
+    }
+
+
+    leaf traffic-statistics {
+      description
+        "The traffic-statistics enable command enables traffic statistics
+         for a VPN instance.";
+
+      type boolean;
+      default "false";
+    }
+
+  }
+
+
+  /*
+   * VPN instance view.
+   */
+  container vpn-instances {
+    description
+      "VPN instances configuration parameters.
+       VPN instances support both the IPv4 and IPv6 address families.";
+
+    list vpn-instance {
+      max-elements "unbounded";
+      min-elements "0";
+      key "vpn-instance-name";
+      description
+        "Specifies the name of the VPN instance. It is a string of 1 to 31
+         case-sensitive characters.";
+
+      leaf vpn-instance-name {
+        mandatory "true";
+        type string {
+          length "1..31";
+        }
+        description
+          "The name of the vpn-instance.";
+      }
+
+      leaf description {
+        description
+          "A textual description of VPN instance, the VPN instance description
+          helps users memorize the VPN instance.";
+
+        type string {
+          length "1..242";
+          pattern "([^?]*)";
+        }
+      }
+
+
+
+
+      container ipv4-family {
+        description
+          "The IPv4 address family is enabled for the VPN instance.";
+
+        uses vpn-af-config;
+      }
+
+      container ipv6-family {
+        description
+          "The IPv6 address family is enabled for the VPN instance.";
+
+        uses vpn-af-config;
+      }
+
+
+    }
+  }
+
+
+
+  /*
+   * Binding Interfaces to a VPN Instance.
+   */
+
+  container vpn-interfaces {
+    description
+      "VPN is enabled on interfaces.";
+
+    list vpn-interface  {
+      key "name";
+      max-elements "unbounded";
+      min-elements "0";
+      leaf name {
+        type leafref {
+          path "/if:interfaces/if:interface/if:name";
+        }
+      }
+      leaf vpn-instance-name {
+        type string {
+          length "1..40";
+        }
+      }
+    }
+  }
+
+  container vrfInfo {
+    description
+      "Display the information of the vrf.
+
+
+      It is intended that this container may be augmented by vendors to
+      reflect the vendor-specific operational state parameters.";
+
+    leaf vrfCreateTime {
+      description
+        "CreateTime of the vrf.";
+      config "false";
+      type yang:timestamp;
+    }
+
+    leaf vrfUpTime {
+      description
+        "UpTime period of the vrf.";
+      config "false";
+      type yang:timeticks;
+    }
+
+    leaf label {
+      description
+        "Label of the vrf.";
+      config "false";
+      type uint32 {
+        range "16..1048574";
+      }
+    }
+
+    leaf vrfStatus {
+      description
+        "vrf status.";
+      config "false";
+      type enumeration {
+        enum up {
+          value "0";
+          description "vrf up.";
+        }
+        enum down {
+          value "1";
+          description "vrf down.";
+        }
+      }
+    }
+  }
+
+
+  /*
+   * augment some bgp vpn functions in bgp module.
+   */
+  augment "/bgp:bgp-router/bgp:vpnv4/bgp:unicast" {
+
+    uses augment-bgp-af-vpn-config;
+
+  }
+
+  augment "/bgp:bgp-router/bgp:vpnv6/bgp:unicast" {
+    uses augment-bgp-af-vpn-config;
+
+  }
+
+  augment "/bgp:bgp-router" {
+
+    container bgp-af-ipv4-vpn-instances {
+      description
+        "vpn-instances ipv4 address family.";
+      list bgp-af-ipv4-vpn-instance {
+        key "vpn-instance-name";
+        max-elements "unbounded";
+        min-elements "0";
+        leaf vpn-instance-name {
+          type string;
+        }
+        uses bgp-af-vpn-instance-config;
+      }
+    }
+
+    container bgp-af-ipv6-vpn-instances {
+      description
+        "vpn-instances ipv6 address family.";
+      list bgp-af-ipv6-vpn-instance {
+        key "vpn-instance-name";
+        max-elements "unbounded";
+        min-elements "0";
+        leaf vpn-instance-name {
+          type string;
+        }
+        uses bgp-af-vpn-instance-config;
+      }
+    }
+
+  }
+
+
+}
diff --git a/vpnmanager-api/src/main/yang/odl-l3vpn.yang b/vpnmanager-api/src/main/yang/odl-l3vpn.yang
new file mode 100644 (file)
index 0000000..1703bbe
--- /dev/null
@@ -0,0 +1,25 @@
+
+module odl-l3vpn {
+       namespace "urn:opendaylight:l3vpn";
+       prefix odl-l3vpn;
+       
+       import l3vpn { prefix l3vpn; revision-date "2014-08-15";}
+
+       revision "2013-09-11" {
+               description "L3 VPN Service module";
+       }
+
+       grouping next-hop-list{
+               list l3-next-hops{
+                       key "ip_address";
+                       leaf nextHopId { type uint32;}
+                       leaf ip_address {type string;}
+                       leaf label {type uint32;} /* optional */
+                       leaf mac_address {type string;} /* optional */
+               }
+       }
+
+       augment "/l3vpn:vpn-interfaces/l3vpn:vpn-interface" {
+               uses next-hop-list;
+       }
+}
\ No newline at end of file
diff --git a/vpnmanager-api/src/main/yang/vpnservice.yang b/vpnmanager-api/src/main/yang/vpnservice.yang
deleted file mode 100644 (file)
index 52dd982..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-
-module vpnService {
-    namespace "urn:opendaylight:l3vpn";
-    prefix l3vpn;
-    import ietf-inet-types {prefix inet;}
-    revision "2015-01-11" {
-        description "L3 VPN Service module";
-    }
-
-    typedef port_type {
-        type enumeration {
-            enum untagged { value 1; }
-            enum vlan { value 2; }
-            enum qinq { value 3; }
-        }
-        description "vpn port type, can be untagged, vlan and qinq, default is untagged";
-    }
-
-    grouping vlan_info{
-        leaf ctag {type uint16;}
-        leaf stag {type uint16;}
-        description "optional VLAN tag values";
-    }
-    typedef l3service_result {
-        type enumeration {
-          enum "success" { value 0; description "operation successful";}
-          enum "error" {   value 1; description "Error happened";}
-        }
-        description "Result types";
-    }
-    
-    grouping vpn_key {
-        leaf tenantId { type uint32;}
-        leaf vpn_name { type string;} 
-    }
-
-    grouping vpn_instance_info {
-        leaf routeDistinguisher{ type string; }
-        leaf-list exportrts{ type string;}
-        leaf-list importrts{ type string;}
-    }
-
-    grouping vpn_port_attributes {
-        leaf port_name {type string;}
-        leaf port_type {type port_type;}
-        uses vlan_info; /* optional */
-        leaf mac_address {type string;}
-        leaf ip_address {type string;}
-        leaf prefix_length {type uint8;}
-    }
-    
-    rpc createVpnInstance {
-        description "Create a new L3 VPN";
-        input { 
-            uses vpn_key;
-            uses vpn_instance_info;
-        }
-        output { 
-            leaf result {type l3service_result;} 
-        }
-    }
-    
-    rpc deleteVpnInstance {
-        description "Delete L3 VPN";
-        input { uses vpn_key;}
-        output {
-            leaf result {type l3service_result;} 
-        }
-    }
-    
-    rpc get_vpn{
-        input { uses vpn_key;}
-        output {uses vpn_instance_info;}
-    }
-    
-    rpc add_port_to_vpn{
-        input {
-            uses vpn_key;
-            uses vpn_port_attributes;
-        }
-        output {
-            leaf result {type l3service_result;} 
-        }
-    }
-    rpc remove_port_from_vpn{
-        input {
-            uses vpn_key;
-            uses vpn_port_attributes;
-        }
-        output {
-            leaf result {type l3service_result;} 
-        }
-
-    }
-
-}
\ No newline at end of file