[ONOS-5990] L3VPN device model YANG files

Change-Id: Ia1640c7745eb1f977e0fddc85c7b85704fc46a13
diff --git a/apps/l3vpn/yangmodel/src/main/yang/ietf-bgp-l3vpn@2016-09-09.yang b/apps/l3vpn/yangmodel/src/main/yang/ietf-bgp-l3vpn@2016-09-09.yang
new file mode 100644
index 0000000..276a59f
--- /dev/null
+++ b/apps/l3vpn/yangmodel/src/main/yang/ietf-bgp-l3vpn@2016-09-09.yang
@@ -0,0 +1,723 @@
+module ietf-bgp-l3vpn {

+  namespace "urn:ietf:params:xml:ns:yang:ietf-bgp-l3vpn";

+  // replace with IANA namespace when assigned

+  prefix l3vpn ;

+

+  import ietf-network-instance {

+    prefix ni;

+    revision-date 2016-06-23;

+  }

+

+  import ietf-interfaces {

+    prefix if;

+  }

+

+// TODO: TBD for bgp-info

+//  import ietf-bgp {

+//    prefix bgp;

+//    revision-date 2016-06-21;

+//  }

+

+  organization

+     "IETF BGP Enabled Services WG";

+

+  contact

+     "BESS working group - bess@ietf.org";

+  description

+    "This YANG module defines a YANG data model to configure and

+     manage BGP Layer3 VPNs. It augments the IETF bgp yang model

+     and IETF network instance model to add L3VPN specific

+     configuration and operational knobs.

+

+

+     Terms and Acronyms

+

+     AF : Address Family

+

+     AS : Autonomous System

+

+     ASBR : Autonomous Systems Border Router

+

+     BGP (bgp) : Border Gateway Protocol

+

+     CE  : Customer Edge

+

+     IP (ip) : Internet Protocol

+

+     IPv4 (ipv4):Internet Protocol Version 4

+

+     IPv6 (ipv6): Internet Protocol Version 6

+

+     L3VPN: Layer 3 VPN

+

+     PE : Provider Edge

+

+     RT : Route Target

+

+     RD : Route Distinguisher

+

+     VPN : Virtual Private Network

+

+     VRF : Virtual Routing and Forwarding

+

+    ";

+

+  revision 2016-09-09 {

+    description

+      "Initial revision.";

+    reference

+      "RFC XXXX: A YANG Data Model for BGP L3VPN config management";

+  }

+

+  //RD

+  grouping route-distinguisher-params {

+    description "BGP route distinguisher";

+    container route-distinguisher {

+      description "Route distinguisher value as per RFC4364";

+        container config {

+          description

+            "Configuration parameters for route distinguisher";

+          leaf rd {

+            type string;

+            description "Route distinguisher value as per RFC4364";

+          }

+        }

+        container state {

+          config "false" ;

+          description

+            "State information for route distinguisher";

+          leaf rd {

+            type string;

+            description "Route distinguisher value";

+          }

+        }

+     }

+  }

+

+  //Label mode

+  typedef bgp-label-mode {

+    type enumeration {

+      enum per-ce {

+        description "Allocate labels per CE";

+      }

+      enum per-route {

+        description "Allocate labels per prefix";

+      }

+      enum per-vpn {

+        description "Allocate labels per VRF";

+      }

+    }

+    description "BGP label allocation mode";

+  }

+

+  //Fwding mode

+  typedef fwd-mode-type {

+    type enumeration {

+      enum mpls {

+        description "Forwarding mode mpls";

+      }

+    }

+    description

+      "Enable forwarding mode under ASBR facing interface";

+  }

+

+  grouping forwarding-mode {

+    description "Forwarding mode of interface for ASBR scenario";

+    container forwarding-mode {

+      description "Forwarding mode of interface for ASBR scenario";

+      container config {

+        description "Configuration of Forwarding mode";

+        leaf forwarding-mode {

+          type  fwd-mode-type;

+          description "Forwarding mode for this interface";

+        }

+      }

+      container state {

+        config "false";

+        description "State information of Forwarding mode";

+        leaf forwarding-mode {

+        type  fwd-mode-type;

+          description "Forwarding mode for this interface";

+        }

+      }

+    }

+ }

+

+  grouping label-security {

+    description "Mpls label security for ASBR option B scenario";

+    container mpls-label-security {

+      description "MPLS label secruity";

+      container config {

+        description "Configuration parameters";

+        leaf rpf {

+          type boolean;

+          description "Enable MPLS label security rpf on interface";

+        }

+      }

+      container state {

+        config "false";

+        description "State information";

+        leaf rpf {

+          type boolean;

+          description "MPLS label security rpf on interface";

+        }

+      }

+    }

+  }

+

+

+  //per VPN instance table limit under BGP

+  grouping 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 {

+      type uint32 {

+         range "1..4294967295";

+      }

+      description

+             "Specifies the maximum number of prefixes supported in the

+              VPN instance IPv4 or IPv6 address family.";

+    }

+

+    choice prefix-limit-action {

+      description ".";

+      case enable-alert-percent {

+        leaf alert-percent-value {

+           type uint8 {

+             range "1..100";

+           }

+           description

+             "Specifies the proportion of the alarm threshold to the

+              maximum number of prefixes.";

+        }

+        leaf route-unchanged {

+           type boolean;

+           default "false";

+           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.";

+        }

+      }

+      case enable-simple-alert {

+        leaf simple-alert {

+          type boolean;

+          default "false";

+          description

+                 "Indicates that when the number of VPN route prefixes

+                  exceeds number, prefixes can still join the VPN

+                  routing table and alarms are displayed.";

+        }

+      }

+    }

+  }

+

+  grouping  vpn-pfx-limit {

+    description "Per VPN instance table limit under BGP";

+    container vpn-prefix-limit {

+      description "Prefix limit for this table";

+      container config {

+         description "Config parameters";

+         uses prefix-limit;

+      }

+      container state {

+         config "false";

+         description "State parameters";

+         uses prefix-limit;

+      }

+    }

+  }

+

+  grouping route-target-set {

+    description

+      "Extended community route-target set ";

+    list rts {

+      key "rt" ;

+      description

+         "List of route-targets" ;

+      leaf rt {

+        type string {

+          pattern '([0-9]+:[0-9]+)';

+        }

+        description "Route target extended community as per RFC4360";

+      }

+      leaf rt-type {

+        type enumeration {

+          enum import {

+            description "Route target is for import routes";

+          }

+          enum export {

+            description "Route target is for export routes";

+          }

+          enum both {

+            description

+              "Route target is for both import and export routes";

+          }

+        }

+        description "Route target type";

+      }

+    }

+    leaf route-policy {

+      type string;

+      description

+         "Reference to the policy containing set of routes.

+          TBD: leafref to policy entry in IETF policy model";

+    }

+  }

+

+  grouping import-from-gbl {

+    description "Import from global routing table";

+    leaf enable {

+      type boolean;

+        description "Enable";

+    }

+    leaf advertise-as-vpn {

+      type boolean;

+      description

+        "Advertise routes imported from global table as VPN routes";

+    }

+    leaf route-policy {

+      type string;

+      description "Route policy as filter for importing routes";

+    }

+

+    leaf bgp-valid-route {

+      type boolean;

+      description

+        "Enable all valid routes (including non-best paths) to be

+         candidate for import";

+    }

+

+    leaf protocol {

+      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:";

+        }

+      }

+      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.";

+      }

+

+      leaf instance {

+        type string;

+        description

+             "Specifies the instance id of the protocol";

+      }

+  }

+  grouping global-imports {

+      description "Grouping for imports from global routing table";

+    container import-from-global {

+      description "Import from global routing table";

+      container config {

+          description "Configuration";

+          uses import-from-gbl;

+      }

+      container state {

+          config "false";

+          description "State";

+          uses import-from-gbl;

+      }

+    }

+  }

+

+

+  grouping export-to-gbl {

+    description "Export routes to default VRF";

+    leaf enable {

+      type boolean;

+        description "Enable";

+    }

+  }

+

+  grouping global-exports {

+    description "Grouping for exports routes to global table";

+    container export-to-global {

+      description "Export to global routing table";

+      container config {

+         description "Configuration";

+         uses export-to-gbl;

+      }

+      container state {

+        config "false";

+        description "State";

+        uses export-to-gbl;

+      }

+    }

+  }

+

+  grouping route-target-params {

+    description "Grouping to specify rules for route import and export";

+    container route-targets {

+      description

+        "Set of route-targets to match for import and export routes

+         to/from VRF";

+      container config {

+         description

+               "Configuration of route targets";

+           uses route-target-set ;

+      }

+      container state {

+        config "false" ;

+        description

+               "State information for route targets";

+           uses route-target-set ;

+      }

+    }

+  }

+

+  grouping route-tbl-limit-params {

+     description "Grouping for VPN table prefix limit config";

+     leaf routing-table-limit-number {

+        type uint32 {

+          range "1..4294967295";

+        }

+        description

+          "Specifies the maximum number of routes supported by a

+           VPN instance. ";

+        }

+

+       choice routing-table-limit-action {

+          description ".";

+           case enable-alert-percent {

+             leaf alert-percent-value {

+               type uint8 {

+                 range "1..100";

+               }

+               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.";

+           }

+        }

+        case enable-simple-alert {

+          leaf simple-alert {

+               type boolean;

+               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.";

+             }

+           }

+       }

+   }

+

+   grouping routing-tbl-limit {

+      description ".";

+      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.";

+          container config {

+             description "Config parameters";

+             uses route-tbl-limit-params;

+          }

+          container state {

+              config "false";

+              description "State parameters";

+              uses route-tbl-limit-params;

+          }

+       }

+   }

+

+  // Tunnel policy parameters

+  grouping tunnel-params {

+     description "Tunnel parameters";

+     container tunnel-params {

+        description "Tunnel config parameters";

+        container config {

+           description "configuration parameters";

+           leaf tunnel-policy {

+              type string;

+              description

+                  "Tunnel policy name.";

+           }

+        }

+        container state {

+           config "false";

+           description "state parameters";

+           leaf tunnel-policy {

+              type string;

+              description

+                   "Tunnel policy name.";

+           }

+        }

+     }

+  }

+

+  // Grouping for the L3vpn specific parameters under VRF

+  // (network-instance)

+  grouping l3vpn-vrf-params {

+      description "Specify route filtering rules for import/export";

+      container ipv4 {

+         description

+           "Specify route filtering rules for import/export";

+         container unicast {

+            description

+              "Specify route filtering rules for import/export";

+            uses route-target-params;

+            uses global-imports;

+            uses global-exports;

+            uses routing-tbl-limit;

+            uses tunnel-params;

+         }

+      }

+      container ipv6 {

+         description

+           "Ipv6 address family specific rules for import/export";

+         container unicast {

+             description "Ipv6 unicast address family";

+             uses route-target-params;

+             uses global-imports;

+             uses global-exports;

+             uses routing-tbl-limit;

+             uses tunnel-params;

+         }

+     }

+  }

+

+  grouping bgp-label-mode {

+       description "MPLS/VPN label allocation mode";

+       container config {

+         description

+           "Configuration parameters for label allocation mode";

+         leaf label-mode {

+           type bgp-label-mode;

+           description "Label allocation mode";

+         }

+       }

+       container state {

+         config "false" ;

+         description "State information for label allocation mode";

+         leaf label-mode {

+           type bgp-label-mode;

+           description "Label allocation mode";

+         }

+       }

+  }

+

+  grouping retain-route-targets {

+       description "Grouping for route target accept";

+    container retain-route-targets {

+      description "Control route target acceptance behavior for ASBRs";

+      container config {

+         description

+           "Configuration parameters for retaining route targets";

+         leaf all {

+            type empty;

+            description "Disable filtering of all route-targets";

+         }

+         leaf route-policy {

+            type string;

+            description "Filter routes as per filter policy name

+                         TBD: leafref to IETF routing policy model";

+         }

+      }

+      container state {

+         config "false" ;

+         description "State information for retaining route targets";

+         leaf all {

+            type empty;

+            description "Disable filtering of all route-targets";

+         }

+         leaf route-policy {

+            type string;

+            description "Filter routes as per filter policy name";

+         }

+      }

+    }

+  }

+

+  grouping nexthop-opts {

+     description "Next hop control options for inter-as route exchange";

+     leaf next-hop-self {

+        type boolean;

+        description

+          "Set nexthop of the route to self when advertising routes";

+     }

+     leaf next-hop-unchanged {

+        type boolean;

+        description "Enforce no nexthop change when advertising routes";

+     }

+  }

+

+  grouping asbr-nexthop-options {

+     description "Nexthop parameters for inter-as VPN options ";

+     container nexthop-options {

+         description "Nexthop related options for inter-as options";

+         container config {

+             description "Configuration parameters for nexthop options";

+             uses nexthop-opts;

+         }

+         container state {

+             config "false";

+             description "State information for nexthop options" ;

+             uses nexthop-opts;

+         }

+     }

+  }

+

+  //

+  // VRF specific parameters.

+  // RD and RTs and route import-export rules are added under

+  // network instance container in network instance model, hence

+  // per VRF scoped

+  augment "/ni:devices/ni:device/ni:network-instances/ni:network-instance" {

+     description

+       "Augment network instance for per VRF L3vpn parameters";

+     container l3vpn {

+        //Enable this check once network instance model has

+        //identify defined for VRF type

+        //when "../type='rt:vrf-network-instance'" {

+        //  description

+        //    "This container is only valid for vrf routing instance.";

+        //}

+        description "Configuration of L3VPN specific parameters";

+

+        uses route-distinguisher-params;

+        uses l3vpn-vrf-params ;

+     }

+  }

+

+  // bgp mpls forwarding enable required for inter-as option AB.

+  augment "/if:devices/if:device/if:interfaces/if:interface" {

+    description

+      "BGP mpls forwarding mode configuration on interface for

+       ASBR scenario";

+    uses forwarding-mode ;

+    uses label-security;

+  }

+

+  //

+  // BGP Specific Paramters

+  //

+

+  //

+  // Retain route-target for inter-as option ASBR knob.

+  // vpn prefix limits

+  // vpnv4/vpnv6 address-family only.

+  //augment "/bgp:bgp/bgp:global/bgp:afi-safis/" +

+  //        "bgp:afi-safi/bgp:l3vpn-ipv4-unicast" {

+  //  description "Retain route targets for ASBR scenario";

+  //  uses retain-route-targets;

+  //  uses vpn-pfx-limit;

+ // }

+

+ // augment "/bgp:bgp/bgp:global/bgp:afi-safis/" +

+ //         "bgp:afi-safi/bgp:l3vpn-ipv6-unicast" {

+ //   description "Retain route targets for ASBR scenario";

+ //   uses retain-route-targets;

+ //   uses vpn-pfx-limit;

+ // }

+

+  // Label allocation mode configuration. Certain AFs only.

+ // augment "/bgp:bgp/bgp:global/bgp:afi-safis/" +

+ //         "bgp:afi-safi/bgp:ipv4-unicast" {

+ //    description

+ //      "Augment BGP global AF mode for label allocation mode

+ //       configuration";

+ //    uses bgp-label-mode ;

+ //    uses routing-tbl-limit;

+ // }

+

+ // augment "/bgp:bgp/bgp:global/bgp:afi-safis/" +

+ //         "bgp:afi-safi/bgp:ipv6-unicast" {

+ //    description

+ //      "Augment BGP global AF mode for label allocation mode

+ //       configuration";

+ //    uses bgp-label-mode ;

+ //    uses routing-tbl-limit;

+ // }

+

+

+  // Nexthop options for the inter-as ASBR peering.

+ // augment "/bgp:bgp/bgp:neighbors/bgp:neighbor" {

+ //    description

+ //      "Augment BGP NBR mode with nexthop options for inter-as ASBRs";

+ //    uses asbr-nexthop-options;

+ // }

+

+ // augment "/bgp:bgp/bgp:peer-groups/bgp:peer-group" {

+ //    description

+ //      "Augment BGP peer-group mode with nexthop options for inter-as

+ //       ASBRs";

+ //    uses asbr-nexthop-options;

+ // }

+

+ // augment "/bgp:bgp/bgp:neighbors/bgp:neighbor/" +

+ //         "bgp:afi-safis/bgp:afi-safi" {

+ //    description

+ //      "Augment BGP NBR AF mode with nexthop options for inter-as

+ //       ASBRs";

+ //    uses asbr-nexthop-options;

+ // }

+

+ // augment "/bgp:bgp/bgp:peer-groups/bgp:peer-group/" +

+ //         "bgp:afi-safis/bgp:afi-safi" {

+ //    description

+ //      "Augment BGP peer-group AF mode with nexthop options for inter-as

+ //       ASBRs";

+ //    uses asbr-nexthop-options;

+ // }

+}

diff --git a/apps/l3vpn/yangmodel/src/main/yang/ietf-interfaces@2014-05-08.yang b/apps/l3vpn/yangmodel/src/main/yang/ietf-interfaces@2014-05-08.yang
new file mode 100644
index 0000000..2171a5a
--- /dev/null
+++ b/apps/l3vpn/yangmodel/src/main/yang/ietf-interfaces@2014-05-08.yang
@@ -0,0 +1,704 @@
+module ietf-interfaces {

+

+     namespace "urn:ietf:params:xml:ns:yang:ietf-interfaces";

+     prefix if;

+

+     import ietf-yang-types {

+       prefix yang;

+     }

+

+     organization

+       "IETF NETMOD (NETCONF Data Modeling Language) Working Group";

+

+     contact

+       "WG Web:   <http://tools.ietf.org/wg/netmod/>

+        WG List:  <mailto:netmod@ietf.org>

+

+        WG Chair: Thomas Nadeau

+                  <mailto:tnadeau@lucidvision.com>

+

+        WG Chair: Juergen Schoenwaelder

+                  <mailto:j.schoenwaelder@jacobs-university.de>

+

+        Editor:   Martin Bjorklund

+                  <mailto:mbj@tail-f.com>";

+

+     description

+       "This module contains a collection of YANG definitions for

+        managing network interfaces.

+

+        Copyright (c) 2014 IETF Trust and the persons identified as

+        authors of the code.  All rights reserved.

+

+        Redistribution and use in source and binary forms, with or

+        without modification, is permitted pursuant to, and subject

+        to the license terms contained in, the Simplified BSD License

+        set forth in Section 4.c of the IETF Trust's Legal Provisions

+        Relating to IETF Documents

+        (http://trustee.ietf.org/license-info).

+

+        This version of this YANG module is part of RFC 7223; see

+        the RFC itself for full legal notices.";

+     revision 2014-05-08 {

+       description

+         "Initial revision.";

+       reference

+         "RFC 7223: A YANG Data Model for Interface Management";

+     }

+

+     /*

+      * Typedefs

+      */

+

+     typedef interface-ref {

+       type leafref {

+         path "/if:devices/if:device/if:interfaces/if:interface/if:name";

+       }

+       description

+         "This type is used by data models that need to reference

+          configured interfaces.";

+     }

+

+     typedef interface-state-ref {

+       type leafref {

+         path "/if:devices/if:device/if:interfaces-state/if:interface/if:name";

+       }

+       description

+         "This type is used by data models that need to reference

+          the operationally present interfaces.";

+     }

+

+     /*

+      * Identities

+      */

+

+     identity interface-type {

+       description

+         "Base identity from which specific interface types are

+          derived.";

+     }

+

+     /*

+      * Features

+      */

+

+     feature arbitrary-names {

+       description

+         "This feature indicates that the device allows user-controlled

+          interfaces to be named arbitrarily.";

+     }

+     feature pre-provisioning {

+       description

+         "This feature indicates that the device supports

+          pre-provisioning of interface configuration, i.e., it is

+          possible to configure an interface whose physical interface

+          hardware is not present on the device.";

+     }

+

+     feature if-mib {

+       description

+         "This feature indicates that the device implements

+          the IF-MIB.";

+       reference

+         "RFC 2863: The Interfaces Group MIB";

+     }

+

+     /*

+      * Configuration data nodes

+      */

+     container devices {

+         list device {

+             key deviceid;

+             leaf deviceid {

+                 type string;

+             }

+             container interfaces {

+                 description

+                     "Interface configuration parameters.";

+

+                 list interface {

+                     key "name";

+

+                     description

+                         "The list of configured interfaces on the device.

+                         The operational state of an interface is available

+                         in the /interfaces-state/interface list.  If the

+                         configuration of a system-controlled interface

+                         cannot be used by the system (e.g., the interface

+                         hardware present does not match the interface type),

+                         then the configuration is not applied to the

+                         system-controlled interface shown in the of a

+                         /interfaces-state/interface list.  If the configuration

+                         user-controlled interface cannot be used by the system,

+                         the configured interface is not instantiated in the

+                         /interfaces-state/interface list.";

+

+                     leaf name {

+                         type string;

+                         description

+                             "The name of the interface.

+

+                             A device MAY restrict the allowed values for

+                             this leaf, possibly depending on the type of the

+                             interface. For system-controlled interfaces,

+                             this leaf is the device-specific name of the

+                             interface.  The 'config false' list

+                             /interfaces-state/interface contains the

+                             currently existing interfaces on the device.

+

+                             If a client tries to create configuration for a

+                             system-controlled interface that is not present

+                             in the /interfaces-state/interface list, the

+                             server MAY reject the request if the

+                             implementation does not support pre-provisioning

+                             of interfaces or if the name refers to an

+                             interface that can never exist in the system.  A

+                             NETCONF server MUST reply with an rpc-error with

+                             the error-tag 'invalid-value' in this case.

+

+                             If the device supports pre-provisioning of

+                             interface configuration, the 'pre-provisioning'

+                             feature is advertised.

+

+                             If the device allows arbitrarily named

+                             user-controlled interfaces, the

+                             'arbitrary-names' feature is advertised.

+

+                             When a configured user-controlled interface is

+                             created by the system, it is instantiated with

+                             the same name in the /interface-state/interface

+                             list.";

+                     }

+

+                     leaf description {

+                         type string;

+                         description

+                             "A textual description of the interface.

+

+                             A server implementation MAY map this leaf to the

+                             ifAlias MIB object.  Such an implementation

+                             needs touse some mechanism to handle the

+                             differences in sizeand characters allowed

+                             between this leaf and ifAlias.The definition of

+                             such a mechanism is outside the scope of this

+                             document.

+

+                             Since ifAlias is defined to be stored in

+                             non-volatile storage, the MIB implementation

+                             MUST map ifAlias to the value of 'description'

+                             in the persistently stored datastore.

+

+                             Specifically, if the device supports ':startup',

+                             when ifAlias is read the device MUST return the

+                             value of 'description' in the 'startup'

+                             datastore, and when it is written, it MUST be

+                             written to the 'running' and 'startup'

+                             datastores.  Note that it is up to the

+                             implementation to decide whether to modify this

+                             single leaf in 'startup' or perform an implicit

+                             copy-config from 'running' to 'startup'.

+

+                             If the device does not support ':startup',

+                             ifAlias MUST be mapped to the 'description' leaf

+                             in the 'running' datastore.";

+                         reference

+                            "RFC 2863: The Interfaces Group MIB - ifAlias";

+                     }

+

+                     leaf type {

+                         type identityref {

+                             base interface-type;

+                         }

+                         mandatory true;

+                         description

+                             "The type of the interface.

+

+                             When an interface entry is created, a server MAY

+                             initialize the type leaf with a valid value, e.g.,

+                             if it is possible to derive the type from the name

+                             of the interface.

+

+                             If a client tries to set the type of an

+                             interface to a value that can never be used by

+                             the system, e.g., if the type is not supported

+                             or if the type does not match the name of the

+                             interface, the server MUST reject the request. A

+                             NETCONF server MUST reply with an rpc-error with

+                             the error-tag 'invalid-value' in this case.";

+                         reference

+                             "RFC 2863: The Interfaces Group MIB - ifType";

+                     }

+

+                     leaf enabled {

+                         type boolean;

+                         default "true";

+                         description

+                             "This leaf contains the configured, desired state

+                             of the interface.

+

+                             Systems that implement the IF-MIB use the value

+                             of this leaf in the 'running' datastore to set

+                             IF-MIB.ifAdminStatus to 'up' or 'down' after an

+                             ifEntry has been initialized, as described in

+                             RFC 2863. Changes in this leaf in the 'running'

+                             datastore are reflected in ifAdminStatus, but if

+                             ifAdminStatus is changed over SNMP, this leaf is

+                             not affected.";

+                         reference

+                             "RFC 2863: The Interfaces Group MIB -

+                             ifAdminStatus";

+                     }

+

+                     leaf link-up-down-trap-enable {

+                         if-feature if-mib;

+                         type enumeration {

+                             enum enabled {

+                                 value 1;

+                             }

+                             enum disabled {

+                                 value 2;

+                             }

+                         }

+                         description

+                             "Controls whether linkUp/linkDown SNMP

+                             notifications should be generated for this

+                             interface.

+

+                             If this node is not configured, the value 'enabled'

+                             is operationally used by the server for

+                             interfaces that do not operate on top of any

+                             other interface (i.e., there are no

+                             'lower-layer-if' entries), and 'disabled'

+                             otherwise.";

+                         reference

+                             "RFC 2863: The Interfaces Group MIB -

+                             ifLinkUpDownTrapEnable";

+                     }

+                 }

+             }

+             /*

+              * Operational state data nodes

+              */

+

+             container interfaces-state {

+               config false;

+               description

+                 "Data nodes for the operational state of interfaces.";

+

+               list interface {

+                 key "name";

+                 description

+                   "The list of interfaces on the device.

+

+                    System-controlled interfaces created by the system are

+                    always present in this list, whether they are configured or

+                    not.";

+

+                 leaf name {

+                   type string;

+                   description

+                     "The name of the interface.

+

+                      A server implementation MAY map this leaf to the ifName

+                      MIB object.  Such an implementation needs to use some

+                      mechanism to handle the differences in size and characters

+                      allowed between this leaf and ifName.  The definition of

+                      such a mechanism is outside the scope of this document.";

+                   reference

+                     "RFC 2863: The Interfaces Group MIB - ifName";

+                 }

+

+                 leaf type {

+                   type identityref {

+                     base interface-type;

+                   }

+                   mandatory true;

+                   description

+                     "The type of the interface.";

+                   reference

+                     "RFC 2863: The Interfaces Group MIB - ifType";

+                 }

+

+                 leaf admin-status {

+                   if-feature if-mib;

+                   type enumeration {

+                     enum up {

+                       value 1;

+                       description

+                         "Ready to pass packets.";

+                     }

+                     enum down {

+                       value 2;

+                       description

+                         "Not ready to pass packets and not in some test mode.";

+                     }

+                     enum testing {

+                       value 3;

+                       description

+                         "In some test mode.";

+                     }

+                   }

+                   mandatory true;

+                   description

+                     "The desired state of the interface.

+

+                      This leaf has the same read semantics as ifAdminStatus.";

+                   reference

+                     "RFC 2863: The Interfaces Group MIB - ifAdminStatus";

+                 }

+

+                 leaf oper-status {

+                   type enumeration {

+                     enum up {

+                       value 1;

+                       description

+                         "Ready to pass packets.";

+                     }

+                     enum down {

+                       value 2;

+                       description

+                         "The interface does not pass any packets.";

+                     }

+                     enum testing {

+                       value 3;

+                       description

+                         "In some test mode.  No operational packets can

+                          be passed.";

+                     }

+                     enum unknown {

+                       value 4;

+                       description

+                         "Status cannot be determined for some reason.";

+                     }

+                     enum dormant {

+                       value 5;

+                       description

+                         "Waiting for some external event.";

+                     }

+                     enum not-present {

+                       value 6;

+                       description

+                         "Some component (typically hardware) is missing.";

+                     }

+                     enum lower-layer-down {

+                       value 7;

+                       description

+                         "Down due to state of lower-layer interface(s).";

+                     }

+                   }

+                   mandatory true;

+                   description

+                     "The current operational state of the interface.

+

+                      This leaf has the same semantics as ifOperStatus.";

+                   reference

+                     "RFC 2863: The Interfaces Group MIB - ifOperStatus";

+                 }

+

+                 leaf last-change {

+                   type yang:date-and-time;

+                   description

+                     "The time the interface entered its current operational

+                      state.  If the current state was entered prior to the

+                      last re-initialization of the local network management

+                      subsystem, then this node is not present.";

+                   reference

+                     "RFC 2863: The Interfaces Group MIB - ifLastChange";

+                 }

+

+                 leaf if-index {

+                   if-feature if-mib;

+                   type int32 {

+                     range "1..2147483647";

+                   }

+                   mandatory true;

+                   description

+                     "The ifIndex value for the ifEntry represented by this

+                      interface.";

+                   reference

+                     "RFC 2863: The Interfaces Group MIB - ifIndex";

+                 }

+

+                 leaf phys-address {

+                   type yang:phys-address;

+                   description

+                     "The interface's address at its protocol sub-layer.  For

+                      example, for an 802.x interface, this object normally

+                      contains a Media Access Control (MAC) address.  The

+                      interface's media-specific modules must define the bit

+

+                      and byte ordering and the format of the value of this

+                      object.  For interfaces that do not have such an address

+                      (e.g., a serial line), this node is not present.";

+                   reference

+                     "RFC 2863: The Interfaces Group MIB - ifPhysAddress";

+                 }

+

+                 leaf-list higher-layer-if {

+                   type interface-state-ref;

+                   description

+                     "A list of references to interfaces layered on top of this

+                      interface.";

+                   reference

+                     "RFC 2863: The Interfaces Group MIB - ifStackTable";

+                 }

+

+                 leaf-list lower-layer-if {

+                   type interface-state-ref;

+                   description

+                     "A list of references to interfaces layered underneath this

+                      interface.";

+                   reference

+                     "RFC 2863: The Interfaces Group MIB - ifStackTable";

+                 }

+

+                 leaf speed {

+                   type yang:gauge64;

+                   units "bits/second";

+                   description

+                       "An estimate of the interface's current bandwidth in bits

+                        per second.  For interfaces that do not vary in

+                        bandwidth or for those where no accurate estimation can

+                        be made, this node should contain the nominal bandwidth.

+                        For interfaces that have no concept of bandwidth, this

+                        node is not present.";

+                   reference

+                     "RFC 2863: The Interfaces Group MIB -

+                                ifSpeed, ifHighSpeed";

+                 }

+                 container statistics {

+                   description

+                     "A collection of interface-related statistics objects.";

+

+                   leaf discontinuity-time {

+                     type yang:date-and-time;

+                     mandatory true;

+                     description

+                       "The time on the most recent occasion at which any one or

+                        more of this interface's counters suffered a

+                        discontinuity.  If no such discontinuities have occurred

+                        since the last re-initialization of the local management

+                        subsystem, then this node contains the time the local

+                        management subsystem re-initialized itself.";

+                   }

+

+                   leaf in-octets {

+                     type yang:counter64;

+                     description

+                       "The total number of octets received on the interface,

+                        including framing characters.

+

+                        Discontinuities in the value of this counter can occur

+                        at re-initialization of the management system, and at

+                        other times as indicated by the value of

+                        'discontinuity-time'.";

+                     reference

+                       "RFC 2863: The Interfaces Group MIB - ifHCInOctets";

+                   }

+

+                   leaf in-unicast-pkts {

+                     type yang:counter64;

+                     description

+                       "The number of packets, delivered by this sub-layer to a

+                        higher (sub-)layer, that were not addressed to a

+                        multicast or broadcast address at this sub-layer.

+

+                        Discontinuities in the value of this counter can occur

+                        at re-initialization of the management system, and at

+                        other times as indicated by the value of

+                        'discontinuity-time'.";

+                     reference

+                       "RFC 2863: The Interfaces Group MIB - ifHCInUcastPkts";

+                   }

+                   leaf in-broadcast-pkts {

+                     type yang:counter64;

+                     description

+                       "The number of packets, delivered by this sub-layer to a

+                        higher (sub-)layer, that were addressed to a broadcast

+                        address at this sub-layer.

+

+                        Discontinuities in the value of this counter can occur

+                        at re-initialization of the management system, and at

+                        other times as indicated by the value of

+                        'discontinuity-time'.";

+                     reference

+                       "RFC 2863: The Interfaces Group MIB -

+                                  ifHCInBroadcastPkts";

+                   }

+

+                   leaf in-multicast-pkts {

+                     type yang:counter64;

+                     description

+                       "The number of packets, delivered by this sub-layer to a

+                        higher (sub-)layer, that were addressed to a multicast

+                        address at this sub-layer.  For a MAC-layer protocol,

+                        this includes both Group and Functional addresses.

+

+                        Discontinuities in the value of this counter can occur

+                        at re-initialization of the management system, and at

+                        other times as indicated by the value of

+                        'discontinuity-time'.";

+                     reference

+                       "RFC 2863: The Interfaces Group MIB -

+                                  ifHCInMulticastPkts";

+                   }

+

+                   leaf in-discards {

+                     type yang:counter32;

+                     description

+                       "The number of inbound packets that were chosen to be

+                        discarded even though no errors had been detected to

+                        prevent their being deliverable to a higher-layer

+                        protocol.  One possible reason for discarding such a

+                        packet could be to free up buffer space.

+

+                        Discontinuities in the value of this counter can occur

+                        at re-initialization of the management system, and at

+                        other times as indicated by the value of

+                        'discontinuity-time'.";

+                     reference

+                       "RFC 2863: The Interfaces Group MIB - ifInDiscards";

+                   }

+

+                   leaf in-errors {

+                     type yang:counter32;

+                     description

+                       "For packet-oriented interfaces, the number of inbound

+                        packets that contained errors preventing them from being

+                        deliverable to a higher-layer protocol.  For character-

+                        oriented or fixed-length interfaces, the number of

+                        inbound transmission units that contained errors

+                        preventing them from being deliverable to a higher-layer

+                        protocol.

+

+                        Discontinuities in the value of this counter can occur

+                        at re-initialization of the management system, and at

+                        other times as indicated by the value of

+                        'discontinuity-time'.";

+                     reference

+                       "RFC 2863: The Interfaces Group MIB - ifInErrors";

+                   }

+

+                   leaf in-unknown-protos {

+                     type yang:counter32;

+                     description

+                       "For packet-oriented interfaces, the number of packets

+                        received via the interface that were discarded because

+                        of an unknown or unsupported protocol.  For

+                        character-oriented or fixed-length interfaces that

+                        support protocol multiplexing, the number of

+                        transmission units received via the interface that were

+                        discarded because of an unknown or unsupported protocol.

+                        For any interface that does not support protocol

+                        multiplexing, this counter is not present.

+

+                        Discontinuities in the value of this counter can occur

+                        at re-initialization of the management system, and at

+                        other times as indicated by the value of

+                        'discontinuity-time'.";

+                     reference

+                       "RFC 2863: The Interfaces Group MIB - ifInUnknownProtos";

+                   }

+                   leaf out-octets {

+                     type yang:counter64;

+                     description

+                       "The total number of octets transmitted out of the

+                        interface, including framing characters.

+

+                        Discontinuities in the value of this counter can occur

+                        at re-initialization of the management system, and at

+                        other times as indicated by the value of

+                        'discontinuity-time'.";

+                     reference

+                       "RFC 2863: The Interfaces Group MIB - ifHCOutOctets";

+                   }

+

+                   leaf out-unicast-pkts {

+                     type yang:counter64;

+                     description

+                       "The total number of packets that higher-level protocols

+                        requested be transmitted, and that were not addressed

+                        to a multicast or broadcast address at this sub-layer,

+                        including those that were discarded or not sent.

+

+                        Discontinuities in the value of this counter can occur

+                        at re-initialization of the management system, and at

+                        other times as indicated by the value of

+                        'discontinuity-time'.";

+                     reference

+                       "RFC 2863: The Interfaces Group MIB - ifHCOutUcastPkts";

+                   }

+

+                   leaf out-broadcast-pkts {

+                     type yang:counter64;

+                     description

+                       "The total number of packets that higher-level protocols

+                        requested be transmitted, and that were addressed to a

+                        broadcast address at this sub-layer, including those

+                        that were discarded or not sent.

+

+                        Discontinuities in the value of this counter can occur

+                        at re-initialization of the management system, and at

+                        other times as indicated by the value of

+                        'discontinuity-time'.";

+                     reference

+                       "RFC 2863: The Interfaces Group MIB -

+                                  ifHCOutBroadcastPkts";

+                   }

+                   leaf out-multicast-pkts {

+                     type yang:counter64;

+                     description

+                       "The total number of packets that higher-level protocols

+                        requested be transmitted, and that were addressed to a

+                        multicast address at this sub-layer, including those

+                        that were discarded or not sent.  For a MAC-layer

+                        protocol, this includes both Group and Functional

+                        addresses.

+

+                        Discontinuities in the value of this counter can occur

+                        at re-initialization of the management system, and at

+                        other times as indicated by the value of

+                        'discontinuity-time'.";

+                     reference

+                       "RFC 2863: The Interfaces Group MIB -

+                                  ifHCOutMulticastPkts";

+                   }

+

+                   leaf out-discards {

+                     type yang:counter32;

+                     description

+                       "The number of outbound packets that were chosen to be

+                        discarded even though no errors had been detected to

+                        prevent their being transmitted.  One possible reason

+                        for discarding such a packet could be to free up buffer

+                        space.

+

+                        Discontinuities in the value of this counter can occur

+                        at re-initialization of the management system, and at

+                        other times as indicated by the value of

+                        'discontinuity-time'.";

+                     reference

+                       "RFC 2863: The Interfaces Group MIB - ifOutDiscards";

+                   }

+

+                   leaf out-errors {

+                     type yang:counter32;

+                     description

+                       "For packet-oriented interfaces, the number of outbound

+                        packets that could not be transmitted because of errors.

+                        For character-oriented or fixed-length interfaces, the

+                        number of outbound transmission units that could not be

+                        transmitted because of errors.

+                        Discontinuities in the value of this counter can occur

+                        at re-initialization of the management system, and at

+                        other times as indicated by the value of

+                        'discontinuity-time'.";

+                     reference

+                       "RFC 2863: The Interfaces Group MIB - ifOutErrors";

+                   }

+                 }

+               }

+             }

+         }

+     }

+   }
\ No newline at end of file
diff --git a/apps/l3vpn/yangmodel/src/main/yang/ietf-ip@2014-06-16.yang b/apps/l3vpn/yangmodel/src/main/yang/ietf-ip@2014-06-16.yang
new file mode 100644
index 0000000..0446258
--- /dev/null
+++ b/apps/l3vpn/yangmodel/src/main/yang/ietf-ip@2014-06-16.yang
@@ -0,0 +1,740 @@
+module ietf-ip {

+

+    yang-version 1;

+

+    namespace

+      "urn:ietf:params:xml:ns:yang:ietf-ip";

+

+    prefix ip;

+

+    import ietf-interfaces {

+      prefix if;

+    }

+    import ietf-inet-types {

+      prefix inet;

+    }

+    import ietf-yang-types {

+      prefix yang;

+    }

+

+    organization

+      "IETF NETMOD (NETCONF Data Modeling Language) Working Group";

+

+    contact

+      "WG Web:   <http://tools.ietf.org/wg/netmod/>

+    WG List:  <mailto:netmod@ietf.org>

+

+    WG Chair: Thomas Nadeau

+              <mailto:tnadeau@lucidvision.com>

+

+    WG Chair: Juergen Schoenwaelder

+              <mailto:j.schoenwaelder@jacobs-university.de>

+

+    Editor:   Martin Bjorklund

+              <mailto:mbj@tail-f.com>";

+

+    description

+      "This module contains a collection of YANG definitions for

+    configuring IP implementations.

+

+    Copyright (c) 2014 IETF Trust and the persons identified as

+    authors of the code.  All rights reserved.

+

+    Redistribution and use in source and binary forms, with or

+    without modification, is permitted pursuant to, and subject

+    to the license terms contained in, the Simplified BSD License

+    set forth in Section 4.c of the IETF Trust's Legal Provisions

+    Relating to IETF Documents

+    (http://trustee.ietf.org/license-info).

+

+    This version of this YANG module is part of RFC 7277; see

+    the RFC itself for full legal notices.";

+

+    revision "2014-06-16" {

+      description "Initial revision.";

+      reference

+        "RFC 7277: A YANG Data Model for IP Management";

+

+    }

+

+    feature ipv4-non-contiguous-netmasks {

+      description

+        "Indicates support for configuring non-contiguous

+      subnet masks.";

+    }

+

+    feature ipv6-privacy-autoconf {

+      description

+        "Indicates support for Privacy Extensions for Stateless Address

+      Autoconfiguration in IPv6.";

+      reference

+        "RFC 4941: Privacy Extensions for Stateless Address

+              Autoconfiguration in IPv6";

+    }

+

+    typedef ip-address-origin {

+      type enumeration {

+        enum "other" {

+          value 0;

+          description

+            "None of the following.";

+        }

+        enum "static" {

+          value 1;

+          description

+            "Indicates that the address has been statically

+          configured - for example, using NETCONF or a Command Line

+          Interface.";

+        }

+        enum "dhcp" {

+          value 2;

+          description

+            "Indicates an address that has been assigned to this

+          system by a DHCP server.";

+        }

+        enum "link-layer" {

+          value 3;

+          description

+            "Indicates an address created by IPv6 stateless

+          autoconfiguration that embeds a link-layer address in its

+          interface identifier.";

+        }

+        enum "random" {

+          value 4;

+          description

+            "Indicates an address chosen by the system at

+

+          random, e.g., an IPv4 address within 169.254/16, an

+          RFC 4941 temporary address, or an RFC 7217 semantically

+          opaque address.";

+          reference

+            "RFC 4941: Privacy Extensions for Stateless Address

+                  Autoconfiguration in IPv6

+             RFC 7217: A Method for Generating Semantically Opaque

+                  Interface Identifiers with IPv6 Stateless

+                  Address Autoconfiguration (SLAAC)";

+        }

+      }

+      description

+        "The origin of an address.";

+    }

+

+    typedef neighbor-origin {

+      type enumeration {

+        enum "other" {

+          value 0;

+          description

+            "None of the following.";

+        }

+        enum "static" {

+          value 1;

+          description

+            "Indicates that the mapping has been statically

+          configured - for example, using NETCONF or a Command Line

+          Interface.";

+        }

+        enum "dynamic" {

+          value 2;

+          description

+            "Indicates that the mapping has been dynamically resolved

+          using, e.g., IPv4 ARP or the IPv6 Neighbor Discovery

+          protocol.";

+        }

+      }

+      description

+        "The origin of a neighbor entry.";

+    }

+

+    augment /if:devices/if:device/if:interfaces/if:interface {

+      description

+        "Parameters for configuring IP on interfaces.

+

+      If an interface is not capable of running IP, the server

+      must not allow the client to configure these parameters.";

+      container ipv4 {

+        presence

+          "Enables IPv4 unless the 'enabled' leaf

+        (which defaults to 'true') is set to 'false'";

+        description

+          "Parameters for the IPv4 address family.";

+        leaf enabled {

+          type boolean;

+          default true;

+          description

+            "Controls whether IPv4 is enabled or disabled on this

+          interface.  When IPv4 is enabled, this interface is

+          connected to an IPv4 stack, and the interface can send

+          and receive IPv4 packets.";

+        }

+

+        leaf forwarding {

+          type boolean;

+          default false;

+          description

+            "Controls IPv4 packet forwarding of datagrams received by,

+          but not addressed to, this interface.  IPv4 routers

+          forward datagrams.  IPv4 hosts do not (except those

+          source-routed via the host).";

+        }

+

+        leaf mtu {

+          type uint16 {

+            range "68..max";

+          }

+          units "octets";

+          description

+            "The size, in octets, of the largest IPv4 packet that the

+          interface will send and receive.

+

+          The server may restrict the allowed values for this leaf,

+          depending on the interface's type.

+

+          If this leaf is not configured, the operationally used MTU

+          depends on the interface's type.";

+          reference

+            "RFC 791: Internet Protocol";

+

+        }

+

+        list address {

+          key "ip";

+          description

+            "The list of configured IPv4 addresses on the interface.";

+          leaf ip {

+            type inet:ipv4-address-no-zone;

+            description

+              "The IPv4 address on the interface.";

+          }

+

+          choice subnet {

+            mandatory true;

+            description

+              "The subnet can be specified as a prefix-length, or,

+            if the server supports non-contiguous netmasks, as

+            a netmask.";

+            leaf prefix-length {

+              type uint8 {

+                range "0..32";

+              }

+              description

+                "The length of the subnet prefix.";

+            }

+            leaf netmask {

+              if-feature ipv4-non-contiguous-netmasks;

+              type yang:dotted-quad;

+              description

+                "The subnet specified as a netmask.";

+            }

+          }  // choice subnet

+        }  // list address

+

+        list neighbor {

+          key "ip";

+          description

+            "A list of mappings from IPv4 addresses to

+          link-layer addresses.

+

+          Entries in this list are used as static entries in the

+          ARP Cache.";

+          reference

+            "RFC 826: An Ethernet Address Resolution Protocol";

+

+          leaf ip {

+            type inet:ipv4-address-no-zone;

+            description

+              "The IPv4 address of the neighbor node.";

+          }

+

+          leaf link-layer-address {

+            type yang:phys-address;

+            mandatory true;

+            description

+              "The link-layer address of the neighbor node.";

+          }

+        }  // list neighbor

+      }  // container ipv4

+

+      container ipv6 {

+        presence

+          "Enables IPv6 unless the 'enabled' leaf

+        (which defaults to 'true') is set to 'false'";

+        description

+          "Parameters for the IPv6 address family.";

+        leaf enabled {

+          type boolean;

+          default true;

+          description

+            "Controls whether IPv6 is enabled or disabled on this

+          interface.  When IPv6 is enabled, this interface is

+          connected to an IPv6 stack, and the interface can send

+          and receive IPv6 packets.";

+        }

+

+        leaf forwarding {

+          type boolean;

+          default false;

+          description

+            "Controls IPv6 packet forwarding of datagrams received by,

+          but not addressed to, this interface.  IPv6 routers

+          forward datagrams.  IPv6 hosts do not (except those

+          source-routed via the host).";

+          reference

+            "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)

+                  Section 6.2.1, IsRouter";

+

+        }

+

+        leaf mtu {

+          type uint32 {

+            range "1280..max";

+          }

+          units "octets";

+          description

+            "The size, in octets, of the largest IPv6 packet that the

+          interface will send and receive.

+

+          The server may restrict the allowed values for this leaf,

+          depending on the interface's type.

+

+          If this leaf is not configured, the operationally used MTU

+          depends on the interface's type.";

+          reference

+            "RFC 2460: Internet Protocol, Version 6 (IPv6) Specification

+                  Section 5";

+

+        }

+

+        list address {

+          key "ip";

+          description

+            "The list of configured IPv6 addresses on the interface.";

+          leaf ip {

+            type inet:ipv6-address-no-zone;

+            description

+              "The IPv6 address on the interface.";

+          }

+

+          leaf prefix-length {

+            type uint8 {

+              range "0..128";

+            }

+            mandatory true;

+            description

+              "The length of the subnet prefix.";

+          }

+        }  // list address

+

+        list neighbor {

+          key "ip";

+          description

+            "A list of mappings from IPv6 addresses to

+          link-layer addresses.

+

+          Entries in this list are used as static entries in the

+          Neighbor Cache.";

+          reference

+            "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)";

+

+          leaf ip {

+            type inet:ipv6-address-no-zone;

+            description

+              "The IPv6 address of the neighbor node.";

+          }

+

+          leaf link-layer-address {

+            type yang:phys-address;

+            mandatory true;

+            description

+              "The link-layer address of the neighbor node.";

+          }

+        }  // list neighbor

+

+        leaf dup-addr-detect-transmits {

+          type uint32;

+          default 1;

+          description

+            "The number of consecutive Neighbor Solicitation messages

+          sent while performing Duplicate Address Detection on a

+          tentative address.  A value of zero indicates that

+          Duplicate Address Detection is not performed on

+          tentative addresses.  A value of one indicates a single

+          transmission with no follow-up retransmissions.";

+          reference

+            "RFC 4862: IPv6 Stateless Address Autoconfiguration";

+

+        }

+

+        container autoconf {

+          description

+            "Parameters to control the autoconfiguration of IPv6

+          addresses, as described in RFC 4862.";

+          reference

+            "RFC 4862: IPv6 Stateless Address Autoconfiguration";

+

+          leaf create-global-addresses {

+            type boolean;

+            default true;

+            description

+              "If enabled, the host creates global addresses as

+            described in RFC 4862.";

+            reference

+              "RFC 4862: IPv6 Stateless Address Autoconfiguration

+                  Section 5.5";

+

+          }

+

+          leaf create-temporary-addresses {

+            if-feature ipv6-privacy-autoconf;

+            type boolean;

+            default false;

+            description

+              "If enabled, the host creates temporary addresses as

+            described in RFC 4941.";

+            reference

+              "RFC 4941: Privacy Extensions for Stateless Address

+                  Autoconfiguration in IPv6";

+

+          }

+

+          leaf temporary-valid-lifetime {

+            if-feature ipv6-privacy-autoconf;

+            type uint32;

+            units "seconds";

+            default 604800;

+            description

+              "The time period during which the temporary address

+            is valid.";

+            reference

+              "RFC 4941: Privacy Extensions for Stateless Address

+                  Autoconfiguration in IPv6

+                  - TEMP_VALID_LIFETIME";

+

+          }

+

+          leaf temporary-preferred-lifetime {

+            if-feature ipv6-privacy-autoconf;

+            type uint32;

+            units "seconds";

+            default 86400;

+            description

+              "The time period during which the temporary address is

+            preferred.";

+            reference

+              "RFC 4941: Privacy Extensions for Stateless Address

+                  Autoconfiguration in IPv6

+                  - TEMP_PREFERRED_LIFETIME";

+

+          }

+        }  // container autoconf

+      }  // container ipv6

+    }

+

+    augment /if:devices/if:device/if:interfaces-state/if:interface {

+      description

+        "Data nodes for the operational state of IP on interfaces.";

+      container ipv4 {

+        presence

+          "Present if IPv4 is enabled on this interface";

+        config false;

+        description

+          "Interface-specific parameters for the IPv4 address family.";

+        leaf forwarding {

+          type boolean;

+          description

+            "Indicates whether IPv4 packet forwarding is enabled or

+          disabled on this interface.";

+        }

+

+        leaf mtu {

+          type uint16 {

+            range "68..max";

+          }

+          units "octets";

+          description

+            "The size, in octets, of the largest IPv4 packet that the

+          interface will send and receive.";

+          reference

+            "RFC 791: Internet Protocol";

+

+        }

+

+        list address {

+          key "ip";

+          description

+            "The list of IPv4 addresses on the interface.";

+          leaf ip {

+            type inet:ipv4-address-no-zone;

+            description

+              "The IPv4 address on the interface.";

+          }

+

+          choice subnet {

+            description

+              "The subnet can be specified as a prefix-length, or,

+            if the server supports non-contiguous netmasks, as

+            a netmask.";

+            leaf prefix-length {

+              type uint8 {

+                range "0..32";

+              }

+              description

+                "The length of the subnet prefix.";

+            }

+            leaf netmask {

+              if-feature ipv4-non-contiguous-netmasks;

+              type yang:dotted-quad;

+              description

+                "The subnet specified as a netmask.";

+            }

+          }  // choice subnet

+

+          leaf origin {

+            type ip-address-origin;

+            description

+              "The origin of this address.";

+          }

+        }  // list address

+

+        list neighbor {

+          key "ip";

+          description

+            "A list of mappings from IPv4 addresses to

+          link-layer addresses.

+

+          This list represents the ARP Cache.";

+          reference

+            "RFC 826: An Ethernet Address Resolution Protocol";

+

+          leaf ip {

+            type inet:ipv4-address-no-zone;

+            description

+              "The IPv4 address of the neighbor node.";

+          }

+

+          leaf link-layer-address {

+            type yang:phys-address;

+            description

+              "The link-layer address of the neighbor node.";

+          }

+

+          leaf origin {

+            type neighbor-origin;

+            description

+              "The origin of this neighbor entry.";

+          }

+        }  // list neighbor

+      }  // container ipv4

+

+      container ipv6 {

+        presence

+          "Present if IPv6 is enabled on this interface";

+        config false;

+        description

+          "Parameters for the IPv6 address family.";

+        leaf forwarding {

+          type boolean;

+          default false;

+          description

+            "Indicates whether IPv6 packet forwarding is enabled or

+          disabled on this interface.";

+          reference

+            "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)

+                  Section 6.2.1, IsRouter";

+

+        }

+

+        leaf mtu {

+          type uint32 {

+            range "1280..max";

+          }

+          units "octets";

+          description

+            "The size, in octets, of the largest IPv6 packet that the

+          interface will send and receive.";

+          reference

+            "RFC 2460: Internet Protocol, Version 6 (IPv6) Specification

+                  Section 5";

+

+        }

+

+        list address {

+          key "ip";

+          description

+            "The list of IPv6 addresses on the interface.";

+          leaf ip {

+            type inet:ipv6-address-no-zone;

+            description

+              "The IPv6 address on the interface.";

+          }

+

+          leaf prefix-length {

+            type uint8 {

+              range "0..128";

+            }

+            mandatory true;

+            description

+              "The length of the subnet prefix.";

+          }

+

+          leaf origin {

+            type ip-address-origin;

+            description

+              "The origin of this address.";

+          }

+

+          leaf status {

+            type enumeration {

+              enum "preferred" {

+                value 0;

+                description

+                  "This is a valid address that can appear as the

+                destination or source address of a packet.";

+              }

+              enum "deprecated" {

+                value 1;

+                description

+                  "This is a valid but deprecated address that should

+                no longer be used as a source address in new

+                communications, but packets addressed to such an

+                address are processed as expected.";

+              }

+              enum "invalid" {

+                value 2;

+                description

+                  "This isn't a valid address, and it shouldn't appear

+                as the destination or source address of a packet.";

+              }

+              enum "inaccessible" {

+                value 3;

+                description

+                  "The address is not accessible because the interface

+                to which this address is assigned is not

+                operational.";

+              }

+              enum "unknown" {

+                value 4;

+                description

+                  "The status cannot be determined for some reason.";

+              }

+              enum "tentative" {

+                value 5;

+                description

+                  "The uniqueness of the address on the link is being

+                verified.  Addresses in this state should not be

+                used for general communication and should only be

+                used to determine the uniqueness of the address.";

+              }

+              enum "duplicate" {

+                value 6;

+                description

+                  "The address has been determined to be non-unique on

+                the link and so must not be used.";

+              }

+              enum "optimistic" {

+                value 7;

+                description

+                  "The address is available for use, subject to

+                restrictions, while its uniqueness on a link is

+                being verified.";

+              }

+            }

+            description

+              "The status of an address.  Most of the states correspond

+            to states from the IPv6 Stateless Address

+            Autoconfiguration protocol.";

+            reference

+              "RFC 4293: Management Information Base for the

+                  Internet Protocol (IP)

+                  - IpAddressStatusTC

+               RFC 4862: IPv6 Stateless Address Autoconfiguration";

+

+          }

+        }  // list address

+

+        list neighbor {

+          key "ip";

+          description

+            "A list of mappings from IPv6 addresses to

+          link-layer addresses.

+

+          This list represents the Neighbor Cache.";

+          reference

+            "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)";

+

+          leaf ip {

+            type inet:ipv6-address-no-zone;

+            description

+              "The IPv6 address of the neighbor node.";

+          }

+

+          leaf link-layer-address {

+            type yang:phys-address;

+            description

+              "The link-layer address of the neighbor node.";

+          }

+

+          leaf origin {

+            type neighbor-origin;

+            description

+              "The origin of this neighbor entry.";

+          }

+

+          leaf is-router {

+            type empty;

+            description

+              "Indicates that the neighbor node acts as a router.";

+          }

+

+          leaf state {

+            type enumeration {

+              enum "incomplete" {

+                value 0;

+                description

+                  "Address resolution is in progress, and the link-layer

+                address of the neighbor has not yet been

+                determined.";

+              }

+              enum "reachable" {

+                value 1;

+                description

+                  "Roughly speaking, the neighbor is known to have been

+                reachable recently (within tens of seconds ago).";

+              }

+              enum "stale" {

+                value 2;

+                description

+                  "The neighbor is no longer known to be reachable, but

+                until traffic is sent to the neighbor no attempt

+                should be made to verify its reachability.";

+              }

+              enum "delay" {

+                value 3;

+                description

+                  "The neighbor is no longer known to be reachable, and

+                traffic has recently been sent to the neighbor.

+                Rather than probe the neighbor immediately, however,

+                delay sending probes for a short while in order to

+                give upper-layer protocols a chance to provide

+                reachability confirmation.";

+              }

+              enum "probe" {

+                value 4;

+                description

+                  "The neighbor is no longer known to be reachable, and

+                unicast Neighbor Solicitation probes are being sent

+                to verify reachability.";

+              }

+            }

+            description

+              "The Neighbor Unreachability Detection state of this

+            entry.";

+            reference

+              "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)

+                  Section 7.3.2";

+

+          }

+        }  // list neighbor

+      }  // container ipv6

+    }

+  }  // module ietf-ip

+

diff --git a/apps/l3vpn/yangmodel/src/main/yang/ietf-network-instance@2016-06-23.yang b/apps/l3vpn/yangmodel/src/main/yang/ietf-network-instance@2016-06-23.yang
new file mode 100644
index 0000000..57eebdc
--- /dev/null
+++ b/apps/l3vpn/yangmodel/src/main/yang/ietf-network-instance@2016-06-23.yang
@@ -0,0 +1,241 @@
+module ietf-network-instance {

+

+     yang-version "1";

+

+     // namespace

+     namespace "urn:ietf:params:xml:ns:yang:ietf-network-instance";

+

+     prefix "ni";

+

+     // import some basic types

+     import ietf-interfaces {

+       prefix if;

+     }

+

+     import ietf-ip {

+       prefix ip;

+     }

+

+     // meta

+     organization "IETF Routing Area Working Group (rtgwg)";

+

+     contact

+         "Routing Area Working Group - <rtgwg@ietf.org>";

+

+

+     description

+       "This module is used to support multiple network instances

+        within a single physical or virtual device.  Network

+        instances are commonly know as VRFs (virtual routing

+        and forwarding) and VSIs (virtual switching instances).";

+

+     revision "2016-06-23" {

+       description

+         "Initial revision.";

+       reference "RFC TBD";

+     }

+

+     // extension statements

+

+     feature bind-network-instance-name {

+       description

+         "Network Instance to which an interface instance is bound";

+     }

+

+     // identity statements

+

+     identity network-instance-type {

+         description

+            "Base identity from which identities describing

+             network instance types are derived.";

+     }

+

+      identity ipv4-interface-protocol-type {

+         description

+             "Base identity for derivation of IPv4 interface

+              protocols";

+      }

+

+      identity ipv6-interface-protocol-type {

+         description

+             "Base identity for derivation of IPv6 interface

+              protocols";

+      }

+

+     // typedef statements

+

+     // grouping statements

+

+     grouping interface-ip-common {

+       description

+         "interface-specific configuration for IP interfaces, IPv4 and

+         IPv6";

+

+     }

+

+     grouping ipv4-interface-protocols {

+         container ipv4-interface-protocols {

+             list ipv4-interface-protocol {

+                 key "type";

+                 leaf type {

+                     type identityref {

+                         base ipv4-interface-protocol-type;

+                     }

+                     mandatory true;

+                     description

+                         "ARP, ICMP, VRRP, DHCP Client, etc.";

+                 }

+                 description

+                     "List of IPv4 protocols configured

+                      on an interface";

+             }

+             description

+                 "Container for list of IPv4 protocols configured

+                   on an interface";

+         }

+         description

+             "Grouping for IPv4 protocols configured on an interface";

+     }

+

+     grouping ipv6-interface-protocols {

+         description

+             "Grouping for IPv6 protocols configured on

+              an interface.";

+         container ipv6-interface-protocols {

+             description

+                 "Container for list of IPv6 protocols configured

+                   on an interface.";

+             list ipv6-interface-protocol {

+                 key "type";

+                 description

+                     "List of IPv6 protocols configured

+                      on an interface";

+                 leaf type {

+                     type identityref {

+                         base ipv6-interface-protocol-type;

+                     }

+                     mandatory true;

+                     description

+                         "ND, ICMPv6, VRRP, DHCPv6 Client, etc.";

+                 }

+             }

+         }

+     }

+

+     grouping network-instance-policy {

+       description

+           "Network instance policies such as route

+            distinguisher, route targets, VPLS ID and neighbor,

+            Ethernet ID, etc. ";

+       reference

+           "RFC 4364 - BGP/MPLS Virtual Private Networks (VPNs)

+            RFC 6074 - Provisioning, Auto-Discovery, and Signaling

+                 in Layer 2 Virtual Private Networks (L2VPNs)

+            RFC 7432 - BGP MPLS-Based Ethernet VPN";

+       container network-instance-policy {

+           description "Network Instance Policy -- details TBD";

+       }

+     }

+

+     // top level device definition statements

+     container devices {

+         list device {

+             key deviceid;

+             leaf deviceid {

+                 type string;

+             }

+             container network-instances {

+                 description "Network instances each of which have

+                      and protocol instantiations. For layer 3,

+                      this consistent with the routing-instance

+                      definition in ietf-routing";

+                 reference "draft-ietf-netmod-routing-cfg";

+                 list network-instance {

+                     key name;

+                     description "List of network-instances";

+                     leaf name {

+                         type string;

+                         description "device scoped

+                              identifier for the network

+                              instance";

+                     }

+                     leaf type {

+                         type identityref {

+                             base network-instance-type;

+                         }

+                         description

+                             "The network instance type -- details TBD

+                              Likely types include core, L3-VRF, VPLS,

+                              L2-cross-connect, L2-VSI, etc.";

+                     }

+                     leaf enabled {

+                         type boolean;

+                         default "true";

+                         description

+                           "Flag indicating whether or not the network

+                            instance is enabled.";

+                     }

+                     leaf description {

+                         type string;

+                         description

+                           "Description of the network instance

+                           and its intended purpose";

+                     }

+                     uses network-instance-policy;

+                //     leaf root {

+                //       type schema-mount;

+                //       description "Root for models supported per

+                //                    network instance";

+                //     }

+                 }

+             }

+         }

+     }

+

+     // augment statements

+     augment "/if:devices/if:device/if:interfaces/if:interface" {

+       description

+           "Add a node for the identification of the logical network

+           instance (which is within the interface's identified logical

+           network element) associated with the IP information

+           configured on an interface";

+

+       leaf bind-network-instance-name {

+         type string;

+         description

+           "Network Instance to which an interface is bound";

+       }

+     }

+

+     augment "/if:devices/if:device/if:interfaces/if:interface/ip:ipv4" {

+       description

+           "Add a node for the identification of the logical

+           network instance (which is within the interface's

+           identified physical or virtual device) associated with

+           the IP information configured on an interface";

+

+       leaf bind-network-instance-name {

+         type string;

+         description

+           "Network Instance to which IPv4 interface is bound";

+

+       }

+     }

+

+     augment "/if:devices/if:device/if:interfaces/if:interface/ip:ipv6" {

+       description

+           "Add a node for the identification of the logical

+           network instance (which is within the interface's

+           identified physical or virtual device) associated with

+           the IP information configured on an interface";

+

+       leaf bind-network-instance-name {

+         type string;

+         description

+           "Network Instance to which IPv6 interface is bound";

+

+       }

+     }

+     // rpc statements

+     // notification statements

+   }
\ No newline at end of file