diff --git a/.gitignore b/.gitignore index 90eeacd9c..c7d22d911 100644 --- a/.gitignore +++ b/.gitignore @@ -48,3 +48,4 @@ test/scripts *.sublime-workspace sdk/python/core/dist sdk/python/core/ydk.egg-info +yang/xr-config-models/ diff --git a/sdk/cpp/core/tests/models/iana-crypt-hash.yang b/sdk/cpp/core/tests/models/iana-crypt-hash.yang deleted file mode 100644 index 3471df449..000000000 --- a/sdk/cpp/core/tests/models/iana-crypt-hash.yang +++ /dev/null @@ -1,127 +0,0 @@ -module iana-crypt-hash { - namespace "urn:ietf:params:xml:ns:yang:iana-crypt-hash"; - prefix ianach; - - organization "IANA"; - contact - " Internet Assigned Numbers Authority - - Postal: ICANN - 12025 Waterfront Drive, Suite 300 - Los Angeles, CA 90094-2536 - United States - - Tel: +1 310 301 5800 - E-Mail: iana@iana.org>"; - description - "This YANG module defines a type for storing passwords - using a hash function and features to indicate which hash - functions are supported by an implementation. - - The latest revision of this YANG module can be obtained from - the IANA web site. - - Requests for new values should be made to IANA via - email (iana@iana.org). - - 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). - - The initial version of this YANG module is part of RFC 7317; - see the RFC itself for full legal notices."; - - revision 2014-08-06 { - description - "Initial revision."; - reference - "RFC 7317: A YANG Data Model for System Management"; - } - - typedef crypt-hash { - type string { - pattern - '$0$.*' - + '|$1$[a-zA-Z0-9./]{1,8}$[a-zA-Z0-9./]{22}' - + '|$5$(rounds=\d+$)?[a-zA-Z0-9./]{1,16}$[a-zA-Z0-9./]{43}' - + '|$6$(rounds=\d+$)?[a-zA-Z0-9./]{1,16}$[a-zA-Z0-9./]{86}'; - } - description - "The crypt-hash type is used to store passwords using - a hash function. The algorithms for applying the hash - function and encoding the result are implemented in - various UNIX systems as the function crypt(3). - - A value of this type matches one of the forms: - - $0$ - $$$ - $$$$ - - The '$0$' prefix signals that the value is clear text. When - such a value is received by the server, a hash value is - calculated, and the string '$$$' or - $$$$ is prepended to the result. This - value is stored in the configuration data store. - If a value starting with '$$', where is not '0', is - received, the server knows that the value already represents a - hashed value and stores it 'as is' in the data store. - - When a server needs to verify a password given by a user, it - finds the stored password hash string for that user, extracts - the salt, and calculates the hash with the salt and given - password as input. If the calculated hash value is the same - as the stored value, the password given by the client is - accepted. - - This type defines the following hash functions: - - id | hash function | feature - ---+---------------+------------------- - 1 | MD5 | crypt-hash-md5 - 5 | SHA-256 | crypt-hash-sha-256 - 6 | SHA-512 | crypt-hash-sha-512 - - The server indicates support for the different hash functions - by advertising the corresponding feature."; - reference - "IEEE Std 1003.1-2008 - crypt() function - RFC 1321: The MD5 Message-Digest Algorithm - FIPS.180-4.2012: Secure Hash Standard (SHS)"; - } - - feature crypt-hash-md5 { - description - "Indicates that the device supports the MD5 - hash function in 'crypt-hash' values."; - reference "RFC 1321: The MD5 Message-Digest Algorithm"; - } - - feature crypt-hash-sha-256 { - description - "Indicates that the device supports the SHA-256 - hash function in 'crypt-hash' values."; - reference "FIPS.180-4.2012: Secure Hash Standard (SHS)"; - } - - - - - - - - - feature crypt-hash-sha-512 { - description - "Indicates that the device supports the SHA-512 - hash function in 'crypt-hash' values."; - reference "FIPS.180-4.2012: Secure Hash Standard (SHS)"; - } - -} diff --git a/sdk/cpp/core/tests/models/ietf-inet-types.yang b/sdk/cpp/core/tests/models/ietf-inet-types.yang deleted file mode 100644 index 5388b0393..000000000 --- a/sdk/cpp/core/tests/models/ietf-inet-types.yang +++ /dev/null @@ -1,461 +0,0 @@ -module ietf-inet-types { - - namespace "urn:ietf:params:xml:ns:yang:ietf-inet-types"; - prefix "inet"; - - organization - "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; - - contact - "WG Web: - WG List: - - WG Chair: David Kessens - - - WG Chair: Juergen Schoenwaelder - - - Editor: Juergen Schoenwaelder - "; - - 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"; - } - - /*** collection of types related to protocol fields ***/ - - 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 . - - 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"; - } - - /*** collection of types related to autonomous systems ***/ - - 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"; - } - - /*** collection of types related to IP addresses and hostnames ***/ - - typedef ip-address { - type union { - type inet:ipv4-address; - type inet: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 inet:ipv4-address-no-zone; - type inet: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 inet: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 inet: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 inet:ipv4-prefix; - type inet: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"; - } - - /*** collection of domain name and URI types ***/ - - typedef domain-name { - type string { - 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]\.?)' - + '|\.'; - length "1..253"; - } - 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 inet:ip-address; - type inet: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)"; - } - -} diff --git a/sdk/cpp/core/tests/models/ietf-interfaces.yang b/sdk/cpp/core/tests/models/ietf-interfaces.yang deleted file mode 100644 index ad64425f7..000000000 --- a/sdk/cpp/core/tests/models/ietf-interfaces.yang +++ /dev/null @@ -1,725 +0,0 @@ -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: - WG List: - - WG Chair: Thomas Nadeau - - - WG Chair: Juergen Schoenwaelder - - - Editor: Martin Bjorklund - "; - - 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: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: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 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 - /interfaces-state/interface list. If the configuration - of a 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 to use some - mechanism to handle the differences in size and 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"; - } - } - } - } -} diff --git a/sdk/cpp/core/tests/models/ietf-netconf-acm.yang b/sdk/cpp/core/tests/models/ietf-netconf-acm.yang deleted file mode 100644 index 19ab8345f..000000000 --- a/sdk/cpp/core/tests/models/ietf-netconf-acm.yang +++ /dev/null @@ -1,449 +0,0 @@ -module ietf-netconf-acm { - - namespace "urn:ietf:params:xml:ns:yang:ietf-netconf-acm"; - - prefix "nacm"; - - import ietf-yang-types { - prefix yang; - } - - organization - "IETF NETCONF (Network Configuration) Working Group"; - - contact - "WG Web: - WG List: - - WG Chair: Mehmet Ersue - - - WG Chair: Bert Wijnen - - - Editor: Andy Bierman - - - Editor: Martin Bjorklund - "; - - description - "NETCONF Access Control Model. - - Copyright (c) 2012 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 6536; see - the RFC itself for full legal notices."; - - revision "2012-02-22" { - description - "Initial version"; - reference - "RFC 6536: Network Configuration Protocol (NETCONF) - Access Control Model"; - } - - /* - * Extension statements - */ - - extension default-deny-write { - description - "Used to indicate that the data model node - represents a sensitive security system parameter. - - If present, and the NACM module is enabled (i.e., - /nacm/enable-nacm object equals 'true'), the NETCONF server - will only allow the designated 'recovery session' to have - write access to the node. An explicit access control rule is - required for all other users. - - The 'default-deny-write' extension MAY appear within a data - definition statement. It is ignored otherwise."; - } - - extension default-deny-all { - description - "Used to indicate that the data model node - controls a very sensitive security system parameter. - - If present, and the NACM module is enabled (i.e., - /nacm/enable-nacm object equals 'true'), the NETCONF server - will only allow the designated 'recovery session' to have - read, write, or execute access to the node. An explicit - access control rule is required for all other users. - - The 'default-deny-all' extension MAY appear within a data - definition statement, 'rpc' statement, or 'notification' - statement. It is ignored otherwise."; - } - - /* - * Derived types - */ - - typedef user-name-type { - type string { - length "1..max"; - } - description - "General Purpose Username string."; - } - - typedef matchall-string-type { - type string { - pattern '\*'; - } - description - "The string containing a single asterisk '*' is used - to conceptually represent all possible values - for the particular leaf using this data type."; - } - - typedef access-operations-type { - type bits { - bit create { - description - "Any protocol operation that creates a - new data node."; - } - bit read { - description - "Any protocol operation or notification that - returns the value of a data node."; - } - bit update { - description - "Any protocol operation that alters an existing - data node."; - } - bit delete { - description - "Any protocol operation that removes a data node."; - } - bit exec { - description - "Execution access to the specified protocol operation."; - } - } - description - "NETCONF Access Operation."; - } - - typedef group-name-type { - type string { - length "1..max"; - pattern '[^\*].*'; - } - description - "Name of administrative group to which - users can be assigned."; - } - - typedef action-type { - type enumeration { - enum permit { - description - "Requested action is permitted."; - } - enum deny { - description - "Requested action is denied."; - } - } - description - "Action taken by the server when a particular - rule matches."; - } - - typedef node-instance-identifier { - type yang:xpath1.0; - description - "Path expression used to represent a special - data node instance identifier string. - - A node-instance-identifier value is an - unrestricted YANG instance-identifier expression. - All the same rules as an instance-identifier apply - except predicates for keys are optional. If a key - predicate is missing, then the node-instance-identifier - represents all possible server instances for that key. - - This XPath expression is evaluated in the following context: - - o The set of namespace declarations are those in scope on - the leaf element where this type is used. - - o The set of variable bindings contains one variable, - 'USER', which contains the name of the user of the current - session. - - o The function library is the core function library, but - note that due to the syntax restrictions of an - instance-identifier, no functions are allowed. - - o The context node is the root node in the data tree."; - } - - /* - * Data definition statements - */ - - container nacm { - nacm:default-deny-all; - - description - "Parameters for NETCONF Access Control Model."; - - leaf enable-nacm { - type boolean; - default true; - description - "Enables or disables all NETCONF access control - enforcement. If 'true', then enforcement - is enabled. If 'false', then enforcement - is disabled."; - } - - leaf read-default { - type action-type; - default "permit"; - description - "Controls whether read access is granted if - no appropriate rule is found for a - particular read request."; - } - - leaf write-default { - type action-type; - default "deny"; - description - "Controls whether create, update, or delete access - is granted if no appropriate rule is found for a - particular write request."; - } - - leaf exec-default { - type action-type; - default "permit"; - description - "Controls whether exec access is granted if no appropriate - rule is found for a particular protocol operation request."; - } - - leaf enable-external-groups { - type boolean; - default true; - description - "Controls whether the server uses the groups reported by the - NETCONF transport layer when it assigns the user to a set of - NACM groups. If this leaf has the value 'false', any group - names reported by the transport layer are ignored by the - server."; - } - - leaf denied-operations { - type yang:zero-based-counter32; - config false; - mandatory true; - description - "Number of times since the server last restarted that a - protocol operation request was denied."; - } - - leaf denied-data-writes { - type yang:zero-based-counter32; - config false; - mandatory true; - description - "Number of times since the server last restarted that a - protocol operation request to alter - a configuration datastore was denied."; - } - - leaf denied-notifications { - type yang:zero-based-counter32; - config false; - mandatory true; - description - "Number of times since the server last restarted that - a notification was dropped for a subscription because - access to the event type was denied."; - } - - container groups { - description - "NETCONF Access Control Groups."; - - list group { - key name; - - description - "One NACM Group Entry. This list will only contain - configured entries, not any entries learned from - any transport protocols."; - - leaf name { - type group-name-type; - description - "Group name associated with this entry."; - } - - leaf-list user-name { - type user-name-type; - description - "Each entry identifies the username of - a member of the group associated with - this entry."; - } - } - } - - list rule-list { - key "name"; - ordered-by user; - description - "An ordered collection of access control rules."; - - leaf name { - type string { - length "1..max"; - } - description - "Arbitrary name assigned to the rule-list."; - } - leaf-list group { - type union { - type matchall-string-type; - type group-name-type; - } - description - "List of administrative groups that will be - assigned the associated access rights - defined by the 'rule' list. - - The string '*' indicates that all groups apply to the - entry."; - } - - list rule { - key "name"; - ordered-by user; - description - "One access control rule. - - Rules are processed in user-defined order until a match is - found. A rule matches if 'module-name', 'rule-type', and - 'access-operations' match the request. If a rule - matches, the 'action' leaf determines if access is granted - or not."; - - leaf name { - type string { - length "1..max"; - } - description - "Arbitrary name assigned to the rule."; - } - - leaf module-name { - type union { - type matchall-string-type; - type string; - } - default "*"; - description - "Name of the module associated with this rule. - - This leaf matches if it has the value '*' or if the - object being accessed is defined in the module with the - specified module name."; - } - choice rule-type { - description - "This choice matches if all leafs present in the rule - match the request. If no leafs are present, the - choice matches all requests."; - case protocol-operation { - leaf rpc-name { - type union { - type matchall-string-type; - type string; - } - description - "This leaf matches if it has the value '*' or if - its value equals the requested protocol operation - name."; - } - } - case notification { - leaf notification-name { - type union { - type matchall-string-type; - type string; - } - description - "This leaf matches if it has the value '*' or if its - value equals the requested notification name."; - } - } - case data-node { - leaf path { - type node-instance-identifier; - mandatory true; - description - "Data Node Instance Identifier associated with the - data node controlled by this rule. - - Configuration data or state data instance - identifiers start with a top-level data node. A - complete instance identifier is required for this - type of path value. - - The special value '/' refers to all possible - datastore contents."; - } - } - } - - leaf access-operations { - type union { - type matchall-string-type; - type access-operations-type; - } - default "*"; - description - "Access operations associated with this rule. - - This leaf matches if it has the value '*' or if the - bit corresponding to the requested operation is set."; - } - - leaf action { - type action-type; - mandatory true; - description - "The access control action associated with the - rule. If a rule is determined to match a - particular request, then this object is used - to determine whether to permit or deny the - request."; - } - - leaf comment { - type string; - description - "A textual description of the access rule."; - } - } - } - } -} diff --git a/sdk/cpp/core/tests/models/ietf-netconf-monitoring.yang b/sdk/cpp/core/tests/models/ietf-netconf-monitoring.yang deleted file mode 100644 index c789125bb..000000000 --- a/sdk/cpp/core/tests/models/ietf-netconf-monitoring.yang +++ /dev/null @@ -1,566 +0,0 @@ -module ietf-netconf-monitoring { - - namespace "urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring"; - prefix "ncm"; - - import ietf-yang-types { prefix yang; } - import ietf-inet-types { prefix inet; } - - organization - "IETF NETCONF (Network Configuration) Working Group"; - - contact - "WG Web: - WG List: - - WG Chair: Mehmet Ersue - - - WG Chair: Bert Wijnen - - - Editor: Mark Scott - - - Editor: Martin Bjorklund - "; - - description - "NETCONF Monitoring Module. - All elements in this module are read-only. - - Copyright (c) 2010 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 6022; see - the RFC itself for full legal notices."; - - revision 2010-10-04 { - description - "Initial revision."; - reference - "RFC 6022: YANG Module for NETCONF Monitoring"; - } - - typedef netconf-datastore-type { - type enumeration { - enum running; - enum candidate; - enum startup; - } - description - "Enumeration of possible NETCONF datastore types."; - reference - "RFC 4741: NETCONF Configuration Protocol"; - } - - identity transport { - description - "Base identity for NETCONF transport types."; - } - - identity netconf-ssh { - base transport; - description - "NETCONF over Secure Shell (SSH)."; - reference - "RFC 4742: Using the NETCONF Configuration Protocol - over Secure SHell (SSH)"; - } - - identity netconf-soap-over-beep { - base transport; - description - "NETCONF over Simple Object Access Protocol (SOAP) over - Blocks Extensible Exchange Protocol (BEEP)."; - - reference - "RFC 4743: Using NETCONF over the Simple Object - Access Protocol (SOAP)"; - } - - identity netconf-soap-over-https { - base transport; - description - "NETCONF over Simple Object Access Protocol (SOAP) - over Hypertext Transfer Protocol Secure (HTTPS)."; - reference - "RFC 4743: Using NETCONF over the Simple Object - Access Protocol (SOAP)"; - } - - identity netconf-beep { - base transport; - description - "NETCONF over Blocks Extensible Exchange Protocol (BEEP)."; - reference - "RFC 4744: Using the NETCONF Protocol over the - Blocks Extensible Exchange Protocol (BEEP)"; - } - - identity netconf-tls { - base transport; - description - "NETCONF over Transport Layer Security (TLS)."; - reference - "RFC 5539: NETCONF over Transport Layer Security (TLS)"; - } - - identity schema-format { - description - "Base identity for data model schema languages."; - } - - identity xsd { - base schema-format; - description - "W3C XML Schema Definition."; - reference - "W3C REC REC-xmlschema-1-20041028: - XML Schema Part 1: Structures"; - } - - identity yang { - base schema-format; - description - "The YANG data modeling language for NETCONF."; - reference - "RFC 6020: YANG - A Data Modeling Language for the - Network Configuration Protocol (NETCONF)"; - } - - identity yin { - base schema-format; - description - "The YIN syntax for YANG."; - reference - "RFC 6020: YANG - A Data Modeling Language for the - Network Configuration Protocol (NETCONF)"; - } - - identity rng { - base schema-format; - description - "Regular Language for XML Next Generation (RELAX NG)."; - reference - "ISO/IEC 19757-2:2008: RELAX NG"; - } - - identity rnc { - base schema-format; - description - "Relax NG Compact Syntax"; - reference - "ISO/IEC 19757-2:2008: RELAX NG"; - } - - grouping common-counters { - description - "Counters that exist both per session, and also globally, - accumulated from all sessions."; - - leaf in-rpcs { - type yang:zero-based-counter32; - description - "Number of correct messages received."; - } - leaf in-bad-rpcs { - type yang:zero-based-counter32; - - description - "Number of messages received when an message was expected, - that were not correct messages. This includes XML parse - errors and errors on the rpc layer."; - } - leaf out-rpc-errors { - type yang:zero-based-counter32; - description - "Number of messages sent that contained an - element."; - } - leaf out-notifications { - type yang:zero-based-counter32; - description - "Number of messages sent."; - } - } - - container netconf-state { - config false; - description - "The netconf-state container is the root of the monitoring - data model."; - - container capabilities { - description - "Contains the list of NETCONF capabilities supported by the - server."; - - leaf-list capability { - type inet:uri; - description - "List of NETCONF capabilities supported by the server."; - } - } - - container datastores { - description - "Contains the list of NETCONF configuration datastores."; - - list datastore { - key name; - description - "List of NETCONF configuration datastores supported by - the NETCONF server and related information."; - - leaf name { - type netconf-datastore-type; - - description - "Name of the datastore associated with this list entry."; - } - container locks { - presence - "This container is present only if the datastore - is locked."; - description - "The NETCONF and operations allow - a client to lock specific resources in a datastore. The - NETCONF server will prevent changes to the locked - resources by all sessions except the one that acquired - the lock(s). - - Monitoring information is provided for each datastore - entry including details such as the session that acquired - the lock, the type of lock (global or partial) and the - list of locked resources. Multiple locks per datastore - are supported."; - - grouping lock-info { - description - "Lock related parameters, common to both global and - partial locks."; - - leaf locked-by-session { - type uint32; - mandatory true; - description - "The session ID of the session that has locked - this resource. Both a global lock and a partial - lock MUST contain the NETCONF session-id. - - If the lock is held by a session that is not managed - by the NETCONF server (e.g., a CLI session), a session - id of 0 (zero) is reported."; - reference - "RFC 4741: NETCONF Configuration Protocol"; - } - leaf locked-time { - type yang:date-and-time; - mandatory true; - description - "The date and time of when the resource was - locked."; - } - } - - choice lock-type { - description - "Indicates if a global lock or a set of partial locks - are set."; - - container global-lock { - description - "Present if the global lock is set."; - uses lock-info; - } - - list partial-lock { - key lock-id; - description - "List of partial locks."; - reference - "RFC 5717: Partial Lock Remote Procedure Call (RPC) for - NETCONF"; - - leaf lock-id { - type uint32; - description - "This is the lock id returned in the - response."; - } - uses lock-info; - leaf-list select { - type yang:xpath1.0; - min-elements 1; - description - "The xpath expression that was used to request - the lock. The select expression indicates the - original intended scope of the lock."; - } - leaf-list locked-node { - type instance-identifier; - description - "The list of instance-identifiers (i.e., the - locked nodes). - - The scope of the partial lock is defined by the list - of locked nodes."; - } - } - } - } - } - } - - container schemas { - description - "Contains the list of data model schemas supported by the - server."; - - list schema { - key "identifier version format"; - - description - "List of data model schemas supported by the server."; - - leaf identifier { - type string; - description - "Identifier to uniquely reference the schema. The - identifier is used in the operation and may - be used for other purposes such as file retrieval. - - For modeling languages that support or require a data - model name (e.g., YANG module name) the identifier MUST - match that name. For YANG data models, the identifier is - the name of the module or submodule. In other cases, an - identifier such as a filename MAY be used instead."; - } - leaf version { - type string; - description - "Version of the schema supported. Multiple versions MAY be - supported simultaneously by a NETCONF server. Each - version MUST be reported individually in the schema list, - i.e., with same identifier, possibly different location, - but different version. - - For YANG data models, version is the value of the most - recent YANG 'revision' statement in the module or - submodule, or the empty string if no 'revision' statement - is present."; - } - leaf format { - type identityref { - base schema-format; - } - description - "The data modeling language the schema is written - in (currently xsd, yang, yin, rng, or rnc). - - For YANG data models, 'yang' format MUST be supported and - 'yin' format MAY also be provided."; - } - leaf namespace { - type inet:uri; - mandatory true; - description - "The XML namespace defined by the data model. - - For YANG data models, this is the module's namespace. - If the list entry describes a submodule, this field - contains the namespace of the module to which the - submodule belongs."; - } - leaf-list location { - type union { - type enumeration { - enum "NETCONF"; - } - type inet:uri; - } - description - "One or more locations from which the schema can be - retrieved. This list SHOULD contain at least one - entry per schema. - - A schema entry may be located on a remote file system - (e.g., reference to file system for ftp retrieval) or - retrieved directly from a server supporting the - operation (denoted by the value 'NETCONF')."; - } - } - } - - container sessions { - description - "The sessions container includes session-specific data for - NETCONF management sessions. The session list MUST include - all currently active NETCONF sessions."; - - list session { - key session-id; - description - "All NETCONF sessions managed by the NETCONF server - MUST be reported in this list."; - - leaf session-id { - type uint32 { - range "1..max"; - } - description - "Unique identifier for the session. This value is the - NETCONF session identifier, as defined in RFC 4741."; - reference - "RFC 4741: NETCONF Configuration Protocol"; - } - leaf transport { - type identityref { - base transport; - } - mandatory true; - description - "Identifies the transport for each session, e.g., - 'netconf-ssh', 'netconf-soap', etc."; - } - leaf username { - type string; - mandatory true; - description - "The username is the client identity that was authenticated - by the NETCONF transport protocol. The algorithm used to - derive the username is NETCONF transport protocol specific - and in addition specific to the authentication mechanism - used by the NETCONF transport protocol."; - } - leaf source-host { - type inet:host; - description - "Host identifier of the NETCONF client. The value - returned is implementation specific (e.g., hostname, - IPv4 address, IPv6 address)"; - } - - leaf login-time { - type yang:date-and-time; - mandatory true; - description - "Time at the server at which the session was established."; - } - uses common-counters { - description - "Per-session counters. Zero based with following reset - behaviour: - - at start of a session - - when max value is reached"; - } - } - } - - container statistics { - description - "Statistical data pertaining to the NETCONF server."; - - leaf netconf-start-time { - type yang:date-and-time; - description - "Date and time at which the management subsystem was - started."; - } - leaf in-bad-hellos { - type yang:zero-based-counter32; - description - "Number of sessions silently dropped because an - invalid message was received. This includes - messages with a 'session-id' attribute, bad namespace, and - bad capability declarations."; - } - leaf in-sessions { - type yang:zero-based-counter32; - description - "Number of sessions started. This counter is incremented - when a message with a is sent. - - 'in-sessions' - 'in-bad-hellos' = - 'number of correctly started netconf sessions'"; - } - leaf dropped-sessions { - type yang:zero-based-counter32; - - description - "Number of sessions that were abnormally terminated, e.g., - due to idle timeout or transport close. This counter is not - incremented when a session is properly closed by a - operation, or killed by a - operation."; - } - uses common-counters { - description - "Global counters, accumulated from all sessions. - Zero based with following reset behaviour: - - re-initialization of NETCONF server - - when max value is reached"; - } - } - } - - rpc get-schema { - description - "This operation is used to retrieve a schema from the - NETCONF server. - - Positive Response: - The NETCONF server returns the requested schema. - - Negative Response: - If requested schema does not exist, the is - 'invalid-value'. - - If more than one schema matches the requested parameters, the - is 'operation-failed', and is - 'data-not-unique'."; - - input { - leaf identifier { - type string; - mandatory true; - description - "Identifier for the schema list entry."; - } - leaf version { - type string; - description - "Version of the schema requested. If this parameter is not - present, and more than one version of the schema exists on - the server, a 'data-not-unique' error is returned, as - described above."; - } - - leaf format { - type identityref { - base schema-format; - } - description - "The data modeling language of the schema. If this - parameter is not present, and more than one formats of - the schema exists on the server, a 'data-not-unique' error - is returned, as described above."; - } - } - output { - anyxml data { - description - "Contains the schema content."; - } - } - } -} diff --git a/sdk/cpp/core/tests/models/ietf-netconf-notifications.yang b/sdk/cpp/core/tests/models/ietf-netconf-notifications.yang deleted file mode 100644 index a9083b2c6..000000000 --- a/sdk/cpp/core/tests/models/ietf-netconf-notifications.yang +++ /dev/null @@ -1,334 +0,0 @@ -module ietf-netconf-notifications { - - namespace - "urn:ietf:params:xml:ns:yang:ietf-netconf-notifications"; - - prefix ncn; - - import ietf-inet-types { prefix inet; } - import ietf-netconf { prefix nc; } - - organization - "IETF NETCONF (Network Configuration Protocol) Working Group"; - - contact - "WG Web: - WG List: - - WG Chair: Bert Wijnen - - - WG Chair: Mehmet Ersue - - - Editor: Andy Bierman - "; - - description - "This module defines a YANG data model for use with the - NETCONF protocol that allows the NETCONF client to - receive common NETCONF base event notifications. - - Copyright (c) 2012 IETF Trust and the persons identified as - the document authors. 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 6470; see - the RFC itself for full legal notices."; - - revision "2012-02-06" { - description - "Initial version."; - reference - "RFC 6470: NETCONF Base Notifications"; - } - - grouping common-session-parms { - description - "Common session parameters to identify a - management session."; - - leaf username { - type string; - mandatory true; - description - "Name of the user for the session."; - } - - leaf session-id { - type nc:session-id-or-zero-type; - mandatory true; - description - "Identifier of the session. - A NETCONF session MUST be identified by a non-zero value. - A non-NETCONF session MAY be identified by the value zero."; - } - - leaf source-host { - type inet:ip-address; - description - "Address of the remote host for the session."; - } - } - - grouping changed-by-parms { - description - "Common parameters to identify the source - of a change event, such as a configuration - or capability change."; - - container changed-by { - description - "Indicates the source of the change. - If caused by internal action, then the - empty leaf 'server' will be present. - If caused by a management session, then - the name, remote host address, and session ID - of the session that made the change will be reported."; - choice server-or-user { - mandatory true; - leaf server { - type empty; - description - "If present, the change was caused - by the server."; - } - - case by-user { - uses common-session-parms; - } - } // choice server-or-user - } // container changed-by-parms - } - - notification netconf-config-change { - description - "Generated when the NETCONF server detects that the - or configuration datastore - has been changed by a management session. - The notification summarizes the edits that - have been detected. - - The server MAY choose to also generate this - notification while loading a datastore during the - boot process for the device."; - - uses changed-by-parms; - - leaf datastore { - type enumeration { - enum running { - description "The datastore has changed."; - } - enum startup { - description "The datastore has changed"; - } - } - default "running"; - description - "Indicates which configuration datastore has changed."; - } - - list edit { - description - "An edit record SHOULD be present for each distinct - edit operation that the server has detected on - the target datastore. This list MAY be omitted - if the detailed edit operations are not known. - The server MAY report entries in this list for - changes not made by a NETCONF session (e.g., CLI)."; - - leaf target { - type instance-identifier; - description - "Topmost node associated with the configuration change. - A server SHOULD set this object to the node within - the datastore that is being altered. A server MAY - set this object to one of the ancestors of the actual - node that was changed, or omit this object, if the - exact node is not known."; - } - - leaf operation { - type nc:edit-operation-type; - description - "Type of edit operation performed. - A server MUST set this object to the NETCONF edit - operation performed on the target datastore."; - } - } // list edit - } // notification netconf-config-change - - notification netconf-capability-change { - description - "Generated when the NETCONF server detects that - the server capabilities have changed. - Indicates which capabilities have been added, deleted, - and/or modified. The manner in which a server - capability is changed is outside the scope of this - document."; - - uses changed-by-parms; - - leaf-list added-capability { - type inet:uri; - description - "List of capabilities that have just been added."; - } - - leaf-list deleted-capability { - type inet:uri; - description - "List of capabilities that have just been deleted."; - } - - leaf-list modified-capability { - type inet:uri; - description - "List of capabilities that have just been modified. - A capability is considered to be modified if the - base URI for the capability has not changed, but - one or more of the parameters encoded at the end of - the capability URI have changed. - The new modified value of the complete URI is returned."; - } - } // notification netconf-capability-change - - notification netconf-session-start { - description - "Generated when a NETCONF server detects that a - NETCONF session has started. A server MAY generate - this event for non-NETCONF management sessions. - Indicates the identity of the user that started - the session."; - uses common-session-parms; - } // notification netconf-session-start - - notification netconf-session-end { - description - "Generated when a NETCONF server detects that a - NETCONF session has terminated. - A server MAY optionally generate this event for - non-NETCONF management sessions. Indicates the - identity of the user that owned the session, - and why the session was terminated."; - - uses common-session-parms; - - leaf killed-by { - when "../termination-reason = 'killed'"; - type nc:session-id-type; - description - "The ID of the session that directly caused this session - to be abnormally terminated. If this session was abnormally - terminated by a non-NETCONF session unknown to the server, - then this leaf will not be present."; - } - - leaf termination-reason { - type enumeration { - enum "closed" { - description - "The session was terminated by the client in normal - fashion, e.g., by the NETCONF - protocol operation."; - } - enum "killed" { - description - "The session was terminated in abnormal - fashion, e.g., by the NETCONF - protocol operation."; - } - enum "dropped" { - description - "The session was terminated because the transport layer - connection was unexpectedly closed."; - } - enum "timeout" { - description - "The session was terminated because of inactivity, - e.g., waiting for the message or - messages."; - } - enum "bad-hello" { - description - "The client's message was invalid."; - } - enum "other" { - description - "The session was terminated for some other reason."; - } - } - mandatory true; - description - "Reason the session was terminated."; - } - } // notification netconf-session-end - - notification netconf-confirmed-commit { - description - "Generated when a NETCONF server detects that a - confirmed-commit event has occurred. Indicates the event - and the current state of the confirmed-commit procedure - in progress."; - reference - "RFC 6241, Section 8.4"; - - uses common-session-parms { - when "confirm-event != 'timeout'"; - } - - leaf confirm-event { - type enumeration { - enum "start" { - description - "The confirmed-commit procedure has started."; - } - enum "cancel" { - description - "The confirmed-commit procedure has been canceled, - e.g., due to the session being terminated, or an - explicit operation."; - } - enum "timeout" { - description - "The confirmed-commit procedure has been canceled - due to the confirm-timeout interval expiring. - The common session parameters will not be present - in this sub-mode."; - } - enum "extend" { - description - "The confirmed-commit timeout has been extended, - e.g., by a new operation."; - } - enum "complete" { - description - "The confirmed-commit procedure has been completed."; - } - } - mandatory true; - description - "Indicates the event that caused the notification."; - } - - leaf timeout { - when - "../confirm-event = 'start' or ../confirm-event = 'extend'"; - type uint32; - units "seconds"; - description - "The configured timeout value if the event type - is 'start' or 'extend'. This value represents - the approximate number of seconds from the event - time when the 'timeout' event might occur."; - } - } // notification netconf-confirmed-commit - -} diff --git a/sdk/cpp/core/tests/models/ietf-netconf-with-defaults.yang b/sdk/cpp/core/tests/models/ietf-netconf-with-defaults.yang deleted file mode 100644 index e19d2b32c..000000000 --- a/sdk/cpp/core/tests/models/ietf-netconf-with-defaults.yang +++ /dev/null @@ -1,140 +0,0 @@ -module ietf-netconf-with-defaults { - - namespace "urn:ietf:params:xml:ns:yang:ietf-netconf-with-defaults"; - - prefix ncwd; - - import ietf-netconf { prefix nc; } - - organization - "IETF NETCONF (Network Configuration Protocol) Working Group"; - - contact - "WG Web: - - WG List: - - WG Chair: Bert Wijnen - - - WG Chair: Mehmet Ersue - - - Editor: Andy Bierman - - - Editor: Balazs Lengyel - "; - - description - "This module defines an extension to the NETCONF protocol - that allows the NETCONF client to control how default - values are handled by the server in particular NETCONF - operations. - - Copyright (c) 2011 IETF Trust and the persons identified as - the document authors. 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 6243; see - the RFC itself for full legal notices."; - - revision 2011-06-01 { - description - "Initial version."; - reference - "RFC 6243: With-defaults Capability for NETCONF"; - } - - typedef with-defaults-mode { - description - "Possible modes to report default data."; - reference - "RFC 6243; Section 3."; - type enumeration { - enum report-all { - description - "All default data is reported."; - reference - "RFC 6243; Section 3.1"; - } - enum report-all-tagged { - description - "All default data is reported. - Any nodes considered to be default data - will contain a 'default' XML attribute, - set to 'true' or '1'."; - reference - "RFC 6243; Section 3.4"; - } - enum trim { - description - "Values are not reported if they contain the default."; - reference - "RFC 6243; Section 3.2"; - } - enum explicit { - description - "Report values that contain the definition of - explicitly set data."; - reference - "RFC 6243; Section 3.3"; - } - } - } - - grouping with-defaults-parameters { - description - "Contains the parameter for control - of defaults in NETCONF retrieval operations."; - - leaf with-defaults { - description - "The explicit defaults processing mode requested."; - reference - "RFC 6243; Section 4.5.1"; - - type with-defaults-mode; - } - } - - // extending the get-config operation - augment /nc:get-config/nc:input { - description - "Adds the parameter to the - input of the NETCONF operation."; - reference - "RFC 6243; Section 4.5.1"; - - uses with-defaults-parameters; - } - - // extending the get operation - augment /nc:get/nc:input { - description - "Adds the parameter to - the input of the NETCONF operation."; - reference - "RFC 6243; Section 4.5.1"; - - uses with-defaults-parameters; - } - - // extending the copy-config operation - augment /nc:copy-config/nc:input { - description - "Adds the parameter to - the input of the NETCONF operation."; - reference - "RFC 6243; Section 4.5.1"; - - uses with-defaults-parameters; - } - -} diff --git a/sdk/cpp/core/tests/models/ietf-netconf.yang b/sdk/cpp/core/tests/models/ietf-netconf.yang deleted file mode 100644 index 4d849c9f1..000000000 --- a/sdk/cpp/core/tests/models/ietf-netconf.yang +++ /dev/null @@ -1,928 +0,0 @@ -module ietf-netconf { - - // the namespace for NETCONF XML definitions is unchanged - // from RFC 4741, which this document replaces - namespace "urn:ietf:params:xml:ns:netconf:base:1.0"; - - prefix nc; - - import ietf-inet-types { - prefix inet; - } - - organization - "IETF NETCONF (Network Configuration) Working Group"; - - contact - "WG Web: - WG List: - - WG Chair: Bert Wijnen - - - WG Chair: Mehmet Ersue - - - Editor: Martin Bjorklund - - - Editor: Juergen Schoenwaelder - - - Editor: Andy Bierman - "; - - description - "NETCONF Protocol Data Types and Protocol Operations. - - Copyright (c) 2011 IETF Trust and the persons identified as - the document authors. 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 6241; see - the RFC itself for full legal notices."; - revision 2011-06-01 { - description - "Initial revision"; - reference - "RFC 6241: Network Configuration Protocol"; - } - - extension get-filter-element-attributes { - description - "If this extension is present within an 'anyxml' - statement named 'filter', which must be conceptually - defined within the RPC input section for the - and protocol operations, then the - following unqualified XML attribute is supported - within the element, within a or - protocol operation: - - type : optional attribute with allowed - value strings 'subtree' and 'xpath'. - If missing, the default value is 'subtree'. - - If the 'xpath' feature is supported, then the - following unqualified XML attribute is - also supported: - - select: optional attribute containing a - string representing an XPath expression. - The 'type' attribute must be equal to 'xpath' - if this attribute is present."; - } - - // NETCONF capabilities defined as features - feature writable-running { - description - "NETCONF :writable-running capability; - If the server advertises the :writable-running - capability for a session, then this feature must - also be enabled for that session. Otherwise, - this feature must not be enabled."; - reference "RFC 6241, Section 8.2"; - } - - feature candidate { - description - "NETCONF :candidate capability; - If the server advertises the :candidate - capability for a session, then this feature must - also be enabled for that session. Otherwise, - this feature must not be enabled."; - reference "RFC 6241, Section 8.3"; - } - - feature confirmed-commit { - if-feature candidate; - description - "NETCONF :confirmed-commit:1.1 capability; - If the server advertises the :confirmed-commit:1.1 - capability for a session, then this feature must - also be enabled for that session. Otherwise, - this feature must not be enabled."; - - reference "RFC 6241, Section 8.4"; - } - - feature rollback-on-error { - description - "NETCONF :rollback-on-error capability; - If the server advertises the :rollback-on-error - capability for a session, then this feature must - also be enabled for that session. Otherwise, - this feature must not be enabled."; - reference "RFC 6241, Section 8.5"; - } - - feature validate { - description - "NETCONF :validate:1.1 capability; - If the server advertises the :validate:1.1 - capability for a session, then this feature must - also be enabled for that session. Otherwise, - this feature must not be enabled."; - reference "RFC 6241, Section 8.6"; - } - - feature startup { - description - "NETCONF :startup capability; - If the server advertises the :startup - capability for a session, then this feature must - also be enabled for that session. Otherwise, - this feature must not be enabled."; - reference "RFC 6241, Section 8.7"; - } - - feature url { - description - "NETCONF :url capability; - If the server advertises the :url - capability for a session, then this feature must - also be enabled for that session. Otherwise, - this feature must not be enabled."; - reference "RFC 6241, Section 8.8"; - } - - feature xpath { - description - "NETCONF :xpath capability; - If the server advertises the :xpath - capability for a session, then this feature must - also be enabled for that session. Otherwise, - this feature must not be enabled."; - reference "RFC 6241, Section 8.9"; - } - - // NETCONF Simple Types - - typedef session-id-type { - type uint32 { - range "1..max"; - } - description - "NETCONF Session Id"; - } - - typedef session-id-or-zero-type { - type uint32; - description - "NETCONF Session Id or Zero to indicate none"; - } - - typedef error-tag-type { - type enumeration { - enum in-use { - description - "The request requires a resource that - already is in use."; - } - enum invalid-value { - description - "The request specifies an unacceptable value for one - or more parameters."; - } - enum too-big { - description - "The request or response (that would be generated) is - too large for the implementation to handle."; - } - enum missing-attribute { - description - "An expected attribute is missing."; - } - enum bad-attribute { - description - "An attribute value is not correct; e.g., wrong type, - out of range, pattern mismatch."; - } - enum unknown-attribute { - description - "An unexpected attribute is present."; - } - enum missing-element { - description - "An expected element is missing."; - } - enum bad-element { - description - "An element value is not correct; e.g., wrong type, - out of range, pattern mismatch."; - } - enum unknown-element { - description - "An unexpected element is present."; - } - enum unknown-namespace { - description - "An unexpected namespace is present."; - } - enum access-denied { - description - "Access to the requested protocol operation or - data model is denied because authorization failed."; - } - enum lock-denied { - description - "Access to the requested lock is denied because the - lock is currently held by another entity."; - } - enum resource-denied { - description - "Request could not be completed because of - insufficient resources."; - } - enum rollback-failed { - description - "Request to roll back some configuration change (via - rollback-on-error or operations) - was not completed for some reason."; - } - enum data-exists { - description - "Request could not be completed because the relevant - data model content already exists. For example, - a 'create' operation was attempted on data that - already exists."; - } - enum data-missing { - description - "Request could not be completed because the relevant - data model content does not exist. For example, - a 'delete' operation was attempted on - data that does not exist."; - } - enum operation-not-supported { - description - "Request could not be completed because the requested - operation is not supported by this implementation."; - } - enum operation-failed { - description - "Request could not be completed because the requested - operation failed for some reason not covered by - any other error condition."; - } - enum partial-operation { - description - "This error-tag is obsolete, and SHOULD NOT be sent - by servers conforming to this document."; - } - enum malformed-message { - description - "A message could not be handled because it failed to - be parsed correctly. For example, the message is not - well-formed XML or it uses an invalid character set."; - } - } - description "NETCONF Error Tag"; - reference "RFC 6241, Appendix A"; - } - - typedef error-severity-type { - type enumeration { - enum error { - description "Error severity"; - } - enum warning { - description "Warning severity"; - } - } - description "NETCONF Error Severity"; - reference "RFC 6241, Section 4.3"; - } - - typedef edit-operation-type { - type enumeration { - enum merge { - description - "The configuration data identified by the - element containing this attribute is merged - with the configuration at the corresponding - level in the configuration datastore identified - by the target parameter."; - } - enum replace { - description - "The configuration data identified by the element - containing this attribute replaces any related - configuration in the configuration datastore - identified by the target parameter. If no such - configuration data exists in the configuration - datastore, it is created. Unlike a - operation, which replaces the - entire target configuration, only the configuration - actually present in the config parameter is affected."; - } - enum create { - description - "The configuration data identified by the element - containing this attribute is added to the - configuration if and only if the configuration - data does not already exist in the configuration - datastore. If the configuration data exists, an - element is returned with an - value of 'data-exists'."; - } - enum delete { - description - "The configuration data identified by the element - containing this attribute is deleted from the - configuration if and only if the configuration - data currently exists in the configuration - datastore. If the configuration data does not - exist, an element is returned with - an value of 'data-missing'."; - } - enum remove { - description - "The configuration data identified by the element - containing this attribute is deleted from the - configuration if the configuration - data currently exists in the configuration - datastore. If the configuration data does not - exist, the 'remove' operation is silently ignored - by the server."; - } - } - default "merge"; - description "NETCONF 'operation' attribute values"; - reference "RFC 6241, Section 7.2"; - } - - // NETCONF Standard Protocol Operations - - rpc get-config { - description - "Retrieve all or part of a specified configuration."; - - reference "RFC 6241, Section 7.1"; - - input { - container source { - description - "Particular configuration to retrieve."; - - choice config-source { - mandatory true; - description - "The configuration to retrieve."; - leaf candidate { - if-feature candidate; - type empty; - description - "The candidate configuration is the config source."; - } - leaf running { - type empty; - description - "The running configuration is the config source."; - } - leaf startup { - if-feature startup; - type empty; - description - "The startup configuration is the config source. - This is optional-to-implement on the server because - not all servers will support filtering for this - datastore."; - } - } - } - - anyxml filter { - description - "Subtree or XPath filter to use."; - nc:get-filter-element-attributes; - } - } - - output { - anyxml data { - description - "Copy of the source datastore subset that matched - the filter criteria (if any). An empty data container - indicates that the request did not produce any results."; - } - } - } - - rpc edit-config { - description - "The operation loads all or part of a specified - configuration to the specified target configuration."; - - reference "RFC 6241, Section 7.2"; - - input { - container target { - description - "Particular configuration to edit."; - - choice config-target { - mandatory true; - description - "The configuration target."; - - leaf candidate { - if-feature candidate; - type empty; - description - "The candidate configuration is the config target."; - } - leaf running { - if-feature writable-running; - type empty; - description - "The running configuration is the config source."; - } - } - } - - leaf default-operation { - type enumeration { - enum merge { - description - "The default operation is merge."; - } - enum replace { - description - "The default operation is replace."; - } - enum none { - description - "There is no default operation."; - } - } - default "merge"; - description - "The default operation to use."; - } - - leaf test-option { - if-feature validate; - type enumeration { - enum test-then-set { - description - "The server will test and then set if no errors."; - } - enum set { - description - "The server will set without a test first."; - } - - enum test-only { - description - "The server will only test and not set, even - if there are no errors."; - } - } - default "test-then-set"; - description - "The test option to use."; - } - - leaf error-option { - type enumeration { - enum stop-on-error { - description - "The server will stop on errors."; - } - enum continue-on-error { - description - "The server may continue on errors."; - } - enum rollback-on-error { - description - "The server will roll back on errors. - This value can only be used if the 'rollback-on-error' - feature is supported."; - } - } - default "stop-on-error"; - description - "The error option to use."; - } - - choice edit-content { - mandatory true; - description - "The content for the edit operation."; - - anyxml config { - description - "Inline Config content."; - } - leaf url { - if-feature url; - type inet:uri; - description - "URL-based config content."; - } - } - } - } - - rpc copy-config { - description - "Create or replace an entire configuration datastore with the - contents of another complete configuration datastore."; - - reference "RFC 6241, Section 7.3"; - - input { - container target { - description - "Particular configuration to copy to."; - - choice config-target { - mandatory true; - description - "The configuration target of the copy operation."; - - leaf candidate { - if-feature candidate; - type empty; - description - "The candidate configuration is the config target."; - } - leaf running { - if-feature writable-running; - type empty; - description - "The running configuration is the config target. - This is optional-to-implement on the server."; - } - leaf startup { - if-feature startup; - type empty; - description - "The startup configuration is the config target."; - } - leaf url { - if-feature url; - type inet:uri; - description - "The URL-based configuration is the config target."; - } - } - } - - container source { - description - "Particular configuration to copy from."; - - choice config-source { - mandatory true; - description - "The configuration source for the copy operation."; - - leaf candidate { - if-feature candidate; - type empty; - description - "The candidate configuration is the config source."; - } - leaf running { - type empty; - description - "The running configuration is the config source."; - } - leaf startup { - if-feature startup; - type empty; - description - "The startup configuration is the config source."; - } - leaf url { - if-feature url; - type inet:uri; - description - "The URL-based configuration is the config source."; - } - anyxml config { - description - "Inline Config content: element. Represents - an entire configuration datastore, not - a subset of the running datastore."; - } - } - } - } - } - - rpc delete-config { - description - "Delete a configuration datastore."; - - reference "RFC 6241, Section 7.4"; - - input { - container target { - description - "Particular configuration to delete."; - - choice config-target { - mandatory true; - description - "The configuration target to delete."; - - leaf startup { - if-feature startup; - type empty; - description - "The startup configuration is the config target."; - } - leaf url { - if-feature url; - type inet:uri; - description - "The URL-based configuration is the config target."; - } - } - } - } - } - - rpc lock { - description - "The lock operation allows the client to lock the configuration - system of a device."; - - reference "RFC 6241, Section 7.5"; - - input { - container target { - description - "Particular configuration to lock."; - - choice config-target { - mandatory true; - description - "The configuration target to lock."; - - leaf candidate { - if-feature candidate; - type empty; - description - "The candidate configuration is the config target."; - } - leaf running { - type empty; - description - "The running configuration is the config target."; - } - leaf startup { - if-feature startup; - type empty; - description - "The startup configuration is the config target."; - } - } - } - } - } - - rpc unlock { - description - "The unlock operation is used to release a configuration lock, - previously obtained with the 'lock' operation."; - - reference "RFC 6241, Section 7.6"; - - input { - container target { - description - "Particular configuration to unlock."; - - choice config-target { - mandatory true; - description - "The configuration target to unlock."; - - leaf candidate { - if-feature candidate; - type empty; - description - "The candidate configuration is the config target."; - } - leaf running { - type empty; - description - "The running configuration is the config target."; - } - leaf startup { - if-feature startup; - type empty; - description - "The startup configuration is the config target."; - } - } - } - } - } - - rpc get { - description - "Retrieve running configuration and device state information."; - - reference "RFC 6241, Section 7.7"; - - input { - anyxml filter { - description - "This parameter specifies the portion of the system - configuration and state data to retrieve."; - nc:get-filter-element-attributes; - } - } - - output { - anyxml data { - description - "Copy of the running datastore subset and/or state - data that matched the filter criteria (if any). - An empty data container indicates that the request did not - produce any results."; - } - } - } - - rpc close-session { - description - "Request graceful termination of a NETCONF session."; - - reference "RFC 6241, Section 7.8"; - } - - rpc kill-session { - description - "Force the termination of a NETCONF session."; - - reference "RFC 6241, Section 7.9"; - - input { - leaf session-id { - type session-id-type; - mandatory true; - description - "Particular session to kill."; - } - } - } - - rpc commit { - if-feature candidate; - - description - "Commit the candidate configuration as the device's new - current configuration."; - - reference "RFC 6241, Section 8.3.4.1"; - - input { - leaf confirmed { - if-feature confirmed-commit; - type empty; - description - "Requests a confirmed commit."; - reference "RFC 6241, Section 8.3.4.1"; - } - - leaf confirm-timeout { - if-feature confirmed-commit; - type uint32 { - range "1..max"; - } - units "seconds"; - default "600"; // 10 minutes - description - "The timeout interval for a confirmed commit."; - reference "RFC 6241, Section 8.3.4.1"; - } - - leaf persist { - if-feature confirmed-commit; - type string; - description - "This parameter is used to make a confirmed commit - persistent. A persistent confirmed commit is not aborted - if the NETCONF session terminates. The only way to abort - a persistent confirmed commit is to let the timer expire, - or to use the operation. - - The value of this parameter is a token that must be given - in the 'persist-id' parameter of or - operations in order to confirm or cancel - the persistent confirmed commit. - - The token should be a random string."; - reference "RFC 6241, Section 8.3.4.1"; - } - - leaf persist-id { - if-feature confirmed-commit; - type string; - description - "This parameter is given in order to commit a persistent - confirmed commit. The value must be equal to the value - given in the 'persist' parameter to the operation. - If it does not match, the operation fails with an - 'invalid-value' error."; - reference "RFC 6241, Section 8.3.4.1"; - } - - } - } - - rpc discard-changes { - if-feature candidate; - - description - "Revert the candidate configuration to the current - running configuration."; - reference "RFC 6241, Section 8.3.4.2"; - } - - rpc cancel-commit { - if-feature confirmed-commit; - description - "This operation is used to cancel an ongoing confirmed commit. - If the confirmed commit is persistent, the parameter - 'persist-id' must be given, and it must match the value of the - 'persist' parameter."; - reference "RFC 6241, Section 8.4.4.1"; - - input { - leaf persist-id { - type string; - description - "This parameter is given in order to cancel a persistent - confirmed commit. The value must be equal to the value - given in the 'persist' parameter to the operation. - If it does not match, the operation fails with an - 'invalid-value' error."; - } - } - } - - rpc validate { - if-feature validate; - - description - "Validates the contents of the specified configuration."; - - reference "RFC 6241, Section 8.6.4.1"; - - input { - container source { - description - "Particular configuration to validate."; - - choice config-source { - mandatory true; - description - "The configuration source to validate."; - - leaf candidate { - if-feature candidate; - type empty; - description - "The candidate configuration is the config source."; - } - leaf running { - type empty; - description - "The running configuration is the config source."; - } - leaf startup { - if-feature startup; - type empty; - description - "The startup configuration is the config source."; - } - leaf url { - if-feature url; - type inet:uri; - description - "The URL-based configuration is the config source."; - } - anyxml config { - description - "Inline Config content: element. Represents - an entire configuration datastore, not - a subset of the running datastore."; - } - } - } - } - } - -} diff --git a/sdk/cpp/core/tests/models/ietf-yang-smiv2.yang b/sdk/cpp/core/tests/models/ietf-yang-smiv2.yang deleted file mode 100644 index b06afc7ab..000000000 --- a/sdk/cpp/core/tests/models/ietf-yang-smiv2.yang +++ /dev/null @@ -1,144 +0,0 @@ -module ietf-yang-smiv2 { - - namespace "urn:ietf:params:xml:ns:yang:ietf-yang-smiv2"; - prefix "smiv2"; - - organization - "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; - - contact - "WG Web: - WG List: - - WG Chair: David Kessens - - - WG Chair: Juergen Schoenwaelder - - - Editor: Juergen Schoenwaelder - "; - - description - "This module defines YANG extensions that are used to translate - SMIv2 concepts into YANG. - - Copyright (c) 2011 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 XXXX; see - the RFC itself for full legal notices."; - // RFC Ed.: replace XXXX with actual RFC number and remove this note - - // RFC Ed.: please update the date to the date of publication - revision 2011-11-25 { - description - "Initial revision."; - reference - "RFC XXXX: Translation of SMIv2 MIB Modules to YANG Modules"; - // RFC Ed.: replace XXXX with actual RFC number and remove this note - } - - identity object-identity { - description - "Base identity for all SMIv2 OBJECT-IDENTITYs."; - } - - typedef opaque { - type binary; - description - "The Opaque type supports the capability to pass arbitrary ASN.1 - syntax. A value is encoded using the ASN.1 Basic Encoding Rules - into a string of octets. This, in turn, is encoded as an OCTET - STRING, in effect 'double-wrapping' the original ASN.1 value. - - In the value set and its semantics, this type is equivalent to - the Opaque type of the SMIv2. This type exists in the SMIv2 - solely for backward-compatibility reasons and this is also - true for this YANG data type."; - reference - "RFC 2578: Structure of Management Information Version 2 (SMIv2)"; - } - - extension display-hint { - argument "format"; - description - "The display-hint statement takes as an argument the DISPLAY-HINT - assigned to an SMIv2 textual convention."; - reference - "RFC2579: Textual Conventions for SMIv2"; - } - - extension max-access { - argument "access"; - description - "The max-access statement takes as an argument the MAX-ACCESS - assigned to an SMIv2 object definition"; - reference - "RFC2578: Structure of Management Information Version 2 (SMIv2)"; - } - - extension defval { - argument "value"; - description - "The defval statement takes as an argument a default value - defined by an SMIv2 DEFVAL clause. Note that the value is in - the SMIv2 value space defined by the SMIv2 syntax of the - corresponding object and not in the YANG value space - defined by the corresponding YANG data type."; - reference - "RFC2578: Structure of Management Information Version 2 (SMIv2)"; - } - - extension implied { - argument "index"; - description - "If an SMIv2 INDEX object is preceded by the IMPLIED keyword, then - the implied statement is present in the yang module and takes as - an argument the name of the IMPLIED index object."; - reference - "RFC2578: Structure of Management Information Version 2 (SMIv2)"; - } - - extension alias { - argument "descriptor"; - description - "The alias statement introduces an SMIv2 descriptor. The body of - the alias statement is expected to contain an oid statement that - provides the numeric OID associated with the descriptor."; - reference - "RFC2578: Structure of Management Information Version 2 (SMIv2)"; - } - - extension oid { - argument "value"; - description - "The oid statement takes as an argument the object identifier - assigned to an SMIv2 definition. The object identifier value - is written in decimal dotted notation."; - reference - "RFC2578: Structure of Management Information Version 2 (SMIv2)"; - } - - extension subid { - argument "value"; - description - "The subid statement takes as an argument the last sub-identifier - of the object identifier assigned to an SMIv2 definition. The - sub-identifier value is a single positive decimal natural number. - The subid statement may not be used as a substatement to any - top-level node in a YANG document. The subid substatement may - be used only as a substatement to a node having a parent node - defined with either a smiv2:oid or smiv2:subid substatement."; - reference - "RFC2578: Structure of Management Information Version 2 (SMIv2)"; - } - -} diff --git a/sdk/cpp/core/tests/models/ietf-yang-types.yang b/sdk/cpp/core/tests/models/ietf-yang-types.yang deleted file mode 100644 index 371a091d1..000000000 --- a/sdk/cpp/core/tests/models/ietf-yang-types.yang +++ /dev/null @@ -1,480 +0,0 @@ -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: - WG List: - - WG Chair: David Kessens - - - WG Chair: Juergen Schoenwaelder - - - Editor: Juergen Schoenwaelder - "; - - 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."; - } -} diff --git a/sdk/cpp/core/tests/models/main.yang b/sdk/cpp/core/tests/models/main.yang deleted file mode 100644 index a5f40bce1..000000000 --- a/sdk/cpp/core/tests/models/main.yang +++ /dev/null @@ -1,50 +0,0 @@ -module main { - - /*** NAMESPACE / PREFIX DEFINITION ***/ - - namespace "http://cisco.com/ns/yang/main"; - - - prefix "main"; - - /*** LINKAGE (IMPORTS / INCLUDES) ***/ - - - organization "Cisco Systems, Inc."; - - contact - "Cisco Systems, Inc. - Customer Service - - Postal: 170 West Tasman Drive - San Jose, CA 95134 - - Tel: +1 800 553-NETS - - E-mail: cs-yang@cisco.com"; - - description - "This module contains a collection of YANG definitions - for sanity package. - - This module contains definitions - for the following management objects: - - - Copyright (c) 2013-2014 by Cisco Systems, Inc. - All rights reserved."; - - revision "2015-11-17" { - description - "Initial revision."; - } - - container A { - - leaf one { - description "blah"; - type int32; - } - - } -} diff --git a/sdk/cpp/core/tests/models/openconfig-bgp-common-multiprotocol.yang b/sdk/cpp/core/tests/models/openconfig-bgp-common-multiprotocol.yang deleted file mode 100644 index 75f9ba068..000000000 --- a/sdk/cpp/core/tests/models/openconfig-bgp-common-multiprotocol.yang +++ /dev/null @@ -1,423 +0,0 @@ -submodule openconfig-bgp-common-multiprotocol { - - belongs-to openconfig-bgp { - prefix "oc-bgp"; - } - - import openconfig-extensions { prefix oc-ext; } - import openconfig-bgp-types { prefix oc-bgp-types; } - import openconfig-routing-policy { prefix oc-rpol; } - import openconfig-types { prefix oc-types; } - - include openconfig-bgp-common; - - // meta - organization - "OpenConfig working group"; - - contact - "OpenConfig working group - netopenconfig@googlegroups.com"; - - description - "This sub-module contains groupings that are related to support - for multiple protocols in BGP. The groupings are common across - multiple contexts."; - - oc-ext:openconfig-version "2.1.1"; - - revision "2016-06-21" { - description - "OpenConfig BGP refactor"; - reference "2.1.1"; - } - - grouping bgp-common-mp-afi-safi-graceful-restart-config { - description - "BGP graceful restart parameters that apply on a per-AFI-SAFI - basis"; - - leaf enabled { - type boolean; - default false; - description - "This leaf indicates whether graceful-restart is enabled for - this AFI-SAFI"; - } - } - - grouping bgp-common-mp-afi-safi-config { - description - "Configuration parameters used for all BGP AFI-SAFIs"; - - leaf afi-safi-name { - type identityref { - base oc-bgp-types:AFI_SAFI_TYPE; - } - description "AFI,SAFI"; - } - - leaf enabled { - type boolean; - default false; - description - "This leaf indicates whether the IPv4 Unicast AFI,SAFI is - enabled for the neighbour or group"; - } - } - - grouping bgp-common-mp-all-afi-safi-list-contents { - description - "A common grouping used for contents of the list that is used - for AFI-SAFI entries"; - - // import and export policy included for the afi/safi - uses oc-rpol:apply-policy-group; - - uses bgp-common-mp-ipv4-unicast-group; - uses bgp-common-mp-ipv6-unicast-group; - uses bgp-common-mp-ipv4-labeled-unicast-group; - uses bgp-common-mp-ipv6-labeled-unicast-group; - uses bgp-common-mp-l3vpn-ipv4-unicast-group; - uses bgp-common-mp-l3vpn-ipv6-unicast-group; - uses bgp-common-mp-l3vpn-ipv4-multicast-group; - uses bgp-common-mp-l3vpn-ipv6-multicast-group; - uses bgp-common-mp-l2vpn-vpls-group; - uses bgp-common-mp-l2vpn-evpn-group; - } - - // Groupings relating to each address family - grouping bgp-common-mp-ipv4-unicast-group { - description - "Group for IPv4 Unicast configuration options"; - - container ipv4-unicast { - when "../afi-safi-name = 'oc-bgp-types:IPV4_UNICAST'" { - description - "Include this container for IPv4 Unicast specific - configuration"; - } - - description "IPv4 unicast configuration options"; - - // include common IPv[46] unicast options - uses bgp-common-mp-ipv4-ipv6-unicast-common; - - // placeholder for IPv4 unicast specific configuration - } - } - - grouping bgp-common-mp-ipv6-unicast-group { - description - "Group for IPv6 Unicast configuration options"; - - container ipv6-unicast { - when "../afi-safi-name = 'oc-bgp-types:IPV6_UNICAST'" { - description - "Include this container for IPv6 Unicast specific - configuration"; - } - - description "IPv6 unicast configuration options"; - - // include common IPv[46] unicast options - uses bgp-common-mp-ipv4-ipv6-unicast-common; - - // placeholder for IPv6 unicast specific configuration - // options - } - } - - grouping bgp-common-mp-ipv4-labeled-unicast-group { - description - "Group for IPv4 Labeled Unicast configuration options"; - - container ipv4-labeled-unicast { - when "../afi-safi-name = 'oc-bgp-types:IPV4_LABELED_UNICAST'" { - description - "Include this container for IPv4 Labeled Unicast specific - configuration"; - } - - description "IPv4 Labeled Unicast configuration options"; - - uses bgp-common-mp-all-afi-safi-common; - - // placeholder for IPv4 Labeled Unicast specific config - // options - } - } - - grouping bgp-common-mp-ipv6-labeled-unicast-group { - description - "Group for IPv6 Labeled Unicast configuration options"; - - container ipv6-labeled-unicast { - when "../afi-safi-name = 'oc-bgp-types:IPV6_LABELED_UNICAST'" { - description - "Include this container for IPv6 Labeled Unicast specific - configuration"; - } - - description "IPv6 Labeled Unicast configuration options"; - - uses bgp-common-mp-all-afi-safi-common; - - // placeholder for IPv6 Labeled Unicast specific config - // options. - } - } - - grouping bgp-common-mp-l3vpn-ipv4-unicast-group { - description - "Group for IPv4 Unicast L3VPN configuration options"; - - container l3vpn-ipv4-unicast { - when "../afi-safi-name = 'oc-bgp-types:L3VPN_IPV4_UNICAST'" { - description - "Include this container for IPv4 Unicast L3VPN specific - configuration"; - } - - description "Unicast IPv4 L3VPN configuration options"; - - // include common L3VPN configuration options - uses bgp-common-mp-l3vpn-ipv4-ipv6-unicast-common; - - // placeholder for IPv4 Unicast L3VPN specific config options. - } - } - - grouping bgp-common-mp-l3vpn-ipv6-unicast-group { - description - "Group for IPv6 Unicast L3VPN configuration options"; - - container l3vpn-ipv6-unicast { - when "../afi-safi-name = 'oc-bgp-types:L3VPN_IPV6_UNICAST'" { - description - "Include this container for unicast IPv6 L3VPN specific - configuration"; - } - - description "Unicast IPv6 L3VPN configuration options"; - - // include common L3VPN configuration options - uses bgp-common-mp-l3vpn-ipv4-ipv6-unicast-common; - - // placeholder for IPv6 Unicast L3VPN specific configuration - // options - } - } - - grouping bgp-common-mp-l3vpn-ipv4-multicast-group { - description - "Group for IPv4 L3VPN multicast configuration options"; - - container l3vpn-ipv4-multicast { - when "../afi-safi-name = 'oc-bgp-types:L3VPN_IPV4_MULTICAST'" { - description - "Include this container for multicast IPv6 L3VPN specific - configuration"; - } - - description "Multicast IPv4 L3VPN configuration options"; - - // include common L3VPN multicast options - uses bgp-common-mp-l3vpn-ipv4-ipv6-multicast-common; - - // placeholder for IPv4 Multicast L3VPN specific configuration - // options - } - } - - grouping bgp-common-mp-l3vpn-ipv6-multicast-group { - description - "Group for IPv6 L3VPN multicast configuration options"; - - container l3vpn-ipv6-multicast { - when "../afi-safi-name = 'oc-bgp-types:L3VPN_IPV6_MULTICAST'" { - description - "Include this container for multicast IPv6 L3VPN specific - configuration"; - } - - description "Multicast IPv6 L3VPN configuration options"; - - // include common L3VPN multicast options - uses bgp-common-mp-l3vpn-ipv4-ipv6-multicast-common; - - // placeholder for IPv6 Multicast L3VPN specific configuration - // options - } - } - - grouping bgp-common-mp-l2vpn-vpls-group { - description - "Group for BGP-signalled VPLS configuration options"; - - container l2vpn-vpls { - when "../afi-safi-name = 'oc-bgp-types:L2VPN_VPLS'" { - description - "Include this container for BGP-signalled VPLS specific - configuration"; - } - - description "BGP-signalled VPLS configuration options"; - - // include common L2VPN options - uses bgp-common-mp-l2vpn-common; - - // placeholder for BGP-signalled VPLS specific configuration - // options - } - } - - grouping bgp-common-mp-l2vpn-evpn-group { - description - "Group for BGP EVPN configuration options"; - - container l2vpn-evpn { - when "../afi-safi-name = 'oc-bgp-types:L2VPN_EVPN'" { - description - "Include this container for BGP EVPN specific - configuration"; - } - - description "BGP EVPN configuration options"; - - // include common L2VPN options - uses bgp-common-mp-l2vpn-common; - - // placeholder for BGP EVPN specific configuration options - } - } - - // Common groupings across multiple AFI,SAFIs - grouping bgp-common-mp-all-afi-safi-common { - description - "Grouping for configuration common to all AFI,SAFI"; - - container prefix-limit { - description - "Configure the maximum number of prefixes that will be - accepted from a peer"; - - container config { - description - "Configuration parameters relating to the prefix - limit for the AFI-SAFI"; - uses bgp-common-mp-all-afi-safi-common-prefix-limit-config; - } - - container state { - config false; - description - "State information relating to the prefix-limit for the - AFI-SAFI"; - uses bgp-common-mp-all-afi-safi-common-prefix-limit-config; - } - } - } - - grouping bgp-common-mp-ipv4-ipv6-unicast-common { - description - "Common configuration that is applicable for IPv4 and IPv6 - unicast"; - - // include common afi-safi options. - uses bgp-common-mp-all-afi-safi-common; - - // configuration options that are specific to IPv[46] unicast - container config { - description - "Configuration parameters for common IPv4 and IPv6 unicast - AFI-SAFI options"; - uses bgp-common-mp-ipv4-ipv6-unicast-common-config; - } - container state { - config false; - description - "State information for common IPv4 and IPv6 unicast - parameters"; - uses bgp-common-mp-ipv4-ipv6-unicast-common-config; - } - } - - grouping bgp-common-mp-l3vpn-ipv4-ipv6-unicast-common { - description - "Common configuration applied across L3VPN for IPv4 - and IPv6"; - - // placeholder -- specific configuration options that are generic - // across IPv[46] unicast address families. - uses bgp-common-mp-all-afi-safi-common; - } - - grouping bgp-common-mp-l3vpn-ipv4-ipv6-multicast-common { - description - "Common configuration applied across L3VPN for IPv4 - and IPv6"; - - // placeholder -- specific configuration options that are - // generic across IPv[46] multicast address families. - uses bgp-common-mp-all-afi-safi-common; - } - - grouping bgp-common-mp-l2vpn-common { - description - "Common configuration applied across L2VPN address - families"; - - // placeholder -- specific configuration options that are - // generic across L2VPN address families - uses bgp-common-mp-all-afi-safi-common; - } - - // Config groupings for common groups - grouping bgp-common-mp-all-afi-safi-common-prefix-limit-config { - description - "Configuration parameters relating to prefix-limits for an - AFI-SAFI"; - - leaf max-prefixes { - type uint32; - description - "Maximum number of prefixes that will be accepted - from the neighbour"; - } - - leaf shutdown-threshold-pct { - type oc-types:percentage; - description - "Threshold on number of prefixes that can be received - from a neighbour before generation of warning messages - or log entries. Expressed as a percentage of - max-prefixes"; - } - - leaf restart-timer { - type decimal64 { - fraction-digits 2; - } - units "seconds"; - description - "Time interval in seconds after which the BGP session - is re-established after being torn down due to exceeding - the max-prefix limit."; - } - } - - grouping bgp-common-mp-ipv4-ipv6-unicast-common-config { - description - "Common configuration parameters for IPv4 and IPv6 Unicast - address families"; - - leaf send-default-route { - type boolean; - default "false"; - description - "If set to true, send the default-route to the neighbour(s)"; - } - } - -} \ No newline at end of file diff --git a/sdk/cpp/core/tests/models/openconfig-bgp-common-structure.yang b/sdk/cpp/core/tests/models/openconfig-bgp-common-structure.yang deleted file mode 100644 index 3f7b0d2ed..000000000 --- a/sdk/cpp/core/tests/models/openconfig-bgp-common-structure.yang +++ /dev/null @@ -1,154 +0,0 @@ -submodule openconfig-bgp-common-structure { - - belongs-to openconfig-bgp { - prefix "oc-bgp"; - } - - import openconfig-extensions { prefix oc-ext; } - - include openconfig-bgp-common-multiprotocol; - include openconfig-bgp-common; - - // meta - organization - "OpenConfig working group"; - - contact - "OpenConfig working group - netopenconfig@googlegroups.com"; - - description - "This sub-module contains groupings that are common across multiple BGP - contexts and provide structure around other primitive groupings."; - - - oc-ext:openconfig-version "2.1.1"; - - revision "2016-06-21" { - description - "OpenConfig BGP refactor"; - reference "2.1.1"; - } - - grouping bgp-common-structure-neighbor-group-logging-options { - description - "Structural grouping used to include error handling configuration and - state for both BGP neighbors and groups"; - - container logging-options { - description - "Logging options for events related to the BGP neighbor or - group"; - container config { - description - "Configuration parameters enabling or modifying logging - for events relating to the BGPgroup"; - uses bgp-common-neighbor-group-logging-options-config; - } - container state { - config false; - description - "State information relating to logging for the BGP neighbor - or group"; - uses bgp-common-neighbor-group-logging-options-config; - } - } - } - - grouping bgp-common-structure-neighbor-group-ebgp-multihop { - description - "Structural grouping used to include eBGP multihop configuration and - state for both BGP neighbors and peer groups"; - - container ebgp-multihop { - description - "eBGP multi-hop parameters for the BGPgroup"; - container config { - description - "Configuration parameters relating to eBGP multihop for the - BGP group"; - uses bgp-common-neighbor-group-multihop-config; - } - container state { - config false; - description - "State information for eBGP multihop, for the BGP neighbor - or group"; - uses bgp-common-neighbor-group-multihop-config; - } - } - } - - grouping bgp-common-structure-neighbor-group-route-reflector { - description - "Structural grouping used to include route reflector configuration and - state for both BGP neighbors and peer groups"; - - container route-reflector { - description - "Route reflector parameters for the BGPgroup"; - container config { - description - "Configuraton parameters relating to route reflection - for the BGPgroup"; - uses bgp-common-neighbor-group-route-reflector-config; - } - container state { - config false; - description - "State information relating to route reflection for the - BGPgroup"; - uses bgp-common-neighbor-group-route-reflector-config; - } - } - } - - grouping bgp-common-structure-neighbor-group-as-path-options { - description - "Structural grouping used to include AS_PATH manipulation configuration - and state for both BGP neighbors and peer groups"; - - container as-path-options { - description - "AS_PATH manipulation parameters for the BGP neighbor or - group"; - container config { - description - "Configuration parameters relating to AS_PATH manipulation - for the BGP peer or group"; - uses bgp-common-neighbor-group-as-path-options-config; - } - container state { - config false; - description - "State information relating to the AS_PATH manipulation - mechanisms for the BGP peer or group"; - uses bgp-common-neighbor-group-as-path-options-config; - } - } - } - - grouping bgp-common-structure-neighbor-group-add-paths { - description - "Structural grouping used to include ADD-PATHs configuration and state - for both BGP neighbors and peer groups"; - - container add-paths { - description - "Parameters relating to the advertisement and receipt of - multiple paths for a single NLRI (add-paths)"; - container config { - description - "Configuration parameters relating to ADD_PATHS"; - uses bgp-common-neighbor-group-add-paths-config; - } - container state { - config false; - description - "State information associated with ADD_PATHS"; - uses bgp-common-neighbor-group-add-paths-config; - } - } - } - -} diff --git a/sdk/cpp/core/tests/models/openconfig-bgp-common.yang b/sdk/cpp/core/tests/models/openconfig-bgp-common.yang deleted file mode 100644 index df06f1912..000000000 --- a/sdk/cpp/core/tests/models/openconfig-bgp-common.yang +++ /dev/null @@ -1,598 +0,0 @@ -submodule openconfig-bgp-common { - - belongs-to openconfig-bgp { - prefix "oc-bgp"; - } - - import openconfig-extensions { prefix oc-ext; } - import openconfig-bgp-types { prefix oc-bgp-types; } - import openconfig-routing-policy { prefix oc-rpol; } - import ietf-inet-types { prefix inet; } - - // meta - organization - "OpenConfig working group"; - - contact - "OpenConfig working group - netopenconfig@googlegroups.com"; - - description - "This sub-module contains common groupings that are common across - multiple contexts within the BGP module. That is to say that they - may be application to a subset of global, peer-group or neighbor - contexts."; - - oc-ext:openconfig-version "2.1.1"; - - revision "2016-06-21" { - description - "OpenConfig BGP refactor"; - reference "2.1.1"; - } - - grouping bgp-common-neighbor-group-timers-config { - description - "Config parameters related to timers associated with the BGP - peer"; - - leaf connect-retry { - type decimal64 { - fraction-digits 2; - } - default 30; - description - "Time interval in seconds between attempts to establish a - session with the peer."; - } - - leaf hold-time { - type decimal64 { - fraction-digits 2; - } - default 90; - description - "Time interval in seconds that a BGP session will be - considered active in the absence of keepalive or other - messages from the peer. The hold-time is typically - set to 3x the keepalive-interval."; - reference - "RFC 4271 - A Border Gateway Protocol 4, Sec. 10"; - } - - leaf keepalive-interval { - type decimal64 { - fraction-digits 2; - } - default 30; - description - "Time interval in seconds between transmission of keepalive - messages to the neighbor. Typically set to 1/3 the - hold-time."; - } - - leaf minimum-advertisement-interval { - type decimal64 { - fraction-digits 2; - } - default 30; - description - "Minimum time which must elapse between subsequent UPDATE - messages relating to a common set of NLRI being transmitted - to a peer. This timer is referred to as - MinRouteAdvertisementIntervalTimer by RFC 4721 and serves to - reduce the number of UPDATE messages transmitted when a - particular set of NLRI exhibit instability."; - reference - "RFC 4271 - A Border Gateway Protocol 4, Sec 9.2.1.1"; - } - } - - grouping bgp-common-neighbor-group-config { - description - "Neighbor level configuration items."; - - leaf peer-as { - type inet:as-number; - description - "AS number of the peer."; - } - - leaf local-as { - type inet:as-number; - description - "The local autonomous system number that is to be used - when establishing sessions with the remote peer or peer - group, if this differs from the global BGP router - autonomous system number."; - } - - leaf peer-type { - type oc-bgp-types:peer-type; - description - "Explicitly designate the peer or peer group as internal - (iBGP) or external (eBGP)."; - } - - leaf auth-password { - type string; - description - "Configures an MD5 authentication password for use with - neighboring devices."; - } - - leaf remove-private-as { - // could also make this a container with a flag to enable - // remove-private and separate option. here, option implies - // remove-private is enabled. - type oc-bgp-types:remove-private-as-option; - description - "Remove private AS numbers from updates sent to peers - when - this leaf is not specified, the AS_PATH attribute should be - sent to the peer unchanged"; - } - - leaf route-flap-damping { - type boolean; - default false; - description - "Enable route flap damping."; - } - - leaf send-community { - type oc-bgp-types:community-type; - default "NONE"; - description - "Specify which types of community should be sent to the - neighbor or group. The default is to not send the - community attribute"; - } - - leaf description { - type string; - description - "An optional textual description (intended primarily for use - with a peer or group"; - } - } - - grouping bgp-common-neighbor-group-transport-config { - description - "Configuration parameters relating to the transport protocol - used by the BGP session to the peer"; - - leaf tcp-mss { - type uint16; - description - "Sets the max segment size for BGP TCP sessions."; - } - - leaf mtu-discovery { - type boolean; - default false; - description - "Turns path mtu discovery for BGP TCP sessions on (true) - or off (false)"; - } - - leaf passive-mode { - type boolean; - default false; - description - "Wait for peers to issue requests to open a BGP session, - rather than initiating sessions from the local router."; - } - - leaf local-address { - type union { - type inet:ip-address; - type string; - } - //TODO: the string should be converted to a leafref type - //to point to an interface when YANG 1.1 is available with - //leafrefs in union types. - description - "Set the local IP (either IPv4 or IPv6) address to use - for the session when sending BGP update messages. This - may be expressed as either an IP address or reference - to the name of an interface."; - } - } - - grouping bgp-common-neighbor-group-error-handling-config { - description - "Configuration parameters relating to enhanced error handling - behaviours for BGP"; - - leaf treat-as-withdraw { - type boolean; - default "false"; - description - "Specify whether erroneous UPDATE messages for which the - NLRI can be extracted are reated as though the NLRI is - withdrawn - avoiding session reset"; - reference "draft-ietf-idr-error-handling-16"; - } - } - - grouping bgp-common-neighbor-group-logging-options-config { - description - "Configuration parameters specifying the logging behaviour for - BGP sessions to the peer"; - - leaf log-neighbor-state-changes { - type boolean; - default "true"; - description - "Configure logging of peer state changes. Default is - to enable logging of peer state changes."; - } - } - - grouping bgp-common-neighbor-group-multihop-config { - description - "Configuration parameters specifying the multihop behaviour for - BGP sessions to the peer"; - - leaf enabled { - type boolean; - default "false"; - description - "When enabled the referenced group or neighbors are permitted - to be indirectly connected - including cases where the TTL - can be decremented between the BGP peers"; - } - - leaf multihop-ttl { - type uint8; - description - "Time-to-live value to use when packets are sent to the - referenced group or neighbors and ebgp-multihop is enabled"; - } - } - - grouping bgp-common-neighbor-group-route-reflector-config { - description - "Configuration parameters determining whether the behaviour of - the local system when acting as a route-reflector"; - - leaf route-reflector-cluster-id { - type oc-bgp-types:rr-cluster-id-type; - description - "route-reflector cluster id to use when local router is - configured as a route reflector. Commonly set at the group - level, but allows a different cluster - id to be set for each neighbor."; - } - - leaf route-reflector-client { - type boolean; - default "false"; - description - "Configure the neighbor as a route reflector client."; - } - } - - grouping bgp-common-neighbor-group-as-path-options-config { - description - "Configuration parameters allowing manipulation of the AS_PATH - attribute"; - - leaf allow-own-as { - type uint8; - default 0; - description - "Specify the number of occurrences of the local BGP speaker's - AS that can occur within the AS_PATH before it is rejected."; - } - - leaf replace-peer-as { - type boolean; - default "false"; - description - "Replace occurrences of the peer's AS in the AS_PATH - with the local autonomous system number"; - } - } - - grouping bgp-common-neighbor-group-add-paths-config { - description - "Configuration parameters specfying whether the local system - will send or receive multiple paths using ADD_PATHS"; - - leaf receive { - type boolean; - default false; - description - "Enable ability to receive multiple path advertisements - for an NLRI from the neighbor or group"; - } - - leaf send-max { - type uint8; - description - "The maximum number of paths to advertise to neighbors - for a single NLRI"; - } - - leaf eligible-prefix-policy { - type leafref { - path "/oc-rpol:routing-policy/oc-rpol:policy-definitions/" + - "oc-rpol:policy-definition/oc-rpol:name"; - } - description - "A reference to a routing policy which can be used to - restrict the prefixes for which add-paths is enabled"; - } - } - - grouping bgp-common-graceful-restart-config { - description - "Configuration parameters relating to BGP graceful restart."; - - leaf enabled { - type boolean; - description - "Enable or disable the graceful-restart capability."; - } - - leaf restart-time { - type uint16 { - range 0..4096; - } - description - "Estimated time (in seconds) for the local BGP speaker to - restart a session. This value is advertise in the graceful - restart BGP capability. This is a 12-bit value, referred to - as Restart Time in RFC4724. Per RFC4724, the suggested - default value is <= the hold-time value."; - } - - leaf stale-routes-time { - type decimal64 { - fraction-digits 2; - } - description - "An upper-bound on the time thate stale routes will be - retained by a router after a session is restarted. If an - End-of-RIB (EOR) marker is received prior to this timer - expiring stale-routes will be flushed upon its receipt - if - no EOR is received, then when this timer expires stale paths - will be purged. This timer is referred to as the - Selection_Deferral_Timer in RFC4724"; - } - - leaf helper-only { - type boolean; - description - "Enable graceful-restart in helper mode only. When this - leaf is set, the local system does not retain forwarding - its own state during a restart, but supports procedures - for the receiving speaker, as defined in RFC4724."; - } - } - - grouping bgp-common-use-multiple-paths-config { - description - "Generic configuration options relating to use of multiple - paths for a referenced AFI-SAFI, group or neighbor"; - - leaf enabled { - type boolean; - default false; - description - "Whether the use of multiple paths for the same NLRI is - enabled for the neighbor. This value is overridden by - any more specific configuration value."; - } - } - - grouping bgp-common-use-multiple-paths-ebgp-as-options-config { - description - "Configuration parameters specific to eBGP multipath applicable - to all contexts"; - - leaf allow-multiple-as { - type boolean; - default "false"; - description - "Allow multipath to use paths from different neighbouring - ASes. The default is to only consider multiple paths from - the same neighbouring AS."; - } - } - - grouping bgp-common-global-group-use-multiple-paths { - description - "Common grouping used for both global and groups which provides - configuration and state parameters relating to use of multiple - paths"; - - container use-multiple-paths { - description - "Parameters related to the use of multiple paths for the - same NLRI"; - - container config { - description - "Configuration parameters relating to multipath"; - uses bgp-common-use-multiple-paths-config; - } - container state { - config false; - description - "State parameters relating to multipath"; - uses bgp-common-use-multiple-paths-config; - } - - container ebgp { - description - "Multipath parameters for eBGP"; - container config { - description - "Configuration parameters relating to eBGP multipath"; - uses bgp-common-use-multiple-paths-ebgp-config; - } - container state { - config false; - description - "State information relating to eBGP multipath"; - uses bgp-common-use-multiple-paths-ebgp-config; - } - } - - container ibgp { - description - "Multipath parameters for iBGP"; - container config { - description - "Configuration parameters relating to iBGP multipath"; - uses bgp-common-use-multiple-paths-ibgp-config; - } - container state { - config false; - description - "State information relating to iBGP multipath"; - uses bgp-common-use-multiple-paths-ibgp-config; - } - } - } - } - - grouping bgp-common-use-multiple-paths-ebgp-config { - description - "Configuration parameters relating to multipath for eBGP"; - - leaf allow-multiple-as { - type boolean; - default "false"; - description - "Allow multipath to use paths from different neighbouring - ASes. The default is to only consider multiple paths from - the same neighbouring AS."; - } - - leaf maximum-paths { - type uint32; - default 1; - description - "Maximum number of parallel paths to consider when using - BGP multipath. The default is use a single path."; - } - } - - grouping bgp-common-use-multiple-paths-ibgp-config { - description - "Configuration parmaeters relating to multipath for iBGP"; - - leaf maximum-paths { - type uint32; - default 1; - description - "Maximum number of parallel paths to consider when using - iBGP multipath. The default is to use a single path"; - } - } - - grouping bgp-common-route-selection-options-config { - description - "Set of configuration options that govern best - path selection."; - - leaf always-compare-med { - type boolean; - default "false"; - description - "Compare multi-exit discriminator (MED) value from - different ASes when selecting the best route. The - default behavior is to only compare MEDs for paths - received from the same AS."; - } - - leaf ignore-as-path-length { - type boolean; - default "false"; - description - "Ignore the AS path length when selecting the best path. - The default is to use the AS path length and prefer paths - with shorter length."; - } - - leaf external-compare-router-id { - type boolean; - default "true"; - description - "When comparing similar routes received from external - BGP peers, use the router-id as a criterion to select - the active path."; - } - - leaf advertise-inactive-routes { - type boolean; - default "false"; - description - "Advertise inactive routes to external peers. The - default is to only advertise active routes."; - } - - leaf enable-aigp { - type boolean; - default false; - description - "Flag to enable sending / receiving accumulated IGP - attribute in routing updates"; - } - - leaf ignore-next-hop-igp-metric { - type boolean; - default "false"; - description - "Ignore the IGP metric to the next-hop when calculating - BGP best-path. The default is to select the route for - which the metric to the next-hop is lowest"; - } - } - - grouping bgp-common-route-selection-options { - description - "Configuration and state relating to route selection options"; - - container route-selection-options { - description - "Parameters relating to options for route selection"; - container config { - description - "Configuration parameters relating to route selection - options"; - uses bgp-common-route-selection-options-config; - } - container state { - config false; - description - "State information for the route selection options"; - uses bgp-common-route-selection-options-config; - } - } - } - - grouping bgp-common-state { - description - "Grouping containing common counters relating to prefixes and - paths"; - - leaf total-paths { - type uint32; - description - "Total number of BGP paths within the context"; - } - - leaf total-prefixes { - type uint32; - description - "Total number of BGP prefixes received within the context"; - } - } - - -} - diff --git a/sdk/cpp/core/tests/models/openconfig-bgp-global.yang b/sdk/cpp/core/tests/models/openconfig-bgp-global.yang deleted file mode 100644 index 742d6d046..000000000 --- a/sdk/cpp/core/tests/models/openconfig-bgp-global.yang +++ /dev/null @@ -1,253 +0,0 @@ -submodule openconfig-bgp-global { - - belongs-to openconfig-bgp { - prefix "oc-bgp"; - } - - import openconfig-extensions { prefix oc-ext; } - import ietf-inet-types { prefix inet; } - import ietf-yang-types { prefix yang; } - - // Include common submodule - include openconfig-bgp-common; - include openconfig-bgp-common-multiprotocol; - - // meta - organization - "OpenConfig working group"; - - contact - "OpenConfig working group - netopenconfig@googlegroups.com"; - - description - "This sub-module contains groupings that are specific to the - global context of the OpenConfig BGP module"; - - oc-ext:openconfig-version "2.1.1"; - - revision "2016-06-21" { - description - "OpenConfig BGP refactor"; - reference "2.1.1"; - } - - grouping bgp-global-config { - description - "Global configuration options for the BGP router."; - - leaf as { - type inet:as-number; - //mandatory true; - description - "Local autonomous system number of the router. Uses - the 32-bit as-number type from the model in RFC 6991."; - } - - leaf router-id { - type yang:dotted-quad; - description - "Router id of the router - an unsigned 32-bit integer - expressed in dotted quad notation."; - reference - "RFC4271 - A Border Gateway Protocol 4 (BGP-4), - Section 4.2"; - } - } - - grouping bgp-global-state { - description - "Operational state parameters for the BGP neighbor"; - - uses bgp-common-state; - } - - grouping bgp-global-default-route-distance-config { - description - "Configuration options relating to the administrative distance - (or preference) assigned to routes received from different - sources (external, internal, and local)."; - - leaf external-route-distance { - type uint8 { - range "1..255"; - } - description - "Administrative distance for routes learned from external - BGP (eBGP)."; - } - leaf internal-route-distance { - type uint8 { - range "1..255"; - } - description - "Administrative distance for routes learned from internal - BGP (iBGP)."; - } - } - - grouping bgp-global-confederation-config { - description - "Configuration options specifying parameters when the local - router is within an autonomous system which is part of a BGP - confederation."; - - leaf enabled { - type boolean; - description - "When this leaf is set to true it indicates that - the local-AS is part of a BGP confederation"; - } - - leaf identifier { - type inet:as-number; - description - "Confederation identifier for the autonomous system."; - } - - leaf-list member-as { - type inet:as-number; - description - "Remote autonomous systems that are to be treated - as part of the local confederation."; - } - } - - grouping bgp-global-afi-safi-list { - description - "List of address-families associated with the BGP instance"; - - list afi-safi { - key "afi-safi-name"; - - description - "AFI,SAFI configuration available for the - neighbour or group"; - - leaf afi-safi-name { - type leafref { - path "../config/afi-safi-name"; - } - description - "Reference to the AFI-SAFI name used as a key - for the AFI-SAFI list"; - } - - container config { - description - "Configuration parameters for the AFI-SAFI"; - uses bgp-common-mp-afi-safi-config; - } - container state { - config false; - description - "State information relating to the AFI-SAFI"; - uses bgp-common-mp-afi-safi-config; - uses bgp-common-state; - } - - container graceful-restart { - description - "Parameters relating to BGP graceful-restart"; - container config { - description - "Configuration options for BGP graceful-restart"; - uses bgp-common-mp-afi-safi-graceful-restart-config; - } - container state { - config false; - description - "State information for BGP graceful-restart"; - uses bgp-common-mp-afi-safi-graceful-restart-config; - } - } - - uses bgp-common-route-selection-options; - uses bgp-common-global-group-use-multiple-paths; - uses bgp-common-mp-all-afi-safi-list-contents; - } - } - - // Structural groupings - grouping bgp-global-base { - description - "Global configuration parameters for the BGP router"; - - container config { - description - "Configuration parameters relating to the global BGP router"; - uses bgp-global-config; - } - container state { - config false; - description - "State information relating to the global BGP router"; - uses bgp-global-config; - uses bgp-global-state; - } - - container default-route-distance { - description - "Administrative distance (or preference) assigned to - routes received from different sources - (external, internal, and local)."; - - container config { - description - "Configuration parameters relating to the default route - distance"; - uses bgp-global-default-route-distance-config; - } - container state { - config false; - description - "State information relating to the default route distance"; - uses bgp-global-default-route-distance-config; - } - } - - container confederation { - description - "Parameters indicating whether the local system acts as part - of a BGP confederation"; - - container config { - description - "Configuration parameters relating to BGP confederations"; - uses bgp-global-confederation-config; - } - container state { - config false; - description - "State information relating to the BGP confederations"; - uses bgp-global-confederation-config; - } - } - - container graceful-restart { - description - "Parameters relating the graceful restart mechanism for BGP"; - container config { - description - "Configuration parameters relating to graceful-restart"; - uses bgp-common-graceful-restart-config; - } - container state { - config false; - description - "State information associated with graceful-restart"; - uses bgp-common-graceful-restart-config; - } - } - - uses bgp-common-global-group-use-multiple-paths; - uses bgp-common-route-selection-options; - - container afi-safis { - description - "Address family specific configuration"; - uses bgp-global-afi-safi-list; - } - } - -} diff --git a/sdk/cpp/core/tests/models/openconfig-bgp-neighbor.yang b/sdk/cpp/core/tests/models/openconfig-bgp-neighbor.yang deleted file mode 100644 index 9563e34b5..000000000 --- a/sdk/cpp/core/tests/models/openconfig-bgp-neighbor.yang +++ /dev/null @@ -1,620 +0,0 @@ -submodule openconfig-bgp-neighbor { - - belongs-to openconfig-bgp { - prefix "oc-bgp"; - } - - import openconfig-extensions { prefix oc-ext; } - import openconfig-routing-policy { prefix oc-rpol; } - import openconfig-types { prefix oc-types; } - import openconfig-bgp-types { prefix oc-bgp-types; } - import ietf-inet-types { prefix inet; } - import ietf-yang-types { prefix yang; } - - // Include the common submodule - include openconfig-bgp-common; - include openconfig-bgp-common-multiprotocol; - include openconfig-bgp-peer-group; - include openconfig-bgp-common-structure; - - // meta - organization - "OpenConfig working group"; - - contact - "OpenConfig working group - netopenconfig@googlegroups.com"; - - description - "This sub-module contains groupings that are specific to the - neighbor context of the OpenConfig BGP module."; - - oc-ext:openconfig-version "2.1.1"; - - revision "2016-06-21" { - description - "OpenConfig BGP refactor"; - reference "2.1.1"; - } - - grouping bgp-neighbor-config { - description - "Configuration parameters relating to a base BGP neighbor that - are not also applicable to any other context - (e.g., peer group)"; - - leaf peer-group { - type leafref { - path "../../../../peer-groups/peer-group/peer-group-name"; - } - description - "The peer-group with which this neighbor is associated"; - } - - leaf neighbor-address { - type inet:ip-address; - description - "Address of the BGP peer, either in IPv4 or IPv6"; - } - - leaf enabled { - type boolean; - default true; - description - "Whether the BGP peer is enabled. In cases where the - enabled leaf is set to false, the local system should not - initiate connections to the neighbor, and should not - respond to TCP connections attempts from the neighbor. If - the state of the BGP session is ESTABLISHED at the time - that this leaf is set to false, the BGP session should be - ceased."; - } - } - - grouping bgp-neighbor-use-multiple-paths { - description - "Multipath configuration and state applicable to a BGP - neighbor"; - - container use-multiple-paths { - description - "Parameters related to the use of multiple-paths for the same - NLRI when they are received only from this neighbor"; - - container config { - description - "Configuration parameters relating to multipath"; - uses bgp-common-use-multiple-paths-config; - } - container state { - config false; - description - "State parameters relating to multipath"; - uses bgp-common-use-multiple-paths-config; - } - - container ebgp { - description - "Multipath configuration for eBGP"; - container config { - description - "Configuration parameters relating to eBGP multipath"; - uses bgp-common-use-multiple-paths-ebgp-as-options-config; - } - container state { - config false; - description - "State information relating to eBGP multipath"; - uses bgp-common-use-multiple-paths-ebgp-as-options-config; - } - } - } - } - - grouping bgp-neighbor-state { - description - "Operational state parameters relating only to a BGP neighbor"; - - leaf session-state { - type enumeration { - enum IDLE { - description - "neighbor is down, and in the Idle state of the - FSM"; - } - enum CONNECT { - description - "neighbor is down, and the session is waiting for - the underlying transport session to be established"; - } - enum ACTIVE { - description - "neighbor is down, and the local system is awaiting - a conncetion from the remote peer"; - } - enum OPENSENT { - description - "neighbor is in the process of being established. - The local system has sent an OPEN message"; - } - enum OPENCONFIRM { - description - "neighbor is in the process of being established. - The local system is awaiting a NOTIFICATION or - KEEPALIVE message"; - } - enum ESTABLISHED { - description - "neighbor is up - the BGP session with the peer is - established"; - } - } - description - "Operational state of the BGP peer"; - } - - leaf last-established { - type oc-types:timeticks64; - description - "This timestamp indicates the time that the - BGP session last transitioned in or out of the Established - state. The value is the timestamp in seconds relative to - the Unix Epoch (Jan 1, 1970 00:00:00 UTC). - - The BGP session uptime can be computed by clients as the - difference between this value and the current time in UTC - (assuming the session is in the ESTABLISHED state, per the - session-state leaf)."; - } - - leaf established-transitions { - type yang:counter64; - description - "Number of transitions to the Established state for - the neighbor session. This value is analogous to the - bgpPeerFsmEstablishedTransitions object from the standard - BGP-4 MIB"; - reference - "RFC 4273 - Definitions of Managed Objects for BGP-4"; - } - - leaf-list supported-capabilities { - type identityref { - base oc-bgp-types:BGP_CAPABILITY; - } - description - "BGP capabilities negotiated as supported with the peer"; - } - - container messages { - description - "Counters for BGP messages sent and received from the - neighbor"; - container sent { - description - "Counters relating to BGP messages sent to the neighbor"; - uses bgp-neighbor-counters-message-types-state; - } - - container received { - description - "Counters for BGP messages received from the neighbor"; - uses bgp-neighbor-counters-message-types-state; - } - } - - container queues { - description - "Counters related to queued messages associated with the - BGP neighbor"; - uses bgp-neighbor-queue-counters-state; - } - } - - grouping bgp-neighbor-counters-message-types-state { - description - "Grouping of BGP message types, included for re-use - across counters"; - - leaf UPDATE { - type uint64; - description - "Number of BGP UPDATE messages announcing, withdrawing - or modifying paths exchanged."; - } - - leaf NOTIFICATION { - type uint64; - description - "Number of BGP NOTIFICATION messages indicating an - error condition has occurred exchanged."; - } - } - - grouping bgp-neighbor-queue-counters-state { - description - "Counters relating to the message queues associated with the - BGP peer"; - - leaf input { - type uint32; - description - "The number of messages received from the peer currently - queued"; - } - - leaf output { - type uint32; - description - "The number of messages queued to be sent to the peer"; - } - } - - grouping bgp-neighbor-transport-state { - description - "Operational state parameters relating to the transport session - used for the BGP session"; - - leaf local-port { - type inet:port-number; - description - "Local TCP port being used for the TCP session supporting - the BGP session"; - } - - leaf remote-address { - type inet:ip-address; - description - "Remote address to which the BGP session has been - established"; - } - - leaf remote-port { - type inet:port-number; - description - "Remote port being used by the peer for the TCP session - supporting the BGP session"; - } - } - - grouping bgp-neighbor-error-handling-state { - description - "Operational state parameters relating to enhanced error - error handling for BGP"; - - leaf erroneous-update-messages { - type uint32; - description - "The number of BGP UPDATE messages for which the - treat-as-withdraw mechanism has been applied based - on erroneous message contents"; - } - } - - grouping bgp-neighbor-timers-state { - description - "Operational state parameters relating to BGP timers associated - with the BGP session"; - - leaf negotiated-hold-time { - type decimal64 { - fraction-digits 2; - } - description - "The negotiated hold-time for the BGP session"; - } - } - - grouping bgp-neighbor-afi-safi-graceful-restart-state { - description - "Operational state variables relating to the graceful-restart - mechanism on a per-AFI-SAFI basis"; - - leaf received { - type boolean; - description - "This leaf indicates whether the neighbor advertised the - ability to support graceful-restart for this AFI-SAFI"; - } - - leaf advertised { - type boolean; - description - "This leaf indicates whether the ability to support - graceful-restart has been advertised to the peer"; - } - } - - grouping bgp-neighbor-graceful-restart-state { - description - "Operational state information relevant to graceful restart - for BGP"; - - leaf peer-restart-time { - type uint16 { - range 0..4096; - } - description - "The period of time (advertised by the peer) that - the peer expects a restart of a BGP session to - take"; - } - - leaf peer-restarting { - type boolean; - description - "This flag indicates whether the remote neighbor is currently - in the process of restarting, and hence received routes are - currently stale"; - } - - leaf local-restarting { - type boolean; - description - "This flag indicates whether the local neighbor is currently - restarting. The flag is unset after all NLRI have been - advertised to the peer, and the End-of-RIB (EOR) marker has - been unset"; - } - - leaf mode { - type enumeration { - enum HELPER_ONLY { - description - "The local router is operating in helper-only mode, and - hence will not retain forwarding state during a local - session restart, but will do so during a restart of the - remote peer"; - } - enum BILATERAL { - description - "The local router is operating in both helper mode, and - hence retains forwarding state during a remote restart, - and also maintains forwarding state during local session - restart"; - } - enum REMOTE_HELPER { - description - "The local system is able to retain routes during restart - but the remote system is only able to act as a helper"; - } - } - description - "Ths leaf indicates the mode of operation of BGP graceful - restart with the peer"; - } - } - - grouping bgp-neighbor-afi-safi-state { - description - "Operational state parameters relating to an individual AFI, - SAFI for a neighbor"; - - leaf active { - type boolean; - description - "This value indicates whether a particular AFI-SAFI has - been succesfully negotiated with the peer. An AFI-SAFI - may be enabled in the current running configuration, but a - session restart may be required in order to negotiate the new - capability."; - } - - container prefixes { - description "Prefix counters for the BGP session"; - leaf received { - type uint32; - description - "The number of prefixes received from the neighbor"; - } - - leaf sent { - type uint32; - description - "The number of prefixes advertised to the neighbor"; - } - - leaf installed { - type uint32; - description - "The number of advertised prefixes installed in the - Loc-RIB"; - } - } - } - - grouping bgp-neighbor-afi-safi-list { - description - "List of address-families associated with the BGP neighbor"; - - list afi-safi { - key "afi-safi-name"; - - description - "AFI,SAFI configuration available for the - neighbour or group"; - - - leaf afi-safi-name { - type leafref { - path "../config/afi-safi-name"; - } - description - "Reference to the AFI-SAFI name used as a key - for the AFI-SAFI list"; - } - - container config { - description - "Configuration parameters for the AFI-SAFI"; - uses bgp-common-mp-afi-safi-config; - } - container state { - config false; - description - "State information relating to the AFI-SAFI"; - uses bgp-common-mp-afi-safi-config; - uses bgp-neighbor-afi-safi-state; - } - - - container graceful-restart { - description - "Parameters relating to BGP graceful-restart"; - container config { - description - "Configuration options for BGP graceful-restart"; - uses bgp-common-mp-afi-safi-graceful-restart-config; - } - container state { - config false; - description - "State information for BGP graceful-restart"; - uses bgp-common-mp-afi-safi-graceful-restart-config; - uses bgp-neighbor-afi-safi-graceful-restart-state; - } - } - - uses bgp-common-mp-all-afi-safi-list-contents; - uses bgp-neighbor-use-multiple-paths; - } - } - - grouping bgp-neighbor-base { - description - "Parameters related to a BGP neighbor"; - - container config { - description - "Configuration parameters relating to the BGP neighbor or - group"; - uses bgp-neighbor-config; - uses bgp-common-neighbor-group-config; - } - container state { - config false; - description - "State information relating to the BGP neighbor"; - uses bgp-neighbor-config; - uses bgp-common-neighbor-group-config; - uses bgp-neighbor-state; - } - - container timers { - description - "Timers related to a BGP neighbor"; - container config { - description - "Configuration parameters relating to timers used for the - BGP neighbor"; - uses bgp-common-neighbor-group-timers-config; - } - container state { - config false; - description - "State information relating to the timers used for the BGP - neighbor"; - uses bgp-common-neighbor-group-timers-config; - uses bgp-neighbor-timers-state; - } - } - - container transport { - description - "Transport session parameters for the BGP neighbor"; - container config { - description - "Configuration parameters relating to the transport - session(s) used for the BGP neighbor"; - uses bgp-common-neighbor-group-transport-config; - } - container state { - config false; - description - "State information relating to the transport session(s) - used for the BGP neighbor"; - uses bgp-common-neighbor-group-transport-config; - uses bgp-neighbor-transport-state; - } - } - - container error-handling { - description - "Error handling parameters used for the BGP neighbor or - group"; - container config { - description - "Configuration parameters enabling or modifying the - behavior or enhanced error handling mechanisms for the BGP - neighbor"; - uses bgp-common-neighbor-group-error-handling-config; - } - container state { - config false; - description - "State information relating to enhanced error handling - mechanisms for the BGP neighbor"; - uses bgp-common-neighbor-group-error-handling-config; - uses bgp-neighbor-error-handling-state; - } - } - - container graceful-restart { - description - "Parameters relating the graceful restart mechanism for BGP"; - container config { - description - "Configuration parameters relating to graceful-restart"; - uses bgp-common-graceful-restart-config; - } - container state { - config false; - description - "State information associated with graceful-restart"; - uses bgp-common-graceful-restart-config; - uses bgp-neighbor-graceful-restart-state; - } - } - - uses bgp-common-structure-neighbor-group-logging-options; - uses bgp-common-structure-neighbor-group-ebgp-multihop; - uses bgp-common-structure-neighbor-group-route-reflector; - uses bgp-common-structure-neighbor-group-as-path-options; - uses bgp-common-structure-neighbor-group-add-paths; - uses bgp-neighbor-use-multiple-paths; - uses oc-rpol:apply-policy-group; - - container afi-safis { - description - "Per-address-family configuration parameters associated with - the neighbor"; - uses bgp-neighbor-afi-safi-list; - } - } - - grouping bgp-neighbor-list { - description - "The list of BGP neighbors"; - - list neighbor { - key "neighbor-address"; - description - "List of BGP neighbors configured on the local system, - uniquely identified by peer IPv[46] address"; - - leaf neighbor-address { - type leafref { - path "../config/neighbor-address"; - } - description - "Reference to the address of the BGP neighbor used as - a key in the neighbor list"; - } - - uses bgp-neighbor-base; - } - - } - - -} diff --git a/sdk/cpp/core/tests/models/openconfig-bgp-peer-group.yang b/sdk/cpp/core/tests/models/openconfig-bgp-peer-group.yang deleted file mode 100644 index 1998e1ada..000000000 --- a/sdk/cpp/core/tests/models/openconfig-bgp-peer-group.yang +++ /dev/null @@ -1,235 +0,0 @@ -submodule openconfig-bgp-peer-group { - - belongs-to openconfig-bgp { - prefix "oc-bgp"; - } - - import openconfig-extensions { prefix oc-ext; } - import openconfig-routing-policy { prefix oc-rpol; } - - // Include the common submodule - include openconfig-bgp-common; - include openconfig-bgp-common-multiprotocol; - include openconfig-bgp-common-structure; - - // meta - organization - "OpenConfig working group"; - - contact - "OpenConfig working group - netopenconfig@googlegroups.com"; - - description - "This sub-module contains groupings that are specific to the - peer-group context of the OpenConfig BGP module."; - - oc-ext:openconfig-version "2.1.1"; - - revision "2016-06-21" { - description - "OpenConfig BGP refactor"; - reference "2.1.1"; - } - - grouping bgp-peer-group-config { - description - "Configuration parameters relating to a base BGP peer group that - are not also applicable to any other context (e.g., neighbor)"; - - leaf peer-group-name { - type string; - description - "Name of the BGP peer-group"; - } - - } - - grouping bgp-peer-group-afi-safi-list { - description - "List of address-families associated with the BGP peer-group"; - - list afi-safi { - key "afi-safi-name"; - - description - "AFI,SAFI configuration available for the - neighbour or group"; - - leaf afi-safi-name { - type leafref { - path "../config/afi-safi-name"; - } - description - "Reference to the AFI-SAFI name used as a key - for the AFI-SAFI list"; - } - - container config { - description - "Configuration parameters for the AFI-SAFI"; - uses bgp-common-mp-afi-safi-config; - } - container state { - config false; - description - "State information relating to the AFI-SAFI"; - uses bgp-common-mp-afi-safi-config; - } - - container graceful-restart { - description - "Parameters relating to BGP graceful-restart"; - container config { - description - "Configuration options for BGP graceful-restart"; - uses bgp-common-mp-afi-safi-graceful-restart-config; - } - container state { - config false; - description - "State information for BGP graceful-restart"; - uses bgp-common-mp-afi-safi-graceful-restart-config; - } - } - - uses bgp-common-route-selection-options; - uses bgp-common-global-group-use-multiple-paths; - uses bgp-common-mp-all-afi-safi-list-contents; - } - } - - grouping bgp-peer-group-base { - description - "Parameters related to a BGP group"; - - container config { - description - "Configuration parameters relating to the BGP neighbor or - group"; - uses bgp-peer-group-config; - uses bgp-common-neighbor-group-config; - } - container state { - config false; - description - "State information relating to the BGP peer-group"; - uses bgp-peer-group-config; - uses bgp-common-neighbor-group-config; - uses bgp-common-state; - } - - container timers { - description - "Timers related to a BGP peer-group"; - - container config { - description - "Configuration parameters relating to timers used for the - BGP neighbor or peer group"; - uses bgp-common-neighbor-group-timers-config; - } - container state { - config false; - description - "State information relating to the timers used for the BGP - group"; - uses bgp-common-neighbor-group-timers-config; - } - } - - container transport { - description - "Transport session parameters for the BGP peer-group"; - - container config { - description - "Configuration parameters relating to the transport - session(s) used for the BGP neighbor or group"; - uses bgp-common-neighbor-group-transport-config; - } - container state { - config false; - description - "State information relating to the transport session(s) - used for the BGP neighbor or group"; - uses bgp-common-neighbor-group-transport-config; - } - } - - container error-handling { - description - "Error handling parameters used for the BGP peer-group"; - - container config { - description - "Configuration parameters enabling or modifying the - behavior or enhanced error handling mechanisms for the BGP - group"; - uses bgp-common-neighbor-group-error-handling-config; - } - container state { - config false; - description - "State information relating to enhanced error handling - mechanisms for the BGP group"; - uses bgp-common-neighbor-group-error-handling-config; - } - } - - container graceful-restart { - description - "Parameters relating the graceful restart mechanism for BGP"; - container config { - description - "Configuration parameters relating to graceful-restart"; - uses bgp-common-graceful-restart-config; - } - container state { - config false; - description - "State information associated with graceful-restart"; - uses bgp-common-graceful-restart-config; - } - } - - uses bgp-common-structure-neighbor-group-logging-options; - uses bgp-common-structure-neighbor-group-ebgp-multihop; - uses bgp-common-structure-neighbor-group-route-reflector; - uses bgp-common-structure-neighbor-group-as-path-options; - uses bgp-common-structure-neighbor-group-add-paths; - uses bgp-common-global-group-use-multiple-paths; - uses oc-rpol:apply-policy-group; - - container afi-safis { - description - "Per-address-family configuration parameters associated with - thegroup"; - uses bgp-peer-group-afi-safi-list; - } - } - - grouping bgp-peer-group-list { - description - "The list of BGP peer groups"; - - list peer-group { - key "peer-group-name"; - description - "List of BGP peer-groups configured on the local system - - uniquely identified by peer-group name"; - - leaf peer-group-name { - type leafref { - path "../config/peer-group-name"; - } - description - "Reference to the name of the BGP peer-group used as a - key in the peer-group list"; - } - - uses bgp-peer-group-base; - } - } - -} diff --git a/sdk/cpp/core/tests/models/openconfig-bgp-policy.yang b/sdk/cpp/core/tests/models/openconfig-bgp-policy.yang deleted file mode 100644 index cdf11fa7c..000000000 --- a/sdk/cpp/core/tests/models/openconfig-bgp-policy.yang +++ /dev/null @@ -1,1164 +0,0 @@ -module openconfig-bgp-policy { - - yang-version "1"; - - // namespace - namespace "http://openconfig.net/yang/bgp-policy"; - - prefix "oc-bgp-pol"; - - // import some basic types - import ietf-inet-types { prefix inet; } - import openconfig-routing-policy {prefix oc-rpol; } - import openconfig-policy-types { prefix oc-pol-types; } - import openconfig-bgp-types { prefix oc-bgp-types; } - import openconfig-extensions { prefix oc-ext; } - - - // meta - organization - "OpenConfig working group"; - - contact - "OpenConfig working group - netopenconfig@googlegroups.com"; - - description - "This module contains data definitions for BGP routing policy. - It augments the base routing-policy module with BGP-specific - options for conditions and actions."; - - oc-ext:openconfig-version "2.1.1"; - - revision "2016-06-21" { - description - "OpenConfig BGP refactor"; - reference "2.1.1"; - } - - - // typedef statements - - typedef bgp-set-community-option-type { - type enumeration { - enum ADD { - description - "add the specified communities to the existing - community attribute"; - } - enum REMOVE { - description - "remove the specified communities from the - existing community attribute"; - } - enum REPLACE { - description - "replace the existing community attribute with - the specified communities. If an empty set is - specified, this removes the community attribute - from the route."; - } - } - description - "Type definition for options when setting the community - attribute in a policy action"; - } - - typedef bgp-next-hop-type { - type union { - type inet:ip-address-no-zone; - type enumeration { - enum SELF { - description "special designation for local router's own - address, i.e., next-hop-self"; - } - } - } - description - "type definition for specifying next-hop in policy actions"; - } - - typedef bgp-set-med-type { - type union { - type uint32; - type string { - pattern "^[+-][0-9]+"; - } - type enumeration { - enum IGP { - description "set the MED value to the IGP cost toward the - next hop for the route"; - } - } - } - description - "Type definition for specifying how the BGP MED can - be set in BGP policy actions. The three choices are to set - the MED directly, increment/decrement using +/- notation, - and setting it to the IGP cost (predefined value)."; - } - - // grouping statements - - grouping match-community-config { - description - "Configuration data for match conditions on communities"; - - leaf community-set { - type leafref { - path "/oc-rpol:routing-policy/oc-rpol:defined-sets/" + - "oc-bgp-pol:bgp-defined-sets/oc-bgp-pol:community-sets/" + - "oc-bgp-pol:community-set/oc-bgp-pol:community-set-name"; - } - description - "References a defined community set"; - } - - uses oc-rpol:match-set-options-group; - } - - grouping match-community-state { - description - "Operational state data for match conditions on communities"; - } - - grouping match-community-top { - description - "Top-level grouping for match conditions on communities"; - - container match-community-set { - description - "Top-level container for match conditions on communities. - Match a referenced community-set according to the logic - defined in the match-set-options leaf"; - - container config { - description - "Configuration data for match conditions on communities"; - - uses match-community-config; - } - - container state { - - config false; - - description - "Operational state data "; - - uses match-community-config; - uses match-community-state; - } - } - } - - grouping match-ext-community-config { - description - "Configuration data for match conditions on extended - communities"; - - leaf ext-community-set { - type leafref { - path "/oc-rpol:routing-policy/oc-rpol:defined-sets/" + - "oc-bgp-pol:bgp-defined-sets/oc-bgp-pol:ext-community-sets/" + - "oc-bgp-pol:ext-community-set/" + - "oc-bgp-pol:ext-community-set-name"; - } - description "References a defined extended community set"; - } - - uses oc-rpol:match-set-options-group; - } - - grouping match-ext-community-state { - description - "Operational state data for match conditions on extended - communities"; - } - - grouping match-ext-community-top { - description - "Top-level grouping for match conditions on extended - communities"; - - container match-ext-community-set { - description - "Match a referenced extended community-set according to the - logic defined in the match-set-options leaf"; - - container config { - description - "Configuration data for match conditions on extended - communities"; - - uses match-ext-community-config; - } - - container state { - - config false; - - description - "Operational state data for match conditions on extended - communities"; - - uses match-ext-community-config; - uses match-ext-community-state; - } - } - } - - grouping match-as-path-config { - description - "Configuration data for match conditions on AS path set"; - - leaf as-path-set { - type leafref { - path "/oc-rpol:routing-policy/oc-rpol:defined-sets/" + - "oc-bgp-pol:bgp-defined-sets/oc-bgp-pol:as-path-sets/" + - "oc-bgp-pol:as-path-set/oc-bgp-pol:as-path-set-name"; - } - description "References a defined AS path set"; - } - uses oc-rpol:match-set-options-group; - } - - grouping match-as-path-state { - description - "Operational state data for match conditions on AS path set"; - } - - grouping match-as-path-top { - description - "Top-level grouping for match conditions on AS path set"; - - container match-as-path-set { - description - "Match a referenced as-path set according to the logic - defined in the match-set-options leaf"; - - container config { - description - "Configuration data for match conditions on AS path set"; - - uses match-as-path-config; - } - - container state { - - config false; - - description - "Operational state data for match conditions on AS - path set"; - - uses match-as-path-config; - uses match-as-path-state; - } - } - } - - grouping bgp-match-set-conditions { - description - "Condition statement definitions for checking membership in a - defined set"; - - uses match-community-top; - uses match-ext-community-top; - uses match-as-path-top; - } - - grouping community-count-config { - description - "Configuration data for community count condition"; - - uses oc-pol-types:attribute-compare-operators; - } - - grouping community-count-state { - description - "Operational state data for community count condition"; - } - - grouping community-count-top { - description - "Top-level grouping for community count condition"; - - container community-count { - description - "Value and comparison operations for conditions based on the - number of communities in the route update"; - - container config { - description - "Configuration data for community count condition"; - - uses community-count-config; - } - - container state { - - config false; - - description - "Operational state data for community count condition"; - - uses community-count-config; - uses community-count-state; - } - } - } - - grouping as-path-length-config { - description - "Configuration data for AS path length condition"; - - uses oc-pol-types:attribute-compare-operators; - } - - grouping as-path-length-state { - description - "Operational state data for AS path length condition"; - } - - grouping as-path-length-top { - description - "Top-level grouping for AS path length condition"; - - container as-path-length { - description - "Value and comparison operations for conditions based on the - length of the AS path in the route update"; - - container config { - description - "Configuration data for AS path length condition"; - - uses as-path-length-config; - } - - container state { - - config false; - - description - "Operational state data for AS path length condition"; - - uses as-path-length-config; - uses as-path-length-state; - } - } - } - - grouping bgp-conditions-config { - description - "Configuration data for BGP-specific policy conditions"; - - leaf med-eq { - type uint32; - description - "Condition to check if the received MED value is equal to - the specified value"; - } - - leaf origin-eq { - type oc-bgp-types:bgp-origin-attr-type; - description - "Condition to check if the route origin is equal to the - specified value"; - } - - leaf-list next-hop-in { - type inet:ip-address-no-zone; - description - "List of next hop addresses to check for in the route - update"; - } - - leaf-list afi-safi-in { - type identityref { - base oc-bgp-types:AFI_SAFI_TYPE; - } - description - "List of address families which the NLRI may be - within"; - } - - leaf local-pref-eq { - type uint32; - // TODO: add support for other comparisons if needed - description - "Condition to check if the local pref attribute is equal to - the specified value"; - } - - leaf route-type { - // TODO: verify extent of vendor support for this comparison - type enumeration { - enum INTERNAL { - description "route type is internal"; - } - enum EXTERNAL { - description "route type is external"; - } - } - description - "Condition to check the route type in the route update"; - } - } - - grouping bgp-conditions-state { - description - "Operational state data for BGP-specific policy conditions"; - } - - grouping bgp-conditions-top { - description - "Top-level grouping for BGP-specific policy conditions"; - - container bgp-conditions { - description - "Top-level container "; - - container config { - description - "Configuration data for BGP-specific policy conditions"; - - uses bgp-conditions-config; - } - - container state { - - config false; - - description - "Operational state data for BGP-specific policy - conditions"; - - uses bgp-conditions-config; - uses bgp-conditions-state; - } - - uses community-count-top; - uses as-path-length-top; - uses bgp-match-set-conditions; - } - } - - grouping community-set-config { - description - "Configuration data for BGP community sets"; - - leaf community-set-name { - type string; - //mandatory true; - description - "name / label of the community set -- this is used to - reference the set in match conditions"; - } - - leaf-list community-member { - type union { - type oc-bgp-types:bgp-std-community-type; - type oc-bgp-types:bgp-community-regexp-type; - type oc-bgp-types:bgp-well-known-community-type; - } - description - "members of the community set"; - } - } - - grouping community-set-state { - description - "Operational state data for BGP community sets"; - } - - grouping community-set-top { - description - "Top-level grouping for BGP community sets"; - - container community-sets { - description - "Enclosing container for list of defined BGP community sets"; - - list community-set { - key "community-set-name"; - description - "List of defined BGP community sets"; - - leaf community-set-name { - type leafref { - path "../config/community-set-name"; - } - description - "Reference to list key"; - } - - container config { - description - "Configuration data for BGP community sets"; - - uses community-set-config; - } - - container state { - - config false; - - description - "Operational state data for BGP community sets"; - - uses community-set-config; - uses community-set-state; - } - } - } - } - - grouping ext-community-set-config { - description - "Configuration data for extended BGP community sets"; - - leaf ext-community-set-name { - type string; - description - "name / label of the extended community set -- this is - used to reference the set in match conditions"; - } - - leaf-list ext-community-member { - type union { - type oc-bgp-types:bgp-ext-community-type; - type oc-bgp-types:bgp-community-regexp-type; - } - description - "members of the extended community set"; - } - } - - grouping ext-community-set-state { - description - "Operational state data for extended BGP community sets"; - } - - grouping ext-community-set-top { - description - "Top-level grouping for extended BGP community sets"; - - container ext-community-sets { - description - "Enclosing container for list of extended BGP community - sets"; - - list ext-community-set { - key "ext-community-set-name"; - description - "List of defined extended BGP community sets"; - - leaf ext-community-set-name { - type leafref { - path "../config/ext-community-set-name"; - } - description - "Reference to list key"; - } - - container config { - description - "Configuration data for extended BGP community sets"; - - uses ext-community-set-config; - } - - container state { - - config false; - - description - "Operational state data for extended BGP community sets"; - - uses ext-community-set-config; - uses ext-community-set-state; - } - } - } - } - - grouping as-path-set-config { - description - "Configuration data for AS path sets"; - - leaf as-path-set-name { - type string; - description - "name of the AS path set -- this is used to reference - the set in match conditions"; - } - - leaf-list as-path-set-member { - // TODO: need to refine typedef for AS path expressions - type string; - description - "AS path expression -- list of ASes in the set"; - } - } - - grouping as-path-set-state { - description - "Operational state data for AS path sets"; - } - - grouping as-path-set-top { - description - "Top-level grouping for AS path sets"; - - container as-path-sets { - description - "Enclosing container for list of define AS path sets"; - - list as-path-set { - key "as-path-set-name"; - description - "List of defined AS path sets"; - - leaf as-path-set-name { - type leafref { - path "../config/as-path-set-name"; - } - description - "Reference to list key"; - } - - container config { - description - "Configuration data for AS path sets"; - - uses as-path-set-config; - } - - container state { - - config false; - - description - "Operational state data for AS path sets"; - - uses as-path-set-config; - uses as-path-set-state; - } - } - } - } - - // augment statements - - augment "/oc-rpol:routing-policy/oc-rpol:defined-sets" { - description "adds BGP defined sets container to routing policy - model"; - - container bgp-defined-sets { - description - "BGP-related set definitions for policy match conditions"; - - uses community-set-top; - uses ext-community-set-top; - uses as-path-set-top; - } - } - - grouping as-path-prepend-config { - description - "Configuration data for the AS path prepend action"; - - leaf repeat-n { - type uint8 { - range 1..max; - } - description - "Number of times to prepend the local AS number to the AS - path. The value should be between 1 and the maximum - supported by the implementation."; - } - } - - grouping as-path-prepend-state { - description - "Operational state data for the AS path prepend action"; - } - - grouping as-path-prepend-top { - description - "Top-level grouping for the AS path prepend action"; - - container set-as-path-prepend { - description - "action to prepend local AS number to the AS-path a - specified number of times"; - - container config { - description - "Configuration data for the AS path prepend action"; - - - uses as-path-prepend-config; - } - - container state { - - config false; - - description - "Operational state data for the AS path prepend action"; - - uses as-path-prepend-config; - uses as-path-prepend-state; - } - } - } - - grouping set-community-action-common { - description - "Common leaves for set-community and set-ext-community - actions"; - - leaf method { - type enumeration { - enum INLINE { - description - "The extended communities are specified inline as a - list"; - } - enum REFERENCE { - description - "The extended communities are specified by referencing a - defined ext-community set"; - } - } - description - "Indicates the method used to specify the extended - communities for the set-ext-community action"; - } - - leaf options { - type bgp-set-community-option-type; - description - "Options for modifying the community attribute with - the specified values. These options apply to both - methods of setting the community attribute."; - } - } - - grouping set-community-inline-config { - description - "Configuration data for inline specification of set-community - action"; - - leaf-list communities { - type union { - type oc-bgp-types:bgp-std-community-type; - type oc-bgp-types:bgp-well-known-community-type; - } - description - "Set the community values for the update inline with - a list."; - } - } - - grouping set-community-inline-state { - description - "Operational state data or inline specification of - set-community action"; - } - - grouping set-community-inline-top { - description - "Top-level grouping or inline specification of set-community - action"; - - container inline { - /*when "../config/method=INLINE" { - description - "Active only when the set-community method is INLINE"; - }*/ - description - "Set the community values for the action inline with - a list."; - - container config { - description - "Configuration data or inline specification of set-community - action"; - - uses set-community-inline-config; - } - - container state { - - config false; - - description - "Operational state data or inline specification of - set-community action"; - - uses set-community-inline-config; - uses set-community-inline-state; - } - } - } - - grouping set-community-reference-config { - description - "Configuration data for referening a community-set in the - set-community action"; - - leaf community-set-ref { - type leafref { - path "/oc-rpol:routing-policy/oc-rpol:defined-sets/" + - "oc-bgp-pol:bgp-defined-sets/" + - "oc-bgp-pol:community-sets/oc-bgp-pol:community-set/" + - "oc-bgp-pol:community-set-name"; - } - description - "References a defined community set by name"; - } - } - - grouping set-community-reference-state { - description - "Operational state data for referening a community-set in the - set-community action"; - } - - grouping set-community-reference-top { - description - "Top-level grouping for referening a community-set in the - set-community action"; - - container reference { - /*when "../config/method=REFERENCE" { - description - "Active only when the set-community method is REFERENCE"; - }*/ - description - "Provide a reference to a defined community set for the - set-community action"; - - container config { - description - "Configuration data for referening a community-set in the - set-community action"; - - uses set-community-reference-config; - } - - container state { - - config false; - - description - "Operational state data for referening a community-set - in the set-community action"; - - uses set-community-reference-config; - uses set-community-reference-state; - } - } - } - - grouping set-community-action-config { - description - "Configuration data for the set-community action"; - - uses set-community-action-common; - } - - grouping set-community-action-state { - description - "Operational state data for the set-community action"; - } - - grouping set-community-action-top { - description - "Top-level grouping for the set-community action"; - - container set-community { - description - "Action to set the community attributes of the route, along - with options to modify how the community is modified. - Communities may be set using an inline list OR - reference to an existing defined set (not both)."; - - container config { - description - "Configuration data for the set-community action"; - - uses set-community-action-config; - } - - container state { - - config false; - - description - "Operational state data for the set-community action"; - - uses set-community-action-config; - uses set-community-action-state; - } - - uses set-community-inline-top; - uses set-community-reference-top; - } - } - - grouping set-ext-community-inline-config { - description - "Configuration data for inline specification of - set-ext-community action"; - - leaf-list communities { - type union { - type oc-bgp-types:bgp-ext-community-type; - type oc-bgp-types:bgp-well-known-community-type; - } - description - "Set the extended community values for the update inline - with a list."; - } - } - - grouping set-ext-community-inline-state { - description - "Operational state data or inline specification of - set-ext-community action"; - } - - grouping set-ext-community-inline-top { - description - "Top-level grouping or inline specification of set-ext-community - action"; - - container inline { - /*when "../config/method=INLINE" { - description - "Active only when the set-community method is INLINE"; - }*/ - description - "Set the extended community values for the action inline with - a list."; - - container config { - description - "Configuration data or inline specification of - set-ext-community action"; - - uses set-ext-community-inline-config; - } - - container state { - - config false; - - description - "Operational state data or inline specification of - set-ext-community action"; - - uses set-ext-community-inline-config; - uses set-ext-community-inline-state; - } - } - } - - grouping set-ext-community-reference-config { - description - "Configuration data for referening a extended community-set - in the set-ext-community action"; - - leaf ext-community-set-ref { - type leafref { - path "/oc-rpol:routing-policy/oc-rpol:defined-sets/" + - "oc-bgp-pol:bgp-defined-sets/" + - "oc-bgp-pol:ext-community-sets/" + - "oc-bgp-pol:ext-community-set/" + - "oc-bgp-pol:ext-community-set-name"; - } - description - "References a defined extended community set by - name"; - } - } - - grouping set-ext-community-reference-state { - description - "Operational state data for referening an extended - community-set in the set-ext-community action"; - } - - grouping set-ext-community-reference-top { - description - "Top-level grouping for referening an extended community-set - in the set-community action"; - - container reference { - /*when "../config/method=REFERENCE" { - description - "Active only when the set-community method is REFERENCE"; - }*/ - description - "Provide a reference to an extended community set for the - set-ext-community action"; - - container config { - description - "Configuration data for referening an extended - community-set in the set-ext-community action"; - - uses set-ext-community-reference-config; - } - - container state { - - config false; - - description - "Operational state data for referening an extended - community-set in the set-ext-community action"; - - uses set-ext-community-reference-config; - uses set-ext-community-reference-state; - } - } - } - - grouping set-ext-community-action-config { - description - "Configuration data for the set-ext-community action"; - - uses set-community-action-common; - } - - grouping set-ext-community-action-state { - description - "Operational state data for the set-ext-community action"; - } - - grouping set-ext-community-action-top { - description - "Top-level grouping for the set-ext-community action"; - - container set-ext-community { - description - "Action to set the extended community attributes of the - route, along with options to modify how the community is - modified. Extended communities may be set using an inline - list OR a reference to an existing defined set (but not - both)."; - - container config { - description - "Configuration data for the set-ext-community action"; - - uses set-ext-community-action-config; - } - - container state { - - config false; - - description - "Operational state data for the set-ext-community action"; - - uses set-ext-community-action-config; - uses set-ext-community-action-state; - } - uses set-ext-community-inline-top; - uses set-ext-community-reference-top; - } - } - - grouping bgp-actions-config { - description - "Configuration data for BGP-specific actions"; - - leaf set-route-origin { - type oc-bgp-types:bgp-origin-attr-type; - description "set the origin attribute to the specified - value"; - } - - leaf set-local-pref { - type uint32; - description "set the local pref attribute on the route - update"; - } - - leaf set-next-hop { - type bgp-next-hop-type; - description "set the next-hop attribute in the route update"; - } - - leaf set-med { - type bgp-set-med-type; - description "set the med metric attribute in the route - update"; - } - } - - grouping bgp-actions-state { - description - "Operational state data for BGP-specific actions"; - } - - grouping bgp-actions-top { - description - "Top-level grouping for BGP-specific actions"; - - container bgp-actions { - description - "Top-level container for BGP-specific actions"; - - container config { - description - "Configuration data for BGP-specific actions"; - - uses bgp-actions-config; - } - - container state { - - config false; - - description - "Operational state data for BGP-specific actions"; - - uses bgp-actions-config; - uses bgp-actions-state; - } - uses as-path-prepend-top; - uses set-community-action-top; - uses set-ext-community-action-top; - } - } - - augment "/oc-rpol:routing-policy/oc-rpol:policy-definitions/" + - "oc-rpol:policy-definition/oc-rpol:statements/oc-rpol:statement/" + - "oc-rpol:conditions" { - description - "BGP policy conditions added to routing policy module"; - - uses bgp-conditions-top; - } - - augment "/oc-rpol:routing-policy/oc-rpol:policy-definitions/" + - "oc-rpol:policy-definition/oc-rpol:statements/oc-rpol:statement/" + - "oc-rpol:actions" { - description "BGP policy actions added to routing policy - module"; - - uses bgp-actions-top; - } - - // rpc statements - - // notification statements -} diff --git a/sdk/cpp/core/tests/models/openconfig-bgp-types.yang b/sdk/cpp/core/tests/models/openconfig-bgp-types.yang deleted file mode 100644 index 567e45213..000000000 --- a/sdk/cpp/core/tests/models/openconfig-bgp-types.yang +++ /dev/null @@ -1,422 +0,0 @@ -module openconfig-bgp-types { - yang-version "1"; - - namespace "http://openconfig.net/yang/bgp-types"; - - prefix "oc-bgp-types"; - - import ietf-inet-types { prefix inet; } - import openconfig-types { prefix oc-types; } - import openconfig-extensions { prefix oc-ext; } - - // meta - organization - "OpenConfig working group"; - - contact - "OpenConfig working group - netopenconfig@googlegroups.com"; - - description - "This module contains general data definitions for use in BGP - policy. It can be imported by modules that make use of BGP - attributes"; - - oc-ext:openconfig-version "2.1.1"; - - revision "2016-06-21" { - description - "OpenConfig BGP refactor"; - reference "2.1.1"; - } - - - identity BGP_CAPABILITY { - description "Base identity for a BGP capability"; - } - - identity MPBGP { - base BGP_CAPABILITY; - description - "Multi-protocol extensions to BGP"; - reference "RFC2858"; - } - - identity ROUTE_REFRESH { - base BGP_CAPABILITY; - description - "The BGP route-refresh functionality"; - reference "RFC2918"; - } - - identity ASN32 { - base BGP_CAPABILITY; - description - "4-byte (32-bit) AS number functionality"; - reference "RFC6793"; - } - - identity GRACEFUL_RESTART { - base BGP_CAPABILITY; - description - "Graceful restart functionality"; - reference "RFC4724"; - } - - identity ADD_PATHS { - base BGP_CAPABILITY; - description - "BGP add-paths"; - reference "draft-ietf-idr-add-paths"; - } - - identity AFI_SAFI_TYPE { - description - "Base identity type for AFI,SAFI tuples for BGP-4"; - reference "RFC4760 - multiprotocol extensions for BGP-4"; - } - - identity IPV4_UNICAST { - base AFI_SAFI_TYPE; - description - "IPv4 unicast (AFI,SAFI = 1,1)"; - reference "RFC4760"; - } - - identity IPV6_UNICAST { - base AFI_SAFI_TYPE; - description - "IPv6 unicast (AFI,SAFI = 2,1)"; - reference "RFC4760"; - } - - identity IPV4_LABELED_UNICAST { - base AFI_SAFI_TYPE; - description - "Labeled IPv4 unicast (AFI,SAFI = 1,4)"; - reference "RFC3107"; - } - - identity IPV6_LABELED_UNICAST { - base AFI_SAFI_TYPE; - description - "Labeled IPv6 unicast (AFI,SAFI = 2,4)"; - reference "RFC3107"; - } - - identity L3VPN_IPV4_UNICAST { - base AFI_SAFI_TYPE; - description - "Unicast IPv4 MPLS L3VPN (AFI,SAFI = 1,128)"; - reference "RFC4364"; - } - - identity L3VPN_IPV6_UNICAST { - base AFI_SAFI_TYPE; - description - "Unicast IPv6 MPLS L3VPN (AFI,SAFI = 2,128)"; - reference "RFC4659"; - } - - identity L3VPN_IPV4_MULTICAST { - base AFI_SAFI_TYPE; - description - "Multicast IPv4 MPLS L3VPN (AFI,SAFI = 1,129)"; - reference "RFC6514"; - } - - identity L3VPN_IPV6_MULTICAST { - base AFI_SAFI_TYPE; - description - "Multicast IPv6 MPLS L3VPN (AFI,SAFI = 2,129)"; - reference "RFC6514"; - } - - identity L2VPN_VPLS { - base AFI_SAFI_TYPE; - description - "BGP-signalled VPLS (AFI,SAFI = 25,65)"; - reference "RFC4761"; - } - - identity L2VPN_EVPN { - base AFI_SAFI_TYPE; - description - "BGP MPLS Based Ethernet VPN (AFI,SAFI = 25,70)"; - } - - identity BGP_WELL_KNOWN_STD_COMMUNITY { - description - "Reserved communities within the standard community space - defined by RFC1997. These communities must fall within the - range 0x00000000 to 0xFFFFFFFF"; - reference "RFC1997"; - } - - identity NO_EXPORT { - base BGP_WELL_KNOWN_STD_COMMUNITY; - description - "Do not export NLRI received carrying this community outside - the bounds of this autonomous system, or this confederation if - the local autonomous system is a confederation member AS. This - community has a value of 0xFFFFFF01."; - reference "RFC1997"; - } - - identity NO_ADVERTISE { - base BGP_WELL_KNOWN_STD_COMMUNITY; - description - "All NLRI received carrying this community must not be - advertised to other BGP peers. This community has a value of - 0xFFFFFF02."; - reference "RFC1997"; - } - - identity NO_EXPORT_SUBCONFED { - base BGP_WELL_KNOWN_STD_COMMUNITY; - description - "All NLRI received carrying this community must not be - advertised to external BGP peers - including over confederation - sub-AS boundaries. This community has a value of 0xFFFFFF03."; - reference "RFC1997"; - } - - identity NOPEER { - base BGP_WELL_KNOWN_STD_COMMUNITY; - description - "An autonomous system receiving NLRI tagged with this community - is advised not to readvertise the NLRI to external bi-lateral - peer autonomous systems. An AS may also filter received NLRI - from bilateral peer sessions when they are tagged with this - community value"; - reference "RFC3765"; - } - - typedef bgp-session-direction { - type enumeration { - enum INBOUND { - description - "Refers to all NLRI received from the BGP peer"; - } - enum OUTBOUND { - description - "Refers to all NLRI advertised to the BGP peer"; - } - } - description - "Type to describe the direction of NLRI transmission"; - } - - typedef bgp-well-known-community-type { - type identityref { - base BGP_WELL_KNOWN_STD_COMMUNITY; - } - description - "Type definition for well-known IETF community attribute - values"; - reference - "IANA Border Gateway Protocol (BGP) Well Known Communities"; - } - - - typedef bgp-std-community-type { - // TODO: further refine restrictions and allowed patterns - // 4-octet value: - // 2 octets - // 2 octets - type union { - type uint32 { - // per RFC 1997, 0x00000000 - 0x0000FFFF and 0xFFFF0000 - - // 0xFFFFFFFF are reserved - range "65536..4294901759"; // 0x00010000..0xFFFEFFFF - } - type string { - pattern '([0-9]+:[0-9]+)'; - } - } - description - "Type definition for standard commmunity attributes"; - reference "RFC 1997 - BGP Communities Attribute"; - } - - typedef bgp-ext-community-type { - // TODO: needs more work to make this more precise given the - // variability of extended community attribute specifications - // 8-octet value: - // 2 octects - // 6 octets - - type union { - type string { - // Type 1: 2-octet global and 4-octet local - // (AS number) (Integer) - pattern '(6[0-5][0-5][0-3][0-5]|[1-5][0-9]{4}|' + - '[1-9][0-9]{1,4}|[0-9]):' + - '(4[0-2][0-9][0-4][0-9][0-6][0-7][0-2][0-9][0-6]|' + - '[1-3][0-9]{9}|[1-9]([0-9]{1,7})?[0-9]|[1-9])'; - } - type string { - // Type 2: 4-octet global and 2-octet local - // (ipv4-address) (integer) - 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]):' + - '(6[0-5][0-5][0-3][0-5]|[1-5][0-9]{4}|' + - '[1-9][0-9]{1,4}|[0-9])'; - } - type string { - // route-target with Type 1 - // route-target:(ASN):(local-part) - pattern 'route\-target:(6[0-5][0-5][0-3][0-5]|' + - '[1-5][0-9]{4}|[1-9][0-9]{1,4}|[0-9]):' + - '(4[0-2][0-9][0-4][0-9][0-6][0-7][0-2][0-9][0-6]|' + - '[1-3][0-9]{9}|[1-9]([0-9]{1,7})?[0-9]|[1-9])'; - } - type string { - // route-target with Type 2 - // route-target:(IPv4):(local-part) - pattern 'route\-target:' + - '(([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]):' + - '(6[0-5][0-5][0-3][0-5]|[1-5][0-9]{4}|' + - '[1-9][0-9]{1,4}|[0-9])'; - } - type string { - // route-origin with Type 1 - pattern 'route\-origin:(6[0-5][0-5][0-3][0-5]|' + - '[1-5][0-9]{4}|[1-9][0-9]{1,4}|[0-9]):' + - '(4[0-2][0-9][0-4][0-9][0-6][0-7][0-2][0-9][0-6]|' + - '[1-3][0-9]{9}|[1-9]([0-9]{1,7})?[0-9]|[1-9])'; - } - type string { - // route-origin with Type 2 - pattern 'route\-origin:' + - '(([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]):' + - '(6[0-5][0-5][0-3][0-5]|[1-5][0-9]{4}|' + - '[1-9][0-9]{1,4}|[0-9])'; - } - } - description - "Type definition for extended community attributes"; - reference "RFC 4360 - BGP Extended Communities Attribute"; - } - - typedef bgp-community-regexp-type { - // TODO: needs more work to decide what format these regexps can - // take. - type oc-types:std-regexp; - description - "Type definition for communities specified as regular - expression patterns"; - } - - typedef bgp-origin-attr-type { - type enumeration { - enum IGP { - description "Origin of the NLRI is internal"; - } - enum EGP { - description "Origin of the NLRI is EGP"; - } - enum INCOMPLETE { - description "Origin of the NLRI is neither IGP or EGP"; - } - } - description - "Type definition for standard BGP origin attribute"; - reference "RFC 4271 - A Border Gateway Protocol 4 (BGP-4), - Sec 4.3"; - } - - typedef peer-type { - type enumeration { - enum INTERNAL { - description "internal (iBGP) peer"; - } - enum EXTERNAL { - description "external (eBGP) peer"; - } - } - description - "labels a peer or peer group as explicitly internal or - external"; - } - - identity REMOVE_PRIVATE_AS_OPTION { - description - "Base identity for options for removing private autonomous - system numbers from the AS_PATH attribute"; - } - - identity PRIVATE_AS_REMOVE_ALL { - base REMOVE_PRIVATE_AS_OPTION; - description - "Strip all private autonmous system numbers from the AS_PATH. - This action is performed regardless of the other content of the - AS_PATH attribute, and for all instances of private AS numbers - within that attribute."; - } - - identity PRIVATE_AS_REPLACE_ALL { - base REMOVE_PRIVATE_AS_OPTION; - description - "Replace all instances of private autonomous system numbers in - the AS_PATH with the local BGP speaker's autonomous system - number. This action is performed regardless of the other - content of the AS_PATH attribute, and for all instances of - private AS number within that attribute."; - } - - typedef remove-private-as-option { - type identityref { - base REMOVE_PRIVATE_AS_OPTION; - } - description - "set of options for configuring how private AS path numbers - are removed from advertisements"; - } - - typedef percentage { - type uint8 { - range "0..100"; - } - description - "Integer indicating a percentage value"; - } - - typedef rr-cluster-id-type { - type union { - type uint32; - type inet:ipv4-address; - } - description - "union type for route reflector cluster ids: - option 1: 4-byte number - option 2: IP address"; - } - - typedef community-type { - type enumeration { - enum STANDARD { - description "send only standard communities"; - } - enum EXTENDED { - description "send only extended communities"; - } - enum BOTH { - description "send both standard and extended communities"; - } - enum NONE { - description "do not send any community attribute"; - } - } - description - "type describing variations of community attributes: - STANDARD: standard BGP community [rfc1997] - EXTENDED: extended BGP community [rfc4360] - BOTH: both standard and extended community"; - } -} diff --git a/sdk/cpp/core/tests/models/openconfig-bgp.yang b/sdk/cpp/core/tests/models/openconfig-bgp.yang deleted file mode 100644 index e3c5c184a..000000000 --- a/sdk/cpp/core/tests/models/openconfig-bgp.yang +++ /dev/null @@ -1,114 +0,0 @@ -module openconfig-bgp { - - yang-version "1"; - - // namespace - namespace "http://openconfig.net/yang/bgp"; - - prefix "oc-bgp"; - - // import some basic inet types - import openconfig-extensions { prefix oc-ext; } - import openconfig-routing-policy { prefix oc-rpol; } - - // Include the OpenConfig BGP submodules - // Common: defines the groupings that are common across more than - // one context (where contexts are neighbor, group, global) - include openconfig-bgp-common; - // Multiprotocol: defines the groupings that are common across more - // than one context, and relate to Multiprotocol - include openconfig-bgp-common-multiprotocol; - // Structure: defines groupings that are shared but are solely used for - // structural reasons. - include openconfig-bgp-common-structure; - // Include peer-group/neighbor/global - these define the groupings - // that are specific to one context - include openconfig-bgp-peer-group; - include openconfig-bgp-neighbor; - include openconfig-bgp-global; - - // meta - organization - "OpenConfig working group"; - - contact - "OpenConfig working group - netopenconfig@googlegroups.com"; - - description - "This module describes a YANG model for BGP protocol - configuration.It is a limited subset of all of the configuration - parameters available in the variety of vendor implementations, - hence it is expected that it would be augmented with vendor- - specific configuration data as needed. Additional modules or - submodules to handle other aspects of BGP configuration, - including policy, VRFs, VPNs, and additional address families - are also expected. - - This model supports the following BGP configuration level - hierarchy: - - BGP - | - +-> [ global BGP configuration ] - +-> AFI / SAFI global - +-> peer group - +-> [ peer group config ] - +-> AFI / SAFI [ per-AFI overrides ] - +-> neighbor - +-> [ neighbor config ] - +-> [ optional pointer to peer-group ] - +-> AFI / SAFI [ per-AFI overrides ]"; - - oc-ext:openconfig-version "2.1.1"; - - revision "2016-06-21" { - description - "OpenConfig BGP refactor"; - reference "2.1.1"; - } - - revision "2016-06-06" { - description - "OpenConfig public release"; - reference "2.1.0"; - } - - revision "2016-03-31" { - description - "OpenConfig public release"; - reference "2.0.1"; - } - - grouping bgp-top { - description - "Top-level grouping for the BGP model data"; - - container bgp { - description - "Top-level configuration and state for the BGP router"; - - container global { - description - "Global configuration for the BGP router"; - uses bgp-global-base; - uses oc-rpol:apply-policy-group; - } - - container neighbors { - description - "Configuration for BGP neighbors"; - uses bgp-neighbor-list; - } - - container peer-groups { - description - "Configuration for BGP peer-groups"; - uses bgp-peer-group-list; - } - } - } - - uses bgp-top; - -} diff --git a/sdk/cpp/core/tests/models/openconfig-extensions.yang b/sdk/cpp/core/tests/models/openconfig-extensions.yang deleted file mode 100644 index d5e9442a8..000000000 --- a/sdk/cpp/core/tests/models/openconfig-extensions.yang +++ /dev/null @@ -1,69 +0,0 @@ -module openconfig-extensions { - - yang-version "1"; - - // namespace - namespace "http://openconfig.net/yang/openconfig-ext"; - - prefix "ocext"; - - // meta - organization "OpenConfig working group"; - - contact - "OpenConfig working group - www.openconfig.net"; - - description - "This module provides extensions to the YANG language to allow - OpenConfig specific functionality and meta-data to be defined."; - - revision "2015-10-09" { - description - "Initial OpenConfig public release"; - } - - revision "2015-10-05" { - description - "Initial revision"; - reference "TBD"; - } - - // extension statements - extension openconfig-version { - argument "semver" { - yin-element false; - } - description - "The OpenConfig version number for the module. This is - expressed as a semantic version number of the form: - x.y.z - where: - * x corresponds to the major version, - * y corresponds to a minor version, - * z corresponds to a patch version. - This version corresponds to the model file within which it is - defined, and does not cover the whole set of OpenConfig models. - Where several modules are used to build up a single block of - functionality, the same module version is specified across each - file that makes up the module. - - A major version number of 0 indicates that this model is still - in development (whether within OpenConfig or with industry - partners), and is potentially subject to change. - - Following a release of major version 1, all modules will - increment major revision number where backwards incompatible - changes to the model are made. - - The minor version is changed when features are added to the - model that do not impact current clients use of the model. - - The patch-level version is incremented when non-feature changes - (such as bugfixes or clarifications to human-readable - descriptions that do not impact model functionality) are made - that maintain backwards compatibility. - - The version number is stored in the module meta-data."; - } -} \ No newline at end of file diff --git a/sdk/cpp/core/tests/models/openconfig-interfaces.yang b/sdk/cpp/core/tests/models/openconfig-interfaces.yang deleted file mode 100644 index 893fe79df..000000000 --- a/sdk/cpp/core/tests/models/openconfig-interfaces.yang +++ /dev/null @@ -1,932 +0,0 @@ -module openconfig-interfaces { - - yang-version "1"; - - // namespace - namespace "http://openconfig.net/yang/interfaces"; - - prefix "oc-if"; - - // import some basic types - import ietf-interfaces { prefix ietf-if; } - import ietf-yang-types { prefix yang; } - import openconfig-extensions { prefix oc-ext; } - - // meta - organization "OpenConfig working group"; - - contact - "OpenConfig working group - netopenconfig@googlegroups.com"; - - description - "Model for managing network interfaces and subinterfaces. This - module also defines convenience types / groupings for other - models to create references to interfaces: - - base-interface-ref (type) - reference to a base interface - interface-ref (grouping) - container for reference to a - interface + subinterface - interface-ref-state (grouping) - container for read-only - (opstate) reference to interface + subinterface - - This model reuses data items defined in the IETF YANG model for - interfaces described by RFC 7223 with an alternate structure - (particularly for operational state data) and and with - additional configuration items."; - - oc-ext:openconfig-version "1.0.2"; - - revision "2016-05-26" { - description - "OpenConfig public release"; - reference "1.0.2"; - } - - - // typedef statements - - typedef base-interface-ref { - type leafref { - path "/oc-if:interfaces/oc-if:interface/oc-if:name"; - } - description - "Reusable type for by-name reference to a base interface. - This type may be used in cases where ability to reference - a subinterface is not required."; - } - - typedef interface-id { - type string; - description - "User-defined identifier for an interface, generally used to - name a interface reference. The id can be arbitrary but a - useful convention is to use a combination of base interface - name and subinterface index."; - } - - // grouping statements - - grouping interface-ref-common { - description - "Reference leafrefs to interface / subinterface"; - - leaf interface { - type leafref { - path "/oc-if:interfaces/oc-if:interface/oc-if:name"; - } - description - "Reference to a base interface. If a reference to a - subinterface is required, this leaf must be specified - to indicate the base interface."; - } - - leaf subinterface { - type leafref { - path "/oc-if:interfaces/oc-if:interface/" + - "oc-if:subinterfaces/oc-if:subinterface/oc-if:index"; - } - description - "Reference to a subinterface -- this requires the base - interface to be specified using the interface leaf in - this container. If only a reference to a base interface - is requuired, this leaf should not be set."; - } - } - - grouping interface-ref-state-container { - description - "Reusable opstate w/container for a reference to an - interface or subinterface"; - - container state { - config false; - description - "Operational state for interface-ref"; - - uses interface-ref-common; - } - } - - grouping interface-ref { - description - "Reusable definition for a reference to an interface or - subinterface"; - - container interface-ref { - description - "Reference to an interface or subinterface"; - - container config { - description - "Configured reference to interface / subinterface"; - - uses interface-ref-common; - } - - uses interface-ref-state-container; - } - } - - grouping interface-ref-state { - description - "Reusable opstate w/container for a reference to an - interface or subinterface"; - - container interface-ref { - description - "Reference to an interface or subinterface"; - - uses interface-ref-state-container; - } - } - - - grouping interface-common-config { - description - "Configuration data data nodes common to physical interfaces - and subinterfaces"; - - leaf name { - type string; - description - "[adapted from IETF interfaces model (RFC 7223)] - - 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/interface[name]/state 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 - corresponding state 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. - - The IETF model in RFC 7223 provides YANG features for the - following (i.e., pre-provisioning and arbitrary-names), - however they are omitted here: - - 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 - /interfaces/interface[name]/state list."; - reference - "RFC 7223: A YANG Data Model for Interface Management"; - } - - leaf description { - type string; - description - "[adapted from IETF interfaces model (RFC 7223)] - - A textual description of the interface. - - A server implementation MAY map this leaf to the ifAlias - MIB object. Such an implementation needs to use some - mechanism to handle the differences in size and 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 enabled { - type boolean; - default "true"; - description - "[adapted from IETF interfaces model (RFC 7223)] - - 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"; - } - - } - - grouping interface-phys-config { - description - "Configuration data for physical interfaces"; - - leaf type { - type identityref { - base ietf-if:interface-type; - } - //mandatory true; - description - "[adapted from IETF interfaces model (RFC 7223)] - - 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 mtu { - type uint16; - description - "Set the max transmission unit size in octets - for the physical interface. If this is not set, the mtu is - set to the operational default -- e.g., 1514 bytes on an - Ethernet interface."; - } - - uses interface-common-config; - } - - grouping interface-phys-holdtime-config { - description - "Configuration data for interface hold-time settings -- - applies to physical interfaces."; - - leaf up { - type uint32; - units milliseconds; - default 0; - description - "Dampens advertisement when the interface - transitions from down to up. A zero value means dampening - is turned off, i.e., immediate notification."; - } - - leaf down { - type uint32; - units milliseconds; - default 0; - description - "Dampens advertisement when the interface transitions from - up to down. A zero value means dampening is turned off, - i.e., immediate notification."; - } - } - - grouping interface-phys-holdtime-state { - description - "Operational state data for interface hold-time."; - } - - grouping interface-phys-holdtime-top { - description - "Top-level grouping for setting link transition - dampening on physical and other types of interfaces."; - - container hold-time { - description - "Top-level container for hold-time settings to enable - dampening advertisements of interface transitions."; - - container config { - description - "Configuration data for interface hold-time settings."; - - uses interface-phys-holdtime-config; - } - - container state { - - config false; - - description - "Operational state data for interface hold-time."; - - uses interface-phys-holdtime-config; - uses interface-phys-holdtime-state; - } - } - } - - grouping interface-common-state { - description - "Operational state data (in addition to intended configuration) - at the global level for this interface"; - - leaf ifindex { - type uint32; - description - "System assigned number for each interface. Corresponds to - ifIndex object in SNMP Interface MIB"; - reference - "RFC 2863 - The Interfaces Group MIB"; - } - - leaf admin-status { - type enumeration { - enum UP { - description - "Ready to pass packets."; - } - enum DOWN { - description - "Not ready to pass packets and not in some test mode."; - } - enum TESTING { - //TODO: This is generally not supported as a configured - //admin state, though it's in the standard interfaces MIB. - //Consider removing it. - description - "In some test mode."; - } - } - //TODO:consider converting to an identity to have the - //flexibility to remove some values defined by RFC 7223 that - //are not used or not implemented consistently. - //mandatory true; - description - "[adapted from IETF interfaces model (RFC 7223)] - - The desired state of the interface. In RFC 7223 this leaf - has the same read semantics as ifAdminStatus. Here, it - reflects the administrative state as set by enabling or - disabling the interface."; - 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)."; - } - } - //TODO:consider converting to an identity to have the - //flexibility to remove some values defined by RFC 7223 that - //are not used or not implemented consistently. - //mandatory true; - description - "[adapted from IETF interfaces model (RFC 7223)] - - 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:timeticks; - description - "Date and time of the last state change of the interface - (e.g., up-to-down transition). This corresponds to the - ifLastChange object in the standard interface MIB."; - reference - "RFC 2863: The Interfaces Group MIB - ifLastChange"; - } - - } - - - grouping interface-counters-state { - description - "Operational state representing interface counters - and statistics. Some of these are adapted from RFC 7223"; - - //TODO: we may need to break this list of counters into those - //that would appear for physical vs. subinterface or logical - //interfaces. For now, just replicating the full stats - //grouping to both interface and subinterface. - - container counters { - description - "A collection of interface-related statistics objects."; - - reference - "RFC 7223 - A YANG Data Model for Interface - Management"; - - leaf in-octets { - type yang:counter64; - description - "[adapted from IETF interfaces model (RFC 7223)] - - 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 - "[adapted from IETF interfaces model (RFC 7223)] - - 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 - "[adapted from IETF interfaces model (RFC 7223)] - - 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 - "[adapted from IETF interfaces model (RFC 7223)] - - - 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:counter64; - description - "[adapted from IETF interfaces model (RFC 7223)] - Changed the counter type to counter64. - - 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:counter64; - description - "[adapted from IETF interfaces model (RFC 7223)] - Changed the counter type to counter64. - - 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 - "[adapted from IETF interfaces model (RFC 7223)] - Changed the counter type to counter64. - - 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 - "[adapted from IETF interfaces model (RFC 7223)] - Changed the counter type to counter64. - - 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 - "[adapted from IETF interfaces model (RFC 7223)] - - 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 - "[adapted from IETF interfaces model (RFC 7223)] - - 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 - "[adapted from IETF interfaces model (RFC 7223)] - Changed the counter type to counter64. - - 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:counter64; - description - "[adapted from IETF interfaces model (RFC 7223)] - Changed the counter type to counter64. - - 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:counter64; - description - "[adapted from IETF interfaces model (RFC 7223)] - Changed the counter type to counter64. - - 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"; - } - - leaf last-clear { - type yang:date-and-time; - description - "Indicates the last time the interface counters were - cleared."; - } - } - } - - // data definition statements - - grouping sub-unnumbered-config { - description - "Configuration data for unnumbered subinterfaces"; - - leaf enabled { - type boolean; - default false; - description - "Indicates that the subinterface is unnumbered. By default - the subinterface is numbered, i.e., expected to have an - IP address configuration."; - } - } - - grouping sub-unnumbered-state { - description - "Operational state data unnumbered subinterfaces"; - } - - grouping sub-unnumbered-top { - description - "Top-level grouping unnumbered subinterfaces"; - - container unnumbered { - description - "Top-level container for setting unnumbered interfaces. - Includes reference the interface that provides the - address information"; - - container config { - description - "Configuration data for unnumbered interface"; - - uses sub-unnumbered-config; - } - - container state { - - config false; - - description - "Operational state data for unnumbered interfaces"; - - uses sub-unnumbered-config; - uses sub-unnumbered-state; - } - - uses oc-if:interface-ref; - } - } - - grouping subinterfaces-config { - description - "Configuration data for subinterfaces"; - - leaf index { - type uint32; - default 0; - description - "The index of the subinterface, or logical interface number. - On systems with no support for subinterfaces, or not using - subinterfaces, this value should default to 0, i.e., the - default subinterface."; - } - - uses interface-common-config; - - } - - grouping subinterfaces-state { - description - "Operational state data for subinterfaces"; - - uses interface-common-state; - uses interface-counters-state; - } - - grouping subinterfaces-top { - description - "Subinterface data for logical interfaces associated with a - given interface"; - - container subinterfaces { - description - "Enclosing container for the list of subinterfaces associated - with a physical interface"; - - list subinterface { - key "index"; - - description - "The list of subinterfaces (logical interfaces) associated - with a physical interface"; - - leaf index { - type leafref { - path "../config/index"; - } - description - "The index number of the subinterface -- used to address - the logical interface"; - } - - container config { - description - "Configurable items at the subinterface level"; - - uses subinterfaces-config; - } - - container state { - - config false; - description - "Operational state data for logical interfaces"; - - uses subinterfaces-config; - uses subinterfaces-state; - } - } - } - } - - grouping interfaces-top { - description - "Top-level grouping for interface configuration and - operational state data"; - - container interfaces { - description - "Top level container for interfaces, including configuration - and state data."; - - - list interface { - key "name"; - - description - "The list of named interfaces on the device."; - - leaf name { - type leafref { - path "../config/name"; - } - description - "References the configured name of the interface"; - //TODO: need to consider whether this should actually - //reference the name in the state subtree, which - //presumably would be the system-assigned name, or the - //configured name. Points to the config/name now - //because of YANG 1.0 limitation that the list - //key must have the same "config" as the list, and - //also can't point to a non-config node. - } - - container config { - description - "Configurable items at the global, physical interface - level"; - - uses interface-phys-config; - } - - container state { - - config false; - description - "Operational state data at the global interface level"; - - uses interface-phys-config; - uses interface-common-state; - uses interface-counters-state; - } - - uses interface-phys-holdtime-top; - uses subinterfaces-top; - } - } - } - - uses interfaces-top; - - -} diff --git a/sdk/cpp/core/tests/models/openconfig-policy-types.yang b/sdk/cpp/core/tests/models/openconfig-policy-types.yang deleted file mode 100644 index 8e1fe366f..000000000 --- a/sdk/cpp/core/tests/models/openconfig-policy-types.yang +++ /dev/null @@ -1,178 +0,0 @@ -module openconfig-policy-types { - - yang-version "1"; - - // namespace - namespace "http://openconfig.net/yang/policy-types"; - - prefix "oc-pol-types"; - - // import some basic types - import ietf-yang-types { prefix yang; } - import openconfig-extensions { prefix oc-ext; } - - // meta - organization - "OpenConfig working group"; - - contact - "OpenConfig working group - netopenconfig@googlegroups.com"; - - description - "This module contains general data definitions for use in routing - policy. It can be imported by modules that contain protocol- - specific policy conditions and actions."; - - oc-ext:openconfig-version "2.0.1"; - - revision "2016-05-12" { - description - "OpenConfig public release"; - reference "2.0.1"; - } - - // identity statements - - identity ATTRIBUTE_COMPARISON { - description - "base type for supported comparison operators on route - attributes"; - } - - identity ATTRIBUTE_EQ { - base ATTRIBUTE_COMPARISON; - description "== comparison"; - } - - identity ATTRIBUTE_GE { - base ATTRIBUTE_COMPARISON; - description ">= comparison"; - } - - identity ATTRIBUTE_LE { - base ATTRIBUTE_COMPARISON; - description "<= comparison"; - } - - typedef match-set-options-type { - type enumeration { - enum ANY { - description "match is true if given value matches any member - of the defined set"; - } - enum ALL { - description "match is true if given value matches all - members of the defined set"; - } - enum INVERT { - description "match is true if given value does not match any - member of the defined set"; - } - } - default ANY; - description - "Options that govern the behavior of a match statement. The - default behavior is ANY, i.e., the given value matches any - of the members of the defined set"; - } - - typedef match-set-options-restricted-type { - type enumeration { - enum ANY { - description "match is true if given value matches any member - of the defined set"; - } - enum INVERT { - description "match is true if given value does not match any - member of the defined set"; - } - } - default ANY; - description - "Options that govern the behavior of a match statement. The - default behavior is ANY, i.e., the given value matches any - of the members of the defined set. Note this type is a - restricted version of the match-set-options-type."; - //TODO: restriction on enumerated types is only allowed in - //YANG 1.1. Until then, we will require this additional type - } - - grouping attribute-compare-operators { - description "common definitions for comparison operations in - condition statements"; - - leaf operator { - type identityref { - base ATTRIBUTE_COMPARISON; - } - description - "type of comparison to be performed"; - } - - leaf value { - type uint32; - description - "value to compare with the community count"; - } - } - - typedef tag-type { - type union { - type uint32; - type yang:hex-string; - } - description "type for expressing route tags on a local system, - including IS-IS and OSPF; may be expressed as either decimal or - hexidecimal integer"; - reference - "RFC 2178 OSPF Version 2 - RFC 5130 A Policy Control Mechanism in IS-IS Using - Administrative Tags"; - } - - identity INSTALL_PROTOCOL_TYPE { - description - "Base type for protocols which can install prefixes into the - RIB"; - } - - identity BGP { - base INSTALL_PROTOCOL_TYPE; - description "BGP"; - reference "RFC 4271"; - } - - identity ISIS { - base INSTALL_PROTOCOL_TYPE; - description "IS-IS"; - reference "ISO/IEC 10589"; - } - - identity OSPF { - base INSTALL_PROTOCOL_TYPE; - description "OSPFv2"; - reference "RFC 2328"; - } - - identity OSPF3 { - base INSTALL_PROTOCOL_TYPE; - description "OSPFv3"; - reference "RFC 5340"; - } - - identity STATIC { - base INSTALL_PROTOCOL_TYPE; - description "Locally-installed static route"; - } - - identity DIRECTLY_CONNECTED { - base INSTALL_PROTOCOL_TYPE; - description "A directly connected route"; - } - - identity LOCAL_AGGREGATE { - base INSTALL_PROTOCOL_TYPE; - description "Locally defined aggregate route"; - } -} diff --git a/sdk/cpp/core/tests/models/openconfig-routing-policy.yang b/sdk/cpp/core/tests/models/openconfig-routing-policy.yang deleted file mode 100644 index 58ccd5f47..000000000 --- a/sdk/cpp/core/tests/models/openconfig-routing-policy.yang +++ /dev/null @@ -1,1114 +0,0 @@ -module openconfig-routing-policy { - - yang-version "1"; - - // namespace - namespace "http://openconfig.net/yang/routing-policy"; - - prefix "oc-rpol"; - - // import some basic types - import ietf-inet-types { prefix inet; } - import openconfig-interfaces { prefix oc-if; } - import openconfig-policy-types { prefix oc-pol-types; } - import openconfig-extensions { prefix oc-ext; } - - // meta - organization - "OpenConfig working group"; - - contact - "OpenConfig working group - netopenconfig@googlegroups.com"; - - description - "This module describes a YANG model for routing policy - configuration. It is a limited subset of all of the policy - configuration parameters available in the variety of vendor - implementations, but supports widely used constructs for managing - how routes are imported, exported, and modified across different - routing protocols. This module is intended to be used in - conjunction with routing protocol configuration models (e.g., - BGP) defined in other modules. - - Route policy expression: - - Policies are expressed as a set of top-level policy definitions, - each of which consists of a sequence of policy statements. Policy - statements consist of simple condition-action tuples. Conditions - may include mutiple match or comparison operations, and similarly - actions may be multitude of changes to route attributes or a - final disposition of accepting or rejecting the route. - - Route policy evaluation: - - Policy definitions are referenced in routing protocol - configurations using import and export configuration statements. - The arguments are members of an ordered list of named policy - definitions which comprise a policy chain, and optionally, an - explicit default policy action (i.e., reject or accept). - - Evaluation of each policy definition proceeds by evaluating its - corresponding individual policy statements in order. When a - condition statement in a policy statement is satisfied, the - corresponding action statement is executed. If the action - statement has either accept-route or reject-route actions, policy - evaluation of the current policy definition stops, and no further - policy definitions in the chain are evaluated. - - If the condition is not satisfied, then evaluation proceeds to - the next policy statement. If none of the policy statement - conditions are satisfied, then evaluation of the current policy - definition stops, and the next policy definition in the chain is - evaluated. When the end of the policy chain is reached, the - default route disposition action is performed (i.e., reject-route - unless an an alternate default action is specified for the - chain). - - Policy 'subroutines' (or nested policies) are supported by - allowing policy statement conditions to reference another policy - definition which applies conditions and actions from the - referenced policy before returning to the calling policy - statement and resuming evaluation. If the called policy - results in an accept-route (either explicit or by default), then - the subroutine returns an effective true value to the calling - policy. Similarly, a reject-route action returns false. If the - subroutine returns true, the calling policy continues to evaluate - the remaining conditions (using a modified route if the - subroutine performed any changes to the route)."; - - oc-ext:openconfig-version "2.0.1"; - - revision "2016-05-12" { - description - "OpenConfig public release"; - reference "2.0.1"; - } - - - // typedef statements - - typedef default-policy-type { - type enumeration { - enum ACCEPT_ROUTE { - description "default policy to accept the route"; - } - enum REJECT_ROUTE { - description "default policy to reject the route"; - } - } - description "type used to specify default route disposition in - a policy chain"; - } - - - // grouping statements - - grouping prefix-set-config { - description - "Configuration data for prefix sets used in policy - definitions."; - - leaf prefix-set-name { - type string; - description - "name / label of the prefix set -- this is used to - reference the set in match conditions"; - } - - } - - grouping prefix-set-state { - description - "Operational state data for prefix sets"; - } - - grouping prefix-set-top { - description - "Top-level data definitions for a list of IPv4 or IPv6 - prefixes which are matched as part of a policy"; - - container prefix-sets { - description - "Enclosing container "; - - list prefix-set { - key "prefix-set-name"; - description - "List of the defined prefix sets"; - - leaf prefix-set-name { - type leafref { - path "../config/prefix-set-name"; - } - description - "Reference to prefix name list key"; - } - - container config { - description - "Configuration data for prefix sets"; - - uses prefix-set-config; - } - - container state { - - config false; - - description - "Operational state data "; - - uses prefix-set-config; - uses prefix-set-state; - } - - uses prefix-top; - } - } - } - - grouping prefix-config { - description - "Configuration data for a prefix definition"; - - leaf ip-prefix { - type inet:ip-prefix; - mandatory true; - description - "The prefix member in CIDR notation -- while the - prefix may be either IPv4 or IPv6, most - implementations require all members of the prefix set - to be the same address family. Mixing address types in - the same prefix set is likely to cause an error."; - } - - leaf masklength-range { - type string { - pattern '^([0-9]+\.\.[0-9]+)|exact$'; - } - description - "Defines a range for the masklength, or 'exact' if - the prefix has an exact length. - - Example: 10.3.192.0/21 through 10.3.192.0/24 would be - expressed as prefix: 10.3.192.0/21, - masklength-range: 21..24. - - Example: 10.3.192.0/21 would be expressed as - prefix: 10.3.192.0/21, - masklength-range: exact"; - } - } - - grouping prefix-state { - description - "Operational state data for prefix definitions"; - } - - grouping prefix-top { - description - "Top-level grouping for prefixes in a prefix list"; - - container prefixes { - description - "Enclosing container for the list of prefixes in a policy - prefix list"; - - list prefix { - key "ip-prefix masklength-range"; - description - "List of prefixes in the prefix set"; - - leaf ip-prefix { - type leafref { - path "../config/ip-prefix"; - } - description - "Reference to the ip-prefix list key."; - } - - leaf masklength-range { - type leafref { - path "../config/masklength-range"; - } - description - "Reference to the masklength-range list key"; - } - - container config { - description - "Configuration data for prefix definition"; - - uses prefix-config; - } - - container state { - - config false; - - description - "Operational state data for prefix definition"; - - uses prefix-config; - uses prefix-state; - } - } - } - } - - grouping neighbor-set-config { - description - "Configuration data for neighbor set definitions"; - - leaf neighbor-set-name { - type string; - description - "name / label of the neighbor set -- this is used to - reference the set in match conditions"; - } - - leaf-list address { - type inet:ip-address-no-zone; - description - "List of IP addresses in the neighbor set"; - } - } - - grouping neighbor-set-state { - description - "Operational state data for neighbor set definitions"; - } - - grouping neighbor-set-top { - description - "Top-level data definition for a list of IPv4 or IPv6 - neighbors which can be matched in a routing policy"; - - container neighbor-sets { - description - "Enclosing container for the list of neighbor set - definitions"; - - list neighbor-set { - key "neighbor-set-name"; - description - "List of defined neighbor sets for use in policies."; - - leaf neighbor-set-name { - type leafref { - path "../config/neighbor-set-name"; - } - description - "Reference to the neighbor set name list key."; - } - - container config { - description - "Configuration data for neighbor sets."; - - uses neighbor-set-config; - } - - container state { - - config false; - - description - "Operational state data for neighbor sets."; - - uses neighbor-set-config; - uses neighbor-set-state; - } - } - } - } - - grouping tag-set-config { - description - "Configuration data for tag set definitions."; - - leaf tag-set-name { - type string; - description - "name / label of the tag set -- this is used to reference - the set in match conditions"; - } - - leaf-list tag-value { - type oc-pol-types:tag-type; - description - "Value of the tag set member"; - } - } - - grouping tag-set-state { - description - "Operational state data for tag set definitions."; - } - - grouping tag-set-top { - description - "Top-level data definitions for a list of tags which can - be matched in policies"; - - container tag-sets { - description - "Enclosing container for the list of tag sets."; - - list tag-set { - key "tag-set-name"; - description - "List of tag set definitions."; - - leaf tag-set-name { - type leafref { - path "../config/tag-set-name"; - } - description - "Reference to the tag set name list key"; - } - - container config { - description - "Configuration data for tag sets"; - - uses tag-set-config; - } - - container state { - - config false; - - description - "Operational state data for tag sets"; - - uses tag-set-config; - uses tag-set-state; - } - } - } - } - - grouping generic-defined-sets { - description - "Data definitions for pre-defined sets of attributes used in - policy match conditions. These sets are generic and can - be used in matching conditions in different routing - protocols."; - - uses prefix-set-top; - uses neighbor-set-top; - uses tag-set-top; - } - - grouping match-set-options-group { - description - "Grouping containing options relating to how a particular set - should be matched"; - - leaf match-set-options { - type oc-pol-types:match-set-options-type; - description - "Optional parameter that governs the behaviour of the - match operation"; - } - } - - grouping match-set-options-restricted-group { - description - "Grouping for a restricted set of match operation modifiers"; - - leaf match-set-options { - type oc-pol-types:match-set-options-restricted-type; - description - "Optional parameter that governs the behaviour of the - match operation. This leaf only supports matching on ANY - member of the set or inverting the match. Matching on ALL is - not supported)"; - } - } - - grouping match-interface-condition-config { - description - "Configuration data for interface match condition"; - - uses oc-if:interface-ref-common; - } - - grouping match-interface-condition-state { - description - "Operational state data for interface match condition"; - } - - grouping match-interface-condition-top { - description - "Top-level grouping for the interface match condition"; - - container match-interface { - description - "Top-level container for interface match conditions"; - - container config { - description - "Configuration data for interface match conditions"; - - uses match-interface-condition-config; - } - - container state { - - config false; - - description - "Operational state data for interface match conditions"; - - uses match-interface-condition-config; - uses match-interface-condition-state; - } - - } - } - - grouping prefix-set-condition-config { - description - "Configuration data for prefix-set conditions"; - - leaf prefix-set { - type leafref { - path "/routing-policy/defined-sets/prefix-sets/" + - "prefix-set/prefix-set-name"; - //TODO: require-instance should be added when it's - //supported in YANG 1.1 - //require-instance true; - } - description "References a defined prefix set"; - } - uses match-set-options-restricted-group; - } - - grouping prefix-set-condition-state { - description - "Operational state data for prefix-set conditions"; - } - - grouping prefix-set-condition-top { - description - "Top-level grouping for prefix-set conditions"; - - container match-prefix-set { - description - "Match a referenced prefix-set according to the logic - defined in the match-set-options leaf"; - - container config { - description - "Configuration data for a prefix-set condition"; - - uses prefix-set-condition-config; - } - - container state { - - config false; - - description - "Operational state data for a prefix-set condition"; - - uses prefix-set-condition-config; - uses prefix-set-condition-state; - } - } - } - - grouping neighbor-set-condition-config { - description - "Configuration data for neighbor-set conditions"; - - leaf neighbor-set { - type leafref { - path "/routing-policy/defined-sets/neighbor-sets/" + - "neighbor-set/neighbor-set-name"; - //TODO: require-instance should be added when it's - //supported in YANG 1.1 - //require-instance true; - } - description "References a defined neighbor set"; - } - - uses match-set-options-restricted-group; - } - - grouping neighbor-set-condition-state { - description - "Operational state data for neighbor-set conditions"; - } - - grouping neighbor-set-condition-top { - description - "Top-level grouping for neighbor-set conditions"; - - container match-neighbor-set { - description - "Match a referenced neighbor set according to the logic - defined in the match-set-options-leaf"; - - container config { - description - "Configuration data "; - - uses neighbor-set-condition-config; - } - - container state { - - config false; - - description - "Operational state data "; - - uses neighbor-set-condition-config; - uses neighbor-set-condition-state; - } - } - } - - grouping tag-set-condition-config { - description - "Configuration data for tag-set condition statements"; - - leaf tag-set { - type leafref { - path "/routing-policy/defined-sets/tag-sets/tag-set" + - "/tag-set-name"; - //TODO: require-instance should be added when it's - //supported in YANG 1.1 - //require-instance true; - } - description "References a defined tag set"; - } - uses match-set-options-restricted-group; - } - - grouping tag-set-condition-state { - description - "Operational state data for tag-set condition statements"; - } - - grouping tag-set-condition-top { - description - "Top-level grouping for tag-set conditions"; - - container match-tag-set { - description - "Match a referenced tag set according to the logic defined - in the match-options-set leaf"; - - container config { - description - "Configuration data for tag-set conditions"; - - uses tag-set-condition-config; - } - - container state { - - config false; - - description - "Operational state data tag-set conditions"; - - uses tag-set-condition-config; - uses tag-set-condition-state; - } - } - } - - grouping generic-conditions { - description "Condition statement definitions for checking - membership in a generic defined set"; - - uses match-interface-condition-top; - uses prefix-set-condition-top; - uses neighbor-set-condition-top; - uses tag-set-condition-top; - - } - - grouping igp-generic-conditions { - description "grouping for IGP policy conditions"; - - } - - - grouping igp-conditions { - description "grouping for IGP-specific policy conditions"; - - container igp-conditions { - description "Policy conditions for IGP attributes"; - - uses igp-generic-conditions; - - } - } - - grouping generic-actions { - description - "Definitions for common set of policy action statements that - manage the disposition or control flow of the policy"; - - choice route-disposition { - description - "Select the final disposition for the route, either - accept or reject."; - leaf accept-route { - type empty; - description "accepts the route into the routing table"; - } - - leaf reject-route { - type empty; - description "rejects the route"; - } - } - } - - - grouping igp-actions-config { - description - "Configuration data for IGP policy actions"; - - leaf set-tag { - type oc-pol-types:tag-type; - description - "Set the tag value for OSPF or IS-IS routes."; - } - } - - grouping igp-actions-state { - description - "Operational state data for IGP policy actions "; - } - - grouping igp-actions-top { - description - "Top-level grouping "; - - container igp-actions { - description - "Actions to set IGP route attributes; these actions - apply to multiple IGPs"; - - container config { - description - "Configuration data "; - - uses igp-actions-config; - } - - container state { - - config false; - - description - "Operational state data "; - - uses igp-actions-config; - uses igp-actions-state; - } - } - } - - - grouping policy-conditions-config { - description - "Configuration data for general policy conditions, i.e., those - not related to match-sets"; - - leaf call-policy { - type leafref { - path "/oc-rpol:routing-policy/" + - "oc-rpol:policy-definitions/" + - "oc-rpol:policy-definition/oc-rpol:name"; - //TODO: require-instance should be added when - //it is supported in YANG 1.1 - //require-instance true; - } - description - "Applies the statements from the specified policy - definition and then returns control the current - policy statement. Note that the called policy may - itself call other policies (subject to - implementation limitations). This is intended to - provide a policy 'subroutine' capability. The - called policy should contain an explicit or a - default route disposition that returns an - effective true (accept-route) or false - (reject-route), otherwise the behavior may be - ambiguous and implementation dependent"; - } - - leaf install-protocol-eq { - type identityref { - base oc-pol-types:INSTALL_PROTOCOL_TYPE; - } - description - "Condition to check the protocol / method used to install - the route into the local routing table"; - } - } - - grouping policy-conditions-state { - description - "Operational state data for policy conditions"; - } - - grouping policy-conditions-top { - description - "Top-level grouping for policy conditions"; - - container conditions { - description - "Condition statements for the current policy statement"; - - container config { - description - "Configuration data for policy conditions"; - - uses policy-conditions-config; - } - - container state { - - config false; - - description - "Operational state data for policy conditions"; - - uses policy-conditions-config; - uses policy-conditions-state; - } - uses generic-conditions; - uses igp-conditions; - } - } - - grouping policy-statements-config { - description - "Configuration data for policy statements"; - - leaf name { - type string; - description - "name of the policy statement"; - } - } - - grouping policy-statements-state { - description - "Operational state data for policy statements"; - } - - - - grouping policy-actions-config { - description - "Configuration data for policy actions"; - - uses generic-actions; - } - - grouping policy-actions-state { - description - "Operational state data for policy actions"; - } - - grouping policy-actions-top { - description - "Top-level grouping for policy actions"; - - container actions { - description - "Top-level container for policy action statements"; - - container config { - description - "Configuration data for policy actions"; - - uses policy-actions-config; - } - - container state { - - config false; - - description - "Operational state data for policy actions"; - - uses policy-actions-config; - uses policy-actions-state; - } - - uses igp-actions-top; - } - } - - grouping policy-statements-top { - description - "Top-level grouping for the policy statements list"; - - container statements { - description - "Enclosing container for policy statements"; - - list statement { - key "name"; - // TODO: names of policy statements within a policy - // definition should probably be optional, however, YANG - // requires a unique id for lists - ordered-by user; - description - "Policy statements group conditions and actions - within a policy definition. They are evaluated in - the order specified (see the description of policy - evaluation at the top of this module."; - - leaf name { - type leafref { - path "../config/name"; - } - description - "Reference to list key"; - } - - container config { - description - "Configuration data for policy statements"; - - uses policy-statements-config; - } - - container state { - - config false; - - description - "Operational state data for policy statements"; - - uses policy-statements-config; - uses policy-statements-state; - } - - uses policy-conditions-top; - uses policy-actions-top; - } - } - } - - grouping defined-sets-top { - description - "Top-level grouping for defined set definitions"; - - container defined-sets { - description - "Predefined sets of attributes used in policy match - statements"; - - uses generic-defined-sets; - } - } - - grouping policy-definitions-config { - description - "Configuration data for policy definitions"; - - leaf name { - type string; - description - "Name of the top-level policy definition -- this name - is used in references to the current policy"; - } - } - - grouping policy-definitions-state { - description - "Operational state data for policy definitions"; - } - - grouping policy-definitions-top { - description - "Top-level grouping for the policy definition list"; - - container policy-definitions { - description - "Enclosing container for the list of top-level policy - definitions"; - - list policy-definition { - key "name"; - description - "List of top-level policy definitions, keyed by unique - name. These policy definitions are expected to be - referenced (by name) in policy chains specified in import - or export configuration statements."; - - leaf name { - type leafref { - path "../config/name"; - } - description - "Reference to the list key"; - } - - container config { - description - "Configuration data for policy defintions"; - - uses policy-definitions-config; - } - - container state { - - config false; - - description - "Operational state data for policy definitions"; - - uses policy-definitions-config; - uses policy-definitions-state; - } - - uses policy-statements-top; - } - } - } - - grouping routing-policy-top { - description - "Top level container for OpenConfig routing policy"; - - container routing-policy { - description - "Top-level container for all routing policy configuration"; - - - uses defined-sets-top; - - uses policy-definitions-top; - } - } - - grouping apply-policy-import-config { - description - "Configuration data for applying import policies"; - - leaf-list import-policy { - type leafref { - path "/oc-rpol:routing-policy/oc-rpol:policy-definitions/" + - "oc-rpol:policy-definition/oc-rpol:name"; - //TODO: require-instance should be added when it's - //supported in YANG 1.1 - //require-instance true; - } - ordered-by user; - description - "list of policy names in sequence to be applied on - receiving a routing update in the current context, e.g., - for the current peer group, neighbor, address family, - etc."; - } - - leaf default-import-policy { - type default-policy-type; - default REJECT_ROUTE; - description - "explicitly set a default policy if no policy definition - in the import policy chain is satisfied."; - } - - } - - grouping apply-policy-export-config { - description - "Configuration data for applying export policies"; - - leaf-list export-policy { - type leafref { - path "/oc-rpol:routing-policy/oc-rpol:policy-definitions/" + - "oc-rpol:policy-definition/oc-rpol:name"; - //TODO: require-instance should be added when it's - //supported in YANG 1.1 - //require-instance true; - } - ordered-by user; - description - "list of policy names in sequence to be applied on - sending a routing update in the current context, e.g., - for the current peer group, neighbor, address family, - etc."; - } - - leaf default-export-policy { - type default-policy-type; - default REJECT_ROUTE; - description - "explicitly set a default policy if no policy definition - in the export policy chain is satisfied."; - } - } - - - grouping apply-policy-config { - description - "Configuration data for routing policies"; - - uses apply-policy-import-config; - uses apply-policy-export-config; - - } - - - - grouping apply-policy-state { - description - "Operational state associated with routing policy"; - - //TODO: identify additional state data beyond the intended - //policy configuration. - } - - grouping apply-policy-group { - description - "Top level container for routing policy applications. This - grouping is intended to be used in routing models where - needed."; - - container apply-policy { - description - "Anchor point for routing policies in the model. - Import and export policies are with respect to the local - routing table, i.e., export (send) and import (receive), - depending on the context."; - - container config { - description - "Policy configuration data."; - - uses apply-policy-config; - } - - container state { - - config false; - description - "Operational state for routing policy"; - - uses apply-policy-config; - uses apply-policy-state; - } - } - } - - uses routing-policy-top; - -} diff --git a/sdk/cpp/core/tests/models/openconfig-types.yang b/sdk/cpp/core/tests/models/openconfig-types.yang deleted file mode 100644 index 1698d8902..000000000 --- a/sdk/cpp/core/tests/models/openconfig-types.yang +++ /dev/null @@ -1,126 +0,0 @@ -module openconfig-types { - yang-version "1"; - - namespace "http://openconfig.net/yang/openconfig-types"; - - prefix "oc-types"; - - // import statements - import openconfig-extensions { prefix oc-ext; } - - // meta - organization - "OpenConfig working group"; - - contact - "OpenConfig working group - netopenconfig@googlegroups.com"; - - description - "This module contains a set of general type definitions that - are used across OpenConfig models. It can be imported by modules - that make use of these types."; - - oc-ext:openconfig-version "0.2.0"; - - revision "2016-05-31" { - description - "OpenConfig public release"; - reference "0.2.0"; - } - - typedef percentage { - type uint8 { - range "0..100"; - } - description - "Integer indicating a percentage value"; - } - - typedef std-regexp { - type string; - description - "This type definition is a placeholder for a standard - definition of a regular expression that can be utilised in - OpenConfig models. Further discussion is required to - consider the type of regular expressions that are to be - supported. An initial proposal is POSIX compatible."; - } - - typedef timeticks64 { - type uint64; - description - "This type is based on the timeticks type defined in - RFC 6991, but with 64-bit width. It represents the time, - modulo 2^64, in hundredths of a second between two epochs."; - reference - "RFC 6991 - Common YANG Data Types"; - } - - grouping avg-min-max-stats-precision1 { - description - "Common nodes for recording average, minimum, and - maximum values for a statistic. These values all have - fraction-digits set to 1."; - - leaf avg { - type decimal64 { - fraction-digits 1; - } - description - "The arithmetic mean value of the statistic over the - sampling period."; - } - - leaf min { - type decimal64 { - fraction-digits 1; - } - description - "The minimum value of the statistic over the sampling - period"; - } - - leaf max { - type decimal64 { - fraction-digits 1; - } - description - "The maximum value of the statitic over the sampling - period"; - } - } - - grouping avg-min-max-instant-stats-precision1 { - description - "Common grouping for recording an instantaneous statistic value - in addition to avg-min-max stats"; - - leaf instant { - type decimal64 { - fraction-digits 1; - } - description - "The instantaneous value of the statistic."; - } - - uses avg-min-max-stats-precision1; - } - - identity ADDRESS_FAMILY { - description - "A base identity for all address families"; - } - - identity IPV4 { - base ADDRESS_FAMILY; - description - "The IPv4 address family"; - } - - identity IPV6 { - base ADDRESS_FAMILY; - description - "The IPv6 address family"; - } -} diff --git a/sdk/cpp/core/tests/models/tailf-aaa.yang b/sdk/cpp/core/tests/models/tailf-aaa.yang deleted file mode 100644 index a59051b88..000000000 --- a/sdk/cpp/core/tests/models/tailf-aaa.yang +++ /dev/null @@ -1,330 +0,0 @@ -module tailf-aaa { - namespace "http://tail-f.com/ns/aaa/1.1"; - prefix aaa; - tailf:id "http://tail-f.com/ns/aaa"; - - import ietf-netconf-acm { - prefix nacm; - } - - import iana-crypt-hash { - prefix ianach; - } - - import tailf-common { - prefix tailf; - } - - organization "Tail-f Systems"; - - description - "This module defines the Tail-f AAA data model."; - - revision 2015-06-16 { - description - "Released as part of ConfD-6.0 / NSO-4.0. - - Added /aaa/authentication/users/user/change-password action."; - } - - revision 2014-08-29 { - description - "Released as part of ConfD-5.2.1 / NCS-3.2.1. - - Removed max-elements restriction on /aaa/authentication/users/user."; - } - - revision 2014-06-30 { - description - "Released as part of ConfD-5.2 / NCS-3.2. - - Changed passwdStr typedef to use ianach:crypt-hash instead of - tailf:md5-digest-string."; - } - - revision 2013-03-07 { - description - "Released as part of ConfD-4.2. - - Added nacm:default-deny-all extension for /aaa and /user, and - nacm:default-deny-write extension for /alias and /session."; - } - - revision 2012-11-08 { - description - "Released as part of ConfD-4.1. - - Removed /aaa/authentication/groups and /aaa/authorization, - since this functionality is modeled in - ietf-netconf-acm.yang as augmented by tailf-acm.yang."; - } - - revision 2011-09-22 { - description - "Released as part of ConfD-3.7."; - } - - revision 2010-06-17 { - description - "Released as part of ConfD-3.3."; - } - - revision 2010-04-22 { - description - "Released as part of ConfD-3.2.1."; - } - - revision 2010-03-18 { - description - "Released as part of ConfD-3.2."; - } - - typedef history { - type uint64 { - range "0 .. 8192"; - } - } - typedef idle-timeout { - type uint64 { - range "0 .. 8192"; - } - } - typedef display-level { - type uint64 { - range "1 .. 64"; - } - } - typedef passwdStr { - type ianach:crypt-hash; - } - typedef levelInt { - type int32 { - range "0 .. 15"; - } - } - typedef modeStr { - type union { - type string; - type builtinModes; - } - } - typedef builtinModes { - type enumeration { - enum exec; - enum configure; - } - } - - grouping session-params { - leaf complete-on-space { - type boolean; - tailf:info "Enable/disable completion on space"; - } - leaf ignore-leading-space { - type boolean; - tailf:info "Ignore leading whitespace"; - } - leaf idle-timeout { - type idle-timeout; - tailf:info "CLI idle-timeout in seconds"; - } - leaf paginate { - type boolean; - tailf:info "Paginate output from CLI commands"; - } - leaf history { - type history; - tailf:info "History size"; - } - leaf autowizard { - type boolean; - tailf:info "Automatically query user for mandatory elems"; - } - leaf show-defaults { - type boolean; - tailf:info "Show default values when showing the configuration"; - } - leaf display-level { - type display-level; - tailf:info "Max depth to show when displaying configuration"; - } - leaf prompt1 { - type string; - tailf:info "Prompt for operational mode"; - } - leaf prompt2 { - type string; - tailf:info "Prompt for configure mode"; - } - } - - container aaa { - tailf:info "AAA management"; - nacm:default-deny-all; - container authentication { - tailf:info "User management"; - container users { - tailf:info "List of local users"; - list user { - key name; - leaf name { - type string; - tailf:info "Login name of the user"; - } - leaf uid { - type int32; - mandatory true; - tailf:info "User Identifier"; - } - leaf gid { - type int32; - mandatory true; - tailf:info "Group Identifier"; - } - leaf password { - type passwdStr; - mandatory true; - } - leaf ssh_keydir { - type string; - mandatory true; - tailf:info "Absolute path to directory where user's ssh keys - may be found"; - } - leaf homedir { - type string; - mandatory true; - tailf:info "Absolute path to user's home directory"; - } - tailf:action change-password { - tailf:info "Request password change"; - tailf:actionpoint internal { - tailf:internal; - } - input { - leaf old-password { - type string; - mandatory true; - tailf:info "Old password"; - tailf:suppress-echo true; - } - leaf new-password { - type string; - mandatory true; - tailf:info "New password"; - tailf:suppress-echo true; - } - leaf confirm-password { - type string; - mandatory true; - tailf:info "Confirm New password"; - tailf:suppress-echo true; - } - } - } - } - } - } - container ios { - tailf:info "Specific IOS settings"; - presence ""; - - list level { - key nr; - min-elements 2; - leaf nr { - type levelInt; - } - leaf secret { - type passwdStr; - } - leaf password { - type passwdStr; - } - leaf prompt { - type string; - default "\h# "; - } - } - - list privilege { - key mode; - leaf mode { - type modeStr; - } - list level { - key nr; - min-elements 1; - max-elements 15; - leaf nr { - type levelInt; - } - list command { - key name; - leaf name { - type string; - } - } - } - } - } - } - list alias { - nacm:default-deny-write; - key name; - tailf:info "Create command alias."; - leaf name { - type string; - tailf:info "Name of the command alias. An alias name can be a single - word or multiple words joined by a dash (-)."; - } - leaf expansion { - type string; - mandatory true; - tailf:info "Original command syntax. Valid abbreviations of the original - command syntax can be entered for the command-syntax - argument."; - } - } - container session { - nacm:default-deny-write; - uses session-params; - presence ""; - tailf:info "Global default CLI session parameters"; - } - list user { - tailf:info "User specific command aliases and default CLI session - parameters"; - nacm:default-deny-all; - key name; - leaf name { - type string; - } - leaf description { - type string; - tailf:info "User description"; - } - list alias { - key name; - tailf:info "Create command alias."; - leaf name { - type string; - tailf:info "Name of the command alias. An alias name can be a single - word or multiple words joined by a dash (-)."; - } - leaf expansion { - type string; - mandatory true; - tailf:info "Original command syntax. Valid abbreviations of the original - command syntax can be entered for the command-syntax - argument."; - } - } - container session { - uses session-params; - tailf:info "User specific default CLI session parameters"; - } - } - -} - diff --git a/sdk/cpp/core/tests/models/tailf-acm.yang b/sdk/cpp/core/tests/models/tailf-acm.yang deleted file mode 100644 index f932f0988..000000000 --- a/sdk/cpp/core/tests/models/tailf-acm.yang +++ /dev/null @@ -1,177 +0,0 @@ -module tailf-acm { - namespace "http://tail-f.com/yang/acm"; - prefix tacm; - - import ietf-netconf-acm { - prefix nacm; - } - - organization "Tail-f Systems"; - - description - "This module augments ietf-netconf-acm with additional - access control data."; - - revision 2013-03-07 { - description - "Released as part of ConfD-4.2. - - Added cmd-read-default and cmd-exec-default."; - } - - revision 2012-11-08 { - description - "Initial revision. - - Released as part of ConfD-4.1."; - } - - augment /nacm:nacm { - leaf cmd-read-default { - type nacm:action-type; - default "permit"; - description - "Controls whether command read access is granted - if no appropriate cmdrule is found for a - particular command read request."; - } - - leaf cmd-exec-default { - type nacm:action-type; - default "permit"; - description - "Controls whether command exec access is granted - if no appropriate cmdrule is found for a - particular command exec request."; - } - - leaf log-if-default-permit { - type empty; - description - "If this leaf is present, access granted due to one of - /nacm/read-default, /nacm/write-default, /nacm/exec-default - /nacm/cmd-read-default, or /nacm/cmd-exec-default - being set to 'permit' is logged in the developer log. - Otherwise, only denied access is logged. Mainly intended - for debugging of rules."; - } - } - - augment /nacm:nacm/nacm:groups/nacm:group { - leaf gid { - type int32; - description - "This leaf associates a numerical group ID with the group. - When a OS command is executed on behalf of a user, - supplementary group IDs are assigned based on 'gid' values - for the groups that the use is a member of."; - } - } - - augment /nacm:nacm/nacm:rule-list { - - list cmdrule { - key "name"; - ordered-by user; - description - "One command access control rule. Command rules control access - to CLI commands and Web UI functions. - - Rules are processed in user-defined order until a match is - found. A rule matches if 'context', 'command', and - 'access-operations' match the request. If a rule - matches, the 'action' leaf determines if access is granted - or not."; - - leaf name { - type string { - length "1..max"; - } - description - "Arbitrary name assigned to the rule."; - } - - leaf context { - type union { - type nacm:matchall-string-type; - type string; - } - default "*"; - description - "This leaf matches if it has the value '*' or if its value - identifies the agent that is requesting access, i.e. 'cli' - for CLI or 'webui' for Web UI."; - } - - leaf command { - type string; - default "*"; - description - "Space-separated tokens representing the command. Refer - to the Tail-f AAA documentation for further details."; - } - - leaf access-operations { - type union { - type nacm:matchall-string-type; - type nacm:access-operations-type; - } - default "*"; - description - "Access operations associated with this rule. - - This leaf matches if it has the value '*' or if the - bit corresponding to the requested operation is set."; - } - - leaf action { - type nacm:action-type; - mandatory true; - description - "The access control action associated with the - rule. If a rule is determined to match a - particular request, then this object is used - to determine whether to permit or deny the - request."; - } - - leaf log-if-permit { - type empty; - description - "If this leaf is present, access granted due to this rule - is logged in the developer log. Otherwise, only denied - access is logged. Mainly intended for debugging of rules."; - } - - leaf comment { - type string; - description - "A textual description of the access rule."; - } - } - } - - augment /nacm:nacm/nacm:rule-list/nacm:rule { - - leaf context { - type union { - type nacm:matchall-string-type; - type string; - } - default "*"; - description - "This leaf matches if it has the value '*' or if its value - identifies the agent that is requesting access, e.g. 'netconf' - for NETCONF, 'cli' for CLI, or 'webui' for Web UI."; - - } - - leaf log-if-permit { - type empty; - description - "If this leaf is present, access granted due to this rule - is logged in the developer log. Otherwise, only denied - access is logged. Mainly intended for debugging of rules."; - } - } -} diff --git a/sdk/cpp/core/tests/models/tailf-cli-extensions.yang b/sdk/cpp/core/tests/models/tailf-cli-extensions.yang deleted file mode 100644 index 5dcfa0266..000000000 --- a/sdk/cpp/core/tests/models/tailf-cli-extensions.yang +++ /dev/null @@ -1,2813 +0,0 @@ -submodule tailf-cli-extensions { - - belongs-to tailf-common { - prefix tailf; - } - - include tailf-meta-extensions { - revision-date 2013-11-07; - } - - organization "Tail-f Systems"; - - description - "This module defines all Tail-f YANG extensions statements - related to CLI customization. - - See also the 'display-' statements and the 'alt-name' statement - in tailf-common.yang."; - - revision 2015-03-19 { - description - "Released as part of ConfD-5.4 / NCS-3.4. - - Added cli-show-obu-comments. - Added cli-batch-confirm-default."; - } - - revision 2014-11-13 { - description - "Released as part of ConfD-5.3 / NCS-3.3. - - Added cli-strict-leafref. - Added cli-trigger-on-*. - Allow cli-boolean-no in typedef."; - } - - revision 2013-11-07 { - description - "Released as part of ConfD-5.0. - - Added cli-disabled-info. - Added cli-suppress-shortenabled. - Added cli-no-keyword. - Added cli-case-sensitive and cli-case-insensitive."; - } - - revision 2012-11-08 { - description - "Released as part of ConfD-4.1. - - Added cli-delete-when-empty. - Added cli-diff-dependency. - Added cli-ignore-modified."; - } - - revision 2012-08-23 { - description - "Released as part of ConfD-4.0.1. - - Allow tailf:cli-operational-mode and tailf:cli-configure-mode in - rpc."; - } - - revision 2012-06-14 { - description - "Released as part of ConfD-4.0. - - Do not allow tailf:cli-drop-node-name and tailf:cli-sequence-commands - inside tailf:action. - Added tailf:cli-configure-mode. - Added tailf:cli-operational-mode."; - } - - revision 2012-05-24 { - description - "Released as part of ConfD-3.9.2. - - Added tailf:cli-no-value-on-delete. - Added tailf:cli-no-name-on-delete. - Added tailf:cli-replace-all. - Allow tailf:cli-remove-before-change in leaf."; - } - - revision 2012-03-08 { - description - "Released as part of ConfD-3.9. - - Allow tailf:cli-range-list-syntax in lists with one integer based - key."; - } - - revision 2011-12-08 { - description - "Released as part of ConfD-3.8. - - Added tailf:cli-min-column-with."; - } - - revision 2011-09-22 { - description - "Released as part of ConfD-3.7. - - Added tailf:cli-disallow-value. - Added tailf:cli-multi-word. - Added tailf:cli-before-key. - Allow tailf:cli-flatten-container in list."; - } - - revision 2011-08-25 { - description - "Released as part of ConfD-3.6.2. - - Added cli-suppress-silent-no. - Added cli-range-delimiters. - Removed duplicate tailf:use-in statement from cli-show-config."; - } - - revision 2011-06-30 { - description - "Released as part of ConfD-3.6.1. - - Added cli-reversed. - Added cli-range-list-syntax."; - } - - revision 2011-05-26 { - description - "Released as part of ConfD-3.6. - - Added cli-allow-join-with-key. - Added cli-display-joined."; - } - revision 2011-02-24 { - description - "Released as part of ConfD-3.5. - - Added cli-boolean-no. - Added cli-exit-command. - Added cli-custom-range-enumerator. - Added cli-reset-siblings. - Added cli-reset-all-siblings. - Added cli-reset-container. - Added cli-hide-in-submode. - Added cli-prefix-key. - Added cli-show-with-default. - - Added 'commasep' and 'show:' filter in - cli-template-string. - - Removed deprecated tailf:cli-default-order."; - } - - revision 2010-12-02 { - description - "Released as part of ConfD-3.4.1. - - Added cli-flatten-container."; - } - - revision 2010-11-04 { - description - "Released as part of ConfD-3.4. - - Added cli-key-format. - Added cli-list-syntax. - Added cli-flat-list-syntax. - - The following statements were added in ConfD-3.3.3: - - Added cli-suppress-list-no. - Added cli-suppress-no. - Added cli-full-no. - Added cli-incomplete-no."; - } - - revision 2010-09-16 { - description - "Released as part of ConfD-3.3.2. - - Added cli-autowizard. - Added cli-multi-word-key. - Added cli-no-match-completion."; - } - - revision 2010-08-19 { - description - "Released as part of ConfD-3.3.1. - - Added cli-show-template-footer. - Added cli-run-template-footer. - Added cli-table-footer. - Changed cli-table-legend to be a template."; - } - - revision 2010-06-17 { - description - "Released as part of ConfD-3.3. - - Added cli-display-empty-config. - - Added cli-expose-key-name. - - Added cli-value-display-template. - - Added cli-run-template. - Added cli-run-template-legend. - Added cli-run-template-enter. - - Added cli-suppress-key-sort. - - Added cli-suppress-validation-warning-prompt. - - Added 'hex' and 'hexlist' as display parameters in the - type cli-template-string. - - Deprecated tailf:cli-default-order."; - } - - revision 2010-03-18 { - description - "Released as part of ConfD-3.2."; - } - - extension cli-show-no { - tailf:use-in "leaf"; - tailf:use-in "list"; - tailf:use-in "leaf-list"; - tailf:use-in "refine"; - tailf:use-in "tailf:symlink"; - tailf:use-in "container"; - description - "Specifies that an optional leaf node or presence container - should be displayed as 'no ' when it does not exist. - For example, if a leaf 'shutdown' has this property and - does not exist, 'no shutdown' is displayed. - - Used in I- and C-style CLIs."; - } - - extension cli-disallow-value { - argument value { - tailf:arg-type { - type string; - } - } - tailf:use-in "leaf"; - tailf:use-in "leaf-list"; - tailf:use-in "refine"; - tailf:use-in "tailf:symlink"; - description - "Specifies that a pattern for invalid values. - - Used in I- and C-style CLIs."; - } - - extension cli-boolean-no { - tailf:use-in "typedef"; - tailf:use-in "leaf"; - tailf:use-in "refine"; - tailf:use-in "tailf:symlink"; - tailf:substatement "tailf:cli-reversed"; - description - "Specifies that a leaf of type boolean should be displayed as - '' if set to true, and 'no ' if set to - false. - - Cannot be used in conjunction with tailf:cli-hide-in-submode - or tailf:cli-compact-syntax. - - Used in I- and C-style CLIs."; - } - - extension cli-reversed { - tailf:use-in "tailf:cli-boolean-no"; - description - "Specified that true should be displayed as 'no ' and - false as 'name'. - - Used in I- and C-style CLIs."; - } - - extension cli-autowizard { - tailf:use-in "leaf"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Specifies that the autowizard should include this leaf even - if the leaf is optional. - - One use case is when implementing pre-configuration of devices. - A config false node can be defined for showing if the - configuration is active or not (preconfigured). - - Used in J-, I- and C-style CLIs."; - } - - extension cli-show-config { - tailf:use-in "leaf"; - tailf:use-in "leaf-list"; - tailf:use-in "list"; - tailf:use-in "container"; - tailf:use-in "refine"; - tailf:use-in "tailf:symlink"; - description - "Specifies that the node will be included when doing a 'show - running-configuration', even if it is a non-config node. - - Used in I- and C-style CLIs."; - } - - - extension cli-display-empty-config { - tailf:use-in "list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Specifies that the node will be included when doing a 'show - stats', even if it is a non-config node, provided - that the list contains at least one non-config node. - - Used in J-style CLI."; - } - - extension cli-mode-name { - argument value { - tailf:arg-type { - type string; - } - } - tailf:use-in "container"; - tailf:use-in "list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Specifies a custom mode name, instead of the default which is the - name of the list or container node. - - Can be used in config nodes only. If used in a container, the - container must also have a tailf:cli-add-mode statement, and if - used in a list, the list must not also have a - tailf:cli-suppress-mode statement. - - Variables for the list keys in the current mode are available. - For examples, 'config-foo-xx$(name)' (privided the key leaf - is called 'name'). - - Used in I- and C-style CLIs."; - } - - extension cli-show-order-taglist { - argument value { - tailf:arg-type { - type string; - } - } - tailf:use-in "container"; - tailf:use-in "list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Specifies a custom display order for nodes with the - tailf:cli-show-order-tag attribute. Nodes will be displayed - in the order indicated in the list. Nodes without a tag will - be displayed after all nodes with a tag have been displayed. - - The scope of a taglist is until a new taglist is encountered. - - Used in I- and C-style CLIs."; - } - - extension cli-show-order-tag { - argument value { - tailf:arg-type { - type string; - } - } - tailf:use-in "container"; - tailf:use-in "list"; - tailf:use-in "leaf"; - tailf:use-in "leaf-list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Specifies a custom display order for nodes with the - tailf:cli-show-order-tag attribute. Nodes will be displayed - in the order indicated by a cli-show-order-taglist attribute in - a parent node. - - The scope of a tag reaches until a new taglist is encountered. - - Used in I- and C-style CLIs."; - } - - extension cli-mode-name-actionpoint { - argument value { - tailf:arg-type { - type string; - } - } - tailf:use-in "container"; - tailf:use-in "list"; - tailf:use-in "refine"; - description - "Specifies that a custom function will be invoked to find out the mode - name, instead of using the default with is the name of the list - or container node. - - The argument is the name of an actionpoint, which must be - implemented by custom code. In the actionpoint, the command() - callback function will be invoked, and it must return a string - with the mode name. See confd_lib_dp(3) for details. - - Can be used in config nodes only. If used in a container, the - container must also have a tailf:cli-add-mode statement, and if - used in a list, the list must not also have a - tailf:cli-suppress-mode statement. - - Used in I- and C-style CLIs."; - } - - extension cli-add-mode { - tailf:use-in "container"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Creates a mode of the container. - - Can be used in config nodes only. - - Used in I- and C-style CLIs."; - } - - extension cli-flatten-container { - tailf:use-in "container"; - tailf:use-in "list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Allows the CLI to exit the container and continue to input - from the parent container when all leaves in the current - container has been set. - - Can be used in config nodes only. - - Used in I- and C-style CLIs."; - } - - extension cli-suppress-mode { - tailf:use-in "list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Instructs the CLI engine to not make a mode of the list node. - - Can be used in config nodes only. - - Used in I- and C-style CLIs."; - } - - extension cli-delete-when-empty { - tailf:use-in "list"; - tailf:use-in "container"; - description - "Instructs the CLI engine to delete the list when the last list - instance is deleted'. Requires that cli-suppress-mode is set. - - The behavior is recursive. If all optional leafs in a list - instance are deleted the list instance itself is deleted. If - that list instance happens to be the last list instance in a - list it is also deleted. And so on. Used in I- and C-style - CLIs."; - } - - extension cli-remove-before-change { - tailf:use-in "leaf-list"; - tailf:use-in "list"; - tailf:use-in "leaf"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Instructs the CLI engine to generate a no-commnd before - modifying an existing instance. It only applies when - generating diffs, eg 'show configuration' in C-style."; - } - - extension cli-no-value-on-delete { - tailf:use-in "leaf"; - tailf:use-in "leaf-list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "When displaying the deleted version of this leaf do not - include the old value. - - Applies to C-style"; - } - - extension cli-no-name-on-delete { - tailf:use-in "leaf"; - tailf:use-in "container"; - tailf:use-in "list"; - tailf:use-in "leaf-list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "When displaying the deleted version of this element do not - include the name. - - Applies to C-style"; - } - - extension cli-embed-no-on-delete { - tailf:use-in "leaf"; - tailf:use-in "container"; - tailf:use-in "list"; - tailf:use-in "leaf-list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Embed no in front of the element name insead of at the - beginning of the line. - - Applies to C-style"; - } - - extension cli-recursive-delete { - tailf:use-in "container"; - tailf:use-in "list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "When generating configuration diffs delete all contents - of a container or list before deleting the node. - - Applies to C-style"; - } - - - extension cli-diff-dependency { - argument path { - tailf:arg-type { - type string; - } - } - tailf:use-in "container"; - tailf:use-in "list"; - tailf:use-in "leaf"; - tailf:use-in "leaf-list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - tailf:substatement "tailf:xpath-root"; - tailf:substatement "tailf:cli-trigger-on-set"; - tailf:substatement "tailf:cli-trigger-on-delete"; - tailf:substatement "tailf:cli-trigger-on-all"; - tailf:occurence "*"; - description - "Tells the 'show configuration' command, and the diff generator - that this node depends on another node. When removing the node - with this declaration, it should be removed before the node - it depends on is removed, ie the declaration controlls the ordering - of the commands in the 'show configuration' output. - - Applies to C-style"; - } - - extension cli-trigger-on-set { - tailf:use-in "tailf:cli-diff-dependency"; - description - 'Specify that the dependency should trigger on set/modify of - the target path, but deletion of the target will trigger the - current node to be placed in front of the target. - - The annotation can be used to get the diff behavior where - one leaf is first deleted before the other leaf is set. - For example, having the data model below: - - container X { - leaf A { - tailf:cli-diff-dependency "../B" { - tailf:cli-trigger-on-set; - } - type empty; - } - leaf B { - tailf:cli-diff-dependency "../A" { - tailf:cli-trigger-on-set; - } - type empty; - } - } - - produces the following diffs when setting one leaf - and deleting the other - - no X A - X B - - and - - no X B - X A - - this can also be done with list instances, for example - - list a { - key id; - - leaf id { - tailf:cli-diff-dependency "/c[id=current()/../id]" { - tailf:cli-trigger-on-set; - } - type string; - } - } - - list c { - key id; - leaf id { - tailf:cli-diff-dependency "/a[id=current()/../id]" { - tailf:cli-trigger-on-set; - } - type string; - } - } - - we get - - no a foo - c foo - ! - - and - - no c foo - a foo - ! - - In the above case if we have the same id in list "a" and "c" - and we delete the instance in one list, and add it in the other, - then the deletion will always preceed the create. - '; - } - - extension cli-trigger-on-delete { - tailf:use-in "tailf:cli-diff-dependency"; - description - "This annotation can be used togeter with tailf:cli-trigger-on-set - to also get the behavior that when deleting the target display - changes to this node first. For exmaple: - - container settings { - tailf:cli-add-mode; - - leaf opmode { - tailf:cli-no-value-on-delete; - - type enumeration { - enum nat; - enum transparent; - } - } - - leaf manageip { - when \"../opmode = 'transparent'\"; - mandatory true; - tailf:cli-no-value-on-delete; - tailf:cli-diff-dependency '../opmode' { - tailf:cli-trigger-on-set; - tailf:cli-trigger-on-delete; - } - - type string; - } - } - - What we are trying to achieve here is that if manageip is - deleted, it should be displayed before opmode, but if we - configure both opmode and manageip, we should display opmode - first, ie get the diffs: - - settings - opmode transparent - manageip 1.1.1.1 - ! - - and - - settings - no manageip - opmode nat - ! - - and - - settings - no manageip - no opmode - ! - - The cli-trigger-on-set annotation will cause the 'no manageip' - command to be displayed before setting opmode. The - tailf:cli-trigger-on-delete will cause 'no manageip' to be - placed before 'no opmode' when both are deleted. - - In the first diff where both are created, opmode will come first - due to the diff-dependency setting, regardless of the - cli-trigger-on-delete and cli-trigger-on-set. - "; - - } - - - extension cli-trigger-on-all { - tailf:use-in "tailf:cli-diff-dependency"; - description - "Specify that the dependency should always trigger. It is the - same as placing one element before another in the data model. - For example, given the data model: - - container X { - leaf A { - tailf:cli-diff-dependency '../B' { - tailf:cli-trigger-on-all; - } - type empty; - } - leaf B { - type empty; - } - } - - We get the diffs - - X B - X A - - and - - no X B - no X A - "; - } - - - extension cli-ignore-modified { - tailf:use-in "container"; - tailf:use-in "list"; - tailf:use-in "leaf"; - tailf:use-in "leaf-list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Tells the cdb_cli_diff_iterate system call to not generate - a CLI string when this container is modified. The string will - instead be generated for the modified sub-element. - - Applies to C-style and I-style"; - } - - extension cli-show-long-obu-diffs { - tailf:use-in "list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Instructs the CLI engine to not generate 'insert' comments - when displaying configuration changes of ordered-by user - lists, but instead explicitly remove old instances with 'no' - and then add the instances following a newly inserted instance. - Should not be used together with tailf:cli-show-obu-comments"; - } - - extension cli-show-obu-comments { - tailf:use-in "list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Enforces the CLI engine to generate 'insert' comments - when displaying configuration changes of ordered-by user - lists. Should not be used together with tailf:cli-show-long-obu-diffs"; - } - - extension cli-allow-join-with-key { - tailf:use-in "list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - tailf:substatement "tailf:cli-display-joined"; - description - "Indicates that the list name may be written together - with the first key, without requiring a whitespace - in between, ie allowing both - interface ethernet1/1 - and - interface ethernet 1/1 - - Used in I- and C-style CLIs."; - } - - extension cli-allow-join-with-value { - tailf:use-in "leaf"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - tailf:substatement "tailf:cli-display-joined"; - description - "Indicates that the leaf name may be written together - with the value, without requiring a whitespace - in between, ie allowing both - interface ethernet1/1 - and - interface ethernet 1/1 - - Used in I- and C-style CLIs."; - } - - - extension cli-display-joined { - tailf:use-in "tailf:cli-allow-join-with-key"; - tailf:use-in "tailf:cli-allow-join-with-value"; - description - "Specifies that the joined version should be used when displaying - the configuration in C- and I- mode."; - } - - extension cli-exit-command { - argument value { - yin-element true; - tailf:arg-type { - type string; - } - } - tailf:use-in "list"; - tailf:use-in "container"; - tailf:use-in "refine"; - tailf:use-in "tailf:symlink"; - tailf:substatement "tailf:info"; - description - "Tells the CLI to add an explicit exit-from-submode command. - The tailf:info substatement can be used for adding a custom - info text for the command. - - Used in I- and C-style CLIs."; - } - - extension cli-explicit-exit { - tailf:use-in "list"; - tailf:use-in "container"; - tailf:use-in "refine"; - tailf:use-in "tailf:symlink"; - description - "Tells the CLI to add an explicit exit command when displaying - the configuration. It will not be added if cli-exit-command - is defined as well. The annotation is inherited by all - sub-modes. - - Used in I- and C-style CLIs."; - } - - - extension cli-key-format { - argument value { - yin-element true; - tailf:arg-type { - type string; - } - } - tailf:use-in "list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "The format string is used when parsing a key value and when - generating a key value for an existing configuration. The key - items are numbered from 1-N and the format string should - indicate how they are related by using $(X) (where X is the - key number). For example: - - tailf:cli-key-format '$(1)-$(2)' means that the first key - item is concatenated with the second key item by a '-'. - - Used in J-, I- and C-style CLIs."; - } - - extension cli-suppress-key-sort { - tailf:use-in "list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Instructs the CLI engine to not sort the keys in alphabetical order - when presenting them to the user during TAB completion. - - Used in J-, I- and C-style CLIs."; - } - - extension cli-suppress-table { - tailf:use-in "list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Instructs the CLI engine to not print the list as a table in - the 'show' command. - - Can be used in non-config nodes only. - - Used in I- and C-style CLIs."; - } - - extension cli-suppress-validation-warning-prompt { - tailf:use-in "list"; - tailf:use-in "leaf"; - tailf:use-in "container"; - tailf:use-in "leaf-list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Instructs the CLI engine to not prompt the user whether to proceed - or not if a warning is generated for this node. - - Used in I- and C-style CLIs."; - } - - - extension cli-suppress-key-abbreviation { - tailf:use-in "list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Key values cannot be abbreviated. The user must always give - complete values for keys. - - In the J-style CLI this is relevant when using the commands - 'delete' and 'edit'. - - In the I- and C-style CLIs this is relevant when using the - commands 'no', 'show configuration' and for commands to enter - submodes. - - See also /confdConfig/cli/allowAbbrevKeys in confd.conf(5)."; - } - - extension cli-allow-key-abbreviation { - tailf:use-in "list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Key values can be abbreviated. - - In the J-style CLI this is relevant when using the commands - 'delete' and 'edit'. - - In the I- and C-style CLIs this is relevant when using the - commands 'no', 'show configuration' and for commands to enter - submodes. - - See also /confdConfig/cli/allowAbbrevKeys in confd.conf(5)."; - } - - extension cli-table-legend { - argument value { - yin-element true; - tailf:arg-type { - type string; - } - } - tailf:use-in "list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Specifies a template string to be printed before all list entries are - printed. - - Used in J-, I- and C-style CLIs."; - } - - extension cli-table-footer { - argument value { - yin-element true; - tailf:arg-type { - type string; - } - } - tailf:use-in "list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Specifies a template string to be printed after all list entries are - printed. - - Used in J-, I- and C-style CLIs."; - } - - extension cli-completion-actionpoint { - argument value { - tailf:arg-type { - type tailf:identifier; - } - } - tailf:use-in "leaf-list"; - tailf:use-in "leaf"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - tailf:substatement "tailf:cli-completion-id"; - description - "Specifies that completion for the leaf values is done through a - callback function. - - The argument is the name of an actionpoint, which must be - implemented by custom code. In the actionpoint, the completion() - callback function will be invoked. See confd_lib_dp(3) for details. - - Used in J-, I- and C-style CLIs."; - } - - extension cli-completion-id { - argument value { - tailf:arg-type { - type tailf:identifier; - } - } - tailf:use-in "tailf:cli-completion-actionpoint"; - tailf:use-in "tailf:cli-custom-range-actionpoint"; - description - "Specifies a string which is passed to the callback when invoked. - This makes it possible to use the same callback at several - locations and still keep track of which point it is invoked - from."; - } - - extension cli-allow-caching { - tailf:use-in "tailf:cli-custom-range-actionpoint"; - tailf:use-in "tailf:cli-custom-range-enumerator"; - description - "Allow caching of the evaluation results between different parent paths."; - } - - extension cli-multi-line-prompt { - tailf:use-in "leaf"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Tells the CLI to automatically enter multi-line mode when prompting - the user for a value to this leaf. - - Used in J-, I- and C-style CLIs."; - } - - extension cli-multi-word-key { - tailf:use-in "leaf"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - tailf:substatement "tailf:cli-max-words"; - description - "Specifies that the key should allow multiple tokens for the - value. Proper type restrictions needs to be used to limit - the range of the leaf value. - - Can be used in key leafs only. - - Used in J-, I- and C-style CLIs."; - } - - extension cli-max-words { - argument value { - tailf:arg-type { - type uint32; - } - } - tailf:use-in "tailf:cli-multi-word-key"; - tailf:use-in "tailf:cli-multi-word"; - tailf:use-in "tailf:cli-multi-value"; - description - "Specifies the maximum number of allowed words for the key or value."; - } - - extension cli-allow-range { - tailf:use-in "leaf"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Means that the non-integer key should allow range expressions. - - Can be used in key leafs only. - - Used in J-, I- and C-style CLIs."; - } - - extension cli-range-delimiters { - argument value { - tailf:arg-type { - type string; - } - } - tailf:use-in "list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Allows for custom delimiters to be defined for range expressions. - By default only / is considered a delimiter, ie when processing - a key like 1/2/3 then each of 1, 2 and 3 will be matched separately - agains range expressions, ie given the expression 1-3/5-6/7,8 - 1 will be matched with 1-3, 2 with 5-6, and 3 with 7,8. If, for - example, the delimiters value is set to '/.' then both '/' and - '.' will be considered delimiters and an key such as 1/2/3.4 will - consist of the enteties 1,2,3,4, all matched separately. - - Used in J-, I- and C-style CLIs."; - } - - - extension cli-suppress-range { - tailf:use-in "leaf"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Means that the integer key should not allow range expressions. - - Can be used in key leafs only. - - Used in J-, I- and C-style CLIs."; - } - - extension cli-custom-range { - tailf:use-in "leaf"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - tailf:substatement "tailf:cli-range-type" { - tailf:occurence "1"; - } - description - "Specifies that the key should support ranges. A type matching the - range expression must be supplied. - - Can be used in key leafs only. - - Used in J-, I- and C-style CLIs."; - } - - extension cli-custom-range-actionpoint { - argument value { - tailf:arg-type { - type tailf:identifier; - } - } - tailf:use-in "list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - tailf:substatement "tailf:cli-completion-id"; - tailf:substatement "tailf:cli-allow-caching"; - description - "Specifies that the list supports range expressions and that a custom - function will be invoked to determine if an instance belong in - the range or not. At least one key element needs a - cli-custom-range statement. - - The argument is the name of an actionpoint, which must be - implemented by custom code. In the actionpoint, the - completion() callback function will be invoked. See - confd_lib_dp(3) for details. - - When a range expression value which matches the type is given in - the CLI, the CLI engine will invoke the callback with each - existing list entry instance. If the callback returns CONFD_OK, - it matches the range expression, and if it returns CONFD_ERR, it - doesn't match. - - Used in J-, I- and C-style CLIs."; - } - - extension cli-custom-range-enumerator { - argument value { - tailf:arg-type { - type tailf:identifier; - } - } - tailf:use-in "list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - tailf:substatement "tailf:cli-completion-id"; - tailf:substatement "tailf:cli-allow-caching"; - description - "Specifies a callback to invoke to get an array of - instances matching a regular expression. This is used - when instances should be allowed to be created using - a range expression in set. - - The callback is not used for delete or show operations. - - The callback is allowed to return a superset of all matching - instances since the instances will be filtered using the - range expression afterwards. - - Used in J-, I- and C-style CLIs."; - } - - extension cli-range-type { - argument value { - tailf:arg-type { - type string; - } - } - tailf:use-in "tailf:cli-custom-range"; - description - "This statement contains the name of a derived type, possibly - with a prefix. If no prefix is given, the type must be defined in - the local module. For example: - - cli-range-type p:my-range-type; - - All range expressions must match this type, and a valid key - value must not match this type."; - } - - extension cli-allow-wildcard { - tailf:use-in "list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Means that the list allows wildcard expressions in the 'show' pattern. - - See also /confdConfig/cli/allowWildcard in confd.conf(5). - - Used in J-, I- and C-style CLIs."; - } - - extension cli-suppress-wildcard { - tailf:use-in "list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Means that the list does not allow wildcard expressions in the 'show' - pattern. - - See also /confdConfig/cli/allowWildcard in confd.conf(5). - - Used in J-, I- and C-style CLIs."; - } - - extension cli-configure-mode { - tailf:use-in "tailf:action"; - tailf:use-in "rpc"; - description - "An action or rpc with this attribute will be available in - configure mode, but not in operational mode. - - The default is that the action or rpc is available in both - configure and operational mode. - - Used in J-, I- and C-style CLIs."; - } - - extension cli-operational-mode { - tailf:use-in "tailf:action"; - tailf:use-in "rpc"; - description - "An action or rpc with this attribute will be available in - operational mode, but not in configure mode. - - The default is that the action or rpc is available in both - configure and operational mode. - - Used in J-, I- and C-style CLIs."; - } - - extension cli-mount-point { - argument value { - tailf:arg-type { - type string; - } - } - tailf:use-in "tailf:action"; - tailf:use-in "rpc"; - description - "By default actions are mounted under the 'request' - command in the J-style CLI and at the top-level in - the I- and C-style CLIs. This annotation allowes - the action to be mounted under other top level commands"; - } - - extension cli-batch-confirm-default { - argument name { - tailf:arg-type { - type boolean; - } - } - tailf:use-in "tailf:confirm-text"; - description - "Specifies if the default is to proceed or abort the action during batch - processing in the CLI (e.g. non-interactive mode) when a confirm-text is - set. If this value is not specified, the default value may instead be - provdied by tailf:confirm-default or by the ConfD global default if - specified in a clispec(5)."; - } - - extension cli-delayed-auto-commit { - tailf:use-in "container"; - tailf:use-in "list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Enables transactions while in a specific submode (or submode of that - mode). The modifications performed in that mode will not take effect - until the user exits that submode. - - Can be used in config nodes only. If used in a container, the - container must also have a tailf:cli-add-mode statement, and if - used in a list, the list must not also have a - tailf:cli-suppress-mode statement. - - Used in I- and C-style CLIs."; - } - - extension cli-preformatted { - tailf:use-in "leaf"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Suppresses quoting of non-config elements when displaying them. - Newlines will be preserved in strings etc. - - Used in J-, I- and C-style CLIs."; - } - - extension cli-disabled-info { - argument value { - tailf:arg-type { - type string; - } - } - tailf:use-in "leaf"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Specifies an info string that will be used as a descriptive text for the - value 'disable' (false) of boolean-typed leafs when the confd.conf(5) - setting /confdConfig/cli/useShortEnabled is set to 'true'. - - Used in J-, I- and C-style CLIs."; - } - - extension cli-suppress-shortenabled { - tailf:use-in "leaf"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Suppresses the confd.conf(5) setting /confdConfig/cli/useShortEnabled. - - Used in J-, I- and C-style CLIs."; - } - - extension cli-trim-default { - tailf:use-in "leaf"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Do not display value if it is same as default. - - Used in I- and C-style CLIs."; - } - - extension cli-expose-key-name { - tailf:use-in "leaf"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Force the user to enter the name of the key and display the - key name when displaying the running-configuration. - - Used in J-, I- and C-style CLIs."; - } - - - extension cli-enforce-table { - tailf:use-in "list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Forces the generation of a table for a list element node regardless of - whether the table will be too wide or not. This applies to the - tables generated by the auto-rendred show commands for non-config data. - - Used in I- and C-style CLIs."; - } - - extension cli-drop-node-name { - tailf:use-in "leaf"; - tailf:use-in "container"; - tailf:use-in "list"; - tailf:use-in "leaf-list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Specifies that the name of a node is not present in the CLI. - - If tailf:cli-drop-node-name is given on a child to a list node, - we recommend that you also use tailf:cli-suppress-mode on that - list node, otherwise the CLI will be very confusing. - - For example, consider this data model, from the tailf-aaa module: - - list alias { - key name; - leaf name { - type string; - } - leaf expansion { - type string; - mandatory true; - tailf:cli-drop-node-name; - } - } - - If you type 'alias foo' in the CLI, you would end up in the - 'alias' submode. But since the expansion is dropped, you would - end up specifying the expansion value without typing any command. - - If, on the other hand, the 'alias' list had a - tailf:cli-suppress-mode statement, you would set an expansion - 'bar' by typing 'alias foo bar'. - - tailf:cli-drop-node-name cannot be used inside tailf:action. - - Used in I- and C-style CLIs."; - } - - extension cli-no-keyword { - tailf:use-in "leaf"; - tailf:use-in "container"; - tailf:use-in "list"; - tailf:use-in "leaf-list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Specifies that the name of a node is not present in the CLI. - - - Note that is must be used with some care, just - like tailf:cli-drop-node-name. The resulting data model must still - be possible to parse deterministically. - For example, consider the data model - - container interfaces { - list traffic { - tailf:cli-no-keyword; - key id; - leaf id { type string; } - leaf mtu { type uint16; } - } - list management { - tailf:cli-no-keyword; - key id; - leaf id { type string; } - leaf mtu { type uint16; } - } - } - - In this case it is impossible to determine if the config - - interfaces { - eth0 { - mtu 1400; - } - } - - Means that there should be an traffic interface instance named - 'eth0' or a management interface instance maned 'eth0'. If, on - the other hand, a restriction on the type was used, for example - - container interfaces { - list traffic { - tailf:cli-no-keyword; - key id; - leaf id { type string; pattern 'eth.*'; } - leaf mtu { type uint16; } - } - list management { - tailf:cli-no-keyword; - key id; - leaf id { type string; pattern 'lo.*';} - leaf mtu { type uint16; } - } - } - - then the problem would disappear. - - Used in the J-style CLIs."; - } - - extension cli-compact-syntax { - tailf:use-in "list"; - tailf:use-in "container"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Instructs the CLI engine to use the compact representation for this - node in the 'show running-configuration' command. The compact - representation means that all leaf elements are shown on a - single line. - - Cannot be used in conjunction with tailf:cli-boolean-no. - - Used in I- and C-style CLIs."; - } - - extension cli-compact-stats { - tailf:use-in "list"; - tailf:use-in "container"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - tailf:substatement "tailf:cli-wrap"; - tailf:substatement "tailf:cli-width"; - tailf:substatement "tailf:cli-delimiter"; - tailf:substatement "tailf:cli-prettify"; - tailf:substatement "tailf:cli-spacer"; - description - "Instructs the CLI engine to use the compact representation for this - node. The compact representation means that all leaf elements - are shown on a single line. - - Used in J-, I- and C-style CLIs."; - } - - extension cli-wrap { - tailf:use-in "tailf:cli-compact-stats"; - description - "If present, the line will be wrapped at screen width."; - } - - extension cli-width { - argument value { - tailf:arg-type { - type uint32; - } - } - tailf:use-in "tailf:cli-compact-stats"; - description - "Specifies a fixed terminal width to use before wrapping line. It is - only used when tailf:cli-wrap is present. If a width is not - specified the line is wrapped when the terminal width is - reached."; - } - - extension cli-delimiter { - argument value { - tailf:arg-type { - type string; - } - } - tailf:use-in "tailf:cli-compact-stats"; - description - "Specifies a string to print between the leaf name and its value - when displaying leaf values."; - } - - extension cli-prettify { - tailf:use-in "tailf:cli-compact-stats"; - description - "If present, dashes (-) and underscores (_) in leaf names are replaced - with spaces."; - } - - extension cli-spacer { - argument value { - tailf:arg-type { - type string; - } - } - tailf:use-in "tailf:cli-compact-stats"; - description - "Specifies a string to print between the nodes."; - } - - - extension cli-column-stats { - tailf:use-in "container"; - tailf:use-in "refine"; - tailf:use-in "tailf:symlink"; - description - "Display leafs in the container as columns, i.e., do not repeat - the name of the container on each line, but instead indent each - leaf under the container. - - Used in I- and C-style CLIs."; - } - - extension cli-column-width { - argument value { - tailf:arg-type { - type uint32; - } - } - tailf:use-in "leaf"; - tailf:use-in "leaf-list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Set a fixed width for the column in the auto-rendered tables. - - Used in J-, I- and C-style CLIs."; - } - - extension cli-min-column-width { - argument value { - tailf:arg-type { - type uint32; - } - } - tailf:use-in "leaf"; - tailf:use-in "leaf-list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Set a minimum width for the column in the auto-rendered tables. - - Used in J-, I- and C-style CLIs."; - } - - extension cli-column-align { - argument value { - tailf:arg-type { - type enumeration { - enum left; - enum center; - enum right; - } - } - } - tailf:use-in "leaf"; - tailf:use-in "leaf-list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Specifies the alignment of the data in the column in the - auto-rendered tables. - - Used in J-, I- and C-style CLIs."; - } - - extension cli-list-syntax { - tailf:use-in "leaf-list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - tailf:substatement "tailf:cli-multi-word"; - description - "Specifies that each entry in a leaf-list should be displayed as - a separate element. - - Used in J-, I- and C-style CLIs."; - } - - extension cli-multi-word { - tailf:use-in "tailf:cli-list-syntax"; - tailf:substatement "tailf:cli-max-words"; - description - "Specifies that a multi-word value may be entered without quotes."; - } - - extension cli-flat-list-syntax { - tailf:use-in "leaf-list"; - tailf:substatement "tailf:cli-replace-all"; - tailf:use-in "refine"; - description - "Specifies that elements in a leaf-list should be entered without - surrounding brackets. Also, multiple elements can be added to a list - or deleted from a list. - - Used in J-, I- and C-style CLIs."; - } - - extension cli-replace-all { - tailf:use-in "leaf-list"; - tailf:use-in "tailf:cli-flat-list-syntax"; - tailf:use-in "refine"; - description - "Specifies that the new leaf-list value(s) should replace the old, - as opposed to be added to the old leaf-list."; - } - - extension cli-range-list-syntax { - tailf:use-in "leaf-list"; - tailf:use-in "list"; - tailf:use-in "refine"; - description - "Specifies that elements in a leaf-list or a list should be entered - without surrounding brackets and presented as ranges. The - element in the list should be separated by a comma. For - example: - - vlan 1,3,10-20,30,32,300-310 - - When this statement is used for lists, the list must have a - single key. The elements are be presented as ranges as above. - - The type of the list key, or the leaf-list, must be integer based. - - Used in J-, I- and C-style CLIs."; - } - - extension cli-incomplete-command { - tailf:use-in "leaf"; - tailf:use-in "leaf-list"; - tailf:use-in "list"; - tailf:use-in "container"; - tailf:use-in "refine"; - description - "Specifies that an auto-rendered command should be considered - incomplete. Can be used to prevent from appearing in - the completion list for optional internal nodes, for example, or - to ensure that the user enters all leaf values in a container - (if used in combination with cli-sequence-commands). - - Used in I- and C-style CLIs."; - } - - extension cli-full-command { - tailf:use-in "leaf"; - tailf:use-in "leaf-list"; - tailf:use-in "list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "container"; - tailf:use-in "refine"; - description - "Specifies that an auto-rendered command should be considered complete, - ie, no additional leaves or containers can be entered on the same - command line. - - Used in I- and C-style CLIs."; - } - - extension cli-sequence-commands { - tailf:use-in "list"; - tailf:use-in "container"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - tailf:substatement "tailf:cli-reset-siblings"; - tailf:substatement "tailf:cli-reset-all-siblings"; - description - "Specifies that an auto-rendered command should only accept arguments - in the same order as they are specified in the YANG model. - This, in combination with tailf:cli-drop-node-name, can be used - to create CLI commands for setting multiple leafs in a container - without having to specify the leaf names. - - In almost all cases this annotation should be accompanied by the - tailf:cli-compact-syntax annotation. Otherwise the output from - 'show running-config' will not be correct, and the sequence - 'save xx' 'load override xx' will not work. - - Used in I- and C-style CLIs."; - } - - extension cli-reset-siblings { - tailf:use-in "tailf:cli-sequence-commands"; - description - "Specifies that all sibling leaves in the sequence should be reset - whenever the first leaf in the sequence is set."; - } - - extension cli-reset-all-siblings { - tailf:use-in "tailf:cli-sequence-commands"; - description - "Specifies that all sibling leaves in the container should be reset - whenever the first leaf in the sequence is set."; - } - - extension cli-reset-container { - tailf:use-in "leaf"; - tailf:use-in "list"; - tailf:use-in "container"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Specifies that all sibling leaves in the container should be - reset when this element is set. - - When used on a container its content is cleared when set."; - } - - extension cli-display-separated { - tailf:use-in "container"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Tells CLI engine to display this container as a separate - line item even when it has children. Only applies to - presence containers. - - Applicable for optional containers in the C- and I- style CLIs."; - } - - extension cli-delete-container-on-delete { - tailf:use-in "leaf"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Specifies that the parent container should be deleted when -. this leaf is deleted."; - } - - extension cli-break-sequence-commands { - tailf:use-in "leaf"; - tailf:use-in "tailf:symlink"; - tailf:use-in "leaf-list"; - tailf:use-in "list"; - tailf:use-in "container"; - tailf:use-in "refine"; - description - "Specifies that previous cli-sequence-command declaration should - stop at this point. Only applicable when a cli-sequence-command - declaration has been used in the parent container. - - Used in I- and C-style CLIs."; - } - - extension cli-strict-leafref { - tailf:use-in "leaf"; - tailf:use-in "leaf-list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Specifies that the leaf should only be allowed to be assigned - references to existing instances when the command is executed. - Without this annotation the requirement is that the instance - exists on commit time. - - Used in I- and C-style CLIs."; - } - - extension cli-optional-in-sequence { - tailf:use-in "leaf"; - tailf:use-in "tailf:symlink"; - tailf:use-in "leaf-list"; - tailf:use-in "list"; - tailf:use-in "container"; - tailf:use-in "refine"; - description - "Specifies that this element is optional in the sequence. If it - is set it must be set in the right sequence but may be skipped. - - Used in I- and C-style CLIs."; - } - - extension cli-incomplete-show-path { - tailf:use-in "leaf"; - tailf:use-in "tailf:symlink"; - tailf:use-in "leaf-list"; - tailf:use-in "list"; - tailf:use-in "container"; - tailf:use-in "refine"; - tailf:substatement "tailf:cli-min-keys"; - description - "Specifies that a path to the show command is considered incomplete, - i.e., it needs more elements added to the path. It can also be used - to specify a minimum number of keys to be given for lists. - - Used in J-, I- and C-style CLIs."; - } - - extension cli-min-keys { - argument value { - tailf:arg-type { - type uint32; - } - } - tailf:use-in "tailf:cli-incomplete-show-path"; - description - "Specifies the minimum number of required keys for the show command."; - } - - extension cli-hide-in-submode { - tailf:use-in "leaf"; - tailf:use-in "container"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Hide leaf when submode has been entered. Mostly useful when - leaf has to be entered in order to enter a submode. Also works - for flattened containers. - - Cannot be used in conjunction with tailf:cli-boolean-no. - - Used in I- and C-style CLIs."; - } - - extension cli-expose-ns-prefix { - tailf:use-in "container"; - tailf:use-in "list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "When used force the CLI to display namespace prefix of all children."; - } - - extension cli-prefix-key { - tailf:use-in "leaf"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - tailf:use-in "leaf-list"; - tailf:substatement "tailf:cli-before-key"; - description - "This leaf has to be given as a prefix before entering the actual - list keys. Very backwards but a construct that exists in some - Cisco CLIs. - - The construct can be used also for leaf-lists but only when - then tailf:cli-range-list-syntax is also used. - - Used in I- and C-style CLIs."; - } - - extension cli-before-key { - argument value { - tailf:arg-type { - type uint32; - } - } - tailf:use-in "tailf:cli-prefix-key"; - description - "Specifies before which key the prefix element should be inserted. - The first key has number 1."; - } - - extension cli-show-with-default { - tailf:use-in "leaf"; - tailf:use-in "refine"; - tailf:use-in "tailf:symlink"; - description - "This leaf will be displayed even when it has its default value. - Note that this will somewhat result in a slightly different behaviour - when you save a config and then load it again. With this setting - in place a leaf that has not been configured will be configured - after the load. - - Used in I- and C-style CLIs."; - } - - extension cli-oper-info { - argument text { - yin-element true; - tailf:arg-type { - type string; - } - } - tailf:use-in "leaf"; - tailf:use-in "leaf-list"; - tailf:use-in "list"; - tailf:use-in "container"; - tailf:use-in "rpc"; - tailf:use-in "identity"; - tailf:use-in "tailf:action"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "This statement works exactly as tailf:info, with the exception - that it is used when displaying the element info in the context - of stats. - - Both tailf:info and tailf:cli-oper-info can be present at the same - time."; - } - - extension cli-case-sensitive { - tailf:use-in "container"; - tailf:use-in "list"; - tailf:use-in "leaf"; - description - "Specifies that this node is case-sensitive. - If applied to a container or a list, any nodes below will - also be case-sensitive. - - Note that this will override any case-sensitivity settings - configured in confd.conf"; - } - - extension cli-case-insensitive { - tailf:use-in "container"; - tailf:use-in "list"; - tailf:use-in "leaf"; - description - "Specifies that node is case-insensitive. - If applied to a container or a list, any nodes below will - also be case-insensitive. - - Note that this will override any case-insensitivity settings - configured in confd.conf"; - } - - extension cli-custom-error { - argument text { - yin-element true; - tailf:arg-type { - type string; - } - } - tailf:use-in "leaf"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "This statement specifies a custom error message to be displayed - when the user enters an invalid value."; - } - - extension cli-full-show-path { - tailf:use-in "leaf"; - tailf:use-in "leaf-list"; - tailf:use-in "list"; - tailf:use-in "container"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - tailf:substatement "tailf:cli-max-keys"; - description - "Specifies that a path to the show command is considered complete, i.e., - no more elements can be added to the path. It can also be used to - specify a maximum number of keys to be given for lists. - - Used in J-, I- and C-style CLIs."; - } - - extension cli-max-keys { - argument value { - tailf:arg-type { - type uint32; - } - } - tailf:use-in "tailf:cli-full-show-path"; - description - "Specifies the maximum number of allowed keys for the show command."; - } - - extension cli-suppress-show-path { - tailf:use-in "leaf"; - tailf:use-in "leaf-list"; - tailf:use-in "list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "container"; - tailf:use-in "refine"; - description - "Specifies that the show command cannot be invoked with the path, - ie the path is suppressed when auto-rendering show commands for - config='false' data. - - Used in J-, I- and C-style CLIs."; - } - - - extension cli-suppress-show-match { - tailf:use-in "leaf"; - tailf:use-in "leaf-list"; - tailf:use-in "list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "container"; - tailf:use-in "refine"; - description - "Specifies that a specific completion match (i.e., a filter match that - appear at list nodes as an alternative to specifying a single - instance) to the show command should not be available. - - Used in J-, I- and C-style CLIs."; - } - - extension cli-suppress-list-no { - tailf:use-in "leaf-list"; - tailf:use-in "list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Specifies that the CLI should not accept deletion of the entire list - or leaf-list. Only specific instances should be deletable not the - entire list in one command. ie, 'no foo ' should be allowed - but not 'no foo'. - - Used in I- and C-style CLIs."; - } - - extension cli-suppress-no { - tailf:use-in "leaf"; - tailf:use-in "leaf-list"; - tailf:use-in "list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "container"; - tailf:use-in "refine"; - description - "Specifies that the CLI should not auto-render 'no' commands for - this element. An element with this annotation will not appear in the - completion list to the 'no' command. - - Used in I- and C-style CLIs."; - } - - extension cli-suppress-silent-no { - argument value { - tailf:arg-type { - type string; - } - } - tailf:use-in "leaf"; - tailf:use-in "leaf-list"; - tailf:use-in "list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "container"; - tailf:use-in "refine"; - description - "Specifies that the confd.cnof directive cSilentNo should be - suppressed for a leaf and that a custom error message should - be displayed when the user attempts to delete a non-existing - element. - - Used in I- and C-style CLIs."; - } - - - extension cli-full-no { - tailf:use-in "leaf"; - tailf:use-in "leaf-list"; - tailf:use-in "list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "container"; - tailf:use-in "refine"; - description - "Specifies that an auto-rendered 'no'-command should be considered complete, - ie, no additional leaves or containers can be entered on the same - command line. - - Used in I- and C-style CLIs."; - } - - extension cli-incomplete-no { - tailf:use-in "leaf"; - tailf:use-in "leaf-list"; - tailf:use-in "list"; - tailf:use-in "container"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Specifies that an auto-rendered 'no'-command should not be considered - complete, ie, additional leaves or containers must be entered on the same - command line. - - Used in I- and C-style CLIs."; - } - - extension cli-no-match-completion { - tailf:use-in "list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Specifies that the CLI engine should not provide match completion - for the key leafs in the list. - - Used in J-, I- and C-style CLIs."; - } - - extension cli-suppress-show-conf-path { - tailf:use-in "leaf"; - tailf:use-in "leaf-list"; - tailf:use-in "list"; - tailf:use-in "container"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Specifies that the show running-config command cannot be invoked with - the path, ie the path is suppressed when auto-rendering show running- - config commands for config='true' data. - - Used in J-, I- and C-style CLIs."; - } - - - extension cli-no-key-completion { - tailf:use-in "list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Specifies that the CLI engine should not perform completion for key - leafs in the list. This is to avoid querying the data provider - for all existing keys. - - Used in J-, I- and C-style CLIs."; - } - - extension cli-instance-info-leafs { - argument value { - tailf:arg-type { - type string; - } - } - tailf:use-in "list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "This statement is used to specifiy how list entries are displayed - when doing completion in the CLI. By default, a list entry is - displayed by listing its key values, and the value of a leaf - called 'description', if such a leaf exists in the list entry. - - The 'cli-instance-info-leafs' statement takes as its argument a - space separated string of leaf names. When a list entry is - displayed, the values of these leafs are concatenated with a - space character as separator and shown to the user. - - For example, when asked to specify an interface the CLI will - display a list of possible interface instances, say 1 2 3 4. If - the cli-instance-info-leafs property is set to 'description' then - the CLI might show: - - Possible completions: - 1 - internet - 2 - lab - 3 - dmz - 4 - wlan - - Used in J-, I- and C-style CLIs."; - } - - extension cli-multi-value { - tailf:use-in "leaf"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - tailf:substatement "tailf:cli-max-words"; - description - "Specifies that all remaining tokens on the command line - should be considered a value for this leaf. This prevents - the need for quoting values containing spaces, but also - prevents multiple leaves from being set on the same command - line once a multi-value leaf has been given on a line. - - If the tailf:cli-max-words substatements is used then - additional leaves may be entered. - - Used in I- and C-style CLIs."; - } - - extension cli-value-display-template { - argument value { - yin-element true; - tailf:arg-type { - type tailf:cli-template-string; - } - } - tailf:use-in "leaf"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Specifies a template string to be used when formating the - value of a leaf for display. Note that other leaves cannot - be referenced from a display template of one leaf. The only - value accessible is the leaf's own value, accessed through - $(.). - - See the defintion of cli-template-string for more info. - - Used in J-, I- and C-style CLIs."; - } - - - extension cli-show-template { - argument value { - yin-element true; - tailf:arg-type { - type tailf:cli-template-string; - } - } - tailf:use-in "leaf"; - tailf:use-in "leaf-list"; - tailf:use-in "list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "container"; - tailf:use-in "refine"; - tailf:substatement "tailf:cli-auto-legend"; - description - "Specifies a template string to be used by the 'show' command in - operational mode. It is primarily intended for displaying - non-config data but config data may be included in the template - as well. - - See the defintion of cli-template-string for more info. - - Some restrictions includes not applying templates on a leaf that - is the key in a list. It is recommended to use the template - directly on the list to format the whole list instead. - - Used in J-, I- and C-style CLIs."; - } - - extension cli-auto-legend { - tailf:use-in "tailf:cli-show-template"; - description - "Specifies that the legend should be automatically rendered if not " - +"already displayed. Useful when using templates for rendering " - +"tables."; - } - - extension cli-show-template-legend { - argument value { - yin-element true; - tailf:arg-type { - type tailf:cli-template-string; - } - } - tailf:use-in "list"; - tailf:use-in "refine"; - description - - "Specifies a template string to be printed before all list entries are - printed. - - See the defintion of cli-template-string for more info. - - Used in J-, I- and C-style CLIs."; - } - - extension cli-show-template-enter { - argument value { - yin-element true; - tailf:arg-type { - type tailf:cli-template-string; - } - } - tailf:use-in "list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Specifies a template string to be printed before each list entry is - printed. - - See the defintion of cli-template-string for more info. - - Used in J-, I- and C-style CLIs."; - } - - extension cli-show-template-footer { - argument value { - yin-element true; - tailf:arg-type { - type tailf:cli-template-string; - } - } - tailf:use-in "list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - - "Specifies a template string to be printed after all list entries are - printed. - - See the defintion of cli-template-string for more info. - - Used in J-, I- and C-style CLIs."; - } - - extension cli-run-template { - argument value { - yin-element true; - tailf:arg-type { - type tailf:cli-template-string; - } - } - tailf:use-in "leaf"; - tailf:use-in "leaf-list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Specifies a template string to be used by the 'show running-config' - command in operational mode. It is primarily intended for displaying - config data but non-config data may be included in the template - as well. - - See the defintion of cli-template-string for more info. - - Used in I- and C-style CLIs."; - } - - extension cli-run-template-legend { - argument value { - yin-element true; - tailf:arg-type { - type tailf:cli-template-string; - } - } - tailf:use-in "list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - - "Specifies a template string to be printed before all list entries are - printed. - - See the defintion of cli-template-string for more info. - - Used in I- and C-style CLIs."; - } - - extension cli-run-template-enter { - argument value { - yin-element true; - tailf:arg-type { - type tailf:cli-template-string; - } - } - tailf:use-in "list"; - tailf:use-in "container"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - "Specifies a template string to be printed before each list entry is - printed. - - When used on a container it only has effect when the container - also has a tailf:cli-add-mode, and when tailf:cli-show-no isn't - used on the container. - - See the defintion of cli-template-string for more info. - - The variable .reenter is set to 'true' when the 'show configuration' - command is executed and the list or container isn't created. This - allow, for example, to display - - create foo - - when an instance is created - - edit foo - - when something inside the instance is modified. - - Used in I- and C-style CLIs."; - } - - extension cli-run-template-footer { - argument value { - yin-element true; - tailf:arg-type { - type tailf:cli-template-string; - } - } - tailf:use-in "list"; - tailf:use-in "tailf:symlink"; - tailf:use-in "refine"; - description - - "Specifies a template string to be printed after all list entries are - printed. - - See the defintion of cli-template-string for more info. - - Used in I- and C-style CLIs."; - } - - typedef cli-template-string { - type string; - description - "A template is a text string which is expanded by the CLI engine, - and then displayed to the user. - - The template may contain a mix of text and expandable entries. - Expandable entries all start with $( and end with a matching ). - Parentheses and dollar signs need to be quoted in plain text. - - The template is expanded as follows: - - A parameter is either a relative or absolute path to a leaf - element (eg /foo/bar, foo/bar), or one of the builtin variables: - .selected, .entered, .legend_shown, .user, .groups, .ip, - .display_groups, .path, .ipath or .licounter. In addition the - variables .spath and .ispath are available when a command - is executed from a show path. - - .selected - - The .selected variable contains the list of selected paths - to be shown. The show template can inspect this element to - determine if a given element should be displayed or - not. For example: - - $(.selected~=hwaddr?HW Address) - - .entered - - The .entered variable is true if the \"entered\" text has - been displayed (either the auto generated text or a - showTemplateEnter). This is useful when having a non-table - template where each instance should have a text. - - $(.entered?:host $(name)) - - .legend_shown - - The .legend_shown variable is true if the \"legend\" text has - been displayed (either the auto generated table header or - a showTemplateLegend). This is useful to inspect when - displaying a table row. If the user enteres the path to a - specific instance the builtin table header will not be - displayed and the showTemplateLegend will not be invoked - and it may be useful to render the legend specifically - for this instance. - - $(.legend_shown!=true?Address Interface) - - .user - - The .user variable contains the name of the current - user. This can be used for differentiating the content - displayed for a specific user, or in paths. For exapmle: - - $(user{$(.user)}/settings) - - .groups - - The .groups variable contains the a list of groups that the - user belongs to. - - .display_groups - - The .display_groups variable contains a list of selected - display groups. This can be used to display different - content depending on the selected display group. For - example: - - $(.display_groups~=details?details...) - - .ip - - The .ip variable contains the ip address that the user - connected from. - - .path - - The .path variable contains the path to the entry, - formated in CLI style. - - .ipath - - The .ipath variable contains the path to the entry, - formated in template style. - - .spath - - The .spath variable contains the show path, - formated in CLI style. - - .ispath - - The .ispath variable contains the show path, - formated in template style. - - .licounter - - The .licounter variable contains a counter that is - incremented for each instance in a list. This means that - it will be 0 in the legend, contain the total number of - list instances in the footer and something in between in - the basic show template. - - $(parameter) - - The value of 'parameter' is substituted. - - $(cond?word1:word2) - - The expansion of 'word1' is substituted if 'cond' - evaluates to true, otherwise the expansion of 'word2' is - substituted. - - 'cond' may be one of - - parameter - - Evaluates to true if the node exists. - - parameter == - - Evaluates to true if the value of the parameter equals - . - - parameter != - - Evalutes to true if the value of the parameter does not - equal - - parameter ~= - - Provided that the value of the parameter is a list - (i.e., the node that the parameter refers to is a - leaf-list), this expression evaluates to true if - is a member of the list. - - $(parameter|filter) - - The value of 'parameter' processed by 'filter' is - substituted. Filters may be either one of the - built-ins or a customized filter defined in a - callback. See /confdConfig/cli/templateFilter. - - A built-in 'filter' may be one of: - - capfirst - - Capitalizes the first character of the value. - - lower - - Converts the value into lowercase. - - upper - - Converts the value into uppercase. - - filesizeformat - - Formats the value in a human-readable format (e.g., - '13 KB', '4.10 MB', '102 bytes' etc), where K - means 1024, M means 1024*1024 etc. - - When used without argument the default number of - decimals displayed is 2. When used with a numeric - integer argument, filesizeformat will display the - given number of decimal places. - - humanreadable - - Similar to filesizeformat except no bytes suffix - is added (e.g., '13.00 k', '4.10 M' '102' etc), - where k means 1000, M means 1000*1000 etc. - - When used without argument the default number of - decimals displayed is 2. When used with a numeric - integer argument, humanreadable will display the - given number of decimal places. - - commasep - - Separate the numerical values into groups of three - digits using a comma (e.g., 1234567 -> 1,234,567) - - hex - - Display integer as hex number. An argument can be - used to indicate how many digits should be used in - the output. If the hex number is too long it will - be truncated at the front, if it is too short it will - be padded with zeros at the front. If the width is - a negative number then at most that number of digits - will be used, but short numbers will not be padded - with zeroes. Another argument can be given to indicate - if the hex numbers should be written with lower - or upper case. - - For example: - - value Template Output - 12345 {{ value|hex }} 3039 - 12345 {{ value|hex:2 }} 39 - 12345 {{ value|hex:8 }} 00003039 - 12345 {{ value|hex:-8 }} 3039 - 14911 {{ value|hex:-8:upper }} 3A3F - 14911 {{ value|hex:-8:lower }} 3a3f - - hexlist - - Display integer as hex number with : between pairs. An - argument can be used to indicate how many digits should - be used in the output. If the hex number is too long it - will be truncated at the front, if it is too short it will - be padded with zeros at the front. If the width is - a negative number then at most that number of digits - will be used, but short numbers will not be padded - with zeroes. Another argument can be given to indicate - if the hex numbers should be written with lower - or upper case. - - For example: - - value Template Output - 12345 {{ value|hexlist }} 30:39 - 12345 {{ value|hexlist:2 }} 39 - 12345 {{ value|hexlist:8 }} 00:00:30:39 - 12345 {{ value|hexlist:-8 }} 30:39 - 14911 {{ value|hexlist:-8:upper }} 3A:3F - 14911 {{ value|hexlist:-8:lower }} 3a:3f - - floatformat - - Used for type 'float' in tailf-xsd-types. We recommend - that the YANG built-in type 'decimal64' is used instead of - 'float'. - - When used without an argument, rounds a floating-point - number to one decimal place -- but only if there is a - decimal part to be displayed. - - For example: - - value Template Output - 34.23234 {{ value|floatformat }} 34.2 - 34.00000 {{ value|floatformat }} 34 - 34.26000 {{ value|floatformat }} 34.3 - - If used with a numeric integer argument, floatformat - rounds a number to that many decimal places. For example: - - value Template Output - 34.23234 {{ value|floatformat:3 }} 34.232 - 34.00000 {{ value|floatformat:3 }} 34.000 - 34.26000 {{ value|floatformat:3 }} 34.260 - - If the argument passed to floatformat is negative, it will - round a number to that many decimal places -- but only if - there's a decimal part to be displayed. For example: - - value Template Output - 34.23234 {{ value|floatformat:-3 }} 34.232 - 34.00000 {{ value|floatformat:-3 }} 34 - 34.26000 {{ value|floatformat:-3 }} 34.260 - - Using floatformat with no argument is equivalent to using - floatformat with an argument of -1. - - ljust:width - - Left-align the value given a width. - - rjust:width - - Right-align the value given a width. - - trunc:width - - Truncate value to a given width. - - lower - - Convert the value into lowercase. - - upper - - Convert the value into uppercase. - - show: - - Substitutes the result of invoking the default display - function for the parameter. The dictionary can be used - for introducing own variables that can be accessed in - the same manner as builtin variables. The user defined - variables overrides builtin variables. The dictionary - is specified as a string on the following form: - - (key=value)(:key=value)* - - For example, with the following expression: - - $(foo|show:myvar1=true:myvar2=Interface) - - the user defined variables can be accessed like this: - - $(.myvar1!=true?Address) $(.myvar2) - - A special case is the dict variable 'indent'. It - controls the indentation level of the displayed path. - The current indent level can be incremented and - decremented using =+ and =-. - - For example: - - $(foobar|show:indent=+2) - $(foobar|show:indent=-1) - $(foobar|show:indent=10) - - Another special case is he dict variable 'noalign'. - It may be used to suppress the default aligning that - may occur when displaying an element. - - For example: - - $(foobar|show:noalign) - - dict: - - Translates the value using the dictionary. Can for - example be used for displaying on/off instead of - true/false. The dictionary is specified as a string on - the following form: - - (key=value)(:key=value)* - - For example, with the following expression: - - $(foo|dict:true=on:false=off) - - if the leaf 'foo' has value 'true', it is displayed as 'on', and - if its value is 'false' it is displayed as 'off'. - - Nested invocations are allowed, ie it is possible to have expressions - like $((state|dict:yes=Yes:no=No)|rjust:14), or $(/foo{$(../bar)}) - - - For example: - - list interface { - key name; - leaf name { ... } - leaf status { ... } - container line { - leaf status { ... } - } - leaf mtu { ... } - leaf bw { ... } - leaf encapsulation { ... } - leaf loopback { ... } - tailf:cli-show-template - '$(name) is administratively $(status),' - + ' line protocol is $(line/status)\\n' - + 'MTU $(mtu) bytes, BW $(bw|humanreadable)bit, \\n' - + 'Encap $(encapsulation|upper), $(loopback?:loopback not set)\\n'; - }"; - } - -} diff --git a/sdk/cpp/core/tests/models/ydktest-sanity.yang b/sdk/cpp/core/tests/models/ydktest-sanity.yang deleted file mode 100644 index 5432693c0..000000000 --- a/sdk/cpp/core/tests/models/ydktest-sanity.yang +++ /dev/null @@ -1,673 +0,0 @@ -module ydktest-sanity { - - /*** NAMESPACE / PREFIX DEFINITION ***/ - - namespace "http://cisco.com/ns/yang/ydktest-sanity"; - - - prefix "ydkut"; - - /*** LINKAGE (IMPORTS / INCLUDES) ***/ - - //import ietf-inet-types { prefix "inet"; } - - import ydktest-types { prefix "types"; } - - include ydktest-sanity-submodule { - revision-date 2016-04-25; - } - - organization "Cisco Systems, Inc."; - - contact - "Cisco Systems, Inc. - Customer Service - - Postal: 170 West Tasman Drive - San Jose, CA 95134 - - Tel: +1 800 553-NETS - - E-mail: cs-yang@cisco.com"; - - description - "This module contains a collection of YANG definitions - for sanity package. - - This module contains definitions - for the following management objects: - - - Copyright (c) 2013-2014 by Cisco Systems, Inc. - All rights reserved."; - - revision "2015-11-17" { - description - "Initial revision."; - } - - identity base-identity; - - identity child-identity { - base base-identity; - } - - identity child-child-identity { - base child-identity; - } - - typedef Ydk-Enum-test { - type enumeration { - enum not-set { - value 0; - description "Not Set"; - } - enum none { - value 1; - description "None"; - } - enum local { - value 2; - description "Local"; - } - enum remote { - value 3; - description "Remote"; - } - } - description "YDK Enum test"; - } - - typedef Ydk-Enum-Int-test { - type union { - type enumeration { - enum any { - value 4096; - description "Any value"; - } - } - type uint32 { - range "1..4096"; - } - } - description "Int or any"; - } - - grouping leaf-ref-g { - description "testing for leaf-ref"; - container leaf-ref { - leaf ref-one-name { - type leafref { - path "/runner/one/name"; - } - } - leaf ref-two-sub1-number { - type leafref { - path "/runner/two/sub1/number"; - } - } - leaf ref-three-sub1-sub2-number { - type leafref { - path "/runner/three/sub1/sub2/number"; - } - } - leaf ref-inbtw { - type leafref { - path "/runner/inbtw-list/ldata[number = current()/../ref-two-sub1-number]" - + "/subc/subc-subl1[number = current()/../ref-three-sub1-sub2-number]/name"; - } - } - container one { - leaf name-of-one { - 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}]+)?"; - } - - } - container two { - leaf self-ref-one-name { - type leafref { - path "../../../ref-one-name"; - } - } - } - } - } - } - - grouping one-level { - description "testing for couple of leaves"; - container one { - description "config for one_level data"; - leaf number { - description "integer value type"; - type int32; - } - - leaf name { - description "this is string value"; - type string; - } - } - } - - - grouping two-level { - description "testing for couple of leaves"; - container two { - description "config for one_level data"; - leaf number { - description "integer value type"; - type int32; - } - - leaf name { - description "this is string value"; - type string; - } - - container sub1 { - description "subconfig1 for config container"; - leaf number { - description "integer value type"; - type int32; - } - } - } - } - - - grouping three-level { - description "testing for couple of leaves"; - container three { - description "config for one_level data"; - leaf number { - description "integer value type"; - type int32; - } - - leaf name { - description "this is string value"; - type string; - } - - container sub1 { - description "subconfig1 for config container"; - leaf number { - description "integer value type"; - type int32; - } - - container sub2 { - description "subconfig2 for config container"; - leaf number { - description "integer value type"; - type int32; - } - } - } - } - } - - - grouping all-ytypes-class { - description "testing for couple of leaves"; - container ytypes { - container none { - leaf test { - type string; - } - } - - description "config for one_level data types"; - leaf enabled { - type empty; - } - container built-in-t { - description "config for built-in types"; - - leaf number8 { - description " 8 bit integer value type"; - type int8; - } - - leaf number16 { - description "16 bit integer value type"; - type int16; - } - - leaf number32 { - description "integer value type"; - type int32; - } - - leaf number64 { - description "integer value type"; - type int64; - } - - leaf u_number8 { - description " 8 bit uinteger value type"; - type uint8; - } - - leaf u_number16 { - description "16 bit uinteger value type"; - type uint16; - } - - leaf u_number32 { - description "32 bit uinteger value type"; - type uint32; - } - - leaf u_number64 { - description "64 bit uinteger value type"; - type uint64; - } - leaf leaf-ref { - description "leaf-ref"; - type leafref { - path "/runner/ytypes/built-in-t/number8"; - } - } - - - leaf deci64 { - description "this is decimal value"; - type decimal64 { - fraction-digits 2; - range "1 .. 3.14 | 10 | 20..max"; - } - } - - - leaf name { - description "this is string value"; - type string; - } - - leaf emptee { - description "this is empty value"; - type empty; - } - - leaf bool-value { - description "this is boolean type value"; - type boolean; - } - - leaf embeded-enum { - description "enum embeded in leaf"; - type enumeration { - enum zero; - enum two; - enum seven { - value 7; - } - } - } - - leaf enum-value { - description "this is enum type value"; - type Ydk-Enum-test; - } - - leaf enum-int-value { - description "enum int type"; - type Ydk-Enum-Int-test; - } - - leaf identity-ref-value { - type identityref { - base base-identity; - } - } - - leaf bincoded { - description "this is binary value"; - type binary; - } - - leaf bits-value { - description "this is bits type value"; - type bits { - bit disable-nagle { - position 0; - } - - bit auto-sense-speed { - position 1; - } - } - default "auto-sense-speed"; - } - -//TODO - /*leaf-list bits-list { - description "this is bits type list"; - type bits { - bit val1 { - position 0; - } - - bit val2 { - position 1; - } - } - }*/ - - leaf younion { - type union { - type Ydk-Enum-test; - type uint32 { - range "0..63"; - } - } - description "union test value"; - } - //enhance identity, instance-identifier, decimal-64 - - //leaf-list types for all types - leaf-list llstring { - type string; - description "A list of string"; - } - - leaf status { - description - "Whether cable is connected or not"; - type enumeration { - enum "good"; - enum "not connected"; - } - } - - leaf-list bits-llist { - type bits { - bit disable-nagle { - position 0; - } - - bit auto-sense-speed { - position 1; - } - } - } - - leaf-list enum-llist { - type Ydk-Enum-test; - description "A leaf-list of enum"; - max-elements 3; - } - - leaf-list identity-llist { - type identityref { - base base-identity; - } - description "A leaf-list of identityref"; - } - - leaf-list llunion { - type union { - type int16; - type string; - } - description "A list of union"; - } - - leaf younion-recursive { - type types:Ydk-Recursive-Union-type; - description "Recursive union leaf"; - } - - leaf-list younion-list { - type union { - type types:Ydk-Simple-Union-type; - type types:Ydk-String-type; - type string; - //type types:Ydk-Identity-type; //TODO this does not work - } - description - "members of the younion"; - } - - - //leaf-refs refeerring to different target node - - - //Other convoluted test case - //submodule definitions - // imports from other modules - - // identityref - // instance-indentifier - // - } - - container derived-t { - description "config for one_level derived data types"; - - } - } - } - - grouping one-level-w-list { - container one-list { - description "config for one_level list data"; - list ldata { - description "one list data"; - key "number"; - max-elements 5; - leaf number { - description "integer value type"; - type int32; - } - - leaf name { - description "this is string value"; - type string; - } - } - - list identity-list { - description "one list data"; - key "id-ref"; - max-elements 5; - leaf id-ref { - description "leafref key"; - type leafref { - path "../config/id"; - } - } - - container config { - leaf id{ - description "base id id ref"; - type identityref { - base base-identity; - } - } - } - } - } - - } - - - grouping two-level-w-list { - container two-list { - description "config for one_level list data"; - list ldata { - description "one list data"; - key "number"; - leaf number { - description "integer value type"; - type int32; - } - - leaf name { - description "this is string value"; - type string; - } - - list subl1 { - description "one list data"; - key "number"; - leaf number { - description "integer value type"; - type int32; - } - - leaf name { - description "this is string value"; - type string; - } - } - } - } - } - - grouping three-level-w-list { - container three-list { - description "config for one_level list data"; - list ldata { - description "one list data"; - key "number"; - leaf number { - description "integer value type"; - type int32; - } - - leaf name { - description "this is string value"; - type string; - } - - list subl1 { - description "one list data"; - key "number"; - leaf number { - description "integer value type"; - type int32; - } - - leaf name { - description "this is string value"; - type string; - } - - list sub-subl1 { - description "one list data"; - key "number"; - leaf number { - description "integer value type"; - type int32; - } - - leaf name { - description "this is string value"; - type string; - } - } - } - } - } - } - - grouping three-level-w-list-at-two { - container inbtw-list { - description "config for one_level list data"; - list ldata { - description "one list data"; - key "number"; - leaf number { - description "integer value type"; - type int32; - } - - leaf name { - description "this is string value"; - type string; - } - - container subc { - description "one list subcontainer data"; - leaf number { - description "integer value type"; - type int32; - } - - leaf name { - description "this is string value"; - type string; - } - - list subc-subl1 { - description "one list data"; - key "number"; - leaf number { - description "integer value type"; - type int32; - } - - leaf name { - description "this is string value"; - type string; - } - } - } - } - } - } - - grouping not-supported { - container not-supported-1 { - container not-supported-1-2 { - leaf some-leaf { - type string; - } - } - leaf not-supported-leaf { - type string; - } - } - list not-supported-2 { - key "number"; - leaf number { - description "Integer key for not supported list"; - type int32; - } - } - } - - container runner { - - //container at 1,2,3 nested level - uses one-level; - uses two-level; - uses three-level; - - //all yang types coverage - uses all-ytypes-class; - - //list level cases - uses one-level-w-list; - uses two-level-w-list; - uses three-level-w-list; - - uses three-level-w-list-at-two; - - uses leaf-ref-g; - - uses not-supported; - - container runner-2 { - - presence "Runner-2 is presence controlled"; - leaf some-leaf { - type string; - } - } - } -} diff --git a/sdk/cpp/core/tests/models/ydktest-sanity@2015-11-17.yang b/sdk/cpp/core/tests/models/ydktest-sanity@2015-11-17.yang index 8b6846ba5..13d495fc9 100644 --- a/sdk/cpp/core/tests/models/ydktest-sanity@2015-11-17.yang +++ b/sdk/cpp/core/tests/models/ydktest-sanity@2015-11-17.yang @@ -241,7 +241,9 @@ module ydktest-sanity { leaf number32 { description "integer value type"; - type int32; + type int32 { + range "min..0 | 19 | 1000..max"; + } } leaf number64 { @@ -284,7 +286,6 @@ module ydktest-sanity { } } - leaf name { description "this is string value"; type string; diff --git a/sdk/cpp/core/tests/models/ydktest-types.yang b/sdk/cpp/core/tests/models/ydktest-types.yang deleted file mode 100644 index a0362fab7..000000000 --- a/sdk/cpp/core/tests/models/ydktest-types.yang +++ /dev/null @@ -1,69 +0,0 @@ -module ydktest-types { - - namespace "http://cisco.com/ns/yang/ydktest-types"; - - prefix "types"; - - organization "Cisco Systems, Inc."; - - contact - "Cisco Systems, Inc. - Customer Service - - Postal: 170 West Tasman Drive - San Jose, CA 95134 - - Tel: +1 800 553-NETS - - E-mail: cs-yang@cisco.com"; - - description - "This module contains a collection of YANG definitions - for sanity package. - - This module contains definitions - for the following management objects: - - - Copyright (c) 2013-2014 by Cisco Systems, Inc. - All rights reserved."; - - revision "2016-05-23" { - description - "Initial revision."; - } - - identity YDK_IDENTITY { - description - "YDK identity"; - } - - typedef Ydk-Simple-Union-type { - type union { - type uint32; - type string; - } - description "Simple int & string union type"; - } - - typedef Ydk-Recursive-Union-type { - type union { - type Ydk-Simple-Union-type; - type int8; - } - description "Union of union types"; - } - - typedef Ydk-String-type { - type string; - description "String type"; - } - - typedef Ydk-Identity-type { - type identityref { - base YDK_IDENTITY; - } - description "Identityref type"; - } - -} \ No newline at end of file diff --git a/yang/ydktest/ydktest-sanity@2015-11-17.yang b/yang/ydktest/ydktest-sanity@2015-11-17.yang index 901b0fe44..13d495fc9 100644 --- a/yang/ydktest/ydktest-sanity@2015-11-17.yang +++ b/yang/ydktest/ydktest-sanity@2015-11-17.yang @@ -241,7 +241,9 @@ module ydktest-sanity { leaf number32 { description "integer value type"; - type int32; + type int32 { + range "min..0 | 19 | 1000..max"; + } } leaf number64 { @@ -284,7 +286,6 @@ module ydktest-sanity { } } - leaf name { description "this is string value"; type string; @@ -345,7 +346,7 @@ module ydktest-sanity { } default "auto-sense-speed"; } - + //TODO /*leaf-list bits-list { description "this is bits type list"; @@ -357,7 +358,7 @@ module ydktest-sanity { bit val2 { position 1; } - } + } }*/ leaf younion { @@ -400,8 +401,8 @@ module ydktest-sanity { leaf-list enum-llist { type Ydk-Enum-test; - description "A leaf-list of enum"; max-elements 3; + description "A leaf-list of enum"; } leaf-list identity-llist { @@ -472,7 +473,7 @@ module ydktest-sanity { type string; } } - + list identity-list { description "one list data"; key "id-ref"; @@ -494,7 +495,7 @@ module ydktest-sanity { } } } - + } diff --git a/ydkgen/printer/meta_data_util.py b/ydkgen/printer/meta_data_util.py index 48eebb32d..12b54da7f 100644 --- a/ydkgen/printer/meta_data_util.py +++ b/ydkgen/printer/meta_data_util.py @@ -360,8 +360,13 @@ def get_meta_info_data(prop, property_type, type_stmt, language, one_class_per_m meta_info_data.doc_link += get_primitive_type_tag('bool', language) elif isinstance(type_spec, Decimal64TypeSpec): meta_info_data.ptype = 'Decimal64' + lower = str(type_spec.min.s) + if type_spec.max is not None: + upper = str(type_spec.max.s) + else: + upper = lower meta_info_data.prange.append( - ('%s' % str(type_spec.min.s), '%s' % str(type_spec.max.s))) + ('%s' % lower, '%s' % upper)) meta_info_data.doc_link += get_primitive_type_tag('Decimal64', language) elif isinstance(type_spec, EmptyTypeSpec): meta_info_data.ptype = 'Empty' @@ -374,7 +379,10 @@ def get_meta_info_data(prop, property_type, type_stmt, language, one_class_per_m meta_info_data.ptype = 'int' meta_info_data.doc_link += meta_info_data.ptype lower = str(type_spec.min) - upper = str(type_spec.max) + if type_spec.max is not None: + upper = str(type_spec.max) + else: + upper = lower meta_info_data.prange.append((lower, upper)) elif isinstance(type_spec, LengthTypeSpec): meta_info_data.ptype = 'str' @@ -475,9 +483,10 @@ def get_range_limits(range_type): if m_max == 'max': pmax = range_type.base.max + elif m_max is not None: + pmax = m_max else: - if m_max is not None: - pmax = m_max + pmax = pmin if types.yang_type_specs['uint64'].max == pmax: prange.append((str(pmin), str(pmax))) prange.append((str(pmin), str(pmax))) @@ -492,9 +501,10 @@ def get_range_limits(range_type): pmin = str(m_min) if m_max == 'max': pmax = range_type.base.max.s + elif m_max is not None: + pmax = str(m_max) else: - if m_max is not None: - pmax = str(m_max) + pmax = pmin prange.append(('%s' % str(pmin), '%s' % str(pmax))) return prange