Drawing yang models from test/config for Yang live compiler test

Change-Id: Ifc3c226d2b8b1b90c667ac71f6e213faa1a479ce
diff --git a/tools/test/configs/yang/ietf-bgp-l3vpn@2016-09-09.yang b/tools/test/configs/yang/ietf-bgp-l3vpn@2016-09-09.yang
new file mode 100644
index 0000000..276a59f
--- /dev/null
+++ b/tools/test/configs/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/tools/test/configs/yang/ietf-inet-types.yang b/tools/test/configs/yang/ietf-inet-types.yang
new file mode 100644
index 0000000..51a44a3
--- /dev/null
+++ b/tools/test/configs/yang/ietf-inet-types.yang
@@ -0,0 +1,454 @@
+  module ietf-inet-types {

+

+    yang-version 1;

+

+    namespace

+      "urn:ietf:params:xml:ns:yang:ietf-inet-types";

+

+    prefix inet;

+

+    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: David Kessens

+              <mailto:david.kessens@nsn.com>

+

+    WG Chair: Juergen Schoenwaelder

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

+

+    Editor:   Juergen Schoenwaelder

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

+

+    description

+      "This module contains a collection of generally useful derived

+    YANG data types for Internet addresses and related things.

+

+    Copyright (c) 2013 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 6991; see

+    the RFC itself for full legal notices.";

+

+    revision "2013-07-15" {

+      description

+        "This revision adds the following new data types:

+      - ip-address-no-zone

+      - ipv4-address-no-zone

+      - ipv6-address-no-zone";

+      reference

+        "RFC 6991: Common YANG Data Types";

+

+    }

+

+    revision "2010-09-24" {

+      description "Initial revision.";

+      reference

+        "RFC 6021: Common YANG Data Types";

+

+    }

+

+

+    typedef ip-version {

+      type enumeration {

+        enum "unknown" {

+          value 0;

+          description

+            "An unknown or unspecified version of the Internet

+          protocol.";

+        }

+        enum "ipv4" {

+          value 1;

+          description

+            "The IPv4 protocol as defined in RFC 791.";

+        }

+        enum "ipv6" {

+          value 2;

+          description

+            "The IPv6 protocol as defined in RFC 2460.";

+        }

+      }

+      description

+        "This value represents the version of the IP protocol.

+

+      In the value set and its semantics, this type is equivalent

+      to the InetVersion textual convention of the SMIv2.";

+      reference

+        "RFC  791: Internet Protocol

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

+         RFC 4001: Textual Conventions for Internet Network Addresses";

+

+    }

+

+    typedef dscp {

+      type uint8 {

+        range "0..63";

+      }

+      description

+        "The dscp type represents a Differentiated Services Code Point

+      that may be used for marking packets in a traffic stream.

+      In the value set and its semantics, this type is equivalent

+      to the Dscp textual convention of the SMIv2.";

+      reference

+        "RFC 3289: Management Information Base for the Differentiated

+        	  Services Architecture

+         RFC 2474: Definition of the Differentiated Services Field

+        	  (DS Field) in the IPv4 and IPv6 Headers

+         RFC 2780: IANA Allocation Guidelines For Values In

+        	  the Internet Protocol and Related Headers";

+

+    }

+

+    typedef ipv6-flow-label {

+      type uint32 {

+        range "0..1048575";

+      }

+      description

+        "The ipv6-flow-label type represents the flow identifier or Flow

+      Label in an IPv6 packet header that may be used to

+      discriminate traffic flows.

+

+      In the value set and its semantics, this type is equivalent

+      to the IPv6FlowLabel textual convention of the SMIv2.";

+      reference

+        "RFC 3595: Textual Conventions for IPv6 Flow Label

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

+

+    }

+

+    typedef port-number {

+      type uint16 {

+        range "0..65535";

+      }

+      description

+        "The port-number type represents a 16-bit port number of an

+      Internet transport-layer protocol such as UDP, TCP, DCCP, or

+      SCTP.  Port numbers are assigned by IANA.  A current list of

+      all assignments is available from <http://www.iana.org/>.

+

+      Note that the port number value zero is reserved by IANA.  In

+      situations where the value zero does not make sense, it can

+      be excluded by subtyping the port-number type.

+      In the value set and its semantics, this type is equivalent

+      to the InetPortNumber textual convention of the SMIv2.";

+      reference

+        "RFC  768: User Datagram Protocol

+         RFC  793: Transmission Control Protocol

+         RFC 4960: Stream Control Transmission Protocol

+         RFC 4340: Datagram Congestion Control Protocol (DCCP)

+         RFC 4001: Textual Conventions for Internet Network Addresses";

+

+    }

+

+    typedef as-number {

+      type uint32;

+      description

+        "The as-number type represents autonomous system numbers

+      which identify an Autonomous System (AS).  An AS is a set

+      of routers under a single technical administration, using

+      an interior gateway protocol and common metrics to route

+      packets within the AS, and using an exterior gateway

+      protocol to route packets to other ASes.  IANA maintains

+      the AS number space and has delegated large parts to the

+      regional registries.

+

+      Autonomous system numbers were originally limited to 16

+      bits.  BGP extensions have enlarged the autonomous system

+      number space to 32 bits.  This type therefore uses an uint32

+      base type without a range restriction in order to support

+      a larger autonomous system number space.

+

+      In the value set and its semantics, this type is equivalent

+      to the InetAutonomousSystemNumber textual convention of

+      the SMIv2.";

+      reference

+        "RFC 1930: Guidelines for creation, selection, and registration

+        	  of an Autonomous System (AS)

+         RFC 4271: A Border Gateway Protocol 4 (BGP-4)

+         RFC 4001: Textual Conventions for Internet Network Addresses

+         RFC 6793: BGP Support for Four-Octet Autonomous System (AS)

+        	  Number Space";

+

+    }

+

+    typedef ip-address {

+      type union {

+        type ipv4-address;

+        type ipv6-address;

+      }

+      description

+        "The ip-address type represents an IP address and is IP

+      version neutral.  The format of the textual representation

+      implies the IP version.  This type supports scoped addresses

+      by allowing zone identifiers in the address format.";

+      reference

+        "RFC 4007: IPv6 Scoped Address Architecture";

+

+    }

+

+    typedef ipv4-address {

+      type string {

+        pattern

+          '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\p{N}\p{L}]+)?';

+      }

+      description

+        "The ipv4-address type represents an IPv4 address in

+       dotted-quad notation.  The IPv4 address may include a zone

+       index, separated by a % sign.

+

+       The zone index is used to disambiguate identical address

+       values.  For link-local addresses, the zone index will

+       typically be the interface index number or the name of an

+       interface.  If the zone index is not present, the default

+       zone of the device will be used.

+

+       The canonical format for the zone index is the numerical

+       format";

+    }

+

+    typedef ipv6-address {

+      type string {

+        pattern

+          '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\p{N}\p{L}]+)?';

+        pattern

+          '(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)(%.+)?';

+      }

+      description

+        "The ipv6-address type represents an IPv6 address in full,

+      mixed, shortened, and shortened-mixed notation.  The IPv6

+      address may include a zone index, separated by a % sign.

+

+      The zone index is used to disambiguate identical address

+      values.  For link-local addresses, the zone index will

+      typically be the interface index number or the name of an

+      interface.  If the zone index is not present, the default

+      zone of the device will be used.

+

+

+

+      The canonical format of IPv6 addresses uses the textual

+      representation defined in Section 4 of RFC 5952.  The

+      canonical format for the zone index is the numerical

+      format as described in Section 11.2 of RFC 4007.";

+      reference

+        "RFC 4291: IP Version 6 Addressing Architecture

+         RFC 4007: IPv6 Scoped Address Architecture

+         RFC 5952: A Recommendation for IPv6 Address Text

+        	  Representation";

+

+    }

+

+    typedef ip-address-no-zone {

+      type union {

+        type ipv4-address-no-zone;

+        type ipv6-address-no-zone;

+      }

+      description

+        "The ip-address-no-zone type represents an IP address and is

+      IP version neutral.  The format of the textual representation

+      implies the IP version.  This type does not support scoped

+      addresses since it does not allow zone identifiers in the

+      address format.";

+      reference

+        "RFC 4007: IPv6 Scoped Address Architecture";

+

+    }

+

+    typedef ipv4-address-no-zone {

+      type ipv4-address {

+        pattern '[0-9\.]*';

+      }

+      description

+        "An IPv4 address without a zone index.  This type, derived from

+       ipv4-address, may be used in situations where the zone is

+       known from the context and hence no zone index is needed.";

+    }

+

+    typedef ipv6-address-no-zone {

+      type ipv6-address {

+        pattern '[0-9a-fA-F:\.]*';

+      }

+      description

+        "An IPv6 address without a zone index.  This type, derived from

+       ipv6-address, may be used in situations where the zone is

+       known from the context and hence no zone index is needed.";

+      reference

+        "RFC 4291: IP Version 6 Addressing Architecture

+         RFC 4007: IPv6 Scoped Address Architecture

+         RFC 5952: A Recommendation for IPv6 Address Text

+        	  Representation";

+

+    }

+

+    typedef ip-prefix {

+      type union {

+        type ipv4-prefix;

+        type ipv6-prefix;

+      }

+      description

+        "The ip-prefix type represents an IP prefix and is IP

+      version neutral.  The format of the textual representations

+      implies the IP version.";

+    }

+

+    typedef ipv4-prefix {

+      type string {

+        pattern

+          '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))';

+      }

+      description

+        "The ipv4-prefix type represents an IPv4 address prefix.

+      The prefix length is given by the number following the

+      slash character and must be less than or equal to 32.

+

+      A prefix length value of n corresponds to an IP address

+      mask that has n contiguous 1-bits from the most

+      significant bit (MSB) and all other bits set to 0.

+

+      The canonical format of an IPv4 prefix has all bits of

+      the IPv4 address set to zero that are not part of the

+      IPv4 prefix.";

+    }

+

+    typedef ipv6-prefix {

+      type string {

+        pattern

+          '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))';

+        pattern

+          '(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)(/.+)';

+      }

+      description

+        "The ipv6-prefix type represents an IPv6 address prefix.

+      The prefix length is given by the number following the

+      slash character and must be less than or equal to 128.

+

+      A prefix length value of n corresponds to an IP address

+      mask that has n contiguous 1-bits from the most

+      significant bit (MSB) and all other bits set to 0.

+

+      The IPv6 address should have all bits that do not belong

+      to the prefix set to zero.

+

+      The canonical format of an IPv6 prefix has all bits of

+      the IPv6 address set to zero that are not part of the

+      IPv6 prefix.  Furthermore, the IPv6 address is represented

+      as defined in Section 4 of RFC 5952.";

+      reference

+        "RFC 5952: A Recommendation for IPv6 Address Text

+        	  Representation";

+

+    }

+

+    typedef domain-name {

+      type string {

+        length "1..253";

+        pattern

+          '((([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.)*([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.?)|\.';

+      }

+      description

+        "The domain-name type represents a DNS domain name.  The

+      name SHOULD be fully qualified whenever possible.

+

+      Internet domain names are only loosely specified.  Section

+      3.5 of RFC 1034 recommends a syntax (modified in Section

+      2.1 of RFC 1123).  The pattern above is intended to allow

+      for current practice in domain name use, and some possible

+      future expansion.  It is designed to hold various types of

+      domain names, including names used for A or AAAA records

+      (host names) and other records, such as SRV records.  Note

+      that Internet host names have a stricter syntax (described

+      in RFC 952) than the DNS recommendations in RFCs 1034 and

+      1123, and that systems that want to store host names in

+      schema nodes using the domain-name type are recommended to

+      adhere to this stricter standard to ensure interoperability.

+

+      The encoding of DNS names in the DNS protocol is limited

+      to 255 characters.  Since the encoding consists of labels

+      prefixed by a length bytes and there is a trailing NULL

+      byte, only 253 characters can appear in the textual dotted

+      notation.

+

+      The description clause of schema nodes using the domain-name

+      type MUST describe when and how these names are resolved to

+      IP addresses.  Note that the resolution of a domain-name value

+      may require to query multiple DNS records (e.g., A for IPv4

+      and AAAA for IPv6).  The order of the resolution process and

+      which DNS record takes precedence can either be defined

+      explicitly or may depend on the configuration of the

+      resolver.

+

+      Domain-name values use the US-ASCII encoding.  Their canonical

+      format uses lowercase US-ASCII characters.  Internationalized

+      domain names MUST be A-labels as per RFC 5890.";

+      reference

+        "RFC  952: DoD Internet Host Table Specification

+         RFC 1034: Domain Names - Concepts and Facilities

+         RFC 1123: Requirements for Internet Hosts -- Application

+        	  and Support

+         RFC 2782: A DNS RR for specifying the location of services

+        	  (DNS SRV)

+         RFC 5890: Internationalized Domain Names in Applications

+        	  (IDNA): Definitions and Document Framework";

+

+    }

+

+    typedef host {

+      type union {

+        type ip-address;

+        type domain-name;

+      }

+      description

+        "The host type represents either an IP address or a DNS

+      domain name.";

+    }

+

+    typedef uri {

+      type string;

+      description

+        "The uri type represents a Uniform Resource Identifier

+      (URI) as defined by STD 66.

+

+      Objects using the uri type MUST be in US-ASCII encoding,

+      and MUST be normalized as described by RFC 3986 Sections

+      6.2.1, 6.2.2.1, and 6.2.2.2.  All unnecessary

+      percent-encoding is removed, and all case-insensitive

+      characters are set to lowercase except for hexadecimal

+      digits, which are normalized to uppercase as described in

+      Section 6.2.2.1.

+

+      The purpose of this normalization is to help provide

+      unique URIs.  Note that this normalization is not

+      sufficient to provide uniqueness.  Two URIs that are

+      textually distinct after this normalization may still be

+      equivalent.

+

+      Objects using the uri type may restrict the schemes that

+      they permit.  For example, 'data:' and 'urn:' schemes

+      might not be appropriate.

+

+      A zero-length URI is not a valid URI.  This can be used to

+      express 'URI absent' where required.

+

+      In the value set and its semantics, this type is equivalent

+      to the Uri SMIv2 textual convention defined in RFC 5017.";

+      reference

+        "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax

+         RFC 3305: Report from the Joint W3C/IETF URI Planning Interest

+        	  Group: Uniform Resource Identifiers (URIs), URLs,

+        	  and Uniform Resource Names (URNs): Clarifications

+        	  and Recommendations

+         RFC 5017: MIB Textual Conventions for Uniform Resource

+        	  Identifiers (URIs)";

+

+    }

+  }
\ No newline at end of file
diff --git a/tools/test/configs/yang/ietf-interfaces@2014-05-08.yang b/tools/test/configs/yang/ietf-interfaces@2014-05-08.yang
new file mode 100644
index 0000000..2171a5a
--- /dev/null
+++ b/tools/test/configs/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/tools/test/configs/yang/ietf-ip@2014-06-16.yang b/tools/test/configs/yang/ietf-ip@2014-06-16.yang
new file mode 100644
index 0000000..0446258
--- /dev/null
+++ b/tools/test/configs/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/tools/test/configs/yang/ietf-l3vpn-svc@2016-07-30.yang b/tools/test/configs/yang/ietf-l3vpn-svc@2016-07-30.yang
new file mode 100644
index 0000000..dbd60dc
--- /dev/null
+++ b/tools/test/configs/yang/ietf-l3vpn-svc@2016-07-30.yang
@@ -0,0 +1,2599 @@
+module ietf-l3vpn-svc {

+

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

+

+    prefix l3vpn-svc;

+

+    import ietf-inet-types {

+        prefix inet;

+    }

+

+    import ietf-yang-types {

+        prefix yang;

+    }

+

+    organization

+     "IETF L3SM Working Group";

+

+    contact

+        "WG List:   &lt;mailto:l3sm@ietf.org&gt;

+

+        Editor:

+

+        ";

+

+    description

+        "The YANG module defines a generic service configuration

+        model for Layer 3 VPN common across all of the vendor

+        implementations.";

+

+    revision 2016-07-30 {

+        description

+        "Eliminated warnings";

+        reference

+            "draft-ietf-l3sm-l3vpn-service-yang-11";

+    }

+

+    revision 2016-07-05 {

+        description

+        "Draft text update";

+        reference

+            "draft-ietf-l3sm-l3vpn-service-yang-11";

+    }

+    revision 2016-06-27 {

+        description

+        "

+        * Removed templates

+        * Add site-network-access-type

+        * Add a leaf number-of-dynamic-address in case

+        of pe-dhcp addressing;

+

+        ";

+        reference "draft-ietf-l3sm-l3vpn-service-yang-10";

+    }

+    revision 2016-06-10 {

+        description

+         "Add site-vpn-flavor NNI";

+        reference "draft-ietf-l3sm-l3vpn-service-yang-09";

+    }

+    revision 2016-06-09 {

+        description

+         "Traffic protection moved to site level.

+          Decouple operational-requirements in two containers.

+         ";

+        reference "draft-ietf-l3sm-l3vpn-service-yang-08";

+    }

+    revision 2016-06-06 {

+        description

+         "Set config false to actual-site-start and stop

+          Add a container before cloud-access list

+          Add a container before authorized-sites list

+          Add a container before denied-sites list

+          Modified access-diversity modeling

+          Replacing type placement diversity by an identity";

+        reference "draft-ietf-l3sm-l3vpn-service-yang-07";

+    }

+    revision 2016-04-19 {

+        description

+         "* remove reference to core routing model :

+            created new address family identities

+          * added features

+          * Modified bearer parameters

+          * Modified union for ipv4/ipv6 addresses to ip-address

+          type

+          * Add BSR parameters for multicast

+          * Add applications matching for QoS classification

+          ";

+        reference "draft-ietf-l3sm-l3vpn-service-yang-06";

+    }

+    revision 2016-04-05 {

+        description

+         "

+         * Added linecard diverse for site diversity

+         * Added a new diversity enum in placement-diversity : none

+         * Added state to site location

+

+         ";

+        reference "";

+    }

+    revision 2016-03-11 {

+        description

+        "

+            * Modify VPN policy and creating a vpn-policy-list

+            * Add VPN policy reference and VPN ID reference

+            under site-network-access

+        ";

+        reference "draft-ietf-l3sm-l3vpn-service-yang-05";

+    }

+    revision 2016-01-04 {

+        description

+        "

+            * Add extranet-vpn container in vpn-svc

+            * Creating top level containers

+            * Refine groupings

+            * Added site-vpn-flavor

+        ";

+        reference "draft-ietf-l3sm-l3vpn-service-yang-03";

+    }

+    revision 2016-01-04 {

+        description

+         "

+            * qos-profile moved to choice

+            * vpn leaf moved to vpn-id in vpn-policy

+            * added ordered-by user to qos classification list

+            * moved traffic protection to access availability

+            * creating a choice in matching filter for VPN policy

+            * added dot1p matching field in flow-definition

+        ";

+        reference "";

+    }

+    revision 2015-12-07 {

+        description

+         "

+            * A site is now a collection of site-accesses.

+            This was introduced to support M to N availability.

+            * Site-availability has been removed, replaced by

+            availability parameters under site-accesses

+            * Added transport-constraints within vpn-svc

+        ";

+        reference "draft-ietf-l3sm-l3vpn-service-yang-02";

+    }

+    revision 2015-11-03 {

+        description "

+        * Add ToS support in match-flow

+        * nexthop in cascaded lan as mandatory

+        * customer-specific-info deleted and moved to routing

+        protocols

+        * customer-lan-connection modified : need prefix and CE address

+        * add choice in managing PE-CE addressing

+        * Simplifying traffic protection

+        ";

+        reference "";

+    }

+    revision 2015-09-10 {

+        description "

+        * Refine groupings for vpn-svc

+        * Removed name in vpn-svc

+        * id in vpn-svc moved to string

+        * Rename id in vpn-svc to vpn-id

+        * Changed key of vpn-svc list to vpn-id

+        * Add DSCP support in flow definition

+        ";

+        reference "";

+    }

+    revision 2015-08-07 {

+        description

+         "

+          Multicast :

+            * Removed ACL from security

+            * Add FW for site and cloud access

+         ";

+        reference "";

+    }

+    revision 2015-08-05 {

+        description

+         "

+          Multicast :

+          * Removed anycast-rp identity as discovery mechanism

+          * Added rp-group mappings for multicast

+          * Added flag for provider managed RP.

+         ";

+        reference "";

+    }

+    revision 2015-08-03 {

+        description

+         " * Creating multiple reusable groupings

+           * Added mpls leaf in vpn-svc for carrier's carrier case

+           * Modify identity single to single-site

+           * Modify site-type to site-role and also child identities.

+           * Creating OAM container under site and moved BFD in.

+           * Creating flow-definition grouping to be reused

+           in ACL, QoS ...

+           * Simplified VPN policy.

+           * Adding multicast static group to RP mappings.

+           * Removed native-vpn and site-role from global site

+           cfg, now managed within the VPN policy.

+           * Creating a separate list for site templates.

+         ";

+        reference "draft-ietf-l3sm-l3vpn-service-yang-01";

+    }

+    revision 2015-07-02 {

+        reference "draft-ietf-l3sm-l3vpn-service-yang-00";

+    }

+    revision 2015-04-24 {

+        description "

+        * Add encryption parameters

+        * Adding holdtime for BFD.

+        * Add postal address in location

+        ";

+        reference "draft-lstd-l3sm-l3vpn-service-yang-00";

+    }

+    revision 2015-02-05 {

+        description "Initial revision.";

+        reference "draft-l3vpn-service-yang-00";

+    }

+

+    /* Features */

+

+    feature cloud-access {

+        description

+         "Allow VPN to connect to a Cloud Service

+         provider.";

+    }

+    feature multicast {

+        description

+        "Enables multicast capabilities in a VPN";

+    }

+    feature ipv4 {

+        description

+        "Enables IPv4 support in a VPN";

+    }

+    feature ipv6 {

+        description

+        "Enables IPv6 support in a VPN";

+    }

+    feature carrierscarrier {

+        description

+        "Enables support of carrier's carrier";

+    }

+    feature traffic-engineering {

+        description

+        "Enables support of transport constraint.";

+    }

+    feature traffic-engineering-multicast {

+        description

+        "Enables support of transport constraint

+        for multicast.";

+    }

+    feature extranet-vpn {

+        description

+        "Enables support of extranet VPNs";

+    }

+    feature site-diversity {

+        description

+        "Enables support of site diversity constraints";

+    }

+    feature encryption {

+        description

+        "Enables support of encryption";

+    }

+    feature qos {

+        description

+        "Enables support of Class of Services";

+    }

+    feature qos-custom {

+        description

+        "Enables support of custom qos profile";

+    }

+    feature rtg-bgp {

+        description

+        "Enables support of BGP routing protocol.";

+    }

+    feature rtg-rip {

+        description

+        "Enables support of RIP routing protocol.";

+    }

+    feature rtg-ospf {

+        description

+        "Enables support of OSPF routing protocol.";

+    }

+    feature rtg-ospf-sham-link {

+        description

+        "Enables support of OSPF sham-links.";

+    }

+    feature rtg-vrrp {

+        description

+        "Enables support of VRRP routing protocol.";

+    }

+    feature fast-reroute {

+        description

+        "Enables support of Fast Reroute.";

+    }

+    feature bfd {

+        description

+        "Enables support of BFD.";

+    }

+    feature always-on {

+        description

+        "Enables support for always-on access

+        constraint.";

+    }

+    feature requested-type {

+        description

+        "Enables support for requested-type access

+        constraint.";

+    }

+    feature bearer-reference {

+        description

+        "Enables support for bearer-reference access

+        constraint.";

+    }

+

+    /* Typedefs */

+

+    typedef svc-id {

+        type string;

+        description

+         "Defining a type of service component

+         identificators.";

+    }

+

+    typedef template-id {

+        type string;

+        description

+         "Defining a type of service template

+         identificators.";

+    }

+

+    /* Identities */

+

+    identity site-network-access-type {

+        description

+         "Base identity for site-network-access type";

+    }

+    identity point-to-point {

+        base site-network-access-type;

+        description

+        "Identity for point-to-point connection";

+    }

+    identity multipoint {

+        base site-network-access-type;

+        description

+        "Identity for multipoint connection

+        Example : ethernet broadcast segment";

+    }

+    identity placement-diversity {

+        description

+         "Base identity for site placement

+         constraints";

+    }

+    identity pe-diverse {

+        base placement-diversity;

+        description

+        "Identity for PE diversity";

+    }

+    identity pop-diverse {

+        base placement-diversity;

+        description

+        "Identity for POP diversity";

+    }

+    identity linecard-diverse {

+        base placement-diversity;

+        description

+        "Identity for linecard diversity";

+    }

+    identity same-pe {

+        base placement-diversity;

+        description

+        "Identity for having sites connected

+        on the same PE";

+    }

+    identity same-bearer {

+        base placement-diversity;

+        description

+        "Identity for having sites connected

+        using the same bearer";

+    }

+    identity customer-application {

+        description

+         "Base identity for customer application";

+    }

+    identity web {

+        base customer-application;

+        description

+         "Identity for web application (e.g. HTTP,HTTPS)";

+    }

+    identity mail {

+        base customer-application;

+        description

+         "Identity for mail applications";

+    }

+    identity file-transfer {

+        base customer-application;

+        description

+         "Identity for file transfer applications (

+         e.g. FTP, SFTP, ...)";

+    }

+    identity database {

+        base customer-application;

+        description

+         "Identity for database applications";

+    }

+    identity social {

+        base customer-application;

+        description

+         "Identity for social network applications";

+    }

+    identity games {

+        base customer-application;

+        description

+         "Identity for gaming applications";

+    }

+    identity p2p {

+        base customer-application;

+        description

+         "Identity for peer to peer applications";

+    }

+    identity network-management {

+        base customer-application;

+        description

+         "Identity for management applications (e.g. telnet

+            syslog, snmp ...)";

+    }

+    identity voice {

+        base customer-application;

+        description

+         "Identity for voice applications";

+    }

+    identity video {

+        base customer-application;

+        description

+         "Identity for video conference applications";

+    }

+    identity address-family {

+        description

+         "Base identity for an address family.";

+    }

+    identity ipv4 {

+        base address-family;

+        description

+        "Identity for IPv4 address family.";

+    }

+    identity ipv6 {

+        base address-family;

+        description

+        "Identity for IPv6 address family.";

+    }

+    identity site-vpn-flavor {

+        description

+        "Base identity for the site VPN service flavor.";

+    }

+    identity site-vpn-flavor-single {

+        base site-vpn-flavor;

+        description

+        "Base identity for the site VPN service flavor.

+        Used when the site belongs to only one VPN.";

+    }

+    identity site-vpn-flavor-multi {

+        base site-vpn-flavor;

+        description

+        "Base identity for the site VPN service flavor.

+        Used when a logical connection of a site

+        belongs to multiple VPNs.";

+    }

+    identity site-vpn-flavor-sub {

+        base site-vpn-flavor;

+        description

+        "Base identity for the site VPN service flavor.

+        Used when a site has multiple logical connections.

+        Each of the connection may belong to different

+        multiple VPNs.";

+    }

+    identity site-vpn-flavor-nni {

+        base site-vpn-flavor;

+        description

+        "Base identity for the site VPN service flavor.

+        Used to describe a NNI option A connection.";

+    }

+    identity transport-constraint {

+        description

+         "Base identity for transport constraint.";

+    }

+    identity tc-latency {

+        base transport-constraint;

+        description

+         "Base identity for transport constraint

+         based on latency.";

+    }

+    identity tc-jitter {

+        base transport-constraint;

+        description

+         "Base identity for transport constraint

+         based on jitter.";

+    }

+    identity tc-bandwidth {

+        base transport-constraint;

+        description

+         "Base identity for transport constraint

+         based on bandwidth.";

+    }

+    identity tc-path-diversity {

+        base transport-constraint;

+        description

+         "Base identity for transport constraint

+         based on path diversity.";

+    }

+    identity tc-site-diversity {

+        base transport-constraint;

+        description

+         "Base identity for transport constraint

+         based on site diversity.";

+    }

+    identity management {

+        description

+         "Base identity for site management scheme.";

+    }

+    identity co-managed {

+        base management;

+        description

+         "Base identity for comanaged site.";

+    }

+    identity customer-managed {

+        base management;

+        description

+         "Base identity for customer managed site.";

+    }

+    identity provider-managed {

+        base management;

+        description

+         "Base identity for provider managed site.";

+    }

+    identity address-allocation-type {

+        description

+         "Base identity for address-allocation-type

+         for PE-CE link.";

+    }

+    identity pe-dhcp {

+        base address-allocation-type;

+        description

+         "PE router provides DHCP service to CE.";

+    }

+    identity static-address {

+        base address-allocation-type;

+        description

+         "PE-CE addressing is static.";

+    }

+    identity slaac {

+        base address-allocation-type;

+        description

+         "Use IPv6 SLAAC.";

+    }

+    identity site-role {

+        description

+         "Base identity for site type.";

+    }

+    identity any-to-any-role {

+        base site-role;

+        description

+         "Site in a any to any IPVPN.";

+    }

+    identity spoke-role {

+        base site-role;

+        description

+         "Spoke Site in a Hub & Spoke IPVPN.";

+    }

+    identity hub-role {

+        base site-role;

+        description

+         "Hub Site in a Hub & Spoke IPVPN.";

+    }

+    identity vpn-topology {

+        description

+         "Base identity for VPN topology.";

+    }

+    identity any-to-any {

+        base vpn-topology;

+        description

+         "Identity for any to any VPN topology.";

+    }

+    identity hub-spoke {

+        base vpn-topology;

+        description

+         "Identity for Hub'n'Spoke VPN topology.";

+    }

+    identity hub-spoke-disjoint {

+        base vpn-topology;

+        description

+         "Identity for Hub'n'Spoke VPN topology

+          where Hubs cannot talk between each other.";

+    }

+    identity multicast-tree-type {

+        description

+         "Base identity for multicast tree type.";

+    }

+    identity ssm-tree-type {

+        base multicast-tree-type;

+        description

+         "Identity for SSM tree type.";

+    }

+    identity asm-tree-type {

+        base multicast-tree-type;

+        description

+         "Identity for ASM tree type.";

+    }

+    identity bidir-tree-type {

+        base multicast-tree-type;

+        description

+         "Identity for BiDir tree type.";

+    }

+    identity multicast-rp-discovery-type {

+        description

+         "Base identity for rp discovery type.";

+    }

+    identity auto-rp {

+        base multicast-rp-discovery-type;

+        description

+         "Base identity for auto-rp discovery type.";

+    }

+    identity static-rp {

+        base multicast-rp-discovery-type;

+        description

+         "Base identity for static type.";

+    }

+    identity bsr-rp {

+        base multicast-rp-discovery-type;

+        description

+         "Base identity for BDR discovery type.";

+    }

+    identity routing-protocol-type {

+        description

+         "Base identity for routing-protocol type.";

+    }

+    identity ospf {

+        base routing-protocol-type;

+        description

+         "Identity for OSPF protocol type.";

+    }

+    identity bgp {

+        base routing-protocol-type;

+        description

+         "Identity for BGP protocol type.";

+    }

+    identity static {

+        base routing-protocol-type;

+        description

+         "Identity for static routing protocol type.";

+    }

+    identity rip {

+        base routing-protocol-type;

+        description

+         "Identity for RIP protocol type.";

+    }

+    identity rip-ng {

+        base routing-protocol-type;

+        description

+         "Identity for RIPng protocol type.";

+    }

+    identity vrrp {

+        base routing-protocol-type;

+        description

+         "Identity for VRRP protocol type.

+         This is to be used when LAn are directly connected

+         to provider Edge routers.";

+    }

+    identity direct {

+        base routing-protocol-type;

+        description

+         "Identity for direct protocol type.

+        .";

+    }

+    identity protocol-type {

+        description

+         "Base identity for protocol field type.";

+    }

+    identity tcp {

+        base protocol-type;

+        description

+         "TCP protocol type.";

+    }

+    identity udp {

+        base protocol-type;

+        description

+         "UDP protocol type.";

+    }

+    identity icmp {

+        base protocol-type;

+        description

+         "icmp protocol type.";

+    }

+    identity icmp6 {

+        base protocol-type;

+        description

+         "icmp v6 protocol type.";

+    }

+    identity gre {

+        base protocol-type;

+        description

+         "GRE protocol type.";

+    }

+    identity ipip {

+        base protocol-type;

+        description

+         "IPinIP protocol type.";

+    }

+    identity hop-by-hop {

+        base protocol-type;

+        description

+         "Hop by Hop IPv6 header type.";

+    }

+    identity routing {

+        base protocol-type;

+        description

+         "Routing IPv6 header type.";

+    }

+    identity esp {

+        base protocol-type;

+        description

+         "ESP header type.";

+    }

+    identity ah {

+        base protocol-type;

+        description

+         "AH header type.";

+    }

+

+    /* Groupings */

+

+    grouping vpn-service-cloud-access {

+        container cloud-accesses {

+        list cloud-access {

+            if-feature cloud-access;

+            key cloud-identifier;

+

+            leaf cloud-identifier {

+                type string;

+                description

+                 "Identification of cloud service. Local

+                 admin meaning.";

+            }

+            container authorized-sites {

+                list authorized-site {

+                    key site-id;

+

+                    leaf site-id {

+                        type leafref {

+                            path "/l3vpn-svc/sites/site/site-id";

+                        }

+                        description

+                         "Site ID.";

+                    }

+                    description

+                     "List of authorized sites.";

+                }

+                description

+                "Configuration of authorized sites";

+            }

+            container denied-sites {

+                list denied-site {

+                    key site-id;

+

+                    leaf site-id {

+                        type leafref {

+                            path "/l3vpn-svc/sites/site/site-id";

+                        }

+                        description

+                         "Site ID.";

+                    }

+                    description

+                     "List of denied sites.";

+                }

+                description

+                "Configuration of denied sites";

+            }

+            leaf nat-enabled {

+                type boolean;

+                description

+                 "Control if NAT is required or not.";

+            }

+            leaf customer-nat-address {

+                type inet:ipv4-address;

+                description

+                 "NAT address to be used in case of public

+                 or shared cloud.

+                 This is to be used in case customer is providing

+                 the public address.";

+            }

+            description

+             "Cloud access configuration.";

+        }

+            description

+             "Container for cloud access configurations";

+        }

+        description

+         "grouping for vpn cloud definition";

+    }

+

+    grouping multicast-rp-group-cfg {

+        choice group-format {

+            case startend {

+                leaf group-start {

+                    type inet:ip-address;

+                    description

+                     "First group address.";

+                }

+                leaf group-end {

+                    type inet:ip-address;

+                    description

+                     "Last group address.";

+                }

+            }

+            case singleaddress {

+                leaf group-address {

+                    type inet:ip-address;

+                    description

+                     "Group address";

+                }

+            }

+            description

+             "Choice for group format.";

+        }

+        description

+         "Definition of groups for

+         RP to group mapping.";

+    }

+

+    grouping vpn-service-multicast {

+        container multicast {

+            if-feature multicast;

+            leaf enabled {

+                type boolean;

+                default false;

+                description

+                 "Enable multicast.";

+            }

+            container customer-tree-flavors {

+                list tree-flavor {

+                    key type;

+

+                    leaf type {

+                        type identityref {

+                            base multicast-tree-type;

+                        }

+                        description

+                         "Type of tree to be used.";

+                    }

+                    description

+                     "List of tree flavors.";

+                }

+                description

+                 "Type of trees used by customer.";

+            }

+            container rp {

+                container rp-group-mappings {

+                    list rp-group-mapping {

+                        key "id";

+

+                        leaf id {

+                            type uint16;

+                            description

+                             "Unique identifier for the mapping.";

+                        }

+                        container provider-managed {

+                            leaf enabled {

+                                type boolean;

+                                default false;

+                                description

+                                 "Set to true, if the RP must be a

+                                 provider

+                                 managed node.

+                                 Set to false, if it is a customer

+                                 managed node.";

+                            }

+

+                            leaf rp-redundancy {

+                                when "../enabled = 'true'" {

+                                    description

+                                     "Relevant when RP

+                                     is provider managed.";

+                                }

+                                type boolean;

+                                default false;

+                                description

+                                 "If true, redundancy

+                                 mechanism for RP is required.";

+                            }

+                            leaf optimal-traffic-delivery {

+                                when "../enabled = 'true'" {

+                                    description

+                                     "Relevant when RP

+                                     is provider managed.";

+                                }

+                                type boolean;

+                                default false;

+                                description

+                                 "If true, SP must ensure

+                                 that traffic uses an optimal path.";

+                            }

+                            description

+                             "Parameters for provider managed RP.";

+                        }

+

+                        leaf rp-address {

+                            when "../provider-managed/enabled='false'" {

+                                description

+                                 "Relevant when RP

+                                 is provider managed.";

+                            }

+                            type inet:ip-address;

+                            description

+                            "Defines the address of the

+                            RendezvousPoint.

+                            Used if RP is customer managed.";

+                        }

+

+                        container groups {

+                            list group {

+                                key id;

+

+                                leaf id {

+                                    type uint16;

+                                    description

+                                     "Identifier for the group.";

+                                }

+                                uses multicast-rp-group-cfg;

+                                description

+                                "List of groups.";

+                            }

+                            description

+                             "Multicast groups associated with RP.";

+                        }

+

+                        description

+                         "List of RP to group mappings.";

+                    }

+                    description

+                    "RP to group mappings.";

+                }

+                container rp-discovery {

+                    leaf rp-discovery-type {

+                        type identityref {

+                            base multicast-rp-discovery-type;

+                        }

+                        default static-rp;

+                        description

+                         "Type of RP discovery used.";

+                    }

+                    container bsr-candidates {

+                        when "../rp-discovery-type='bsr-rp'" {

+                            description

+                             "Only applicable if discovery type

+                             is BSR-RP";

+                        }

+                        list bsr-candidate {

+                            key address;

+

+                            leaf address {

+                                type inet:ip-address;

+                                description

+                                 "Address of BSR candidate";

+                            }

+

+                            description

+                             "List of customer BSR candidates";

+                        }

+                        description

+                         "Customer BSR candidates address";

+                    }

+                    description

+                     "RP discovery parameters";

+                }

+

+                description

+                 "RendezvousPoint parameters.";

+            }

+            description

+                "Multicast global parameters for the VPN service.";

+        }

+        description

+         "grouping for multicast vpn definition";

+    }

+

+    grouping vpn-service-mpls {

+        leaf carrierscarrier {

+            if-feature carrierscarrier;

+            type boolean;

+            default false;

+            description

+             "The VPN is using Carrier's Carrier,

+             and so MPLS is required.";

+        }

+        description

+         "grouping for mpls CsC definition";

+    }

+

+    grouping customer-location-info {

+        container location {

+                leaf address {

+                    type string;

+                    description

+                    "Address (number and street)

+                    of the site.";

+

+                }

+                leaf zip-code {

+                    type string;

+                    description

+                    "ZIP code of the site.";

+                }

+                leaf state {

+                    type string;

+                    description

+                    "State of the site.

+                    This leaf can also be used

+                    to describe a region

+                    for country who does not have

+                    states.

+                    ";

+                }

+                leaf city {

+                    type string;

+                    description

+                     "City of the site.";

+                }

+                leaf country-code {

+                    type string;

+                    description

+                     "Country of the site.";

+                }

+                description

+                    "Location of the site.";

+        }

+        description

+         "This grouping defines customer location

+          parameters";

+    }

+

+    grouping site-diversity {

+        container site-diversity {

+                if-feature site-diversity;

+

+                container groups {

+                    list group {

+                        key group-id;

+

+                        leaf group-id {

+                            type string;

+                            description

+                             "Group-id the site

+                             is belonging to";

+                        }

+                        description

+                        "List of group-id";

+                    }

+                    description

+                     "Groups the site

+                     is belonging to.

+                     All site network accesses will

+                     inherit those group values.";

+                }

+                description

+                     "Diversity constraint type.";

+            }

+        description

+         "This grouping defines site diversity

+          parameters";

+    }

+

+    grouping access-diversity {

+        container access-diversity {

+                if-feature site-diversity;

+                container groups {

+                    list group {

+                        key group-id;

+

+                        leaf group-id {

+                            type string;

+                            description

+                             "Group-id the site network access

+                             is belonging to";

+                        }

+                        description

+                        "List of group-id";

+                    }

+                    description

+                     "Groups the site network access

+                     is belonging to";

+                }

+                container constraints {

+                    list constraint {

+                        key constraint-type;

+

+                        leaf constraint-type {

+                            type identityref {

+                                base placement-diversity;

+                            }

+                            description

+                             "Diversity constraint type.";

+                        }

+                        container target {

+                            choice target-flavor {

+                                case id {

+                                    list group {

+                                        key group-id;

+

+                                        leaf group-id {

+                                            type string;

+                                            description

+                                             "The constraint will apply

+                                             against this particular

+                                             group-id";

+                                        }

+                                        description

+                                         "List of groups";

+                                    }

+                                }

+                                case all-accesses {

+                                    leaf all-other-accesses {

+                                        type empty;

+                                        description

+                                         "The constraint will apply

+                                         against all other site network

+                                         access

+                                         of this site";

+                                    }

+                                }

+                                case all-groups {

+                                    leaf all-other-groups {

+                                        type empty;

+                                        description

+                                         "The constraint will apply

+                                         against all other groups the

+                                         customer

+                                         is managing";

+                                    }

+                                }

+                                description

+                                 "Choice for the group definition";

+                            }

+                            description

+                             "The constraint will apply against

+                             this list of groups";

+                        }

+                        description

+                         "List of constraints";

+                    }

+                    description

+                     "Constraints for placing this site

+                     network access";

+                }

+

+                description

+                     "Diversity parameters.";

+            }

+        description

+         "This grouping defines access diversity

+          parameters";

+    }

+

+    grouping operational-requirements {

+          leaf requested-site-start {

+               type yang:date-and-time;

+               description

+                "Optional leaf indicating requested date

+                and time

+                when the service at a particular site is

+                expected

+                to start";

+           }

+

+           leaf requested-site-stop {

+               type yang:date-and-time;

+               description

+                "Optional leaf indicating requested date

+                and time

+                when the service at a particular site is

+                expected

+                to stop";

+           }

+        description

+         "This grouping defines some operational parameters

+          parameters";

+    }

+

+    grouping operational-requirements-ops {

+           leaf actual-site-start {

+               type yang:date-and-time;

+               config false;

+               description

+                "Optional leaf indicating actual date

+                and time

+                when the service at a particular site

+                actually

+                started";

+           }

+           leaf actual-site-stop {

+               type yang:date-and-time;

+               config false;

+               description

+                "Optional leaf indicating actual date

+                and time

+                when the service at a particular site

+                actually

+                stopped";

+           }

+        description

+         "This grouping defines some operational parameters

+          parameters";

+    }

+

+    grouping flow-definition {

+        container match-flow {

+            leaf dscp {

+                type uint8 {

+                    range "0 .. 63";

+                }

+                description

+                 "DSCP value.";

+            }

+            leaf tos {

+                type uint8 {

+                    range "0 .. 254";

+                }

+                description

+                 "TOS value.";

+            }

+            leaf dot1p {

+                type uint8 {

+                    range "0 .. 7";

+                }

+                description

+                "802.1p matching.";

+            }

+            leaf ipv4-src-prefix {

+                type inet:ipv4-prefix;

+                description

+                 "Match on IPv4 src address.";

+            }

+            leaf ipv6-src-prefix {

+                type inet:ipv6-prefix;

+                description

+                 "Match on IPv6 src address.";

+            }

+            leaf ipv4-dst-prefix {

+                type inet:ipv4-prefix;

+                description

+                 "Match on IPv4 dst address.";

+            }

+            leaf ipv6-dst-prefix {

+                type inet:ipv6-prefix;

+                description

+                 "Match on IPv6 dst address.";

+            }

+            leaf l4-src-port {

+                type uint16;

+                description

+                 "Match on layer 4 src port.";

+            }

+            leaf l4-dst-port {

+                type uint16;

+                description

+                 "Match on layer 4 dst port.";

+            }

+            leaf protocol-field {

+                type union {

+                    type uint8;

+                    type identityref {

+                        base protocol-type;

+                    }

+                }

+                description

+                 "Match on IPv4 protocol or

+                  Ipv6 Next Header

+                 field.";

+            }

+

+            description

+             "Describe flow matching

+             criterions.";

+        }

+        description

+         "Flow definition based on criteria.";

+    }

+

+    grouping site-service-basic {

+        leaf svc-input-bandwidth {

+               type uint32;

+               units bps;

+               description

+                "From the PE perspective, the service input

+                bandwidth of the connection.";

+        }

+        leaf svc-output-bandwidth {

+           type uint32;

+           units bps;

+           description

+            "From the PE perspective, the service output

+            bandwidth of the connection.";

+        }

+        leaf svc-mtu {

+            type uint16;

+            units bytes;

+            description

+             "MTU at service level.

+             If the service is IP,

+             it refers to the IP MTU.";

+        }

+        description

+         "Defines basic service parameters for a site.";

+    }

+

+    grouping site-protection {

+        container traffic-protection {

+            if-feature fast-reroute;

+            leaf enabled {

+                type boolean;

+                description

+                 "Enables

+                 traffic protection of access link.";

+            }

+

+            description

+             "Fast reroute service parameters

+             for the site.";

+        }

+        description

+         "Defines protection service parameters for a site.";

+    }

+

+    grouping site-service-mpls {

+        container carrierscarrier {

+            if-feature carrierscarrier;

+            leaf signalling-type {

+                type enumeration {

+                    enum "ldp" {

+                        description

+                            "Use LDP as signalling

+                            protocol between PE and CE.";

+                    }

+                    enum "bgp" {

+                        description

+                            "Use BGP 3107 as signalling

+                            protocol between PE and CE.

+                            In this case, bgp must be also

+                            configured

+                            as routing-protocol.

+                            ";

+                    }

+                }

+                description

+                 "MPLS signalling type.";

+            }

+            description

+             "This container is used when customer provides

+             MPLS based services.

+             This is used in case of Carrier's

+             Carrier.";

+        }

+        description

+         "Defines MPLS service parameters for a site.";

+    }

+

+    grouping site-service-qos-profile {

+        container qos {

+            if-feature qos;

+            container qos-classification-policy {

+                list rule {

+                    key id;

+                    ordered-by user;

+

+                    leaf id {

+                        type uint16;

+                        description

+                         "ID of the rule.";

+                    }

+

+                    choice match-type {

+                        case match-flow {

+                            uses flow-definition;

+                        }

+                        case match-application {

+                            leaf match-application {

+                                type identityref {

+                                    base customer-application;

+                                }

+                                description

+                                 "Defines the application

+                                 to match.";

+                            }

+                        }

+                        description

+                         "Choice for classification";

+                    }

+

+                    leaf target-class-id {

+                        type string;

+                        description

+                         "Identification of the

+                         class of service.

+                         This identifier is internal to

+                         the administration.";

+                    }

+

+                    description

+                     "List of marking rules.";

+                }

+                description

+                 "Need to express marking rules ...";

+            }

+            container qos-profile {

+

+                choice qos-profile {

+                    description

+                     "Choice for QoS profile.

+                     Can be standard profile or custom.";

+                    case standard {

+                        leaf profile {

+                            type string;

+                            description

+                             "QoS profile to be used";

+                        }

+                    }

+                    case custom {

+                        container classes {

+                            if-feature qos-custom;

+                            list class {

+                                key class-id;

+

+                                leaf class-id {

+                                    type string;

+                                    description

+                                     "Identification of the

+                                     class of service.

+                                     This identifier is internal to

+                                     the administration.";

+                                }

+                                leaf rate-limit {

+                                    type uint8;

+                                    units percent;

+                                    description

+                                     "To be used if class must

+                                     be rate

+                                     limited. Expressed as

+                                     percentage of the svc-bw.";

+                                }

+                                leaf priority-level {

+                                    type uint8;

+                                    description

+                                     "Defines the level of the

+                                     class in

+                                     term of priority queueing.

+                                      The higher the level is the

+                                      higher

+                                      is the priority.";

+                                }

+                                leaf guaranteed-bw-percent {

+                                    type uint8;

+                                    units percent;

+                                    description

+                                     "To be used to define the

+                                     guaranteed

+                                     BW in percent of the svc-bw

+                                     available at the priority-level.";

+                                }

+                                description

+                                 "List of class of services.";

+                            }

+                            description

+                                 "Container for

+                                 list of class of services.";

+                        }

+

+                    }

+

+                }

+                description

+                "Qos profile configuration.";

+            }

+            description

+             "QoS configuration.";

+        }

+        description

+         "This grouping defines QoS parameters

+         for a site";

+

+    }

+

+    grouping site-security-authentication {

+        container authentication {

+            description

+             "Authentication parameters";

+        }

+        description

+         "This grouping defines authentication

+         parameters

+         for a site";

+    }

+

+    grouping site-security-encryption {

+        container encryption {

+            if-feature encryption;

+            leaf enabled {

+                type boolean;

+                description

+                 "If true, access encryption is required.";

+            }

+            leaf layer {

+                type enumeration {

+                    enum layer2 {

+                        description

+                         "Encryption will occur at layer2.";

+                    }

+                    enum layer3 {

+                        description

+                         "IPSec is requested.";

+                    }

+                }

+                description

+                 "Layer on which encryption is applied.";

+            }

+            container encryption-profile {

+                choice profile {

+                    case provider-profile {

+                        leaf profile-name {

+                            type string;

+                            description

+                             "Name of the SP profile

+                             to be applied.";

+                        }

+                    }

+                    case customer-profile {

+                        leaf algorithm {

+                            type string;

+                            description

+                             "Encryption algorithm to

+                             be used.";

+                        }

+                        choice key-type {

+                            case psk {

+                                leaf preshared-key {

+                                    type string;

+                                    description

+                                     "Key coming from

+                                     customer.";

+                                }

+                            }

+                            case pki {

+

+                            }

+                            description

+                             "Type of keys to be used.";

+                        }

+                    }

+                    description

+                     "Choice of profile.";

+                }

+                description

+                 "Profile of encryption to be applied.";

+            }

+            description

+             "Encryption parameters.";

+        }

+        description

+         "This grouping defines encryption parameters

+         for a site";

+    }

+

+    grouping site-attachment-bearer {

+        container bearer {

+            container requested-type {

+                if-feature requested-type;

+                leaf requested-type {

+                    type string;

+                    description

+                     "Type of requested bearer Ethernet, DSL,

+                     Wireless ...

+                     Operator specific.";

+                }

+                leaf strict {

+                    type boolean;

+                    default false;

+                    description

+                     "define if the requested-type is a preference

+                     or a strict requirement.";

+                }

+                description

+                 "Container for requested type.";

+            }

+            leaf always-on {

+                if-feature always-on;

+                type boolean;

+                default true;

+                description

+                "Request for an always on access type.

+                This means no Dial access type for

+                example.";

+            }

+            leaf bearer-reference {

+                if-feature bearer-reference;

+                type string;

+                description

+                 "This is an internal reference for the

+                 service provider.

+                 Used ";

+            }

+            description

+             "Bearer specific parameters.

+             To be augmented.";

+        }

+        description

+         "Defines physical properties of

+         a site attachment.";

+    }

+

+    grouping site-routing {

+        container routing-protocols {

+            list routing-protocol {

+                key type;

+

+                leaf type {

+                    type identityref {

+                        base routing-protocol-type;

+                    }

+                    description

+                     "Type of routing protocol.";

+                }

+

+

+                container ospf {

+                    when "../type = 'ospf'" {

+                        description

+                         "Only applies

+                         when protocol is OSPF.";

+                    }

+                    if-feature rtg-ospf;

+                    leaf-list address-family {

+                        type identityref {

+                            base address-family;

+                        }

+                        description

+                         "Address family to be activated.";

+                    }

+                    leaf area-address {

+                        type yang:dotted-quad;

+                        description

+                         "Area address.";

+                    }

+                    leaf metric {

+                        type uint16;

+                        description

+                         "Metric of PE-CE link.";

+                    }

+                    container sham-links {

+                        if-feature rtg-ospf-sham-link;

+                        list sham-link {

+                            key target-site;

+

+                            leaf target-site {

+                                type svc-id;

+                                description

+                                 "Target site for the sham link

+                                  connection.

+                                  The site is referred through it's ID.";

+                            }

+                            leaf metric {

+                                type uint16;

+                                description

+                                 "Metric of the sham link.";

+                            }

+                            description

+                             "Creates a shamlink with another

+                             site";

+                        }

+                        description

+                         "List of Sham links";

+                    }

+                    description

+                     "OSPF specific configuration.";

+                }

+

+                container bgp {

+

+                    when "../type = 'bgp'" {

+                        description

+                         "Only applies when

+                         protocol is BGP.";

+                    }

+                    if-feature rtg-bgp;

+                    leaf autonomous-system {

+                        type uint32;

+                        description

+                         "AS number.";

+                    }

+                    leaf-list address-family {

+                        type identityref {

+                            base address-family;

+                        }

+                        description

+                         "Address family to be activated.";

+                    }

+                    description

+                     "BGP specific configuration.";

+                }

+                container static {

+                    when "../type = 'static'" {

+                        description

+                         "Only applies when protocol

+                         is static.";

+                    }

+

+                    container cascaded-lan-prefixes {

+                        list ipv4-lan-prefixes {

+                            if-feature ipv4;

+                            key "lan next-hop";

+

+                            leaf lan {

+                                type inet:ipv4-prefix;

+                                description

+                                 "Lan prefixes.";

+                            }

+                            leaf lan-tag {

+                                type string;

+                                description

+                                 "Internal tag to be used in vpn

+                                 policies.";

+                            }

+                            leaf next-hop {

+                                type inet:ipv4-address;

+                                description

+                                 "Nexthop address to use at customer

+                                 side.";

+                            }

+                            description "

+                                List of LAN prefixes for

+                                the site.

+                                ";

+                        }

+                        list ipv6-lan-prefixes {

+                            if-feature ipv6;

+                            key "lan next-hop";

+

+                            leaf lan {

+                                type inet:ipv6-prefix;

+                                description

+                                 "Lan prefixes.";

+                            }

+                            leaf lan-tag {

+                                type string;

+                                description

+                                 "Internal tag to be used

+                                 in vpn policies.";

+                            }

+                            leaf next-hop {

+                                type inet:ipv6-address;

+                                description

+                                 "Nexthop address to use at

+                                 customer side.";

+                            }

+                            description "

+                                List of LAN prefixes for the site.

+                                ";

+                        }

+                        description

+                            "LAN prefixes from the customer.";

+                    }

+                    description

+                     "Static routing

+                     specific configuration.";

+                }

+                container rip {

+

+                    when "../type = 'rip'" {

+                        description

+                         "Only applies when

+                         protocol is RIP.";

+                    }

+                    if-feature rtg-rip;

+                    leaf-list address-family {

+                        type identityref {

+                            base address-family;

+                        }

+                        description

+                         "Address family to be

+                         activated.";

+                    }

+

+                    description

+                     "RIP routing specific

+                     configuration.";

+                }

+

+

+                container vrrp {

+

+                    when "../type = 'vrrp'" {

+                        description

+                         "Only applies when

+                         protocol is VRRP.";

+                    }

+                    if-feature rtg-vrrp;

+                    leaf-list address-family {

+                        type identityref {

+                            base address-family;

+                        }

+                        description

+                         "Address family to be activated.";

+                    }

+                    description

+                     "VRRP routing specific configuration.";

+                }

+

+

+                description

+                 "List of routing protocols used

+                 on the site.

+                 Need to be augmented.";

+            }

+            description

+             "Defines routing protocols.";

+        }

+        description

+         "Grouping for routing protocols.";

+    }

+

+    grouping site-attachment-ip-connection {

+        container ip-connection {

+            container ipv4 {

+                if-feature ipv4;

+                leaf address-allocation-type {

+                    type identityref {

+                        base address-allocation-type;

+                    }

+

+                    default "static-address";

+                    description

+                     "Defines how addresses are allocated.

+                     ";

+                }

+

+                leaf number-of-dynamic-address {

+                    when

+                    "../address-allocation-type = 'pe-dhcp'"

+                     {

+                        description

+                         "Only applies when

+                         protocol allocation type is static";

+                    }

+                    type uint8;

+                    default 1;

+                    description

+                     "Describes the number of IP addresses the

+                     customer requires";

+                }

+                container addresses {

+                    when

+                    "../address-allocation-type = 'static-address'" {

+                        description

+                         "Only applies when

+                         protocol allocation type is static";

+                    }

+                    leaf provider-address {

+                        type inet:ipv4-address;

+                        description

+                         "Provider side address.";

+                    }

+                    leaf customer-address {

+                        type inet:ipv4-address;

+                        description

+                         "Customer side address.";

+                    }

+                    leaf mask {

+                        type uint8 {

+                            range "0..32";

+                        }

+                        description

+                         "Subnet mask expressed

+                         in bits";

+                    }

+                    description

+                     "Describes IP addresses used";

+                }

+                description

+                 "IPv4 specific parameters";

+

+            }

+            container ipv6 {

+                if-feature ipv6;

+                leaf address-allocation-type {

+                    type identityref {

+                        base address-allocation-type;

+                    }

+                    default "static-address";

+                    description

+                     "Defines how addresses are allocated.

+                     ";

+                }

+                leaf number-of-dynamic-address {

+                    when

+                    "../address-allocation-type = 'pe-dhcp'" {

+                        description

+                         "Only applies when

+                         protocol allocation type is static";

+                    }

+                    type uint8;

+                    default 1;

+                    description

+                     "Describes the number of IP addresses the

+                     customer requires";

+                }

+                container addresses {

+                    when

+                    "../address-allocation-type = 'static-address'" {

+                        description

+                         "Only applies when

+                         protocol allocation type is static";

+                    }

+                    leaf provider-address {

+                        type inet:ipv6-address;

+                        description

+                         "Provider side address.";

+                    }

+                    leaf customer-address {

+                        type inet:ipv6-address;

+                        description

+                         "Customer side address.";

+                    }

+                    leaf mask {

+                        type uint8 {

+                            range "0..128";

+

+                        }

+                        description

+                         "Subnet mask expressed

+                         in bits";

+                    }

+                    description

+                     "Describes IP addresses used";

+                }

+

+                description

+                 "IPv6 specific parameters";

+

+            }

+            container oam {

+                container bfd {

+                    if-feature bfd;

+                    leaf bfd-enabled {

+                        type boolean;

+                        description

+                         "BFD activation";

+                    }

+

+                    choice holdtime {

+                        case profile {

+                            leaf profile-name {

+                                type string;

+                                description

+                                 "Service provider well

+                                 known profile.";

+                            }

+                            description

+                                 "Service provider well

+                                 known profile.";

+                        }

+                        case fixed {

+                            leaf fixed-value {

+                                type uint32;

+                                units msec;

+                                description

+                                 "Expected holdtime

+                                 expressed

+                                 in msec.";

+                            }

+                        }

+                        description

+                         "Choice for holdtime flavor.";

+                    }

+                    description

+                     "Container for BFD.";

+                }

+                description

+                 "Define the OAM used on the connection.";

+            }

+            description

+             "Defines connection parameters.";

+        }

+        description

+         "This grouping defines IP connection parameters.";

+    }

+

+    grouping site-service-multicast {

+        container multicast {

+            if-feature multicast;

+            leaf multicast-site-type {

+                type enumeration {

+                    enum receiver-only {

+                        description

+                         "The site has only receivers.";

+                    }

+                    enum source-only {

+                        description

+                         "The site has only sources.";

+                    }

+                    enum source-receiver {

+                        description

+                         "The site has both

+                         sources & receivers.";

+                    }

+                }

+                default "source-receiver";

+                description

+                 "Type of multicast site.";

+            }

+            container multicast-transport-protocol {

+                leaf ipv4 {

+                    if-feature ipv4;

+                    type boolean;

+                    default true;

+                    description

+                        "Enables ipv4 multicast transport";

+                }

+                leaf ipv6 {

+                    if-feature ipv6;

+                    type boolean;

+                    default false;

+                    description

+                        "Enables ipv6 multicast transport";

+                }

+                description

+                 "Defines protocol to transport multicast.";

+            }

+            leaf protocol-type {

+                type enumeration {

+                    enum host {

+                        description

+                         "

+                         Hosts are directly connected

+                         to the provider network.

+                         Host protocols like IGMP, MLD

+                         are required.

+                         ";

+                    }

+                    enum router {

+                        description

+                         "

+                         Hosts are behind a customer router.

+                         PIM will be implemented.

+                         ";

+                    }

+                    enum both {

+                        description

+                         "Some Hosts are behind a customer

+                         router and some others are directly

+                         connected to the provider network.

+                         Both host and routing protocols must be

+                         used. Typically IGMP and PIM will be

+                         implemented.

+                         ";

+                    }

+                }

+                default "both";

+                description

+                 "Multicast protocol type to be used

+                 with the customer site.";

+            }

+

+            description

+             "Multicast parameters for the site.";

+        }

+        description

+          "Multicast parameters for the site.";

+    }

+

+    grouping site-management {

+        container management {

+            leaf type {

+                type identityref {

+                    base management;

+                }

+                description

+                "Management type of the connection.";

+            }

+            leaf management-transport {

+                type identityref {

+                    base address-family;

+                }

+                description

+                 "Transport protocol used for management.";

+            }

+            leaf address {

+                type inet:ip-address;

+                description

+                 "Management address";

+            }

+

+            description

+             "Management configuration";

+        }

+        description

+          "Management parameters for the site.";

+    }

+

+    grouping site-vpn-flavor-profile {

+        leaf site-vpn-flavor {

+            type identityref {

+                base site-vpn-flavor;

+            }

+            default site-vpn-flavor-single;

+            description

+             "Defines if the site

+            is a single VPN site, or multiVPN or ...";

+        }

+        description

+         "Grouping for site-vpn-flavor.";

+    }

+

+    grouping site-vpn-policy {

+        container vpn-policy-list {

+            list vpn-policy {

+                key vpn-policy-id;

+

+                leaf vpn-policy-id {

+                    type svc-id;

+                    description

+                     "Unique identifier for

+                     the VPN policy.";

+                }

+

+                list entries {

+                    key id;

+

+                    leaf id {

+                            type svc-id;

+                            description

+                             "Unique identifier for

+                              the policy entry.";

+                    }

+                    container filter {

+                        choice lan {

+                            case lan-prefix {

+                                container lan-prefixes {

+                                    list ipv4-lan-prefixes {

+                                        if-feature ipv4;

+                                        key lan;

+

+                                        leaf lan {

+                                            type inet:ipv4-prefix;

+                                            description

+                                             "Lan prefixes.";

+                                        }

+                                        description "

+                                            List of LAN prefixes

+                                            for the site.

+                                            ";

+                                    }

+                                    list ipv6-lan-prefixes {

+                                        if-feature ipv6;

+                                        key lan;

+

+                                        leaf lan {

+                                            type inet:ipv6-prefix;

+                                            description

+                                             "Lan prefixes.";

+                                        }

+                                        description "

+                                            List of LAN prefixes

+                                            for the site.

+                                            ";

+                                    }

+                                    description

+                                     "LAN prefixes from the customer.";

+                                }

+                            }

+                            case lan-tag {

+                                leaf-list lan-tag {

+                                    type string;

+                                    description

+                                     "List of lan-tags to be matched.";

+                                }

+                            }

+                            description

+                             "Choice for LAN matching type";

+                        }

+                        description

+                         "If used, it permit to split site LANs

+                         among multiple VPNs.

+                         If no filter used, all the LANs will be

+                         part of the same VPNs with the same

+                         role.";

+                    }

+                    container vpn {

+                        leaf vpn-id {

+                            type leafref {

+                                path "/l3vpn-svc/vpn-services/vpn-svc/vpn-id";

+                            }

+                            mandatory true;

+                            description

+                             "Reference to an IPVPN.";

+                        }

+                        leaf site-role {

+                            type identityref {

+                                base site-role;

+                            }

+                            mandatory true;

+                            description

+                             "Role of the site in the IPVPN.";

+                        }

+                        description

+                         "List of VPNs the LAN is associated to.";

+                    }

+                    description

+                     "List of entries for export policy.";

+                }

+                description

+                 "List of VPN policies.";

+            }

+            description

+                 "VPN policy.";

+        }

+        description

+          "VPN policy parameters for the site.";

+    }

+

+    grouping site-maximum-routes {

+        container maximum-routes {

+            list address-family {

+                key af;

+

+                leaf af {

+                    type identityref {

+                        base address-family;

+                    }

+                    description

+                     "Address-family.";

+                }

+                leaf maximum-routes {

+                    type uint32;

+                    description

+                     "Maximum prefixes the VRF can

+                     accept for this

+                     address-family.";

+                }

+                description

+                 "List of address families.";

+            }

+

+            description

+             "Define maximum-routes for the VRF.";

+        }

+        description

+        "Define maximum-routes for the site.";

+    }

+

+    grouping site-security {

+        container security {

+            uses site-security-authentication;

+            uses site-security-encryption;

+

+            description

+             "Site specific security parameters.";

+        }

+        description

+         "Grouping for security parameters.";

+    }

+

+    grouping site-service {

+        container service {

+            uses site-service-basic;

+            uses site-service-qos-profile;

+            uses site-service-mpls;

+            uses site-service-multicast;

+

+            description

+             "Service parameters on the attachement.";

+        }

+        description

+         "Grouping for service parameters.";

+    }

+

+    grouping transport-constraint-profile {

+        list constraint-list {

+            key constraint-type;

+

+            leaf constraint-type {

+                type identityref {

+                    base transport-constraint;

+                }

+                description

+                 "Constraint type to be applied.";

+            }

+            leaf constraint-opaque-value {

+                type string;

+                description

+                "Opaque value that can be used to

+                specify constraint parameters.";

+            }

+            description

+             "List of constraints";

+        }

+        description

+         "Grouping for transport constraint.";

+    }

+

+    grouping transport-constraints {

+        container transport-constraints {

+            if-feature traffic-engineering;

+            container unicast-transport-constraints {

+                list constraint {

+                    key constraint-id;

+

+                    leaf constraint-id {

+                        type svc-id;

+                        description

+                         "Defines an ID for the constraint

+                         rule.";

+                    }

+

+                    leaf site1 {

+                        type svc-id;

+                        description

+                         "The ID refers to one site end.";

+                    }

+                    leaf site2 {

+                        type svc-id;

+                        description

+                         "The ID refers to the other

+                         site end.";

+                    }

+                    uses transport-constraint-profile;

+                    description

+                     "List of constraints.

+                     Constraints are bidirectional.";

+                }

+                description

+                 "Unicast transport constraints.";

+            }

+            container multicast-transport-constraints {

+                if-feature traffic-engineering-multicast;

+                list constraint {

+                    key constraint-id;

+

+                    leaf constraint-id {

+                        type svc-id;

+                        description

+                         "Defines an ID for the constraint

+                         rule.";

+                    }

+

+                    leaf src-site {

+                        type svc-id;

+                        description

+                         "The ID refers to source site.";

+                    }

+                    leaf dst-site {

+                        type svc-id;

+                        description

+                         "The ID refers to the receiver

+                         site.";

+                    }

+                    uses transport-constraint-profile;

+                    description

+                     "List of constraints.

+                     Constraints are unidirectional.";

+                }

+                description

+                 "Multicast transport constraints.";

+            }

+            description

+                 "transport constraints.";

+        }

+        description

+         "Grouping for transport constraints

+         description.";

+    }

+

+    grouping vpn-extranet {

+        container extranet-vpns {

+            if-feature extranet-vpn;

+            list extranet-vpn {

+                key vpn-id;

+

+                leaf vpn-id {

+                    type svc-id;

+                    description

+                        "Identifies the target VPN";

+                }

+                leaf local-sites-role {

+                    type identityref {

+                        base site-role;

+                    }

+                    description

+                     "This describes the role of the

+                     local sites in the target VPN topology.";

+                }

+                description

+                 "List of extranet VPNs the local

+                 VPN is attached to.";

+            }

+            description

+             "Container for extranet vpn cfg.";

+        }

+        description

+            "grouping for extranet VPN configuration.

+            Extranet provides a way to interconnect all sites

+            from two VPNs in a easy way.";

+    }

+

+    grouping site-attachment-availability {

+        container availability {

+            leaf access-priority {

+                type uint32;

+                default 1;

+                description

+                 "Defines the priority for the access.

+                 The highest the priority value is,

+                 the highest the

+                 preference of the access is.";

+            }

+            description

+             "Availability parameters

+             (used for multihoming)";

+        }

+        description

+         "Defines site availability parameters.";

+    }

+

+    grouping access-vpn-policy {

+        container vpn-attachment {

+            choice attachment-flavor {

+                case vpn-policy-id {

+                    leaf vpn-policy-id {

+                        type leafref {

+                            path "/l3vpn-svc/sites/site/"+

+                            "vpn-policy-list/vpn-policy/"+

+                            "vpn-policy-id";

+                        }

+                        description

+                         "Reference to a VPN policy.";

+                    }

+                }

+                case vpn-id {

+                    leaf vpn-id {

+                        type leafref {

+                            path "/l3vpn-svc/vpn-services"+

+                            "/vpn-svc/vpn-id";

+                        }

+                        description

+                            "Reference to a VPN.";

+                    }

+                    leaf site-role {

+                        type identityref {

+                                base site-role;

+                            }

+                        mandatory true;

+                        description

+                         "Role of the site in the IPVPN.";

+                    }

+                }

+                mandatory true;

+                description

+                 "Choice for VPN attachment flavor.";

+            }

+            description

+             "Defines VPN attachment of a site.";

+        }

+        description

+         "Defines the VPN attachment rules

+         for a site logical access.";

+    }

+

+    grouping vpn-svc-cfg {

+        leaf vpn-id {

+                type svc-id;

+                description

+                "VPN identifier. Local administration meaning.";

+            }

+        leaf customer-name {

+            type string;

+            description

+             "Name of the customer.";

+        }

+        leaf topology {

+            type identityref {

+                base vpn-topology;

+            }

+            default "any-to-any";

+            description

+             "VPN topology.";

+        }

+

+        uses vpn-service-cloud-access;

+        uses vpn-service-multicast;

+        uses vpn-service-mpls;

+        uses transport-constraints;

+        uses vpn-extranet;

+

+        description

+         "grouping for vpn-svc configuration.";

+    }

+

+    grouping site-top-level-cfg {

+        uses operational-requirements;

+        uses customer-location-info;

+        uses site-diversity;

+        uses site-management;

+        uses site-vpn-policy;

+        uses site-vpn-flavor-profile;

+        uses site-maximum-routes;

+        uses site-security;

+        uses site-service;

+        uses site-protection;

+        uses site-routing;

+

+        description

+         "Grouping for site top level cfg.";

+    }

+

+    grouping site-network-access-top-level-cfg {

+        leaf site-network-access-type {

+            type identityref {

+                base site-network-access-type;

+            }

+            default "point-to-point";

+            description

+            "Describes the type of connection, e.g. :

+            point-to-point or multipoint";

+        }

+        uses access-diversity;

+        uses site-attachment-bearer;

+        uses site-attachment-ip-connection;

+        uses site-security;

+        uses site-service;

+        uses site-routing;

+        uses site-attachment-availability;

+        uses access-vpn-policy;

+

+        description

+         "Grouping for site network access

+         top level cfg.";

+    }

+

+    /* Main blocks */

+

+    container l3vpn-svc {

+        container vpn-services {

+            list vpn-svc {

+                key vpn-id;

+

+                uses vpn-svc-cfg;

+

+                description "

+                    List of VPN services.

+

+                ";

+            }

+            description

+             "top level container

+             for the VPN services.";

+        }

+

+        container sites {

+            list site {

+                key site-id;

+

+                leaf site-id {

+                    type svc-id;

+                    description

+                        "Identifier of the site.";

+                }

+

+                uses site-top-level-cfg;

+                uses operational-requirements-ops;

+

+                container site-network-accesses {

+                    list site-network-access {

+                        key site-network-access-id;

+

+                        leaf site-network-access-id {

+                            type svc-id;

+                            description

+                             "Identifier for the access";

+                        }

+                        uses site-network-access-top-level-cfg;

+

+                        description

+                         "List of accesses for a site.";

+                    }

+                    description

+                     "List of accesses for a site.";

+                }

+

+                description "List of sites.";

+            }

+            description

+             "Container for sites";

+        }

+

+        description

+         "Main container for L3VPN service configuration.";

+    }

+}
\ No newline at end of file
diff --git a/tools/test/configs/yang/ietf-network-instance@2016-06-23.yang b/tools/test/configs/yang/ietf-network-instance@2016-06-23.yang
new file mode 100644
index 0000000..57eebdc
--- /dev/null
+++ b/tools/test/configs/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
diff --git a/tools/test/configs/yang/ietf-yang-types.yang b/tools/test/configs/yang/ietf-yang-types.yang
new file mode 100644
index 0000000..3f87464
--- /dev/null
+++ b/tools/test/configs/yang/ietf-yang-types.yang
@@ -0,0 +1,473 @@
+module ietf-yang-types {

+

+     namespace "urn:ietf:params:xml:ns:yang: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: David Kessens

+                 <mailto:david.kessens@nsn.com>

+

+       WG Chair: Juergen Schoenwaelder

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

+

+       Editor:   Juergen Schoenwaelder

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

+

+     description

+      "This module contains a collection of generally useful derived

+       YANG data types.

+

+       Copyright (c) 2013 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 6991; see

+       the RFC itself for full legal notices.";

+

+     revision 2013-07-15 {

+       description

+        "This revision adds the following new data types:

+         - yang-identifier

+         - hex-string

+         - uuid

+         - dotted-quad";

+       reference

+        "RFC 6991: Common YANG Data Types";

+     }

+

+     revision 2010-09-24 {

+       description

+        "Initial revision.";

+       reference

+        "RFC 6021: Common YANG Data Types";

+     }

+

+     /*** collection of counter and gauge types ***/

+

+     typedef counter32 {

+       type uint32;

+       description

+        "The counter32 type represents a non-negative integer

+         that monotonically increases until it reaches a

+         maximum value of 2^32-1 (4294967295 decimal), when it

+         wraps around and starts increasing again from zero.

+

+         Counters have no defined 'initial' value, and thus, a

+         single value of a counter has (in general) no information

+         content.  Discontinuities in the monotonically increasing

+         value normally occur at re-initialization of the

+         management system, and at other times as specified in the

+         description of a schema node using this type.  If such

+         other times can occur, for example, the creation of

+         a schema node of type counter32 at times other than

+         re-initialization, then a corresponding schema node

+         should be defined, with an appropriate type, to indicate

+         the last discontinuity.

+

+         The counter32 type should not be used for configuration

+         schema nodes.  A default statement SHOULD NOT be used in

+         combination with the type counter32.

+

+         In the value set and its semantics, this type is equivalent

+         to the Counter32 type of the SMIv2.";

+       reference

+        "RFC 2578: Structure of Management Information Version 2

+                   (SMIv2)";

+     }

+

+     typedef zero-based-counter32 {

+       type yang:counter32;

+       default "0";

+       description

+        "The zero-based-counter32 type represents a counter32

+         that has the defined 'initial' value zero.

+

+         A schema node of this type will be set to zero (0) on creation

+         and will thereafter increase monotonically until it reaches

+         a maximum value of 2^32-1 (4294967295 decimal), when it

+         wraps around and starts increasing again from zero.

+

+         Provided that an application discovers a new schema node

+         of this type within the minimum time to wrap, it can use the

+         'initial' value as a delta.  It is important for a management

+         station to be aware of this minimum time and the actual time

+         between polls, and to discard data if the actual time is too

+         long or there is no defined minimum time.

+         In the value set and its semantics, this type is equivalent

+         to the ZeroBasedCounter32 textual convention of the SMIv2.";

+       reference

+         "RFC 4502: Remote Network Monitoring Management Information

+                    Base Version 2";

+     }

+

+     typedef counter64 {

+       type uint64;

+       description

+        "The counter64 type represents a non-negative integer

+         that monotonically increases until it reaches a

+         maximum value of 2^64-1 (18446744073709551615 decimal),

+         when it wraps around and starts increasing again from zero.

+

+         Counters have no defined 'initial' value, and thus, a

+         single value of a counter has (in general) no information

+         content.  Discontinuities in the monotonically increasing

+         value normally occur at re-initialization of the

+         management system, and at other times as specified in the

+         description of a schema node using this type.  If such

+         other times can occur, for example, the creation of

+         a schema node of type counter64 at times other than

+         re-initialization, then a corresponding schema node

+         should be defined, with an appropriate type, to indicate

+         the last discontinuity.

+

+         The counter64 type should not be used for configuration

+         schema nodes.  A default statement SHOULD NOT be used in

+         combination with the type counter64.

+

+         In the value set and its semantics, this type is equivalent

+         to the Counter64 type of the SMIv2.";

+       reference

+        "RFC 2578: Structure of Management Information Version 2

+                   (SMIv2)";

+     }

+

+     typedef zero-based-counter64 {

+       type yang:counter64;

+       default "0";

+       description

+        "The zero-based-counter64 type represents a counter64 that

+         has the defined 'initial' value zero.

+         A schema node of this type will be set to zero (0) on creation

+         and will thereafter increase monotonically until it reaches

+         a maximum value of 2^64-1 (18446744073709551615 decimal),

+         when it wraps around and starts increasing again from zero.

+

+         Provided that an application discovers a new schema node

+         of this type within the minimum time to wrap, it can use the

+         'initial' value as a delta.  It is important for a management

+         station to be aware of this minimum time and the actual time

+         between polls, and to discard data if the actual time is too

+         long or there is no defined minimum time.

+

+         In the value set and its semantics, this type is equivalent

+         to the ZeroBasedCounter64 textual convention of the SMIv2.";

+       reference

+        "RFC 2856: Textual Conventions for Additional High Capacity

+                   Data Types";

+     }

+

+     typedef gauge32 {

+       type uint32;

+       description

+        "The gauge32 type represents a non-negative integer, which

+         may increase or decrease, but shall never exceed a maximum

+         value, nor fall below a minimum value.  The maximum value

+         cannot be greater than 2^32-1 (4294967295 decimal), and

+         the minimum value cannot be smaller than 0.  The value of

+         a gauge32 has its maximum value whenever the information

+         being modeled is greater than or equal to its maximum

+         value, and has its minimum value whenever the information

+         being modeled is smaller than or equal to its minimum value.

+         If the information being modeled subsequently decreases

+         below (increases above) the maximum (minimum) value, the

+         gauge32 also decreases (increases).

+

+         In the value set and its semantics, this type is equivalent

+         to the Gauge32 type of the SMIv2.";

+       reference

+        "RFC 2578: Structure of Management Information Version 2

+                   (SMIv2)";

+     }

+

+     typedef gauge64 {

+       type uint64;

+       description

+        "The gauge64 type represents a non-negative integer, which

+         may increase or decrease, but shall never exceed a maximum

+         value, nor fall below a minimum value.  The maximum value

+         cannot be greater than 2^64-1 (18446744073709551615), and

+         the minimum value cannot be smaller than 0.  The value of

+         a gauge64 has its maximum value whenever the information

+         being modeled is greater than or equal to its maximum

+         value, and has its minimum value whenever the information

+         being modeled is smaller than or equal to its minimum value.

+         If the information being modeled subsequently decreases

+         below (increases above) the maximum (minimum) value, the

+         gauge64 also decreases (increases).

+

+         In the value set and its semantics, this type is equivalent

+         to the CounterBasedGauge64 SMIv2 textual convention defined

+         in RFC 2856";

+       reference

+        "RFC 2856: Textual Conventions for Additional High Capacity

+                   Data Types";

+     }

+

+     /*** collection of identifier-related types ***/

+

+     typedef object-identifier {

+       type string {

+         pattern '(([0-1](\.[1-3]?[0-9]))|(2\.(0|([1-9]\d*))))'

+               + '(\.(0|([1-9]\d*)))*';

+       }

+       description

+        "The object-identifier type represents administratively

+         assigned names in a registration-hierarchical-name tree.

+

+         Values of this type are denoted as a sequence of numerical

+         non-negative sub-identifier values.  Each sub-identifier

+         value MUST NOT exceed 2^32-1 (4294967295).  Sub-identifiers

+         are separated by single dots and without any intermediate

+         whitespace.

+

+         The ASN.1 standard restricts the value space of the first

+         sub-identifier to 0, 1, or 2.  Furthermore, the value space

+         of the second sub-identifier is restricted to the range

+         0 to 39 if the first sub-identifier is 0 or 1.  Finally,

+         the ASN.1 standard requires that an object identifier

+         has always at least two sub-identifiers.  The pattern

+         captures these restrictions.

+

+         Although the number of sub-identifiers is not limited,

+         module designers should realize that there may be

+         implementations that stick with the SMIv2 limit of 128

+         sub-identifiers.

+

+         This type is a superset of the SMIv2 OBJECT IDENTIFIER type

+         since it is not restricted to 128 sub-identifiers.  Hence,

+         this type SHOULD NOT be used to represent the SMIv2 OBJECT

+         IDENTIFIER type; the object-identifier-128 type SHOULD be

+         used instead.";

+       reference

+        "ISO9834-1: Information technology -- Open Systems

+         Interconnection -- Procedures for the operation of OSI

+         Registration Authorities: General procedures and top

+         arcs of the ASN.1 Object Identifier tree";

+     }

+

+     typedef object-identifier-128 {

+       type object-identifier {

+         pattern '\d*(\.\d*){1,127}';

+       }

+       description

+        "This type represents object-identifiers restricted to 128

+         sub-identifiers.

+

+         In the value set and its semantics, this type is equivalent

+         to the OBJECT IDENTIFIER type of the SMIv2.";

+       reference

+        "RFC 2578: Structure of Management Information Version 2

+                   (SMIv2)";

+     }

+

+     typedef yang-identifier {

+       type string {

+         length "1..max";

+         pattern '[a-zA-Z_][a-zA-Z0-9\-_.]*';

+         pattern '.|..|[^xX].*|.[^mM].*|..[^lL].*';

+       }

+       description

+         "A YANG identifier string as defined by the 'identifier'

+          rule in Section 12 of RFC 6020.  An identifier must

+          start with an alphabetic character or an underscore

+          followed by an arbitrary sequence of alphabetic or

+          numeric characters, underscores, hyphens, or dots.

+

+          A YANG identifier MUST NOT start with any possible

+          combination of the lowercase or uppercase character

+          sequence 'xml'.";

+       reference

+         "RFC 6020: YANG - A Data Modeling Language for the Network

+                    Configuration Protocol (NETCONF)";

+     }

+

+     /*** collection of types related to date and time***/

+

+     typedef date-and-time {

+       type string {

+         pattern '\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?'

+               + '(Z|[\+\-]\d{2}:\d{2})';

+       }

+       description

+        "The date-and-time type is a profile of the ISO 8601

+         standard for representation of dates and times using the

+         Gregorian calendar.  The profile is defined by the

+         date-time production in Section 5.6 of RFC 3339.

+

+         The date-and-time type is compatible with the dateTime XML

+         schema type with the following notable exceptions:

+

+         (a) The date-and-time type does not allow negative years.

+

+         (b) The date-and-time time-offset -00:00 indicates an unknown

+             time zone (see RFC 3339) while -00:00 and +00:00 and Z

+             all represent the same time zone in dateTime.

+

+         (c) The canonical format (see below) of data-and-time values

+             differs from the canonical format used by the dateTime XML

+             schema type, which requires all times to be in UTC using

+             the time-offset 'Z'.

+

+         This type is not equivalent to the DateAndTime textual

+         convention of the SMIv2 since RFC 3339 uses a different

+         separator between full-date and full-time and provides

+         higher resolution of time-secfrac.

+

+         The canonical format for date-and-time values with a known time

+         zone uses a numeric time zone offset that is calculated using

+         the device's configured known offset to UTC time.  A change of

+         the device's offset to UTC time will cause date-and-time values

+         to change accordingly.  Such changes might happen periodically

+         in case a server follows automatically daylight saving time

+         (DST) time zone offset changes.  The canonical format for

+         date-and-time values with an unknown time zone (usually

+         referring to the notion of local time) uses the time-offset

+         -00:00.";

+       reference

+        "RFC 3339: Date and Time on the Internet: Timestamps

+         RFC 2579: Textual Conventions for SMIv2

+         XSD-TYPES: XML Schema Part 2: Datatypes Second Edition";

+     }

+

+     typedef timeticks {

+       type uint32;

+       description

+        "The timeticks type represents a non-negative integer that

+         represents the time, modulo 2^32 (4294967296 decimal), in

+         hundredths of a second between two epochs.  When a schema

+         node is defined that uses this type, the description of

+         the schema node identifies both of the reference epochs.

+

+         In the value set and its semantics, this type is equivalent

+         to the TimeTicks type of the SMIv2.";

+       reference

+        "RFC 2578: Structure of Management Information Version 2

+                   (SMIv2)";

+     }

+

+     typedef timestamp {

+       type yang:timeticks;

+       description

+        "The timestamp type represents the value of an associated

+         timeticks schema node at which a specific occurrence

+         happened.  The specific occurrence must be defined in the

+         description of any schema node defined using this type.  When

+         the specific occurrence occurred prior to the last time the

+         associated timeticks attribute was zero, then the timestamp

+         value is zero.  Note that this requires all timestamp values

+         to be reset to zero when the value of the associated timeticks

+         attribute reaches 497+ days and wraps around to zero.

+

+         The associated timeticks schema node must be specified

+         in the description of any schema node using this type.

+

+         In the value set and its semantics, this type is equivalent

+         to the TimeStamp textual convention of the SMIv2.";

+       reference

+        "RFC 2579: Textual Conventions for SMIv2";

+     }

+

+     /*** collection of generic address types ***/

+

+     typedef phys-address {

+       type string {

+         pattern '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?';

+       }

+

+       description

+        "Represents media- or physical-level addresses represented

+         as a sequence octets, each octet represented by two hexadecimal

+         numbers.  Octets are separated by colons.  The canonical

+         representation uses lowercase characters.

+

+         In the value set and its semantics, this type is equivalent

+         to the PhysAddress textual convention of the SMIv2.";

+       reference

+        "RFC 2579: Textual Conventions for SMIv2";

+     }

+

+     typedef mac-address {

+       type string {

+         pattern '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}';

+       }

+       description

+        "The mac-address type represents an IEEE 802 MAC address.

+         The canonical representation uses lowercase characters.

+

+         In the value set and its semantics, this type is equivalent

+         to the MacAddress textual convention of the SMIv2.";

+       reference

+        "IEEE 802: IEEE Standard for Local and Metropolitan Area

+                   Networks: Overview and Architecture

+         RFC 2579: Textual Conventions for SMIv2";

+     }

+

+     /*** collection of XML-specific types ***/

+

+     typedef xpath1.0 {

+       type string;

+       description

+        "This type represents an XPATH 1.0 expression.

+

+         When a schema node is defined that uses this type, the

+         description of the schema node MUST specify the XPath

+         context in which the XPath expression is evaluated.";

+       reference

+        "XPATH: XML Path Language (XPath) Version 1.0";

+     }

+

+     /*** collection of string types ***/

+

+     typedef hex-string {

+       type string {

+         pattern '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?';

+       }

+

+       description

+        "A hexadecimal string with octets represented as hex digits

+         separated by colons.  The canonical representation uses

+         lowercase characters.";

+     }

+

+     typedef uuid {

+       type string {

+         pattern '[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-'

+               + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12}';

+       }

+       description

+        "A Universally Unique IDentifier in the string representation

+         defined in RFC 4122.  The canonical representation uses

+         lowercase characters.

+

+         The following is an example of a UUID in string representation:

+         f81d4fae-7dec-11d0-a765-00a0c91e6bf6

+         ";

+       reference

+        "RFC 4122: A Universally Unique IDentifier (UUID) URN

+                   Namespace";

+     }

+

+     typedef dotted-quad {

+       type string {

+         pattern

+           '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}'

+         + '([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])';

+       }

+       description

+         "An unsigned 32-bit number expressed in the dotted-quad

+          notation, i.e., four octets written as decimal numbers

+          and separated with the '.' (full stop) character.";

+     }

+   }
\ No newline at end of file
diff --git a/tools/test/configs/yang/l3vpn-svc-ext@2016-07-30.yang b/tools/test/configs/yang/l3vpn-svc-ext@2016-07-30.yang
new file mode 100644
index 0000000..e3fecb6
--- /dev/null
+++ b/tools/test/configs/yang/l3vpn-svc-ext@2016-07-30.yang
@@ -0,0 +1,362 @@
+module l3vpn-svc-ext {
+    yang-version 1;
+    namespace "urn:ietf:params:xml:ns:yang:l3vpn:svc:ext";
+    prefix "l3vpn-svc-ext";
+
+    import ietf-inet-types { prefix inet;  }
+    import ietf-l3vpn-svc { prefix l3vpn;  }
+
+    revision 2016-07-30 {
+        description
+        "Eliminated warnings";
+    }
+
+    revision "2016-07-20" {
+        description "Initial revision of extended l3vpn yang model";
+    }
+
+    typedef short-as-number {
+        type inet:as-number {
+            range 0..65535;
+        }
+    }
+
+    typedef route-distinguisher {
+        reference "https://tools.ietf.org/html/rfc4364#section-4.2";
+        type union {
+            type rd-ipv4;
+            type rd-as;
+            type rd-as2;
+        }
+    }
+
+    typedef rd-ipv4 {
+        type string {
+            /* IPv4 : 2B number */
+            pattern '((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}'
+                + '([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]))'
+                + ':'
+                + '([0-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|'
+                + '[1-5][0-9][0-9][0-9][0-9]|6[0-4][0-9][0-9][0-9]|'
+                + '65[0-4][0-9][0-9]|655[0-2][0-9]|6553[0-5])';
+        }
+    }
+
+    typedef rd-as {
+        type string {
+            /* 2B AS : 4B number */
+            pattern '([0-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|'
+                + '[1-5][0-9][0-9][0-9][0-9]|6[0-4][0-9][0-9][0-9]|'
+                + '65[0-4][0-9][0-9]|655[0-2][0-9]|6553[0-5])'
+                + ':'
+                + '([0-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|'
+                + '[1-9][0-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9][0-9]|'
+                + '[1-9][0-9][0-9][0-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]|'
+                + '[1-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]|[1-3][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]|'
+                + '4[0-1][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]|42[0-8][0-9][0-9][0-9][0-9][0-9][0-9][0-9]|'
+                + '429[0-3][0-9][0-9][0-9][0-9][0-9][0-9]|4294[0-8][0-9][0-9][0-9][0-9][0-9]|'
+                + '42949[0-5][0-9][0-9][0-9][0-9]|429496[0-6][0-9][0-9][0-9]|4294967[0-1][0-9][0-9]|'
+                + '42949672[0-8][0-9]|429496729[0-5])';
+        }
+    }
+
+    typedef rd-as2 {
+        type string {
+            /* 4B AS : 2B number */
+            pattern '([0-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|'
+                + '[1-9][0-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9][0-9]|'
+                + '[1-9][0-9][0-9][0-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]|'
+                + '[1-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]|[1-3][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]|'
+                + '4[0-1][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]|42[0-8][0-9][0-9][0-9][0-9][0-9][0-9][0-9]|'
+                + '429[0-3][0-9][0-9][0-9][0-9][0-9][0-9]|4294[0-8][0-9][0-9][0-9][0-9][0-9]|'
+                + '42949[0-5][0-9][0-9][0-9][0-9]|429496[0-6][0-9][0-9][0-9]|4294967[0-1][0-9][0-9]|'
+                + '42949672[0-8][0-9]|429496729[0-5])'
+                + ':'
+                + '([0-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|'
+                + '[1-5][0-9][0-9][0-9][0-9]|6[0-4][0-9][0-9][0-9]|'
+                + '65[0-4][0-9][0-9]|655[0-2][0-9]|6553[0-5])';
+        }
+    }
+
+    identity tc-demanded-tunnel {
+        base l3vpn:transport-constraint;
+        description "on-demand tunnel.";
+    }
+
+    grouping class-profile {
+        list qos-class {
+            key class-id;
+            leaf class-id {
+                type string;
+                description
+                 "Identification of the
+                 class of service.
+                 This identifier is internal to
+                 the administration.";
+            }
+            leaf rate-limit {
+                type uint8;
+                units percent;
+                description
+                 "To be used if class must
+                 be rate
+                 limited. Expressed as
+                 percentage of the svc-bw.";
+            }
+            leaf priority-level {
+                type uint8;
+                description
+                 "Defines the level of the
+                 class in
+                 term of priority queueing.
+                 The higher the level is the
+                 higher
+                 is the priority.";
+            }
+            leaf guaranteed-bw-percent {
+                type uint8;
+                units percent;
+                description
+                 "To be used to define the
+                 guaranteed
+                 BW in percent of the svc-bw
+                 available at the priority-level.";
+            }
+            description
+             "List of class of services.";
+        }
+    }
+
+    augment "/l3vpn:l3vpn-svc/l3vpn:sites/l3vpn:site/l3vpn:site-network-accesses/l3vpn:site-network-access/l3vpn:service/l3vpn:qos/l3vpn:qos-profile/l3vpn:qos-profile" {
+        case custom-unicom {
+            container inbound-classes {
+                uses class-profile;
+            }
+            container outbound-classes {
+                uses class-profile;
+            }
+        }
+    }
+
+    grouping bearer-attachment-grouping {
+        container bearer-attachment {
+            leaf pe-name {
+                type string;
+            }
+            leaf pe-mgmt-ip {
+                type inet:ipv4-address;
+            }
+            description "attached PE";
+        }
+    }
+
+    augment "/l3vpn:l3vpn-svc/l3vpn:sites/l3vpn:site/l3vpn:site-network-accesses/l3vpn:site-network-access/l3vpn:bearer" {
+        uses bearer-attachment-grouping;
+    }
+
+    grouping requested-type-grouping {
+        container requested-type-profile {
+            choice requested-type-choice {
+                case dot1q-case {
+                    container dot1q {
+                        leaf physical-if {
+                            description "physical interface name.";
+                            type string;
+                        }
+                        leaf vlan-id {
+                            type uint16 {
+                                range "1..4096";
+                            }
+                        }
+                    }
+                }
+                case physical-case {
+                    container physical {
+                        leaf physical-if {
+                            description "physical interface name.";
+                            type string;
+                        }
+                    }
+                }
+            }
+            leaf circuit-id {
+                description "circuit description for PE-CE port.";
+                type string;
+            }
+        }
+    }
+
+    augment "/l3vpn:l3vpn-svc/l3vpn:sites/l3vpn:site/l3vpn:site-network-accesses/l3vpn:site-network-access/l3vpn:bearer/l3vpn:requested-type" {
+        uses requested-type-grouping;
+    }
+
+    grouping bfd-grouping {
+        leaf bfd-enabled {
+            type boolean;
+            description
+             "BFD activation";
+        }
+        choice holdtime {
+            case profile {
+                leaf profile-name {
+                    type string;
+                    description
+                     "Service provider well
+                     known profile.";
+                }
+                description
+                 "Service provider well
+                 known profile.";
+            }
+            case fixed {
+                leaf fixed-value {
+                    type uint32;
+                    units msec;
+                    description
+                     "Expected holdtime
+                     expressed
+                     in msec.";
+                }
+            }
+            case dynamic {
+                container dynamic-value {
+                    leaf interval {
+                        type uint16;
+                        units msec;
+                        default 500;
+                    }
+                    leaf multiplier {
+                        type uint16;
+                        default 3;
+                    }
+                    description
+                     "interval * multiplier is
+                     timeout value.";
+                }
+            }
+        }
+    }
+
+    grouping bgp-profile {
+        leaf as-override {
+            type boolean;
+            default false;
+        }
+        container soo {
+            leaf soo-enabled {
+                type boolean;
+            }
+            leaf soo-value {
+                type string;
+            }
+        }
+        container password {
+            leaf password-enabled {
+                type boolean;
+            }
+            leaf password-value {
+                type string;
+            }
+        }
+        container bgp-timer {
+            leaf keep-alive {
+                type uint16;
+                default 60;
+                units "seconds";
+            }
+            leaf hold-time {
+                type uint16;
+                default 180;
+                units "seconds";
+            }
+        }
+        container bfd {
+            uses bfd-grouping;
+        }
+    }
+
+    augment "/l3vpn:l3vpn-svc/l3vpn:sites/l3vpn:site/l3vpn:site-network-accesses/l3vpn:site-network-access/l3vpn:routing-protocols/l3vpn:routing-protocol/l3vpn:bgp" {
+        uses bgp-profile;
+    }
+
+    augment "/l3vpn:l3vpn-svc/l3vpn:vpn-services/l3vpn:vpn-svc/l3vpn:transport-constraints/l3vpn:unicast-transport-constraints/l3vpn:constraint/l3vpn:constraint-list" {
+        leaf constraint-opaque-value2 {
+            type string;
+            description
+             "Opaque value that can be used to
+             specify constraint parameters.";
+        }
+    }
+
+    grouping route-ipv4-extended-community {
+        reference "http://tools.ietf.org/html/rfc4360";
+        leaf global-administrator {
+            type inet:ipv4-address;
+        }
+        leaf local-administrator {
+            type uint16;
+        }
+    }
+
+    grouping extended-community {
+        choice extended-community {
+            reference "http://tools.ietf.org/html/rfc4360#section-4";
+            default route-target-extended-community-case;
+            case route-target-extended-community-case {
+                container route-target-extended-community {
+                    leaf global-administrator {
+                        type short-as-number;
+                    }
+                    leaf local-administrator {
+                        type uint32;
+                    }
+                }
+            }
+            case route-target-ipv4-case {
+                container route-target-ipv4 {
+                    uses route-ipv4-extended-community;
+                }
+            }
+            case route-target-extended-community-case2 {
+                container route-target-extended-community2 {
+                    leaf global-administrator {
+                        type uint32;
+                    }
+                    leaf local-administrator {
+                        type uint16;
+                    }
+                }
+            }
+        }
+    }
+
+    grouping rdrt-profile {
+        choice site-role {
+            case custom-case {
+                container custom {
+                    list import-rt {
+                        key imrt-id;
+                        leaf imrt-id {
+                          type string;
+                        }
+                        uses extended-community;
+                    }
+                    list export-rt {
+                        key exrt-id;
+                        leaf exrt-id {
+                          type string;
+                        }
+                        uses extended-community;
+                    }
+                    leaf rd {
+                        type route-distinguisher;
+                    }
+                }
+            }
+        }
+    }
+
+    augment "/l3vpn:l3vpn-svc/l3vpn:sites/l3vpn:site/l3vpn:site-network-accesses/l3vpn:site-network-access/l3vpn:vpn-attachment" {
+        uses rdrt-profile;
+    }
+}
\ No newline at end of file
diff --git a/tools/test/scenarios/yang-live-compile.xml b/tools/test/scenarios/yang-live-compile.xml
index 5aebcda..89d7eb3 100644
--- a/tools/test/scenarios/yang-live-compile.xml
+++ b/tools/test/scenarios/yang-live-compile.xml
@@ -19,7 +19,7 @@
         <step name="Pre-Cleanup-YANG-Model" exec="onos ${OC1} app uninstall l3vpn" env="~"/>
         <step name="Check-YANG-Runtime" exec="onos-check-apps ${OC1} drivers,yang includes"
               requires="Activate-YANG-Runtime"/>
-        <step name="Compile-YANG-Model" exec="onos-compile-yang ${OC1} ${ONOS_ROOT}/models/l3vpn"
+        <step name="Compile-YANG-Model" exec="onos-compile-yang ${OC1} ${ONOS_ROOT}/tools/test/config/yang"
               requires="Check-YANG-Runtime,Pre-Cleanup-YANG-Model"/>
         <step name="Verify-YANG-Models" exec="onos ${OC1} models | grep l3vpn"
               requires="Compile-YANG-Model"/>