From 4147132ec0fa3ceef55c1ea81ed6ef323b57ee4e Mon Sep 17 00:00:00 2001 From: caran Date: Fri, 17 May 2024 15:16:28 +0200 Subject: [PATCH] Yang 1.1 parses properly now. --- Compiler.Tests/Compiler.Tests.csproj | 4 + Compiler.Tests/ParsingTests.cs | 2 +- .../ietf-inet-types@2013-07-15.yang | 0 .../iana-crypt-hash@2014-08-06.yang | 120 - .../iana-dots-signal-channel@2020-05-28.yang | 176 -- .../YangSource/iana-if-type@2014-05-08.yang | 1523 ----------- .../YangSource/iana-pseudowire-types.yang | 1 - .../iana-routing-types@2017-12-04.yang | 471 ---- TestData/YangSource/iana-tunnel-type.yang | 1 - .../YangSource/ietf-access-control-list.yang | 1 - TestData/YangSource/ietf-alarms-x733.yang | 1 - .../YangSource/ietf-bfd-ip-mh@2021-10-21.yang | 144 - .../YangSource/ietf-bfd-ip-sh@2021-10-21.yang | 152 -- .../YangSource/ietf-bfd-lag@2021-10-21.yang | 189 -- .../YangSource/ietf-bfd-mpls@2021-10-21.yang | 188 -- .../YangSource/ietf-bfd-types@2021-10-21.yang | 661 ----- TestData/YangSource/ietf-bfd@2021-10-21.yang | 77 - .../ietf-complex-types@2011-03-15.yang | 91 - ...connectionless-oam-methods@2019-04-16.yang | 434 --- .../ietf-dots-signal-channel@2020-05-28.yang | 530 ---- .../ietf-ethertypes@2019-03-04.yang | 381 --- TestData/YangSource/ietf-foo@2016-03-20.yang | 12 - .../ietf-inet-types@2010-09-24.yang | 418 --- .../ietf-interfaces@2014-05-08.yang | 696 ----- TestData/YangSource/ietf-ip@2014-06-16.yang | 701 ----- .../ietf-ipfix-psamp@2012-09-05.yang | 2232 --------------- .../ietf-ipv4-unicast-routing@2016-11-04.yang | 249 -- ...ipv6-router-advertisements@2016-11-04.yang | 469 ---- .../ietf-ipv6-unicast-routing@2016-11-04.yang | 254 -- .../ietf-l3-unicast-topology-state.yang | 1 - .../YangSource/ietf-l3-unicast-topology.yang | 1 - .../YangSource/ietf-l3vpn-svc@2017-01-27.yang | 2401 ----------------- .../YangSource/ietf-mpls-ldp-extended.yang | 1 - .../ietf-netconf-acm@2012-02-22.yang | 449 --- .../ietf-netconf-acm@2018-02-14.yang | 464 ---- .../ietf-netconf-monitoring@2010-10-04.yang | 561 ---- ...ietf-netconf-notifications@2012-02-06.yang | 336 --- .../ietf-netconf-partial-lock@2009-10-19.yang | 77 - .../ietf-netconf-time@2016-01-26.yang | 378 --- ...ietf-netconf-with-defaults@2011-06-01.yang | 138 - .../YangSource/ietf-netconf@2011-06-01.yang | 927 ------- .../ietf-restconf-monitoring@2017-01-26.yang | 150 - .../ietf-routing-types@2017-12-04.yang | 771 ------ .../YangSource/ietf-routing@2016-11-04.yang | 576 ---- .../ietf-snmp-common@2014-12-10.yang | 184 -- .../ietf-snmp-community@2014-12-10.yang | 241 -- .../ietf-snmp-engine@2014-12-10.yang | 155 -- .../ietf-snmp-notification@2014-12-10.yang | 204 -- .../ietf-snmp-proxy@2014-12-10.yang | 155 -- .../YangSource/ietf-snmp-ssh@2014-12-10.yang | 145 - .../ietf-snmp-target@2014-12-10.yang | 207 -- .../YangSource/ietf-snmp-tls@2014-12-10.yang | 222 -- .../YangSource/ietf-snmp-tsm@2014-12-10.yang | 116 - .../YangSource/ietf-snmp-usm@2014-12-10.yang | 216 -- .../YangSource/ietf-snmp-vacm@2014-12-10.yang | 291 -- TestData/YangSource/ietf-snmp@2014-12-10.yang | 82 - .../YangSource/ietf-system@2014-08-06.yang | 800 ------ .../YangSource/ietf-template@2010-05-18.yang | 83 - .../ietf-x509-cert-to-name@2014-12-10.yang | 303 --- .../ietf-yang-library@2016-06-21.yang | 244 -- .../ietf-yang-metadata@2016-08-05.yang | 84 - .../ietf-yang-smiv2@2012-06-22.yang | 146 - .../ietf-yang-types@2010-09-24.yang | 392 --- .../ietf-yang-types@2013-07-15.yang | 474 ---- YangParser/Generator/YangGenerator.cs | 63 +- YangParser/Parser/YangStatementScanner.cs | 2 +- YangParser/SemanticModel/Action.cs | 2 +- YangParser/SemanticModel/AnyXml.cs | 35 +- YangParser/SemanticModel/Argument.cs | 2 +- YangParser/SemanticModel/Augment.cs | 3 +- YangParser/SemanticModel/Base.cs | 2 +- YangParser/SemanticModel/Bit.cs | 2 +- YangParser/SemanticModel/Case.cs | 5 +- YangParser/SemanticModel/Choice.cs | 9 +- .../SemanticModel/{StateData.cs => Config.cs} | 4 +- YangParser/SemanticModel/Contact.cs | 2 +- YangParser/SemanticModel/Container.cs | 10 +- YangParser/SemanticModel/DefaultValue.cs | 2 +- YangParser/SemanticModel/Deviate.cs | 4 +- YangParser/SemanticModel/Deviation.cs | 2 +- YangParser/SemanticModel/Enum.cs | 6 +- YangParser/SemanticModel/ErrorAppTag.cs | 2 +- YangParser/SemanticModel/ErrorMessage.cs | 2 +- YangParser/SemanticModel/Extension.cs | 2 +- YangParser/SemanticModel/Feature.cs | 2 +- YangParser/SemanticModel/FeatureFlag.cs | 2 +- YangParser/SemanticModel/FractionDigits.cs | 17 + YangParser/SemanticModel/Grouping.cs | 6 +- YangParser/SemanticModel/IStatement.cs | 12 +- YangParser/SemanticModel/Identity.cs | 12 +- YangParser/SemanticModel/Import.cs | 4 +- YangParser/SemanticModel/Include.cs | 2 +- YangParser/SemanticModel/Input.cs | 2 +- YangParser/SemanticModel/Key.cs | 2 +- YangParser/SemanticModel/Leaf.cs | 6 +- YangParser/SemanticModel/LeafList.cs | 7 +- YangParser/SemanticModel/Length.cs | 2 +- YangParser/SemanticModel/List.cs | 20 +- YangParser/SemanticModel/MaxElements.cs | 2 +- YangParser/SemanticModel/MinElements.cs | 2 +- YangParser/SemanticModel/Module.cs | 4 +- YangParser/SemanticModel/Must.cs | 2 +- YangParser/SemanticModel/Namespace.cs | 2 +- YangParser/SemanticModel/Notification.cs | 3 +- YangParser/SemanticModel/OrderedBy.cs | 2 +- YangParser/SemanticModel/Organization.cs | 2 +- YangParser/SemanticModel/Output.cs | 3 +- YangParser/SemanticModel/Path.cs | 2 +- YangParser/SemanticModel/Pattern.cs | 20 +- YangParser/SemanticModel/Position.cs | 2 +- YangParser/SemanticModel/Prefix.cs | 2 +- YangParser/SemanticModel/Range.cs | 2 +- YangParser/SemanticModel/Reference.cs | 4 +- YangParser/SemanticModel/Refine.cs | 4 +- YangParser/SemanticModel/RequireInstance.cs | 2 +- YangParser/SemanticModel/Revision.cs | 2 +- YangParser/SemanticModel/RevisionDate.cs | 2 +- YangParser/SemanticModel/Rpc.cs | 5 +- YangParser/SemanticModel/SemanticError.cs | 21 + YangParser/SemanticModel/Statement.cs | 24 +- YangParser/SemanticModel/StatementFactory.cs | 35 +- YangParser/SemanticModel/Status.cs | 2 +- YangParser/SemanticModel/Submodule.cs | 69 + YangParser/SemanticModel/Type.cs | 7 +- YangParser/SemanticModel/TypeDefinition.cs | 11 +- YangParser/SemanticModel/Unique.cs | 2 +- YangParser/SemanticModel/Units.cs | 2 +- YangParser/SemanticModel/Uses.cs | 5 +- YangParser/SemanticModel/Value.cs | 2 +- YangParser/SemanticModel/When.cs | 8 +- YangParser/SemanticModel/YangVersion.cs | 2 +- YangParser/SemanticModel/YinElement.cs | 2 +- 132 files changed, 407 insertions(+), 22264 deletions(-) rename {TestData/YangSource => Compiler.Tests}/ietf-inet-types@2013-07-15.yang (100%) delete mode 100644 TestData/YangSource/iana-crypt-hash@2014-08-06.yang delete mode 100644 TestData/YangSource/iana-dots-signal-channel@2020-05-28.yang delete mode 100644 TestData/YangSource/iana-if-type@2014-05-08.yang delete mode 100644 TestData/YangSource/iana-pseudowire-types.yang delete mode 100644 TestData/YangSource/iana-routing-types@2017-12-04.yang delete mode 100644 TestData/YangSource/iana-tunnel-type.yang delete mode 100644 TestData/YangSource/ietf-access-control-list.yang delete mode 100644 TestData/YangSource/ietf-alarms-x733.yang delete mode 100644 TestData/YangSource/ietf-bfd-ip-mh@2021-10-21.yang delete mode 100644 TestData/YangSource/ietf-bfd-ip-sh@2021-10-21.yang delete mode 100644 TestData/YangSource/ietf-bfd-lag@2021-10-21.yang delete mode 100644 TestData/YangSource/ietf-bfd-mpls@2021-10-21.yang delete mode 100644 TestData/YangSource/ietf-bfd-types@2021-10-21.yang delete mode 100644 TestData/YangSource/ietf-bfd@2021-10-21.yang delete mode 100644 TestData/YangSource/ietf-complex-types@2011-03-15.yang delete mode 100644 TestData/YangSource/ietf-connectionless-oam-methods@2019-04-16.yang delete mode 100644 TestData/YangSource/ietf-dots-signal-channel@2020-05-28.yang delete mode 100644 TestData/YangSource/ietf-ethertypes@2019-03-04.yang delete mode 100644 TestData/YangSource/ietf-foo@2016-03-20.yang delete mode 100644 TestData/YangSource/ietf-inet-types@2010-09-24.yang delete mode 100644 TestData/YangSource/ietf-interfaces@2014-05-08.yang delete mode 100644 TestData/YangSource/ietf-ip@2014-06-16.yang delete mode 100644 TestData/YangSource/ietf-ipfix-psamp@2012-09-05.yang delete mode 100644 TestData/YangSource/ietf-ipv4-unicast-routing@2016-11-04.yang delete mode 100644 TestData/YangSource/ietf-ipv6-router-advertisements@2016-11-04.yang delete mode 100644 TestData/YangSource/ietf-ipv6-unicast-routing@2016-11-04.yang delete mode 100644 TestData/YangSource/ietf-l3-unicast-topology-state.yang delete mode 100644 TestData/YangSource/ietf-l3-unicast-topology.yang delete mode 100644 TestData/YangSource/ietf-l3vpn-svc@2017-01-27.yang delete mode 100644 TestData/YangSource/ietf-mpls-ldp-extended.yang delete mode 100644 TestData/YangSource/ietf-netconf-acm@2012-02-22.yang delete mode 100644 TestData/YangSource/ietf-netconf-acm@2018-02-14.yang delete mode 100644 TestData/YangSource/ietf-netconf-monitoring@2010-10-04.yang delete mode 100644 TestData/YangSource/ietf-netconf-notifications@2012-02-06.yang delete mode 100644 TestData/YangSource/ietf-netconf-partial-lock@2009-10-19.yang delete mode 100644 TestData/YangSource/ietf-netconf-time@2016-01-26.yang delete mode 100644 TestData/YangSource/ietf-netconf-with-defaults@2011-06-01.yang delete mode 100644 TestData/YangSource/ietf-netconf@2011-06-01.yang delete mode 100644 TestData/YangSource/ietf-restconf-monitoring@2017-01-26.yang delete mode 100644 TestData/YangSource/ietf-routing-types@2017-12-04.yang delete mode 100644 TestData/YangSource/ietf-routing@2016-11-04.yang delete mode 100644 TestData/YangSource/ietf-snmp-common@2014-12-10.yang delete mode 100644 TestData/YangSource/ietf-snmp-community@2014-12-10.yang delete mode 100644 TestData/YangSource/ietf-snmp-engine@2014-12-10.yang delete mode 100644 TestData/YangSource/ietf-snmp-notification@2014-12-10.yang delete mode 100644 TestData/YangSource/ietf-snmp-proxy@2014-12-10.yang delete mode 100644 TestData/YangSource/ietf-snmp-ssh@2014-12-10.yang delete mode 100644 TestData/YangSource/ietf-snmp-target@2014-12-10.yang delete mode 100644 TestData/YangSource/ietf-snmp-tls@2014-12-10.yang delete mode 100644 TestData/YangSource/ietf-snmp-tsm@2014-12-10.yang delete mode 100644 TestData/YangSource/ietf-snmp-usm@2014-12-10.yang delete mode 100644 TestData/YangSource/ietf-snmp-vacm@2014-12-10.yang delete mode 100644 TestData/YangSource/ietf-snmp@2014-12-10.yang delete mode 100644 TestData/YangSource/ietf-system@2014-08-06.yang delete mode 100644 TestData/YangSource/ietf-template@2010-05-18.yang delete mode 100644 TestData/YangSource/ietf-x509-cert-to-name@2014-12-10.yang delete mode 100644 TestData/YangSource/ietf-yang-library@2016-06-21.yang delete mode 100644 TestData/YangSource/ietf-yang-metadata@2016-08-05.yang delete mode 100644 TestData/YangSource/ietf-yang-smiv2@2012-06-22.yang delete mode 100644 TestData/YangSource/ietf-yang-types@2010-09-24.yang delete mode 100644 TestData/YangSource/ietf-yang-types@2013-07-15.yang rename YangParser/SemanticModel/{StateData.cs => Config.cs} (75%) create mode 100644 YangParser/SemanticModel/FractionDigits.cs create mode 100644 YangParser/SemanticModel/SemanticError.cs create mode 100644 YangParser/SemanticModel/Submodule.cs diff --git a/Compiler.Tests/Compiler.Tests.csproj b/Compiler.Tests/Compiler.Tests.csproj index 3ffee01..be79105 100644 --- a/Compiler.Tests/Compiler.Tests.csproj +++ b/Compiler.Tests/Compiler.Tests.csproj @@ -28,4 +28,8 @@ + + + + diff --git a/Compiler.Tests/ParsingTests.cs b/Compiler.Tests/ParsingTests.cs index 2e93152..c6dae84 100644 --- a/Compiler.Tests/ParsingTests.cs +++ b/Compiler.Tests/ParsingTests.cs @@ -11,7 +11,7 @@ public class ParsingTests(ITestOutputHelper output) [Fact] public void IetfYangLibrary() { - var result = Parser.Parse("memory", File.ReadAllText("lin.yang")); + var result = Parser.Parse("memory", File.ReadAllText("ietf-inet-types@2013-07-15.yang")); var statements = StatementFactory.Create(result); Print(statements); } diff --git a/TestData/YangSource/ietf-inet-types@2013-07-15.yang b/Compiler.Tests/ietf-inet-types@2013-07-15.yang similarity index 100% rename from TestData/YangSource/ietf-inet-types@2013-07-15.yang rename to Compiler.Tests/ietf-inet-types@2013-07-15.yang diff --git a/TestData/YangSource/iana-crypt-hash@2014-08-06.yang b/TestData/YangSource/iana-crypt-hash@2014-08-06.yang deleted file mode 100644 index 44c4674..0000000 --- a/TestData/YangSource/iana-crypt-hash@2014-08-06.yang +++ /dev/null @@ -1,120 +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/TestData/YangSource/iana-dots-signal-channel@2020-05-28.yang b/TestData/YangSource/iana-dots-signal-channel@2020-05-28.yang deleted file mode 100644 index c05510a..0000000 --- a/TestData/YangSource/iana-dots-signal-channel@2020-05-28.yang +++ /dev/null @@ -1,176 +0,0 @@ -module iana-dots-signal-channel { - yang-version 1.1; - namespace "urn:ietf:params:xml:ns:yang:iana-dots-signal-channel"; - prefix iana-signal; - - organization - "IANA"; - contact - "Internet Assigned Numbers Authority - - Postal: ICANN - 12025 Waterfront Drive, Suite 300 - Los Angeles, CA 90094-2536 - United States of America - Tel: +1 310 301 5800 - "; - description - "This module contains a collection of YANG data types defined - by IANA and used for DOTS signal channel protocol. - - Copyright (c) 2020 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 8782; see - the RFC itself for full legal notices."; - - revision 2020-05-28 { - description - "Initial revision."; - reference - "RFC 8782: Distributed Denial-of-Service Open Threat - Signaling (DOTS) Signal Channel Specification"; - } - - typedef status { - type enumeration { - enum attack-mitigation-in-progress { - value 1; - description - "Attack mitigation setup is in progress (e.g., changing - the network path to reroute the inbound traffic - to DOTS mitigator)."; - } - enum attack-successfully-mitigated { - value 2; - description - "Attack is being successfully mitigated (e.g., traffic - is redirected to a DDoS mitigator and attack - traffic is dropped or blackholed)."; - } - enum attack-stopped { - value 3; - description - "Attack has stopped and the DOTS client can - withdraw the mitigation request."; - } - enum attack-exceeded-capability { - value 4; - description - "Attack has exceeded the mitigation provider - capability."; - } - enum dots-client-withdrawn-mitigation { - value 5; - description - "DOTS client has withdrawn the mitigation - request and the mitigation is active but - terminating."; - } - enum attack-mitigation-terminated { - value 6; - description - "Attack mitigation is now terminated."; - } - enum attack-mitigation-withdrawn { - value 7; - description - "Attack mitigation is withdrawn."; - } - enum attack-mitigation-signal-loss { - value 8; - description - "Attack mitigation will be triggered - for the mitigation request only when - the DOTS signal channel session is lost."; - } - } - description - "Enumeration for status reported by the DOTS server."; - } - - typedef conflict-status { - type enumeration { - enum request-inactive-other-active { - value 1; - description - "DOTS Server has detected conflicting mitigation - requests from different DOTS clients. - This mitigation request is currently inactive - until the conflicts are resolved. Another - mitigation request is active."; - } - enum request-active { - value 2; - description - "DOTS Server has detected conflicting mitigation - requests from different DOTS clients. - This mitigation request is currently active."; - } - enum all-requests-inactive { - value 3; - description - "DOTS Server has detected conflicting mitigation - requests from different DOTS clients. All - conflicting mitigation requests are inactive."; - } - } - description - "Enumeration for conflict status."; - } - - typedef conflict-cause { - type enumeration { - enum overlapping-targets { - value 1; - description - "Overlapping targets. conflict-scope provides - more details about the exact conflict."; - } - enum conflict-with-acceptlist { - value 2; - description - "Conflicts with an existing accept-list. - - This code is returned when the DDoS mitigation - detects that some of the source addresses/prefixes - listed in the accept-list ACLs are actually - attacking the target."; - } - enum cuid-collision { - value 3; - description - "Conflicts with the cuid used by another - DOTS client."; - } - } - description - "Enumeration for conflict causes."; - } - - typedef attack-status { - type enumeration { - enum under-attack { - value 1; - description - "The DOTS client determines that it is still under - attack."; - } - enum attack-successfully-mitigated { - value 2; - description - "The DOTS client determines that the attack is - successfully mitigated."; - } - } - description - "Enumeration for attack status codes."; - } -} diff --git a/TestData/YangSource/iana-if-type@2014-05-08.yang b/TestData/YangSource/iana-if-type@2014-05-08.yang deleted file mode 100644 index 81b2175..0000000 --- a/TestData/YangSource/iana-if-type@2014-05-08.yang +++ /dev/null @@ -1,1523 +0,0 @@ -module iana-if-type { - namespace "urn:ietf:params:xml:ns:yang:iana-if-type"; - prefix ianaift; - - import ietf-interfaces { - prefix if; - } - - organization "IANA"; - contact - " Internet Assigned Numbers Authority - - Postal: ICANN - 4676 Admiralty Way, Suite 330 - Marina del Rey, CA 90292 - - Tel: +1 310 823 9358 - "; - description - "This YANG module defines YANG identities for IANA-registered - interface types. - - This YANG module is maintained by IANA and reflects the - 'ifType definitions' registry. - - 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 7224; - see the RFC itself for full legal notices."; - reference - "IANA 'ifType definitions' registry. - "; - - revision 2014-05-08 { - description - "Initial revision."; - reference - "RFC 7224: IANA Interface Type YANG Module"; - } - - identity iana-interface-type { - base if:interface-type; - description - "This identity is used as a base for all interface types - defined in the 'ifType definitions' registry."; - } - - identity other { - base iana-interface-type; - } - identity regular1822 { - base iana-interface-type; - } - identity hdh1822 { - base iana-interface-type; - } - identity ddnX25 { - base iana-interface-type; - } - identity rfc877x25 { - base iana-interface-type; - reference - "RFC 1382 - SNMP MIB Extension for the X.25 Packet Layer"; - } - identity ethernetCsmacd { - base iana-interface-type; - description - "For all Ethernet-like interfaces, regardless of speed, - as per RFC 3635."; - reference - "RFC 3635 - Definitions of Managed Objects for the - Ethernet-like Interface Types"; - } - identity iso88023Csmacd { - base iana-interface-type; - status deprecated; - description - "Deprecated via RFC 3635. - Use ethernetCsmacd(6) instead."; - reference - "RFC 3635 - Definitions of Managed Objects for the - Ethernet-like Interface Types"; - } - identity iso88024TokenBus { - base iana-interface-type; - } - identity iso88025TokenRing { - base iana-interface-type; - } - identity iso88026Man { - base iana-interface-type; - } - identity starLan { - base iana-interface-type; - status deprecated; - description - "Deprecated via RFC 3635. - Use ethernetCsmacd(6) instead."; - reference - "RFC 3635 - Definitions of Managed Objects for the - Ethernet-like Interface Types"; - } - identity proteon10Mbit { - base iana-interface-type; - } - identity proteon80Mbit { - base iana-interface-type; - } - identity hyperchannel { - base iana-interface-type; - } - identity fddi { - base iana-interface-type; - reference - "RFC 1512 - FDDI Management Information Base"; - } - identity lapb { - base iana-interface-type; - reference - "RFC 1381 - SNMP MIB Extension for X.25 LAPB"; - } - identity sdlc { - base iana-interface-type; - } - identity ds1 { - base iana-interface-type; - description - "DS1-MIB."; - reference - "RFC 4805 - Definitions of Managed Objects for the - DS1, J1, E1, DS2, and E2 Interface Types"; - } - identity e1 { - base iana-interface-type; - status obsolete; - description - "Obsolete; see DS1-MIB."; - reference - "RFC 4805 - Definitions of Managed Objects for the - DS1, J1, E1, DS2, and E2 Interface Types"; - } - - identity basicISDN { - base iana-interface-type; - description - "No longer used. See also RFC 2127."; - } - identity primaryISDN { - base iana-interface-type; - description - "No longer used. See also RFC 2127."; - } - identity propPointToPointSerial { - base iana-interface-type; - description - "Proprietary serial."; - } - identity ppp { - base iana-interface-type; - } - identity softwareLoopback { - base iana-interface-type; - } - identity eon { - base iana-interface-type; - description - "CLNP over IP."; - } - identity ethernet3Mbit { - base iana-interface-type; - } - identity nsip { - base iana-interface-type; - description - "XNS over IP."; - } - identity slip { - base iana-interface-type; - description - "Generic SLIP."; - } - identity ultra { - base iana-interface-type; - description - "Ultra Technologies."; - } - identity ds3 { - base iana-interface-type; - description - "DS3-MIB."; - reference - "RFC 3896 - Definitions of Managed Objects for the - DS3/E3 Interface Type"; - } - identity sip { - base iana-interface-type; - description - "SMDS, coffee."; - reference - "RFC 1694 - Definitions of Managed Objects for SMDS - Interfaces using SMIv2"; - } - identity frameRelay { - base iana-interface-type; - description - "DTE only."; - reference - "RFC 2115 - Management Information Base for Frame Relay - DTEs Using SMIv2"; - } - identity rs232 { - base iana-interface-type; - reference - "RFC 1659 - Definitions of Managed Objects for RS-232-like - Hardware Devices using SMIv2"; - } - identity para { - base iana-interface-type; - description - "Parallel-port."; - reference - "RFC 1660 - Definitions of Managed Objects for - Parallel-printer-like Hardware Devices using - SMIv2"; - } - identity arcnet { - base iana-interface-type; - description - "ARCnet."; - } - identity arcnetPlus { - base iana-interface-type; - description - "ARCnet Plus."; - } - - identity atm { - base iana-interface-type; - description - "ATM cells."; - } - identity miox25 { - base iana-interface-type; - reference - "RFC 1461 - SNMP MIB extension for Multiprotocol - Interconnect over X.25"; - } - identity sonet { - base iana-interface-type; - description - "SONET or SDH."; - } - identity x25ple { - base iana-interface-type; - reference - "RFC 2127 - ISDN Management Information Base using SMIv2"; - } - identity iso88022llc { - base iana-interface-type; - } - identity localTalk { - base iana-interface-type; - } - identity smdsDxi { - base iana-interface-type; - } - identity frameRelayService { - base iana-interface-type; - description - "FRNETSERV-MIB."; - reference - "RFC 2954 - Definitions of Managed Objects for Frame - Relay Service"; - } - identity v35 { - base iana-interface-type; - } - identity hssi { - base iana-interface-type; - } - identity hippi { - base iana-interface-type; - } - - identity modem { - base iana-interface-type; - description - "Generic modem."; - } - identity aal5 { - base iana-interface-type; - description - "AAL5 over ATM."; - } - identity sonetPath { - base iana-interface-type; - } - identity sonetVT { - base iana-interface-type; - } - identity smdsIcip { - base iana-interface-type; - description - "SMDS InterCarrier Interface."; - } - identity propVirtual { - base iana-interface-type; - description - "Proprietary virtual/internal."; - reference - "RFC 2863 - The Interfaces Group MIB"; - } - identity propMultiplexor { - base iana-interface-type; - description - "Proprietary multiplexing."; - reference - "RFC 2863 - The Interfaces Group MIB"; - } - identity ieee80212 { - base iana-interface-type; - description - "100BaseVG."; - } - identity fibreChannel { - base iana-interface-type; - description - "Fibre Channel."; - } - - identity hippiInterface { - base iana-interface-type; - description - "HIPPI interfaces."; - } - identity frameRelayInterconnect { - base iana-interface-type; - status obsolete; - description - "Obsolete; use either - frameRelay(32) or frameRelayService(44)."; - } - identity aflane8023 { - base iana-interface-type; - description - "ATM Emulated LAN for 802.3."; - } - identity aflane8025 { - base iana-interface-type; - description - "ATM Emulated LAN for 802.5."; - } - identity cctEmul { - base iana-interface-type; - description - "ATM Emulated circuit."; - } - identity fastEther { - base iana-interface-type; - status deprecated; - description - "Obsoleted via RFC 3635. - ethernetCsmacd(6) should be used instead."; - reference - "RFC 3635 - Definitions of Managed Objects for the - Ethernet-like Interface Types"; - } - identity isdn { - base iana-interface-type; - description - "ISDN and X.25."; - reference - "RFC 1356 - Multiprotocol Interconnect on X.25 and ISDN - in the Packet Mode"; - } - - identity v11 { - base iana-interface-type; - description - "CCITT V.11/X.21."; - } - identity v36 { - base iana-interface-type; - description - "CCITT V.36."; - } - identity g703at64k { - base iana-interface-type; - description - "CCITT G703 at 64Kbps."; - } - identity g703at2mb { - base iana-interface-type; - status obsolete; - description - "Obsolete; see DS1-MIB."; - } - identity qllc { - base iana-interface-type; - description - "SNA QLLC."; - } - identity fastEtherFX { - base iana-interface-type; - status deprecated; - description - "Obsoleted via RFC 3635. - ethernetCsmacd(6) should be used instead."; - reference - "RFC 3635 - Definitions of Managed Objects for the - Ethernet-like Interface Types"; - } - identity channel { - base iana-interface-type; - description - "Channel."; - } - identity ieee80211 { - base iana-interface-type; - description - "Radio spread spectrum."; - } - identity ibm370parChan { - base iana-interface-type; - description - "IBM System 360/370 OEMI Channel."; - } - identity escon { - base iana-interface-type; - description - "IBM Enterprise Systems Connection."; - } - identity dlsw { - base iana-interface-type; - description - "Data Link Switching."; - } - identity isdns { - base iana-interface-type; - description - "ISDN S/T interface."; - } - identity isdnu { - base iana-interface-type; - description - "ISDN U interface."; - } - identity lapd { - base iana-interface-type; - description - "Link Access Protocol D."; - } - identity ipSwitch { - base iana-interface-type; - description - "IP Switching Objects."; - } - identity rsrb { - base iana-interface-type; - description - "Remote Source Route Bridging."; - } - identity atmLogical { - base iana-interface-type; - description - "ATM Logical Port."; - reference - "RFC 3606 - Definitions of Supplemental Managed Objects - for ATM Interface"; - } - identity ds0 { - base iana-interface-type; - description - "Digital Signal Level 0."; - reference - "RFC 2494 - Definitions of Managed Objects for the DS0 - and DS0 Bundle Interface Type"; - } - identity ds0Bundle { - base iana-interface-type; - description - "Group of ds0s on the same ds1."; - reference - "RFC 2494 - Definitions of Managed Objects for the DS0 - and DS0 Bundle Interface Type"; - } - identity bsc { - base iana-interface-type; - description - "Bisynchronous Protocol."; - } - identity async { - base iana-interface-type; - description - "Asynchronous Protocol."; - } - identity cnr { - base iana-interface-type; - description - "Combat Net Radio."; - } - identity iso88025Dtr { - base iana-interface-type; - description - "ISO 802.5r DTR."; - } - identity eplrs { - base iana-interface-type; - description - "Ext Pos Loc Report Sys."; - } - identity arap { - base iana-interface-type; - description - "Appletalk Remote Access Protocol."; - } - identity propCnls { - base iana-interface-type; - description - "Proprietary Connectionless Protocol."; - } - identity hostPad { - base iana-interface-type; - description - "CCITT-ITU X.29 PAD Protocol."; - } - identity termPad { - base iana-interface-type; - description - "CCITT-ITU X.3 PAD Facility."; - } - identity frameRelayMPI { - base iana-interface-type; - description - "Multiproto Interconnect over FR."; - } - identity x213 { - base iana-interface-type; - description - "CCITT-ITU X213."; - } - identity adsl { - base iana-interface-type; - description - "Asymmetric Digital Subscriber Loop."; - } - identity radsl { - base iana-interface-type; - description - "Rate-Adapt. Digital Subscriber Loop."; - } - identity sdsl { - base iana-interface-type; - description - "Symmetric Digital Subscriber Loop."; - } - identity vdsl { - base iana-interface-type; - description - "Very H-Speed Digital Subscrib. Loop."; - } - identity iso88025CRFPInt { - base iana-interface-type; - description - "ISO 802.5 CRFP."; - } - identity myrinet { - base iana-interface-type; - description - "Myricom Myrinet."; - } - identity voiceEM { - base iana-interface-type; - description - "Voice recEive and transMit."; - } - identity voiceFXO { - base iana-interface-type; - description - "Voice Foreign Exchange Office."; - } - identity voiceFXS { - base iana-interface-type; - description - "Voice Foreign Exchange Station."; - } - identity voiceEncap { - base iana-interface-type; - description - "Voice encapsulation."; - } - identity voiceOverIp { - base iana-interface-type; - description - "Voice over IP encapsulation."; - } - identity atmDxi { - base iana-interface-type; - description - "ATM DXI."; - } - identity atmFuni { - base iana-interface-type; - description - "ATM FUNI."; - } - identity atmIma { - base iana-interface-type; - description - "ATM IMA."; - } - identity pppMultilinkBundle { - base iana-interface-type; - description - "PPP Multilink Bundle."; - } - identity ipOverCdlc { - base iana-interface-type; - description - "IBM ipOverCdlc."; - } - identity ipOverClaw { - base iana-interface-type; - description - "IBM Common Link Access to Workstn."; - } - identity stackToStack { - base iana-interface-type; - description - "IBM stackToStack."; - } - identity virtualIpAddress { - base iana-interface-type; - description - "IBM VIPA."; - } - identity mpc { - base iana-interface-type; - description - "IBM multi-protocol channel support."; - } - identity ipOverAtm { - base iana-interface-type; - description - "IBM ipOverAtm."; - reference - "RFC 2320 - Definitions of Managed Objects for Classical IP - and ARP Over ATM Using SMIv2 (IPOA-MIB)"; - } - identity iso88025Fiber { - base iana-interface-type; - description - "ISO 802.5j Fiber Token Ring."; - } - identity tdlc { - base iana-interface-type; - description - "IBM twinaxial data link control."; - } - identity gigabitEthernet { - base iana-interface-type; - status deprecated; - - description - "Obsoleted via RFC 3635. - ethernetCsmacd(6) should be used instead."; - reference - "RFC 3635 - Definitions of Managed Objects for the - Ethernet-like Interface Types"; - } - identity hdlc { - base iana-interface-type; - description - "HDLC."; - } - identity lapf { - base iana-interface-type; - description - "LAP F."; - } - identity v37 { - base iana-interface-type; - description - "V.37."; - } - identity x25mlp { - base iana-interface-type; - description - "Multi-Link Protocol."; - } - identity x25huntGroup { - base iana-interface-type; - description - "X25 Hunt Group."; - } - identity transpHdlc { - base iana-interface-type; - description - "Transp HDLC."; - } - identity interleave { - base iana-interface-type; - description - "Interleave channel."; - } - identity fast { - base iana-interface-type; - description - "Fast channel."; - } - - identity ip { - base iana-interface-type; - description - "IP (for APPN HPR in IP networks)."; - } - identity docsCableMaclayer { - base iana-interface-type; - description - "CATV Mac Layer."; - } - identity docsCableDownstream { - base iana-interface-type; - description - "CATV Downstream interface."; - } - identity docsCableUpstream { - base iana-interface-type; - description - "CATV Upstream interface."; - } - identity a12MppSwitch { - base iana-interface-type; - description - "Avalon Parallel Processor."; - } - identity tunnel { - base iana-interface-type; - description - "Encapsulation interface."; - } - identity coffee { - base iana-interface-type; - description - "Coffee pot."; - reference - "RFC 2325 - Coffee MIB"; - } - identity ces { - base iana-interface-type; - description - "Circuit Emulation Service."; - } - identity atmSubInterface { - base iana-interface-type; - description - "ATM Sub Interface."; - } - - identity l2vlan { - base iana-interface-type; - description - "Layer 2 Virtual LAN using 802.1Q."; - } - identity l3ipvlan { - base iana-interface-type; - description - "Layer 3 Virtual LAN using IP."; - } - identity l3ipxvlan { - base iana-interface-type; - description - "Layer 3 Virtual LAN using IPX."; - } - identity digitalPowerline { - base iana-interface-type; - description - "IP over Power Lines."; - } - identity mediaMailOverIp { - base iana-interface-type; - description - "Multimedia Mail over IP."; - } - identity dtm { - base iana-interface-type; - description - "Dynamic synchronous Transfer Mode."; - } - identity dcn { - base iana-interface-type; - description - "Data Communications Network."; - } - identity ipForward { - base iana-interface-type; - description - "IP Forwarding Interface."; - } - identity msdsl { - base iana-interface-type; - description - "Multi-rate Symmetric DSL."; - } - identity ieee1394 { - base iana-interface-type; - - description - "IEEE1394 High Performance Serial Bus."; - } - identity if-gsn { - base iana-interface-type; - description - "HIPPI-6400."; - } - identity dvbRccMacLayer { - base iana-interface-type; - description - "DVB-RCC MAC Layer."; - } - identity dvbRccDownstream { - base iana-interface-type; - description - "DVB-RCC Downstream Channel."; - } - identity dvbRccUpstream { - base iana-interface-type; - description - "DVB-RCC Upstream Channel."; - } - identity atmVirtual { - base iana-interface-type; - description - "ATM Virtual Interface."; - } - identity mplsTunnel { - base iana-interface-type; - description - "MPLS Tunnel Virtual Interface."; - } - identity srp { - base iana-interface-type; - description - "Spatial Reuse Protocol."; - } - identity voiceOverAtm { - base iana-interface-type; - description - "Voice over ATM."; - } - identity voiceOverFrameRelay { - base iana-interface-type; - description - "Voice Over Frame Relay."; - } - identity idsl { - base iana-interface-type; - description - "Digital Subscriber Loop over ISDN."; - } - identity compositeLink { - base iana-interface-type; - description - "Avici Composite Link Interface."; - } - identity ss7SigLink { - base iana-interface-type; - description - "SS7 Signaling Link."; - } - identity propWirelessP2P { - base iana-interface-type; - description - "Prop. P2P wireless interface."; - } - identity frForward { - base iana-interface-type; - description - "Frame Forward Interface."; - } - identity rfc1483 { - base iana-interface-type; - description - "Multiprotocol over ATM AAL5."; - reference - "RFC 1483 - Multiprotocol Encapsulation over ATM - Adaptation Layer 5"; - } - identity usb { - base iana-interface-type; - description - "USB Interface."; - } - identity ieee8023adLag { - base iana-interface-type; - description - "IEEE 802.3ad Link Aggregate."; - } - identity bgppolicyaccounting { - base iana-interface-type; - description - "BGP Policy Accounting."; - } - identity frf16MfrBundle { - base iana-interface-type; - description - "FRF.16 Multilink Frame Relay."; - } - identity h323Gatekeeper { - base iana-interface-type; - description - "H323 Gatekeeper."; - } - identity h323Proxy { - base iana-interface-type; - description - "H323 Voice and Video Proxy."; - } - identity mpls { - base iana-interface-type; - description - "MPLS."; - } - identity mfSigLink { - base iana-interface-type; - description - "Multi-frequency signaling link."; - } - identity hdsl2 { - base iana-interface-type; - description - "High Bit-Rate DSL - 2nd generation."; - } - identity shdsl { - base iana-interface-type; - description - "Multirate HDSL2."; - } - identity ds1FDL { - base iana-interface-type; - description - "Facility Data Link (4Kbps) on a DS1."; - } - identity pos { - base iana-interface-type; - description - "Packet over SONET/SDH Interface."; - } - - identity dvbAsiIn { - base iana-interface-type; - description - "DVB-ASI Input."; - } - identity dvbAsiOut { - base iana-interface-type; - description - "DVB-ASI Output."; - } - identity plc { - base iana-interface-type; - description - "Power Line Communications."; - } - identity nfas { - base iana-interface-type; - description - "Non-Facility Associated Signaling."; - } - identity tr008 { - base iana-interface-type; - description - "TR008."; - } - identity gr303RDT { - base iana-interface-type; - description - "Remote Digital Terminal."; - } - identity gr303IDT { - base iana-interface-type; - description - "Integrated Digital Terminal."; - } - identity isup { - base iana-interface-type; - description - "ISUP."; - } - identity propDocsWirelessMaclayer { - base iana-interface-type; - description - "Cisco proprietary Maclayer."; - } - - identity propDocsWirelessDownstream { - base iana-interface-type; - description - "Cisco proprietary Downstream."; - } - identity propDocsWirelessUpstream { - base iana-interface-type; - description - "Cisco proprietary Upstream."; - } - identity hiperlan2 { - base iana-interface-type; - description - "HIPERLAN Type 2 Radio Interface."; - } - identity propBWAp2Mp { - base iana-interface-type; - description - "PropBroadbandWirelessAccesspt2Multipt (use of this value - for IEEE 802.16 WMAN interfaces as per IEEE Std 802.16f - is deprecated, and ieee80216WMAN(237) should be used - instead)."; - } - identity sonetOverheadChannel { - base iana-interface-type; - description - "SONET Overhead Channel."; - } - identity digitalWrapperOverheadChannel { - base iana-interface-type; - description - "Digital Wrapper."; - } - identity aal2 { - base iana-interface-type; - description - "ATM adaptation layer 2."; - } - identity radioMAC { - base iana-interface-type; - description - "MAC layer over radio links."; - } - identity atmRadio { - base iana-interface-type; - description - "ATM over radio links."; - } - identity imt { - base iana-interface-type; - description - "Inter-Machine Trunks."; - } - identity mvl { - base iana-interface-type; - description - "Multiple Virtual Lines DSL."; - } - identity reachDSL { - base iana-interface-type; - description - "Long Reach DSL."; - } - identity frDlciEndPt { - base iana-interface-type; - description - "Frame Relay DLCI End Point."; - } - identity atmVciEndPt { - base iana-interface-type; - description - "ATM VCI End Point."; - } - identity opticalChannel { - base iana-interface-type; - description - "Optical Channel."; - } - identity opticalTransport { - base iana-interface-type; - description - "Optical Transport."; - } - identity propAtm { - base iana-interface-type; - description - "Proprietary ATM."; - } - identity voiceOverCable { - base iana-interface-type; - description - "Voice Over Cable Interface."; - } - - identity infiniband { - base iana-interface-type; - description - "Infiniband."; - } - identity teLink { - base iana-interface-type; - description - "TE Link."; - } - identity q2931 { - base iana-interface-type; - description - "Q.2931."; - } - identity virtualTg { - base iana-interface-type; - description - "Virtual Trunk Group."; - } - identity sipTg { - base iana-interface-type; - description - "SIP Trunk Group."; - } - identity sipSig { - base iana-interface-type; - description - "SIP Signaling."; - } - identity docsCableUpstreamChannel { - base iana-interface-type; - description - "CATV Upstream Channel."; - } - identity econet { - base iana-interface-type; - description - "Acorn Econet."; - } - identity pon155 { - base iana-interface-type; - description - "FSAN 155Mb Symetrical PON interface."; - } - - identity pon622 { - base iana-interface-type; - description - "FSAN 622Mb Symetrical PON interface."; - } - identity bridge { - base iana-interface-type; - description - "Transparent bridge interface."; - } - identity linegroup { - base iana-interface-type; - description - "Interface common to multiple lines."; - } - identity voiceEMFGD { - base iana-interface-type; - description - "Voice E&M Feature Group D."; - } - identity voiceFGDEANA { - base iana-interface-type; - description - "Voice FGD Exchange Access North American."; - } - identity voiceDID { - base iana-interface-type; - description - "Voice Direct Inward Dialing."; - } - identity mpegTransport { - base iana-interface-type; - description - "MPEG transport interface."; - } - identity sixToFour { - base iana-interface-type; - status deprecated; - description - "6to4 interface (DEPRECATED)."; - reference - "RFC 4087 - IP Tunnel MIB"; - } - identity gtp { - base iana-interface-type; - description - "GTP (GPRS Tunneling Protocol)."; - } - identity pdnEtherLoop1 { - base iana-interface-type; - description - "Paradyne EtherLoop 1."; - } - identity pdnEtherLoop2 { - base iana-interface-type; - description - "Paradyne EtherLoop 2."; - } - identity opticalChannelGroup { - base iana-interface-type; - description - "Optical Channel Group."; - } - identity homepna { - base iana-interface-type; - description - "HomePNA ITU-T G.989."; - } - identity gfp { - base iana-interface-type; - description - "Generic Framing Procedure (GFP)."; - } - identity ciscoISLvlan { - base iana-interface-type; - description - "Layer 2 Virtual LAN using Cisco ISL."; - } - identity actelisMetaLOOP { - base iana-interface-type; - description - "Acteleis proprietary MetaLOOP High Speed Link."; - } - identity fcipLink { - base iana-interface-type; - description - "FCIP Link."; - } - identity rpr { - base iana-interface-type; - description - "Resilient Packet Ring Interface Type."; - } - - identity qam { - base iana-interface-type; - description - "RF Qam Interface."; - } - identity lmp { - base iana-interface-type; - description - "Link Management Protocol."; - reference - "RFC 4327 - Link Management Protocol (LMP) Management - Information Base (MIB)"; - } - identity cblVectaStar { - base iana-interface-type; - description - "Cambridge Broadband Networks Limited VectaStar."; - } - identity docsCableMCmtsDownstream { - base iana-interface-type; - description - "CATV Modular CMTS Downstream Interface."; - } - identity adsl2 { - base iana-interface-type; - status deprecated; - description - "Asymmetric Digital Subscriber Loop Version 2 - (DEPRECATED/OBSOLETED - please use adsl2plus(238) - instead)."; - reference - "RFC 4706 - Definitions of Managed Objects for Asymmetric - Digital Subscriber Line 2 (ADSL2)"; - } - identity macSecControlledIF { - base iana-interface-type; - description - "MACSecControlled."; - } - identity macSecUncontrolledIF { - base iana-interface-type; - description - "MACSecUncontrolled."; - } - identity aviciOpticalEther { - base iana-interface-type; - description - "Avici Optical Ethernet Aggregate."; - } - identity atmbond { - base iana-interface-type; - description - "atmbond."; - } - identity voiceFGDOS { - base iana-interface-type; - description - "Voice FGD Operator Services."; - } - identity mocaVersion1 { - base iana-interface-type; - description - "MultiMedia over Coax Alliance (MoCA) Interface - as documented in information provided privately to IANA."; - } - identity ieee80216WMAN { - base iana-interface-type; - description - "IEEE 802.16 WMAN interface."; - } - identity adsl2plus { - base iana-interface-type; - description - "Asymmetric Digital Subscriber Loop Version 2 - - Version 2 Plus and all variants."; - } - identity dvbRcsMacLayer { - base iana-interface-type; - description - "DVB-RCS MAC Layer."; - reference - "RFC 5728 - The SatLabs Group DVB-RCS MIB"; - } - identity dvbTdm { - base iana-interface-type; - description - "DVB Satellite TDM."; - reference - "RFC 5728 - The SatLabs Group DVB-RCS MIB"; - } - identity dvbRcsTdma { - base iana-interface-type; - description - "DVB-RCS TDMA."; - reference - "RFC 5728 - The SatLabs Group DVB-RCS MIB"; - } - identity x86Laps { - base iana-interface-type; - description - "LAPS based on ITU-T X.86/Y.1323."; - } - identity wwanPP { - base iana-interface-type; - description - "3GPP WWAN."; - } - identity wwanPP2 { - base iana-interface-type; - description - "3GPP2 WWAN."; - } - identity voiceEBS { - base iana-interface-type; - description - "Voice P-phone EBS physical interface."; - } - identity ifPwType { - base iana-interface-type; - description - "Pseudowire interface type."; - reference - "RFC 5601 - Pseudowire (PW) Management Information Base (MIB)"; - } - identity ilan { - base iana-interface-type; - description - "Internal LAN on a bridge per IEEE 802.1ap."; - } - identity pip { - base iana-interface-type; - description - "Provider Instance Port on a bridge per IEEE 802.1ah PBB."; - } - identity aluELP { - base iana-interface-type; - description - "Alcatel-Lucent Ethernet Link Protection."; - } - identity gpon { - base iana-interface-type; - description - "Gigabit-capable passive optical networks (G-PON) as per - ITU-T G.948."; - } - identity vdsl2 { - base iana-interface-type; - description - "Very high speed digital subscriber line Version 2 - (as per ITU-T Recommendation G.993.2)."; - reference - "RFC 5650 - Definitions of Managed Objects for Very High - Speed Digital Subscriber Line 2 (VDSL2)"; - } - identity capwapDot11Profile { - base iana-interface-type; - description - "WLAN Profile Interface."; - reference - "RFC 5834 - Control and Provisioning of Wireless Access - Points (CAPWAP) Protocol Binding MIB for - IEEE 802.11"; - } - identity capwapDot11Bss { - base iana-interface-type; - description - "WLAN BSS Interface."; - reference - "RFC 5834 - Control and Provisioning of Wireless Access - Points (CAPWAP) Protocol Binding MIB for - IEEE 802.11"; - } - identity capwapWtpVirtualRadio { - base iana-interface-type; - description - "WTP Virtual Radio Interface."; - reference - "RFC 5833 - Control and Provisioning of Wireless Access - Points (CAPWAP) Protocol Base MIB"; - } - identity bits { - base iana-interface-type; - description - "bitsport."; - } - identity docsCableUpstreamRfPort { - base iana-interface-type; - description - "DOCSIS CATV Upstream RF Port."; - } - - identity cableDownstreamRfPort { - base iana-interface-type; - description - "CATV downstream RF Port."; - } - identity vmwareVirtualNic { - base iana-interface-type; - description - "VMware Virtual Network Interface."; - } - identity ieee802154 { - base iana-interface-type; - description - "IEEE 802.15.4 WPAN interface."; - reference - "IEEE 802.15.4-2006"; - } - identity otnOdu { - base iana-interface-type; - description - "OTN Optical Data Unit."; - } - identity otnOtu { - base iana-interface-type; - description - "OTN Optical channel Transport Unit."; - } - identity ifVfiType { - base iana-interface-type; - description - "VPLS Forwarding Instance Interface Type."; - } - identity g9981 { - base iana-interface-type; - description - "G.998.1 bonded interface."; - } - identity g9982 { - base iana-interface-type; - description - "G.998.2 bonded interface."; - } - identity g9983 { - base iana-interface-type; - description - "G.998.3 bonded interface."; - } - - identity aluEpon { - base iana-interface-type; - description - "Ethernet Passive Optical Networks (E-PON)."; - } - identity aluEponOnu { - base iana-interface-type; - description - "EPON Optical Network Unit."; - } - identity aluEponPhysicalUni { - base iana-interface-type; - description - "EPON physical User to Network interface."; - } - identity aluEponLogicalLink { - base iana-interface-type; - description - "The emulation of a point-to-point link over the EPON - layer."; - } - identity aluGponOnu { - base iana-interface-type; - description - "GPON Optical Network Unit."; - reference - "ITU-T G.984.2"; - } - identity aluGponPhysicalUni { - base iana-interface-type; - description - "GPON physical User to Network interface."; - reference - "ITU-T G.984.2"; - } - identity vmwareNicTeam { - base iana-interface-type; - description - "VMware NIC Team."; - } -} diff --git a/TestData/YangSource/iana-pseudowire-types.yang b/TestData/YangSource/iana-pseudowire-types.yang deleted file mode 100644 index 6a87cf4..0000000 --- a/TestData/YangSource/iana-pseudowire-types.yang +++ /dev/null @@ -1 +0,0 @@ -iana-pseudowire-types@2022-09-20.yang \ No newline at end of file diff --git a/TestData/YangSource/iana-routing-types@2017-12-04.yang b/TestData/YangSource/iana-routing-types@2017-12-04.yang deleted file mode 100644 index a538179..0000000 --- a/TestData/YangSource/iana-routing-types@2017-12-04.yang +++ /dev/null @@ -1,471 +0,0 @@ -module iana-routing-types { - namespace "urn:ietf:params:xml:ns:yang:iana-routing-types"; - prefix iana-rt-types; - - organization - "IANA"; - contact - "Internet Assigned Numbers Authority - - Postal: ICANN - 12025 Waterfront Drive, Suite 300 - Los Angeles, CA 90094-2536 - United States of America - Tel: +1 310 301 5800 - "; - - description - "This module contains a collection of YANG data types - considered defined by IANA and used for routing - protocols. - - Copyright (c) 2017 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 - (https://trustee.ietf.org/license-info). - - This version of this YANG module is part of RFC 8294; see - the RFC itself for full legal notices."; - - revision 2017-12-04 { - description "Initial revision."; - reference - "RFC 8294: Common YANG Data Types for the Routing Area. - Section 4."; - } - - /*** Collection of IANA types related to routing ***/ - /*** IANA Address Family enumeration ***/ - - typedef address-family { - type enumeration { - enum ipv4 { - value 1; - description - "IPv4 Address Family."; - } - - enum ipv6 { - value 2; - description - "IPv6 Address Family."; - } - - enum nsap { - value 3; - description - "OSI Network Service Access Point (NSAP) Address Family."; - } - - enum hdlc { - value 4; - description - "High-Level Data Link Control (HDLC) Address Family."; - } - - enum bbn1822 { - value 5; - description - "Bolt, Beranek, and Newman Report 1822 (BBN 1822) - Address Family."; - } - - enum ieee802 { - value 6; - description - "IEEE 802 Committee Address Family - (aka Media Access Control (MAC) address)."; - } - - enum e163 { - value 7; - description - "ITU-T E.163 Address Family."; - } - enum e164 { - value 8; - description - "ITU-T E.164 (Switched Multimegabit Data Service (SMDS), - Frame Relay, ATM) Address Family."; - } - - enum f69 { - value 9; - description - "ITU-T F.69 (Telex) Address Family."; - } - - enum x121 { - value 10; - description - "ITU-T X.121 (X.25, Frame Relay) Address Family."; - } - - enum ipx { - value 11; - description - "Novell Internetwork Packet Exchange (IPX) - Address Family."; - } - - enum appletalk { - value 12; - description - "Apple AppleTalk Address Family."; - } - - enum decnet-iv { - value 13; - description - "Digital Equipment DECnet Phase IV Address Family."; - } - - enum vines { - value 14; - description - "Banyan Vines Address Family."; - } - - enum e164-nsap { - value 15; - description - "ITU-T E.164 with NSAP sub-address Address Family."; - } - - enum dns { - value 16; - description - "Domain Name System (DNS) Address Family."; - } - - enum distinguished-name { - value 17; - description - "Distinguished Name Address Family."; - } - - enum as-num { - value 18; - description - "Autonomous System (AS) Number Address Family."; - } - - enum xtp-v4 { - value 19; - description - "Xpress Transport Protocol (XTP) over IPv4 - Address Family."; - } - - enum xtp-v6 { - value 20; - description - "XTP over IPv6 Address Family."; - } - - enum xtp-native { - value 21; - description - "XTP native mode Address Family."; - } - - enum fc-port { - value 22; - description - "Fibre Channel (FC) World-Wide Port Name Address Family."; - } - enum fc-node { - value 23; - description - "FC World-Wide Node Name Address Family."; - } - - enum gwid { - value 24; - description - "ATM Gateway Identifier (GWID) Number Address Family."; - } - - enum l2vpn { - value 25; - description - "Layer 2 VPN (L2VPN) Address Family."; - } - - enum mpls-tp-section-eid { - value 26; - description - "MPLS Transport Profile (MPLS-TP) Section Endpoint - Identifier Address Family."; - } - - enum mpls-tp-lsp-eid { - value 27; - description - "MPLS-TP Label Switched Path (LSP) Endpoint Identifier - Address Family."; - } - - enum mpls-tp-pwe-eid { - value 28; - description - "MPLS-TP Pseudowire Endpoint Identifier Address Family."; - } - - enum mt-v4 { - value 29; - description - "Multi-Topology IPv4 Address Family."; - } - - enum mt-v6 { - value 30; - description - "Multi-Topology IPv6 Address Family."; - } - - enum eigrp-common-sf { - value 16384; - description - "Enhanced Interior Gateway Routing Protocol (EIGRP) - Common Service Family Address Family."; - } - - enum eigrp-v4-sf { - value 16385; - description - "EIGRP IPv4 Service Family Address Family."; - } - - enum eigrp-v6-sf { - value 16386; - description - "EIGRP IPv6 Service Family Address Family."; - } - - enum lcaf { - value 16387; - description - "Locator/ID Separation Protocol (LISP) - Canonical Address Format (LCAF) Address Family."; - } - - enum bgp-ls { - value 16388; - description - "Border Gateway Protocol - Link State (BGP-LS) - Address Family."; - } - - enum mac-48 { - value 16389; - description - "IEEE 48-bit MAC Address Family."; - } - - enum mac-64 { - value 16390; - description - "IEEE 64-bit MAC Address Family."; - } - - enum trill-oui { - value 16391; - description - "Transparent Interconnection of Lots of Links (TRILL) - IEEE Organizationally Unique Identifier (OUI) - Address Family."; - } - - enum trill-mac-24 { - value 16392; - description - "TRILL final 3 octets of 48-bit MAC Address Family."; - } - - enum trill-mac-40 { - value 16393; - description - "TRILL final 5 octets of 64-bit MAC Address Family."; - } - - enum ipv6-64 { - value 16394; - description - "First 8 octets (64 bits) of IPv6 address - Address Family."; - } - - enum trill-rbridge-port-id { - value 16395; - description - "TRILL Routing Bridge (RBridge) Port ID Address Family."; - } - - enum trill-nickname { - value 16396; - description - "TRILL Nickname Address Family."; - } - } - - description - "Enumeration containing all the IANA-defined - Address Families."; - - } - - /*** Subsequent Address Family Identifiers (SAFIs) ***/ - /*** for multiprotocol BGP enumeration ***/ - - typedef bgp-safi { - type enumeration { - enum unicast-safi { - value 1; - description - "Unicast SAFI."; - } - - enum multicast-safi { - value 2; - description - "Multicast SAFI."; - } - - enum labeled-unicast-safi { - value 4; - description - "Labeled Unicast SAFI."; - } - - enum multicast-vpn-safi { - value 5; - description - "Multicast VPN SAFI."; - } - - enum pseudowire-safi { - value 6; - description - "Multi-segment Pseudowire VPN SAFI."; - } - - enum tunnel-encap-safi { - value 7; - description - "Tunnel Encap SAFI."; - } - - enum mcast-vpls-safi { - value 8; - description - "Multicast Virtual Private LAN Service (VPLS) SAFI."; - } - - enum tunnel-safi { - value 64; - description - "Tunnel SAFI."; - } - - enum vpls-safi { - value 65; - description - "VPLS SAFI."; - } - - enum mdt-safi { - value 66; - description - "Multicast Distribution Tree (MDT) SAFI."; - } - - enum v4-over-v6-safi { - value 67; - description - "IPv4 over IPv6 SAFI."; - } - - enum v6-over-v4-safi { - value 68; - description - "IPv6 over IPv4 SAFI."; - } - - enum l1-vpn-auto-discovery-safi { - value 69; - description - "Layer 1 VPN Auto-Discovery SAFI."; - } - - enum evpn-safi { - value 70; - description - "Ethernet VPN (EVPN) SAFI."; - } - - enum bgp-ls-safi { - value 71; - description - "BGP-LS SAFI."; - } - - enum bgp-ls-vpn-safi { - value 72; - description - "BGP-LS VPN SAFI."; - } - - enum sr-te-safi { - value 73; - description - "Segment Routing - Traffic Engineering (SR-TE) SAFI."; - } - - enum labeled-vpn-safi { - value 128; - description - "MPLS Labeled VPN SAFI."; - } - - enum multicast-mpls-vpn-safi { - value 129; - description - "Multicast for BGP/MPLS IP VPN SAFI."; - } - - enum route-target-safi { - value 132; - description - "Route Target SAFI."; - } - - enum ipv4-flow-spec-safi { - value 133; - description - "IPv4 Flow Specification SAFI."; - } - - enum vpnv4-flow-spec-safi { - value 134; - description - "IPv4 VPN Flow Specification SAFI."; - } - - enum vpn-auto-discovery-safi { - value 140; - description - "VPN Auto-Discovery SAFI."; - } - } - description - "Enumeration for BGP SAFI."; - reference - "RFC 4760: Multiprotocol Extensions for BGP-4."; - } -} diff --git a/TestData/YangSource/iana-tunnel-type.yang b/TestData/YangSource/iana-tunnel-type.yang deleted file mode 100644 index a38556e..0000000 --- a/TestData/YangSource/iana-tunnel-type.yang +++ /dev/null @@ -1 +0,0 @@ -iana-tunnel-type@2019-11-16.yang \ No newline at end of file diff --git a/TestData/YangSource/ietf-access-control-list.yang b/TestData/YangSource/ietf-access-control-list.yang deleted file mode 100644 index e7e335d..0000000 --- a/TestData/YangSource/ietf-access-control-list.yang +++ /dev/null @@ -1 +0,0 @@ -ietf-access-control-list@2019-03-04.yang \ No newline at end of file diff --git a/TestData/YangSource/ietf-alarms-x733.yang b/TestData/YangSource/ietf-alarms-x733.yang deleted file mode 100644 index 47a3144..0000000 --- a/TestData/YangSource/ietf-alarms-x733.yang +++ /dev/null @@ -1 +0,0 @@ -ietf-alarms-x733@2019-09-11.yang \ No newline at end of file diff --git a/TestData/YangSource/ietf-bfd-ip-mh@2021-10-21.yang b/TestData/YangSource/ietf-bfd-ip-mh@2021-10-21.yang deleted file mode 100644 index 5b358e4..0000000 --- a/TestData/YangSource/ietf-bfd-ip-mh@2021-10-21.yang +++ /dev/null @@ -1,144 +0,0 @@ -module ietf-bfd-ip-mh { - yang-version 1.1; - namespace "urn:ietf:params:xml:ns:yang:ietf-bfd-ip-mh"; - prefix bfd-ip-mh; - - import ietf-bfd-types { - prefix bfd-types; - reference - "RFC 9127: YANG Data Model for Bidirectional Forwarding - Detection (BFD)"; - } - import ietf-bfd { - prefix bfd; - reference - "RFC 9127: YANG Data Model for Bidirectional Forwarding - Detection (BFD)"; - } - import ietf-inet-types { - prefix inet; - reference - "RFC 6991: Common YANG Data Types"; - } - import ietf-routing { - prefix rt; - reference - "RFC 8349: A YANG Data Model for Routing Management - (NMDA Version)"; - } - - organization - "IETF BFD Working Group"; - contact - "WG Web: - WG List: - - Editor: Reshad Rahman - - - Editor: Lianshu Zheng - - - Editor: Mahesh Jethanandani - "; - description - "This module contains the YANG definition for BFD IP multihop - as per RFC 5883. - - Copyright (c) 2021 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 - (https://trustee.ietf.org/license-info). - - This version of this YANG module is part of RFC 9127; see the - RFC itself for full legal notices."; - reference - "RFC 5883: Bidirectional Forwarding Detection (BFD) for - Multihop Paths - RFC 9127: YANG Data Model for Bidirectional Forwarding - Detection (BFD)"; - - revision 2021-10-21 { - description - "Initial revision."; - reference - "RFC 9127: YANG Data Model for Bidirectional Forwarding - Detection (BFD)"; - } - - /* - * Augments - */ - - augment "/rt:routing/rt:control-plane-protocols/" - + "rt:control-plane-protocol/bfd:bfd" { - description - "BFD augmentation for IP multihop."; - container ip-mh { - description - "BFD IP multihop top-level container."; - uses bfd-types:session-statistics-summary; - container session-groups { - description - "BFD IP multihop session groups."; - list session-group { - key "source-addr dest-addr"; - description - "Group of BFD IP multihop sessions (for ECMP). A - group of sessions is between one source and one - destination. Each session has a different field - in the UDP/IP header for ECMP."; - leaf source-addr { - type inet:ip-address; - description - "Local IP address."; - } - leaf dest-addr { - type inet:ip-address; - description - "IP address of the peer."; - } - uses bfd-types:common-cfg-parms; - leaf tx-ttl { - type bfd-types:hops; - default "255"; - description - "Hop count of outgoing BFD control packets."; - } - leaf rx-ttl { - type bfd-types:hops; - mandatory true; - description - "Minimum allowed hop count value for incoming BFD - control packets. Control packets whose hop count is - lower than this value are dropped."; - } - list sessions { - config false; - description - "The multiple BFD sessions between a source and a - destination."; - uses bfd-types:all-session; - } - } - } - } - } - - /* - * Notifications - */ - - notification multihop-notification { - description - "Notification for BFD multihop session state change. An - implementation may rate-limit notifications, e.g., when a - session is continuously changing state."; - uses bfd-types:notification-parms; - } -} diff --git a/TestData/YangSource/ietf-bfd-ip-sh@2021-10-21.yang b/TestData/YangSource/ietf-bfd-ip-sh@2021-10-21.yang deleted file mode 100644 index c592a4c..0000000 --- a/TestData/YangSource/ietf-bfd-ip-sh@2021-10-21.yang +++ /dev/null @@ -1,152 +0,0 @@ -module ietf-bfd-ip-sh { - yang-version 1.1; - namespace "urn:ietf:params:xml:ns:yang:ietf-bfd-ip-sh"; - prefix bfd-ip-sh; - - import ietf-bfd-types { - prefix bfd-types; - reference - "RFC 9127: YANG Data Model for Bidirectional Forwarding - Detection (BFD)"; - } - import ietf-bfd { - prefix bfd; - reference - "RFC 9127: YANG Data Model for Bidirectional Forwarding - Detection (BFD)"; - } - import ietf-interfaces { - prefix if; - reference - "RFC 8343: A YANG Data Model for Interface Management"; - } - import ietf-inet-types { - prefix inet; - reference - "RFC 6991: Common YANG Data Types"; - } - import ietf-routing { - prefix rt; - reference - "RFC 8349: A YANG Data Model for Routing Management - (NMDA Version)"; - } - - organization - "IETF BFD Working Group"; - contact - "WG Web: - WG List: - - Editor: Reshad Rahman - - - Editor: Lianshu Zheng - - - Editor: Mahesh Jethanandani - "; - description - "This module contains the YANG definition for BFD IP single-hop - as per RFC 5881. - - Copyright (c) 2021 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 - (https://trustee.ietf.org/license-info). - - This version of this YANG module is part of RFC 9127; see the - RFC itself for full legal notices."; - reference - "RFC 5881: Bidirectional Forwarding Detection (BFD) - for IPv4 and IPv6 (Single Hop) - RFC 9127: YANG Data Model for Bidirectional Forwarding - Detection (BFD)"; - - revision 2021-10-21 { - description - "Initial revision."; - reference - "RFC 9127: YANG Data Model for Bidirectional Forwarding - Detection (BFD)"; - } - - /* - * Augments - */ - - augment "/rt:routing/rt:control-plane-protocols/" - + "rt:control-plane-protocol/bfd:bfd" { - description - "BFD augmentation for IP single-hop."; - container ip-sh { - description - "BFD IP single-hop top-level container."; - uses bfd-types:session-statistics-summary; - container sessions { - description - "BFD IP single-hop sessions."; - list session { - key "interface dest-addr"; - description - "List of IP single-hop sessions."; - leaf interface { - type if:interface-ref; - description - "Interface on which the BFD session is running."; - } - leaf dest-addr { - type inet:ip-address; - description - "IP address of the peer."; - } - leaf source-addr { - type inet:ip-address; - description - "Local IP address."; - } - uses bfd-types:common-cfg-parms; - uses bfd-types:all-session; - } - } - list interfaces { - key "interface"; - description - "List of interfaces."; - leaf interface { - type if:interface-ref; - description - "BFD information for this interface."; - } - uses bfd-types:auth-parms; - } - } - } - - /* - * Notifications - */ - - notification singlehop-notification { - description - "Notification for BFD single-hop session state change. An - implementation may rate-limit notifications, e.g., when a - session is continuously changing state."; - uses bfd-types:notification-parms; - leaf interface { - type if:interface-ref; - description - "Interface to which this BFD session belongs."; - } - leaf echo-enabled { - type boolean; - description - "Indicates whether Echo was enabled for BFD."; - } - } -} diff --git a/TestData/YangSource/ietf-bfd-lag@2021-10-21.yang b/TestData/YangSource/ietf-bfd-lag@2021-10-21.yang deleted file mode 100644 index ee821ab..0000000 --- a/TestData/YangSource/ietf-bfd-lag@2021-10-21.yang +++ /dev/null @@ -1,189 +0,0 @@ -module ietf-bfd-lag { - yang-version 1.1; - namespace "urn:ietf:params:xml:ns:yang:ietf-bfd-lag"; - prefix bfd-lag; - - import ietf-bfd-types { - prefix bfd-types; - reference - "RFC 9127: YANG Data Model for Bidirectional Forwarding - Detection (BFD)"; - } - import ietf-bfd { - prefix bfd; - reference - "RFC 9127: YANG Data Model for Bidirectional Forwarding - Detection (BFD)"; - } - import ietf-interfaces { - prefix if; - reference - "RFC 8343: A YANG Data Model for Interface Management"; - } - import ietf-inet-types { - prefix inet; - reference - "RFC 6991: Common YANG Data Types"; - } - import ietf-routing { - prefix rt; - reference - "RFC 8349: A YANG Data Model for Routing Management - (NMDA Version)"; - } - - organization - "IETF BFD Working Group"; - contact - "WG Web: - WG List: - - Editor: Reshad Rahman - - - Editor: Lianshu Zheng - - - Editor: Mahesh Jethanandani - "; - description - "This module contains the YANG definition for BFD-over-LAG - interfaces as per RFC 7130. - - Copyright (c) 2021 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 - (https://trustee.ietf.org/license-info). - - This version of this YANG module is part of RFC 9127; see the - RFC itself for full legal notices."; - reference - "RFC 7130: Bidirectional Forwarding Detection (BFD) on - Link Aggregation Group (LAG) Interfaces - RFC 9127: YANG Data Model for Bidirectional Forwarding - Detection (BFD)"; - - revision 2021-10-21 { - description - "Initial revision."; - reference - "RFC 9127: YANG Data Model for Bidirectional Forwarding - Detection (BFD)"; - } - - /* - * Augments - */ - - augment "/rt:routing/rt:control-plane-protocols/" - + "rt:control-plane-protocol/bfd:bfd" { - description - "BFD augmentation for a LAG."; - container lag { - description - "BFD-over-LAG top-level container."; - container micro-bfd-ipv4-session-statistics { - description - "Micro-BFD IPv4 session counters."; - uses bfd-types:session-statistics-summary; - } - container micro-bfd-ipv6-session-statistics { - description - "Micro-BFD IPv6 session counters."; - uses bfd-types:session-statistics-summary; - } - container sessions { - description - "BFD-over-LAG sessions."; - list session { - key "lag-name"; - description - "List of BFD-over-LAG sessions."; - leaf lag-name { - type if:interface-ref; - description - "Name of the LAG."; - } - leaf ipv4-dest-addr { - type inet:ipv4-address; - description - "IPv4 address of the peer, for IPv4 micro-BFD."; - } - leaf ipv6-dest-addr { - type inet:ipv6-address; - description - "IPv6 address of the peer, for IPv6 micro-BFD."; - } - uses bfd-types:common-cfg-parms; - leaf use-ipv4 { - type boolean; - description - "Using IPv4 micro-BFD."; - } - leaf use-ipv6 { - type boolean; - description - "Using IPv6 micro-BFD."; - } - list member-links { - key "member-link"; - config false; - description - "Micro-BFD over a LAG. This represents one - member link."; - leaf member-link { - type if:interface-ref; - description - "Member link on which micro-BFD is running."; - } - container micro-bfd-ipv4 { - when "../../use-ipv4 = 'true'" { - description - "Needed only if IPv4 is used."; - } - description - "Micro-BFD IPv4 session state on a member link."; - uses bfd-types:all-session; - } - container micro-bfd-ipv6 { - when "../../use-ipv6 = 'true'" { - description - "Needed only if IPv6 is used."; - } - description - "Micro-BFD IPv6 session state on a member link."; - uses bfd-types:all-session; - } - } - } - } - } - } - - /* - * Notifications - */ - - notification lag-notification { - description - "Notification for BFD-over-LAG session state change. - An implementation may rate-limit notifications, e.g., when a - session is continuously changing state."; - uses bfd-types:notification-parms; - leaf lag-name { - type if:interface-ref; - description - "LAG interface name."; - } - leaf member-link { - type if:interface-ref; - description - "Member link on which BFD is running."; - } - } -} diff --git a/TestData/YangSource/ietf-bfd-mpls@2021-10-21.yang b/TestData/YangSource/ietf-bfd-mpls@2021-10-21.yang deleted file mode 100644 index f1820f4..0000000 --- a/TestData/YangSource/ietf-bfd-mpls@2021-10-21.yang +++ /dev/null @@ -1,188 +0,0 @@ -module ietf-bfd-mpls { - yang-version 1.1; - namespace "urn:ietf:params:xml:ns:yang:ietf-bfd-mpls"; - prefix bfd-mpls; - - import ietf-bfd-types { - prefix bfd-types; - reference - "RFC 9127: YANG Data Model for Bidirectional Forwarding - Detection (BFD)"; - } - import ietf-bfd { - prefix bfd; - reference - "RFC 9127: YANG Data Model for Bidirectional Forwarding - Detection (BFD)"; - } - import ietf-inet-types { - prefix inet; - reference - "RFC 6991: Common YANG Data Types"; - } - import ietf-routing { - prefix rt; - reference - "RFC 8349: A YANG Data Model for Routing Management - (NMDA Version)"; - } - - organization - "IETF BFD Working Group"; - contact - "WG Web: - WG List: - - Editor: Reshad Rahman - - - Editor: Lianshu Zheng - - - Editor: Mahesh Jethanandani - "; - description - "This module contains the YANG definition for BFD parameters for - MPLS LSPs as per RFC 5884. - - Copyright (c) 2021 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 - (https://trustee.ietf.org/license-info). - - This version of this YANG module is part of RFC 9127; see the - RFC itself for full legal notices."; - reference - "RFC 5884: Bidirectional Forwarding Detection (BFD) - for MPLS Label Switched Paths (LSPs) - RFC 9127: YANG Data Model for Bidirectional Forwarding - Detection (BFD)"; - - revision 2021-10-21 { - description - "Initial revision."; - reference - "RFC 9127: YANG Data Model for Bidirectional Forwarding - Detection (BFD)"; - } - - /* - * Identity definitions - */ - - identity encap-gach { - base bfd-types:encap-type; - description - "BFD with G-ACh encapsulation as per RFC 5586."; - reference - "RFC 5586: MPLS Generic Associated Channel"; - } - - identity encap-ip-gach { - base bfd-types:encap-type; - description - "BFD with IP and G-ACh encapsulation as per RFC 5586."; - } - - /* - * Groupings - */ - - grouping encap-cfg { - description - "Configuration for BFD encapsulation."; - leaf encap { - type identityref { - base bfd-types:encap-type; - } - default "bfd-types:encap-ip"; - description - "BFD encapsulation."; - } - } - - grouping mpls-dest-address { - description - "Destination address as per RFC 5884."; - reference - "RFC 5884: Bidirectional Forwarding Detection (BFD) - for MPLS Label Switched Paths (LSPs)"; - leaf mpls-dest-address { - type inet:ip-address; - config false; - description - "Destination address as per RFC 5884. - Needed if IP encapsulation is used."; - } - } - - /* - * Augments - */ - - augment "/rt:routing/rt:control-plane-protocols/" - + "rt:control-plane-protocol/bfd:bfd" { - description - "BFD augmentation for MPLS."; - container mpls { - description - "BFD MPLS top-level container."; - uses bfd-types:session-statistics-summary; - container egress { - description - "Egress configuration."; - uses bfd-types:client-cfg-parms; - uses bfd-types:auth-parms; - } - container session-groups { - description - "BFD-over-MPLS session groups."; - list session-group { - key "mpls-fec"; - description - "Group of BFD MPLS sessions (for ECMP). A group of - sessions is for one FEC. Each session has a different - field in the UDP/IP header for ECMP."; - leaf mpls-fec { - type inet:ip-prefix; - description - "MPLS FEC."; - } - uses bfd-types:common-cfg-parms; - list sessions { - config false; - description - "The BFD sessions for an MPLS FEC. The local - discriminator is unique for each session in the - group."; - uses bfd-types:all-session; - uses bfd-mpls:mpls-dest-address; - } - } - } - } - } - - /* - * Notifications - */ - - notification mpls-notification { - description - "Notification for BFD-over-MPLS FEC session state change. - An implementation may rate-limit notifications, e.g., when a - session is continuously changing state."; - uses bfd-types:notification-parms; - leaf mpls-dest-address { - type inet:ip-address; - description - "Destination address as per RFC 5884. - Needed if IP encapsulation is used."; - } - } -} diff --git a/TestData/YangSource/ietf-bfd-types@2021-10-21.yang b/TestData/YangSource/ietf-bfd-types@2021-10-21.yang deleted file mode 100644 index 7c1bc2b..0000000 --- a/TestData/YangSource/ietf-bfd-types@2021-10-21.yang +++ /dev/null @@ -1,661 +0,0 @@ -module ietf-bfd-types { - yang-version 1.1; - namespace "urn:ietf:params:xml:ns:yang:ietf-bfd-types"; - prefix bfd-types; - - import iana-bfd-types { - prefix iana-bfd-types; - reference - "RFC 9127: YANG Data Model for Bidirectional Forwarding - Detection (BFD)"; - } - import ietf-inet-types { - prefix inet; - reference - "RFC 6991: Common YANG Data Types"; - } - import ietf-yang-types { - prefix yang; - reference - "RFC 6991: Common YANG Data Types"; - } - import ietf-routing { - prefix rt; - reference - "RFC 8349: A YANG Data Model for Routing Management - (NMDA Version)"; - } - import ietf-key-chain { - prefix key-chain; - reference - "RFC 8177: YANG Data Model for Key Chains"; - } - - organization - "IETF BFD Working Group"; - contact - "WG Web: - WG List: - - Editor: Reshad Rahman - - - Editor: Lianshu Zheng - - - Editor: Mahesh Jethanandani - "; - description - "This module contains a collection of BFD-specific YANG data type - definitions, as per RFC 5880, and also groupings that are common - to other BFD YANG modules. - - Copyright (c) 2021 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 - (https://trustee.ietf.org/license-info). - - This version of this YANG module is part of RFC 9127; see the - RFC itself for full legal notices."; - reference - "RFC 5880: Bidirectional Forwarding Detection (BFD) - RFC 9127: YANG Data Model for Bidirectional Forwarding - Detection (BFD)"; - - revision 2021-10-21 { - description - "Initial revision."; - reference - "RFC 9127: YANG Data Model for Bidirectional Forwarding - Detection (BFD)"; - } - - /* - * Feature definitions - */ - - feature single-minimum-interval { - description - "This feature indicates that the server supports configuration - of one minimum interval value that is used for both transmit - and receive minimum intervals."; - } - - feature authentication { - description - "This feature indicates that the server supports BFD - authentication."; - reference - "RFC 5880: Bidirectional Forwarding Detection (BFD), - Section 6.7"; - } - - feature demand-mode { - description - "This feature indicates that the server supports BFD Demand - mode."; - reference - "RFC 5880: Bidirectional Forwarding Detection (BFD), - Section 6.6"; - } - - feature echo-mode { - description - "This feature indicates that the server supports BFD Echo - mode."; - reference - "RFC 5880: Bidirectional Forwarding Detection (BFD), - Section 6.4"; - } - - /* - * Identity definitions - */ - - identity bfdv1 { - base rt:control-plane-protocol; - description - "BFD protocol version 1."; - reference - "RFC 5880: Bidirectional Forwarding Detection (BFD)"; - } - - identity path-type { - description - "Base identity for the BFD path type. The path type indicates - the type of path on which BFD is running."; - } - - identity path-ip-sh { - base path-type; - description - "BFD on IP single-hop."; - reference - "RFC 5881: Bidirectional Forwarding Detection (BFD) - for IPv4 and IPv6 (Single Hop)"; - } - - identity path-ip-mh { - base path-type; - description - "BFD on IP multihop paths."; - reference - "RFC 5883: Bidirectional Forwarding Detection (BFD) for - Multihop Paths"; - } - - identity path-mpls-te { - base path-type; - description - "BFD on MPLS Traffic Engineering."; - reference - "RFC 5884: Bidirectional Forwarding Detection (BFD) - for MPLS Label Switched Paths (LSPs)"; - } - - identity path-mpls-lsp { - base path-type; - description - "BFD on an MPLS Label Switched Path."; - reference - "RFC 5884: Bidirectional Forwarding Detection (BFD) - for MPLS Label Switched Paths (LSPs)"; - } - - identity path-lag { - base path-type; - description - "Micro-BFD on LAG member links."; - reference - "RFC 7130: Bidirectional Forwarding Detection (BFD) on - Link Aggregation Group (LAG) Interfaces"; - } - - identity encap-type { - description - "Base identity for BFD encapsulation type."; - } - - identity encap-ip { - base encap-type; - description - "BFD with IP encapsulation."; - } - - /* - * Type definitions - */ - - typedef discriminator { - type uint32; - description - "BFD Discriminator as described in RFC 5880."; - reference - "RFC 5880: Bidirectional Forwarding Detection (BFD)"; - } - - typedef state { - type enumeration { - enum adminDown { - value 0; - description - "'adminDown' state."; - } - enum down { - value 1; - description - "'Down' state."; - } - enum init { - value 2; - description - "'Init' state."; - } - enum up { - value 3; - description - "'Up' state."; - } - } - description - "BFD states as defined in RFC 5880."; - } - - typedef multiplier { - type uint8 { - range "1..255"; - } - description - "BFD multiplier as described in RFC 5880."; - } - - typedef hops { - type uint8 { - range "1..255"; - } - description - "This corresponds to Time To Live for IPv4 and corresponds to - the hop limit for IPv6."; - } - - /* - * Groupings - */ - - grouping auth-parms { - description - "Grouping for BFD authentication parameters - (see Section 6.7 of RFC 5880)."; - container authentication { - if-feature "authentication"; - presence "Enables BFD authentication (see Section 6.7 - of RFC 5880)."; - description - "Parameters for BFD authentication."; - reference - "RFC 5880: Bidirectional Forwarding Detection (BFD), - Section 6.7"; - leaf key-chain { - type key-chain:key-chain-ref; - description - "Name of the 'key-chain' as per RFC 8177."; - } - leaf meticulous { - type boolean; - description - "Enables a meticulous mode as per Section 6.7 of - RFC 5880."; - } - } - } - - grouping base-cfg-parms { - description - "BFD grouping for base configuration parameters."; - leaf local-multiplier { - type multiplier; - default "3"; - description - "Multiplier transmitted by the local system."; - } - choice interval-config-type { - default "tx-rx-intervals"; - description - "Two interval values or one value used for both transmit and - receive."; - case tx-rx-intervals { - leaf desired-min-tx-interval { - type uint32; - units "microseconds"; - default "1000000"; - description - "Desired minimum transmit interval of control packets."; - } - leaf required-min-rx-interval { - type uint32; - units "microseconds"; - default "1000000"; - description - "Required minimum receive interval of control packets."; - } - } - case single-interval { - if-feature "single-minimum-interval"; - leaf min-interval { - type uint32; - units "microseconds"; - default "1000000"; - description - "Desired minimum transmit interval and required - minimum receive interval of control packets."; - } - } - } - } - - grouping client-cfg-parms { - description - "BFD grouping for configuration parameters - used by BFD clients, e.g., IGP or MPLS."; - leaf enabled { - type boolean; - default "false"; - description - "Indicates whether BFD is enabled."; - } - uses base-cfg-parms; - } - - grouping common-cfg-parms { - description - "BFD grouping for common configuration parameters."; - uses base-cfg-parms; - leaf demand-enabled { - if-feature "demand-mode"; - type boolean; - default "false"; - description - "To enable Demand mode."; - } - leaf admin-down { - type boolean; - default "false"; - description - "Indicates whether the BFD session is administratively - down."; - } - uses auth-parms; - } - - grouping all-session { - description - "BFD session operational information."; - leaf path-type { - type identityref { - base path-type; - } - config false; - description - "BFD path type. This indicates the path type that BFD is - running on."; - } - leaf ip-encapsulation { - type boolean; - config false; - description - "Indicates whether BFD encapsulation uses IP."; - } - leaf local-discriminator { - type discriminator; - config false; - description - "Local discriminator."; - } - leaf remote-discriminator { - type discriminator; - config false; - description - "Remote discriminator."; - } - leaf remote-multiplier { - type multiplier; - config false; - description - "Remote multiplier."; - } - leaf demand-capability { - if-feature "demand-mode"; - type boolean; - config false; - description - "Local Demand mode capability."; - } - leaf source-port { - when "../ip-encapsulation = 'true'" { - description - "Source port valid only when IP encapsulation is used."; - } - type inet:port-number; - config false; - description - "Source UDP port."; - } - leaf dest-port { - when "../ip-encapsulation = 'true'" { - description - "Destination port valid only when IP encapsulation - is used."; - } - type inet:port-number; - config false; - description - "Destination UDP port."; - } - container session-running { - config false; - description - "BFD 'session-running' information."; - leaf session-index { - type uint32; - description - "An index used to uniquely identify BFD sessions."; - } - leaf local-state { - type state; - description - "Local state."; - } - leaf remote-state { - type state; - description - "Remote state."; - } - leaf local-diagnostic { - type iana-bfd-types:diagnostic; - description - "Local diagnostic."; - } - leaf remote-diagnostic { - type iana-bfd-types:diagnostic; - description - "Remote diagnostic."; - } - leaf remote-authenticated { - type boolean; - description - "Indicates whether incoming BFD control packets are - authenticated."; - } - leaf remote-authentication-type { - when "../remote-authenticated = 'true'" { - description - "Only valid when incoming BFD control packets are - authenticated."; - } - if-feature "authentication"; - type iana-bfd-types:auth-type; - description - "Authentication type of incoming BFD control packets."; - } - leaf detection-mode { - type enumeration { - enum async-with-echo { - value 1; - description - "Async with echo."; - } - enum async-without-echo { - value 2; - description - "Async without echo."; - } - enum demand-with-echo { - value 3; - description - "Demand with echo."; - } - enum demand-without-echo { - value 4; - description - "Demand without echo."; - } - } - description - "Detection mode."; - } - leaf negotiated-tx-interval { - type uint32; - units "microseconds"; - description - "Negotiated transmit interval."; - } - leaf negotiated-rx-interval { - type uint32; - units "microseconds"; - description - "Negotiated receive interval."; - } - leaf detection-time { - type uint32; - units "microseconds"; - description - "Detection time."; - } - leaf echo-tx-interval-in-use { - when "../../path-type = 'bfd-types:path-ip-sh'" { - description - "Echo is supported for IP single-hop only."; - } - if-feature "echo-mode"; - type uint32; - units "microseconds"; - description - "Echo transmit interval in use."; - } - } - container session-statistics { - config false; - description - "BFD per-session statistics."; - leaf create-time { - type yang:date-and-time; - description - "Time and date when this session was created."; - } - leaf last-down-time { - type yang:date-and-time; - description - "Time and date of the last time this session went down."; - } - leaf last-up-time { - type yang:date-and-time; - description - "Time and date of the last time this session went up."; - } - leaf down-count { - type yang:counter32; - description - "The number of times this session has transitioned to the - 'down' state."; - } - leaf admin-down-count { - type yang:counter32; - description - "The number of times this session has transitioned to the - 'admin-down' state."; - } - leaf receive-packet-count { - type yang:counter64; - description - "Count of received packets in this session. This includes - valid and invalid received packets."; - } - leaf send-packet-count { - type yang:counter64; - description - "Count of sent packets in this session."; - } - leaf receive-invalid-packet-count { - type yang:counter64; - description - "Count of invalid received packets in this session."; - } - leaf send-failed-packet-count { - type yang:counter64; - description - "Count of packets that failed to be sent in this session."; - } - } - } - - grouping session-statistics-summary { - description - "Grouping for session statistics summary."; - container summary { - config false; - description - "BFD session statistics summary."; - leaf number-of-sessions { - type yang:gauge32; - description - "Number of BFD sessions."; - } - leaf number-of-sessions-up { - type yang:gauge32; - description - "Number of BFD sessions currently in the 'Up' state - (as defined in RFC 5880)."; - } - leaf number-of-sessions-down { - type yang:gauge32; - description - "Number of BFD sessions currently in the 'Down' or 'Init' - state but not 'adminDown' (as defined in RFC 5880)."; - } - leaf number-of-sessions-admin-down { - type yang:gauge32; - description - "Number of BFD sessions currently in the 'adminDown' state - (as defined in RFC 5880)."; - } - } - } - - grouping notification-parms { - description - "This group describes common parameters that will be sent - as part of BFD notifications."; - leaf local-discr { - type discriminator; - description - "BFD local discriminator."; - } - leaf remote-discr { - type discriminator; - description - "BFD remote discriminator."; - } - leaf new-state { - type state; - description - "Current BFD state."; - } - leaf state-change-reason { - type iana-bfd-types:diagnostic; - description - "Reason for the BFD state change."; - } - leaf time-of-last-state-change { - type yang:date-and-time; - description - "Calendar time of the most recent previous state change."; - } - leaf dest-addr { - type inet:ip-address; - description - "BFD peer address."; - } - leaf source-addr { - type inet:ip-address; - description - "BFD local address."; - } - leaf session-index { - type uint32; - description - "An index used to uniquely identify BFD sessions."; - } - leaf path-type { - type identityref { - base path-type; - } - description - "BFD path type."; - } - } -} diff --git a/TestData/YangSource/ietf-bfd@2021-10-21.yang b/TestData/YangSource/ietf-bfd@2021-10-21.yang deleted file mode 100644 index fe7cfa6..0000000 --- a/TestData/YangSource/ietf-bfd@2021-10-21.yang +++ /dev/null @@ -1,77 +0,0 @@ -module ietf-bfd { - yang-version 1.1; - namespace "urn:ietf:params:xml:ns:yang:ietf-bfd"; - prefix bfd; - - import ietf-bfd-types { - prefix bfd-types; - reference - "RFC 9127: YANG Data Model for Bidirectional Forwarding - Detection (BFD)"; - } - import ietf-routing { - prefix rt; - reference - "RFC 8349: A YANG Data Model for Routing Management - (NMDA Version)"; - } - - organization - "IETF BFD Working Group"; - contact - "WG Web: - WG List: - - Editor: Reshad Rahman - - - Editor: Lianshu Zheng - - - Editor: Mahesh Jethanandani - "; - description - "This module contains the YANG definition for BFD parameters as - per RFC 5880. - - Copyright (c) 2021 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 - (https://trustee.ietf.org/license-info). - - This version of this YANG module is part of RFC 9127; see the - RFC itself for full legal notices."; - reference - "RFC 5880: Bidirectional Forwarding Detection (BFD) - RFC 9127: YANG Data Model for Bidirectional Forwarding - Detection (BFD)"; - - revision 2021-10-21 { - description - "Initial revision."; - reference - "RFC 9127: YANG Data Model for Bidirectional Forwarding - Detection (BFD)"; - } - - augment "/rt:routing/rt:control-plane-protocols/" - + "rt:control-plane-protocol" { - when "derived-from-or-self(rt:type, 'bfd-types:bfdv1')" { - description - "This augmentation is only valid for a control-plane protocol - instance of BFD (type 'bfdv1')."; - } - description - "BFD augmentation."; - container bfd { - description - "BFD top-level container."; - uses bfd-types:session-statistics-summary; - } - } -} diff --git a/TestData/YangSource/ietf-complex-types@2011-03-15.yang b/TestData/YangSource/ietf-complex-types@2011-03-15.yang deleted file mode 100644 index dd967ba..0000000 --- a/TestData/YangSource/ietf-complex-types@2011-03-15.yang +++ /dev/null @@ -1,91 +0,0 @@ -module ietf-complex-types { - - namespace "urn:ietf:params:xml:ns:yang:ietf-complex-types"; - prefix "ct"; - - organization - "NETMOD WG"; - - contact - "Editor: Bernd Linowski - - Editor: Mehmet Ersue - - Editor: Siarhei Kuryla - "; - - description - "YANG extensions for complex types and typed instance - identifiers. - - 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 6095; see - the RFC itself for full legal notices."; - - revision 2011-03-15 { - description "Initial revision."; - } - - extension complex-type { - description "Defines a complex-type."; - reference "Section 2.2, complex-type Extension Statement"; - argument type-identifier { - yin-element true; - } - } - - extension extends { - description "Defines the base type of a complex-type."; - reference "Section 2.5, extends Extension Statement"; - argument base-type-identifier { - yin-element true; - } - } - extension abstract { - description "Makes the complex-type abstract."; - reference "Section 2.6, abstract Extension Statement"; - argument status; - } - - extension instance { - description "Declares an instance of the given - complex type."; - reference "Section 2.3, instance Extension Statement"; - argument ct-instance-identifier { - yin-element true; - } - } - - extension instance-list { - description "Declares a list of instances of the given - complex type"; - reference "Section 2.4, instance-list Extension Statement"; - argument ct-instance-identifier { - yin-element true; - } - } - - extension instance-type { - description "Tells to which type instance the instance - identifier refers."; - reference "Section 3.2, instance-type Extension Statement"; - argument target-type-identifier { - yin-element true; - } - } - - feature complex-types { - description "Indicates that the server supports - complex types and instance identifiers."; - } - - } diff --git a/TestData/YangSource/ietf-connectionless-oam-methods@2019-04-16.yang b/TestData/YangSource/ietf-connectionless-oam-methods@2019-04-16.yang deleted file mode 100644 index 7964381..0000000 --- a/TestData/YangSource/ietf-connectionless-oam-methods@2019-04-16.yang +++ /dev/null @@ -1,434 +0,0 @@ -module ietf-connectionless-oam-methods { - namespace - "urn:ietf:params:xml:ns:yang:ietf-connectionless-oam-methods"; - prefix cloam-methods; - - import ietf-interfaces { - prefix if; - } - import ietf-connectionless-oam { - prefix cl-oam; - } - organization - "IETF LIME Working Group"; - contact - "WG Web: - WG List: - - Deepak Kumar - Qin Wu - Srihari Raghavan - Michael Wang - Reshad Rahman "; - description - "This YANG module defines the RPC operations for - connectionless OAM to be used within the IETF - in a protocol-independent manner. It is - assumed that each protocol maps corresponding - abstracts to its native format. Each protocol - may extend the YANG data model defined here to - include protocol-specific extensions. - - Copyright (c) 2019 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 8533; see - the RFC itself for full legal notices."; - - revision 2019-04-16 { - description - "Initial revision."; - reference - "RFC 8533: Retrieval Methods YANG Data Model for the Management - of Operations, Administration, and Maintenance (OAM) - Protocols That Use Connectionless Communications"; - } - - identity protocol-id { - description - "This is the base identity for a generic protocol - ID. The protocol registry can be found at - https://www.iana.org/protocols."; - } - identity protocol-id-internet { - base protocol-id; - description - "Identity for Internet Protocols."; - } - - identity protocol-id-proprietary { - base protocol-id; - description - "Identity for proprietary protocols (e.g., - IP SLA)."; - } - - identity protocol-id-sfc { - base protocol-id; - description - "Identity for Service Function Chaining."; - } - - identity protocol-id-mpls { - base protocol-id; - description - "The MPLS protocol."; - } - - identity protocol-id-mpls-tp { - base protocol-id; - description - "The MPLS-TP protocol."; - } - - identity protocol-id-twamp { - base protocol-id; - description - "The Two-Way Active Measurement Protocol (TWAMP) - protocol."; - } - - identity protocol-id-bier { - base protocol-id; - description - "The Bit Index Explicit Replication (BIER) - protocol."; - } - - identity status-code { - description - "This is base identity for a status code."; - } - - identity success-reach { - base status-code; - description - "Indicates that the destination being verified - is reachable (see RFC 7276)."; - reference - "RFC 7276: An Overview of Operations, Administration, and - Maintenance (OAM) Tools"; - } - - identity fail-reach { - base status-code; - description - "Indicates that the destination being verified - is not reachable (see RFC 7276)."; - reference - "RFC 7276: An Overview of Operations, Administration, and - Maintenance (OAM) Tools"; - } - - identity success-path-verification { - base status-code; - description - "Indicates that the path verification is performed - successfully (see RFC 7276)."; - reference - "RFC 7276: An Overview of Operations, Administration, and - Maintenance (OAM) Tools"; - } - - identity fail-path-verification { - base status-code; - description - "Indicates that the path verification fails - (see RFC 7276)."; - reference - "RFC 7276: An Overview of Operations, Administration, and - Maintenance (OAM) Tools"; - } - - identity status-sub-code { - description - "IdentityBase status-sub-code."; - } - - identity invalid-cc { - base status-sub-code; - description - "Indicates that the Continuity Check message is invalid - (see RFC 7276)."; - reference - "RFC 7276: An Overview of Operations, Administration, and - Maintenance (OAM) Tools"; - } - - identity invalid-pd { - base status-sub-code; - description - "Indicates that the path discovery message is invalid - (see RFC 7276)."; - reference - "RFC 7276: An Overview of Operations, Administration, and - Maintenance (OAM) Tools"; - } - - identity protocol-id-meta-data { - description - "This is the base identity for metadata that corresponds - to the protocol ID."; - } - - identity protocol-internet-number { - base protocol-id-meta-data; - description - "Internet Protocol number for standard - Internet Protocols (IANA-assigned Internet - Protocol numbers) to help in protocol processing. - The Protocol Numbers registry can be found at - https://www.iana.org/assignments/protocol-numbers."; - } - - grouping rpc-input-parameters { - container destination-tp { - uses cl-oam:tp-address; - description - "Destination test point."; - } - leaf source-interface { - type if:interface-ref; - mandatory true; - description - "Source interface."; - } - leaf outbound-interface { - type if:interface-ref; - mandatory true; - description - "Outbound interface."; - } - leaf vrf { - type cl-oam:routing-instance-ref; - description - "Virtual Routing and Forwarding (VRF) instance."; - } - description - "Grouping for RPC input parameters"; - } - - rpc continuity-check { - if-feature "cl-oam:continuity-check"; - description - "Continuity Check RPC operation as per RFC 7276."; - reference - "RFC 7276: An Overview of Operations, Administration, and - Maintenance (OAM) Tools"; - input { - uses rpc-input-parameters; - uses cl-oam:session-type { - description - "If session-type is specified, then session-type - must be set to on demand"; - } - leaf count { - type uint32 { - range "0..4294967295" { - description - "The overall number of packets to be transmitted - by the sender. The value of the count 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."; - } - } - default "5"; - description - "Specifies the number of - packets that will be sent. By - default, the packet number is - set to 5."; - } - leaf ttl { - type uint8; - default "255"; - description - "Time to live (TTL) used to limit the lifetime - of data packets transmitted in the network - to prevent looping. The TTL value is decremented - for every hop that the packet traverses. If the - TTL is zero, the data packet will be discarded."; - } - leaf packet-size { - type uint32 { - range "64..10000"; - } - default "64"; - description - "Packet size of the Continuity Check message, in octets. - By default, the packet size is set to 64 octets."; - } - } - output { - container response-info { - leaf protocol-id { - type identityref { - base protocol-id; - } - mandatory true; - description - "Protocol used in the Continuity Check message. - This could be a standard protocol (e.g., - TCP/IP protocols, MPLS, etc.) or a proprietary - protocol as identified by this field."; - } - leaf protocol-id-meta-data { - type identityref { - base protocol-id-meta-data; - } - description - "An optional metadata related to the protocol ID. - For example, this could be the Internet Protocol - number for standard Internet Protocols used for - help with protocol processing."; - } - leaf status-code { - type identityref { - base status-code; - } - mandatory true; - description - "Status code for Continuity Check RPC operation. - This could be a basic status code (e.g., destination - is reachable or destination is not reachable; see RFC 7276) - or some customized status code as identified by this - field."; - reference - "RFC 7276: An Overview of Operations, Administration, and - Maintenance (OAM) Tools"; - } - leaf status-sub-code { - type identityref { - base status-sub-code; - } - mandatory true; - description - "An optional status-sub-code for Continuity Check - RPC operation. If the basic status code is destination - reachable, this status-sub-code doesn't need to be - specified. If the basic status code is destination - unreachable, the status-sub-code can be used to specify - the detailed reasons. This could be a basic - sub-status-code (such as an invalid Continuity Check) or - other error codes specific to the protocol under use for - the Continuity Checks. For example, if ICMP is the - protocol under use, the error codes defined in RFC 4443 - can be used to specify the reasons specific to ICMP. - This technology-specific status-sub-code can be - defined in technology-specific models."; - reference - "RFC 4443: The IETF Administrative Oversight Committee - (IAOC) Member Selection Guidelines and Process."; - } - description - "Status code and status-sub-code for Continuity Check RPC - operation."; - } - uses cl-oam:continuity-check-data; - } - } - - rpc path-discovery { - if-feature "cl-oam:path-discovery"; - description - "Path discovery RPC operation as per RFC 7276."; - reference - "RFC 7276: An Overview of Operations, Administration, and - Maintenance (OAM) Tools"; - input { - uses rpc-input-parameters; - uses cl-oam:session-type { - description - "If session-type is specified, then session-type - must be set to on demand"; - } - leaf max-ttl { - type uint8; - default "255"; - description - "Maximum TTL indicates the maximum number of hops that - a packet is permitted to travel before being discarded - by a router. By default, the maximum TTL is set to - 255."; - } - } - output { - list response-list { - key "response-index"; - description - "Path discovery response list."; - leaf response-index { - type uint32; - mandatory true; - description - "Response index."; - } - leaf protocol-id { - type identityref { - base protocol-id; - } - mandatory true; - description - "Protocol used in path discovery. This could be a - standard protocol (e.g., TCP/IP protocols, MPLS, etc.) - or a proprietary protocol as identified by - this field."; - } - leaf protocol-id-meta-data { - type identityref { - base protocol-id-meta-data; - } - description - "An optional metadata related to the protocol ID. - For example, this could be the Internet Protocol - number for standard Internet Protocols used for - help with protocol processing."; - } - leaf status-code { - type identityref { - base status-code; - } - mandatory true; - description - "Status code for Continuity Check RPC operation. - This could be a basic status code (e.g., destination - is reachable or destination is not reachable) or some - customized status code as identified by this field."; - } - leaf status-sub-code { - type identityref { - base status-sub-code; - } - mandatory true; - description - "An optional status-sub-code for Continuity Check - RPC operation. If the basic status code is destination - reachable, this status-sub-code doesn't need to be - specified. If the basic status code is destination - unreachable, the status-sub-code can be used to specify - the detailed reasons. This could be a basic - sub-status-code (such as an invalid Continuity Check) or - other error codes specific to the protocol under use for - Continuity Checks. For example, if ICMP is the protocol - under use, the error codes defined in RFC 4443 - can be used to specify the reasons specific to ICMP. - This technology-specific status-sub-code can be defined - in technology-specific models."; - reference - "RFC 4443: The IETF Administrative Oversight Committee - (IAOC) Member Selection Guidelines and Process."; - } - } - uses cl-oam:path-discovery-data; - } - } -} diff --git a/TestData/YangSource/ietf-dots-signal-channel@2020-05-28.yang b/TestData/YangSource/ietf-dots-signal-channel@2020-05-28.yang deleted file mode 100644 index 4d8eb7d..0000000 --- a/TestData/YangSource/ietf-dots-signal-channel@2020-05-28.yang +++ /dev/null @@ -1,530 +0,0 @@ -module ietf-dots-signal-channel { - yang-version 1.1; - namespace "urn:ietf:params:xml:ns:yang:ietf-dots-signal-channel"; - prefix signal; - - import ietf-inet-types { - prefix inet; - reference - "Section 4 of RFC 6991"; - } - import ietf-yang-types { - prefix yang; - reference - "Section 3 of RFC 6991"; - } - import ietf-dots-data-channel { - prefix ietf-data; - reference - "RFC 8783: Distributed Denial-of-Service Open Threat Signaling - (DOTS) Data Channel Specification"; - } - import iana-dots-signal-channel { - prefix iana-signal; - } - - organization - "IETF DDoS Open Threat Signaling (DOTS) Working Group"; - contact - "WG Web: - WG List: - - Editor: Konda, Tirumaleswar Reddy.K - - - Editor: Mohamed Boucadair - - - Author: Prashanth Patil - - - Author: Andrew Mortensen - - - Author: Nik Teague - "; - description - "This module contains YANG definition for the signaling - messages exchanged between a DOTS client and a DOTS server. - - Copyright (c) 2020 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 8782; see - the RFC itself for full legal notices."; - - revision 2020-05-28 { - description - "Initial revision."; - reference - "RFC 8782: Distributed Denial-of-Service Open Threat - Signaling (DOTS) Signal Channel Specification"; - } - - /* - * Groupings - */ - - grouping mitigation-scope { - description - "Specifies the scope of the mitigation request."; - list scope { - key "cuid mid"; - description - "The scope of the request."; - leaf cdid { - type string; - description - "The cdid should be included by a server-domain - DOTS gateway to propagate the client domain - identification information from the - gateway's client-facing side to the gateway's - server-facing side, and from the gateway's - server-facing side to the DOTS server. - - It may be used by the final DOTS server - for policy enforcement purposes."; - } - leaf cuid { - type string; - description - "A unique identifier that is - generated by a DOTS client to prevent - request collisions. It is expected that the - cuid will remain consistent throughout the - lifetime of the DOTS client."; - } - leaf mid { - type uint32; - description - "Mitigation request identifier. - - This identifier must be unique for each mitigation - request bound to the DOTS client."; - } - uses ietf-data:target; - leaf-list alias-name { - type string; - description - "An alias name that points to a resource."; - } - leaf lifetime { - type int32; - units "seconds"; - default "3600"; - description - "Indicates the lifetime of the mitigation request. - - A lifetime of '0' in a mitigation request is an - invalid value. - - A lifetime of negative one (-1) indicates indefinite - lifetime for the mitigation request."; - } - leaf trigger-mitigation { - type boolean; - default "true"; - description - "If set to 'false', DDoS mitigation will not be - triggered unless the DOTS signal channel - session is lost."; - } - leaf mitigation-start { - type uint64; - config false; - description - "Mitigation start time is represented in seconds - relative to 1970-01-01T00:00:00Z in UTC time."; - } - leaf status { - type iana-signal:status; - config false; - description - "Indicates the status of a mitigation request. - It must be included in responses only."; - } - container conflict-information { - config false; - description - "Indicates that a conflict is detected. - Must only be used for responses."; - leaf conflict-status { - type iana-signal:conflict-status; - description - "Indicates the conflict status."; - } - leaf conflict-cause { - type iana-signal:conflict-cause; - description - "Indicates the cause of the conflict."; - } - leaf retry-timer { - type uint32; - units "seconds"; - description - "The DOTS client must not resend the - same request that has a conflict before the expiry of - this timer."; - } - container conflict-scope { - description - "Provides more information about the conflict scope."; - uses ietf-data:target { - when "/dots-signal/scope/conflict-information/" - + "conflict-cause = 'overlapping-targets'"; - } - leaf-list alias-name { - when "../../conflict-cause = 'overlapping-targets'"; - type string; - description - "Conflicting alias-name."; - } - list acl-list { - when "../../conflict-cause = 'conflict-with-acceptlist'"; - key "acl-name"; - description - "List of conflicting ACLs as defined in the DOTS data - channel. These ACLs are uniquely defined by - cuid and acl-name."; - leaf acl-name { - type leafref { - path "/ietf-data:dots-data/ietf-data:dots-client/" - + "ietf-data:acls/ietf-data:acl/ietf-data:name"; - } - description - "Reference to the conflicting ACL name bound to - a DOTS client."; - } - leaf acl-type { - type leafref { - path "/ietf-data:dots-data/ietf-data:dots-client/" - + "ietf-data:acls/ietf-data:acl/ietf-data:type"; - } - description - "Reference to the conflicting ACL type bound to - a DOTS client."; - } - } - leaf mid { - when "../../conflict-cause = 'overlapping-targets'"; - type leafref { - path "../../../mid"; - } - description - "Reference to the conflicting 'mid' bound to - the same DOTS client."; - } - } - } - leaf bytes-dropped { - type yang:zero-based-counter64; - units "bytes"; - config false; - description - "The total dropped byte count for the mitigation - request since the attack mitigation was triggered. - The count wraps around when it reaches the maximum value - of counter64 for dropped bytes."; - } - leaf bps-dropped { - type yang:gauge64; - config false; - description - "The average number of dropped bits per second for - the mitigation request since the attack - mitigation was triggered. This should be over - five-minute intervals (that is, measuring bytes - into five-minute buckets and then averaging these - buckets over the time since the mitigation was - triggered)."; - } - leaf pkts-dropped { - type yang:zero-based-counter64; - config false; - description - "The total number of dropped packet count for the - mitigation request since the attack mitigation was - triggered. The count wraps around when it reaches - the maximum value of counter64 for dropped packets."; - } - leaf pps-dropped { - type yang:gauge64; - config false; - description - "The average number of dropped packets per second - for the mitigation request since the attack - mitigation was triggered. This should be over - five-minute intervals (that is, measuring packets - into five-minute buckets and then averaging these - buckets over the time since the mitigation was - triggered)."; - } - leaf attack-status { - type iana-signal:attack-status; - description - "Indicates the status of an attack as seen by the - DOTS client."; - } - } - } - - grouping config-parameters { - description - "Subset of DOTS signal channel session configuration."; - container heartbeat-interval { - description - "DOTS agents regularly send heartbeats to each other - after mutual authentication is successfully - completed in order to keep the DOTS signal channel - open."; - leaf max-value { - type uint16; - units "seconds"; - config false; - description - "Maximum acceptable heartbeat-interval value."; - } - leaf min-value { - type uint16; - units "seconds"; - config false; - description - "Minimum acceptable heartbeat-interval value."; - } - leaf current-value { - type uint16; - units "seconds"; - default "30"; - description - "Current heartbeat-interval value. - - '0' means that heartbeat mechanism is deactivated."; - } - } - container missing-hb-allowed { - description - "Maximum number of missing heartbeats allowed."; - leaf max-value { - type uint16; - config false; - description - "Maximum acceptable missing-hb-allowed value."; - } - leaf min-value { - type uint16; - config false; - description - "Minimum acceptable missing-hb-allowed value."; - } - leaf current-value { - type uint16; - default "15"; - description - "Current missing-hb-allowed value."; - } - } - container probing-rate { - description - "The limit for sending Non-confirmable messages with - no response."; - leaf max-value { - type uint16; - units "byte/second"; - config false; - description - "Maximum acceptable probing-rate value."; - } - leaf min-value { - type uint16; - units "byte/second"; - config false; - description - "Minimum acceptable probing-rate value."; - } - leaf current-value { - type uint16; - units "byte/second"; - default "5"; - description - "Current probing-rate value."; - } - } - container max-retransmit { - description - "Maximum number of retransmissions of a Confirmable - message."; - leaf max-value { - type uint16; - config false; - description - "Maximum acceptable max-retransmit value."; - } - leaf min-value { - type uint16; - config false; - description - "Minimum acceptable max-retransmit value."; - } - leaf current-value { - type uint16; - default "3"; - description - "Current max-retransmit value."; - } - } - container ack-timeout { - description - "Initial retransmission timeout value."; - leaf max-value-decimal { - type decimal64 { - fraction-digits 2; - } - units "seconds"; - config false; - description - "Maximum ack-timeout value."; - } - leaf min-value-decimal { - type decimal64 { - fraction-digits 2; - } - units "seconds"; - config false; - description - "Minimum ack-timeout value."; - } - leaf current-value-decimal { - type decimal64 { - fraction-digits 2; - } - units "seconds"; - default "2"; - description - "Current ack-timeout value."; - } - } - container ack-random-factor { - description - "Random factor used to influence the timing of - retransmissions."; - leaf max-value-decimal { - type decimal64 { - fraction-digits 2; - } - config false; - description - "Maximum acceptable ack-random-factor value."; - } - leaf min-value-decimal { - type decimal64 { - fraction-digits 2; - } - config false; - description - "Minimum acceptable ack-random-factor value."; - } - leaf current-value-decimal { - type decimal64 { - fraction-digits 2; - } - default "1.5"; - description - "Current ack-random-factor value."; - } - } - } - - grouping signal-config { - description - "DOTS signal channel session configuration."; - leaf sid { - type uint32; - mandatory true; - description - "An identifier for the DOTS signal channel - session configuration data."; - } - container mitigating-config { - description - "Configuration parameters to use when a mitigation - is active."; - uses config-parameters; - } - container idle-config { - description - "Configuration parameters to use when no mitigation - is active."; - uses config-parameters; - } - } - - grouping redirected-signal { - description - "Grouping for the redirected signaling."; - leaf alt-server { - type string; - config false; - mandatory true; - description - "FQDN of an alternate server."; - } - leaf-list alt-server-record { - type inet:ip-address; - config false; - description - "List of records for the alternate server."; - } - } - - /* - * Main Container for DOTS Signal Channel - */ - - container dots-signal { - description - "Main container for DOTS signal message. - - A DOTS signal message can be a mitigation, a configuration, - or a redirected signal message."; - choice message-type { - description - "Can be a mitigation, a configuration, or a redirect - message."; - case mitigation-scope { - description - "Mitigation scope of a mitigation message."; - uses mitigation-scope; - } - case signal-config { - description - "Configuration message."; - uses signal-config; - } - case redirected-signal { - description - "Redirected signaling."; - uses redirected-signal; - } - case heartbeat { - description - "DOTS heartbeats."; - leaf peer-hb-status { - type boolean; - mandatory true; - description - "Indicates whether a DOTS agent receives heartbeats - from its peer. The value is set to 'true' if the - DOTS agent is receiving heartbeat messages - from its peer."; - } - } - } - } -} diff --git a/TestData/YangSource/ietf-ethertypes@2019-03-04.yang b/TestData/YangSource/ietf-ethertypes@2019-03-04.yang deleted file mode 100644 index fd05507..0000000 --- a/TestData/YangSource/ietf-ethertypes@2019-03-04.yang +++ /dev/null @@ -1,381 +0,0 @@ -module ietf-ethertypes { - namespace "urn:ietf:params:xml:ns:yang:ietf-ethertypes"; - prefix ethertypes; - - organization - "IETF NETMOD (Network Modeling) Working Group."; - - contact - "WG Web: - WG List: - - Editor: Mahesh Jethanandani - "; - - description - "This module contains common definitions for the - Ethertype used by different modules. It is a - placeholder module, till such time that IEEE - starts a project to define these Ethertypes - and publishes a standard. - - At that time, this module can be deprecated. - - Copyright (c) 2019 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 8519; see - the RFC itself for full legal notices."; - - revision 2019-03-04 { - description - "Initial revision."; - reference - "RFC 8519: YANG Data Model for Network Access Control - Lists (ACLs)."; - } - - typedef ethertype { - type union { - type uint16; - type enumeration { - enum ipv4 { - value 2048; - description - "Internet Protocol version 4 (IPv4) with a - hex value of 0x0800."; - reference - "RFC 791: Internet Protocol."; - } - enum arp { - value 2054; - description - "Address Resolution Protocol (ARP) with a - hex value of 0x0806."; - reference - "RFC 826: An Ethernet Address Resolution Protocol: Or - Converting Network Protocol Addresses to 48.bit - Ethernet Address for Transmission on Ethernet - Hardware."; - } - enum wlan { - value 2114; - description - "Wake-on-LAN. Hex value of 0x0842."; - } - enum trill { - value 8947; - description - "Transparent Interconnection of Lots of Links. - Hex value of 0x22F3."; - reference - "RFC 6325: Routing Bridges (RBridges): Base Protocol - Specification."; - } - enum srp { - value 8938; - description - "Stream Reservation Protocol. Hex value of - 0x22EA."; - reference - "IEEE 801.1Q-2011."; - } - enum decnet { - value 24579; - description - "DECnet Phase IV. Hex value of 0x6003."; - } - enum rarp { - value 32821; - description - "Reverse Address Resolution Protocol. - Hex value 0x8035."; - reference - "RFC 903: A Reverse Address Resolution Protocol."; - } - enum appletalk { - value 32923; - description - "Appletalk (Ethertalk). Hex value of 0x809B."; - } - enum aarp { - value 33011; - description - "Appletalk Address Resolution Protocol. Hex value - of 0x80F3."; - } - enum vlan { - value 33024; - description - "VLAN-tagged frame (IEEE 802.1Q) and Shortest Path - Bridging IEEE 802.1aq with Network-Network - Interface (NNI) compatibility. Hex value of - 0x8100."; - reference - "IEEE 802.1Q."; - } - enum ipx { - value 33079; - description - "Internetwork Packet Exchange (IPX). Hex value - of 0x8137."; - } - enum qnx { - value 33284; - description - "QNX Qnet. Hex value of 0x8204."; - } - enum ipv6 { - value 34525; - description - "Internet Protocol Version 6 (IPv6). Hex value - of 0x86DD."; - reference - "RFC 8200: Internet Protocol, Version 6 (IPv6) - Specification - RFC 8201: Path MTU Discovery for IP version 6."; - } - enum efc { - value 34824; - description - "Ethernet flow control using pause frames. - Hex value of 0x8808."; - reference - "IEEE 802.1Qbb."; - } - enum esp { - value 34825; - description - "Ethernet Slow Protocol. Hex value of 0x8809."; - reference - "IEEE 802.3-2015."; - } - enum cobranet { - value 34841; - description - "CobraNet. Hex value of 0x8819."; - } - enum mpls-unicast { - value 34887; - description - "Multiprotocol Label Switching (MPLS) unicast traffic. - Hex value of 0x8847."; - reference - "RFC 3031: Multiprotocol Label Switching Architecture."; - } - enum mpls-multicast { - value 34888; - description - "MPLS multicast traffic. Hex value of 0x8848."; - reference - "RFC 3031: Multiprotocol Label Switching Architecture."; - } - enum pppoe-discovery { - value 34915; - description - "Point-to-Point Protocol over Ethernet. Used during - the discovery process. Hex value of 0x8863."; - reference - "RFC 2516: A Method for Transmitting PPP Over Ethernet - (PPPoE)."; - } - enum pppoe-session { - value 34916; - description - "Point-to-Point Protocol over Ethernet. Used during - session stage. Hex value of 0x8864."; - reference - "RFC 2516: A Method for Transmitting PPP Over Ethernet - (PPPoE)."; - } - enum intel-ans { - value 34925; - description - "Intel Advanced Networking Services. Hex value of - 0x886D."; - } - enum jumbo-frames { - value 34928; - description - "Jumbo frames or Ethernet frames with more than - 1500 bytes of payload, up to 9000 bytes."; - } - enum homeplug { - value 34939; - description - "Family name for the various power line - communications. Hex value of 0x887B."; - } - enum eap { - value 34958; - description - "Ethernet Access Protocol (EAP) over LAN. Hex value - of 0x888E."; - reference - "IEEE 802.1X."; - } - enum profinet { - value 34962; - description - "PROcess FIeld Net (PROFINET). Hex value of 0x8892."; - } - enum hyperscsi { - value 34970; - description - "Small Computer System Interface (SCSI) over Ethernet. - Hex value of 0x889A."; - } - enum aoe { - value 34978; - description - "Advanced Technology Advancement (ATA) over Ethernet. - Hex value of 0x88A2."; - } - enum ethercat { - value 34980; - description - "Ethernet for Control Automation Technology (EtherCAT). - Hex value of 0x88A4."; - } - enum provider-bridging { - value 34984; - description - "Provider Bridging (802.1ad) and Shortest Path Bridging - (801.1aq). Hex value of 0x88A8."; - reference - "IEEE 802.1ad and IEEE 802.1aq)."; - } - enum ethernet-powerlink { - value 34987; - description - "Ethernet Powerlink. Hex value of 0x88AB."; - } - enum goose { - value 35000; - description - "Generic Object Oriented Substation Event (GOOSE). - Hex value of 0x88B8."; - reference - "IEC/ISO 8802-2 and 8802-3."; - } - enum gse { - value 35001; - description - "Generic Substation Events. Hex value of 88B9."; - reference - "IEC 61850."; - } - enum sv { - value 35002; - description - "Sampled Value Transmission. Hex value of 0x88BA."; - reference - "IEC 61850."; - } - enum lldp { - value 35020; - description - "Link Layer Discovery Protocol (LLDP). Hex value of - 0x88CC."; - reference - "IEEE 802.1AB."; - } - enum sercos { - value 35021; - description - "Sercos Interface. Hex value of 0x88CD."; - } - enum wsmp { - value 35036; - description - "WAVE Short Message Protocol (WSMP). Hex value of - 0x88DC."; - } - enum homeplug-av-mme { - value 35041; - description - "HomePlug AV Mobile Management Entity (MME). Hex value - of 88E1."; - } - enum mrp { - value 35043; - description - "Media Redundancy Protocol (MRP). Hex value of - 0x88E3."; - reference - "IEC 62439-2."; - } - enum macsec { - value 35045; - description - "MAC Security. Hex value of 0x88E5."; - reference - "IEEE 802.1AE."; - } - enum pbb { - value 35047; - description - "Provider Backbone Bridges (PBB). Hex value of - 0x88E7."; - reference - "IEEE 802.1ah."; - } - enum cfm { - value 35074; - description - "Connectivity Fault Management (CFM). Hex value of - 0x8902."; - reference - "IEEE 802.1ag."; - } - enum fcoe { - value 35078; - description - "Fiber Channel over Ethernet (FCoE). Hex value of - 0x8906."; - reference - "T11 FC-BB-5."; - } - enum fcoe-ip { - value 35092; - description - "FCoE Initialization Protocol. Hex value of 0x8914."; - } - enum roce { - value 35093; - description - "RDMA over Converged Ethernet (RoCE). Hex value of - 0x8915."; - } - enum tte { - value 35101; - description - "TTEthernet Protocol Control Frame (TTE). Hex value - of 0x891D."; - reference - "SAE AS6802."; - } - enum hsr { - value 35119; - description - "High-availability Seamless Redundancy (HSR). Hex - value of 0x892F."; - reference - "IEC 62439-3:2016."; - } - } - } - description - "The uint16 type placeholder is defined to enable - users to manage their own ethertypes not - covered by the module. Otherwise, the module contains - enum definitions for the more commonly used ethertypes."; - } -} diff --git a/TestData/YangSource/ietf-foo@2016-03-20.yang b/TestData/YangSource/ietf-foo@2016-03-20.yang deleted file mode 100644 index 8e0e3e8..0000000 --- a/TestData/YangSource/ietf-foo@2016-03-20.yang +++ /dev/null @@ -1,12 +0,0 @@ -module ietf-foo { - namespace "urn:ietf:params:xml:ns:yang:ietf-foo"; - prefix "foo"; - organization "..."; - contact "..."; - description "..."; - revision 2016-03-20 { - description "Latest revision"; - reference "RFC XXXX: Foo Protocol"; - } - // ... more statements -} diff --git a/TestData/YangSource/ietf-inet-types@2010-09-24.yang b/TestData/YangSource/ietf-inet-types@2010-09-24.yang deleted file mode 100644 index c3ada6c..0000000 --- a/TestData/YangSource/ietf-inet-types@2010-09-24.yang +++ /dev/null @@ -1,418 +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 Partain - - - WG Chair: David Kessens - - - Editor: Juergen Schoenwaelder - "; - - description - "This module contains a collection of generally useful derived - YANG data types for Internet addresses and related things. - - 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 6021; see - the RFC itself for full legal notices."; - - revision 2010-09-24 { - description - "Initial revision."; - reference - "RFC 6021: Common YANG Data Types"; - } - - /*** collection of protocol field related types ***/ - - typedef ip-version { - type enumeration { - enum unknown { - value "0"; - description - "An unknown or unspecified version of the Internet protocol."; - } - enum ipv4 { - value "1"; - description - "The IPv4 protocol as defined in RFC 791."; - } - enum ipv6 { - value "2"; - description - "The IPv6 protocol as defined in RFC 2460."; - } - } - description - "This value represents the version of the IP protocol. - - In the value set and its semantics, this type is equivalent - to the InetVersion textual convention of the SMIv2."; - reference - "RFC 791: Internet Protocol - RFC 2460: Internet Protocol, Version 6 (IPv6) Specification - RFC 4001: Textual Conventions for Internet Network Addresses"; - } - - typedef dscp { - type uint8 { - range "0..63"; - } - description - "The dscp type represents a Differentiated Services Code-Point - that may be used for marking packets in a traffic stream. - - In the value set and its semantics, this type is equivalent - to the Dscp textual convention of the SMIv2."; - reference - "RFC 3289: Management Information Base for the Differentiated - Services Architecture - RFC 2474: Definition of the Differentiated Services Field - (DS Field) in the IPv4 and IPv6 Headers - RFC 2780: IANA Allocation Guidelines For Values In - the Internet Protocol and Related Headers"; - } - - typedef ipv6-flow-label { - type uint32 { - range "0..1048575"; - } - description - "The flow-label type represents 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 autonomous system related types ***/ - - 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 ASs'. 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 4893: BGP Support for Four-octet AS Number Space - RFC 4001: Textual Conventions for Internet Network Addresses"; - } - - /*** collection of IP address and hostname related types ***/ - - 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 representations - implies the IP version."; - } - - 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 compressed - format described in RFC 4291, Section 2.2, item 2 with the - following additional rules: the :: substitution must be - applied to the longest sequence of all-zero 16-bit chunks - in an IPv6 address. If there is a tie, the first sequence - of all-zero 16-bit chunks is replaced by ::. Single - all-zero 16-bit chunks are not compressed. The canonical - format uses lowercase characters and leading zeros are - not allowed. The canonical format for the zone index is - the numerical format as described in RFC 4007, Section - 11.2."; - 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 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, IPv6 address is represented - in the compressed format described in RFC 4291, Section - 2.2, item 2 with the following additional rules: the :: - substitution must be applied to the longest sequence of - all-zero 16-bit chunks in an IPv6 address. If there is - a tie, the first sequence of all-zero 16-bit chunks is - replaced by ::. Single all-zero 16-bit chunks are not - compressed. The canonical format uses lowercase - characters and leading zeros are not allowed."; - reference - "RFC 4291: IP Version 6 Addressing Architecture"; - } - - /*** 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 - explicitely or it 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 encoded in punycode as described in RFC - 3492"; - 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 3492: Punycode: A Bootstring encoding of Unicode for - Internationalized Domain Names in Applications - (IDNA) - RFC 5891: Internationalizing Domain Names in Applications - (IDNA): Protocol"; - } - - 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/TestData/YangSource/ietf-interfaces@2014-05-08.yang b/TestData/YangSource/ietf-interfaces@2014-05-08.yang deleted file mode 100644 index 710e7e6..0000000 --- a/TestData/YangSource/ietf-interfaces@2014-05-08.yang +++ /dev/null @@ -1,696 +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/TestData/YangSource/ietf-ip@2014-06-16.yang b/TestData/YangSource/ietf-ip@2014-06-16.yang deleted file mode 100644 index 51276a5..0000000 --- a/TestData/YangSource/ietf-ip@2014-06-16.yang +++ /dev/null @@ -1,701 +0,0 @@ -module ietf-ip { - - namespace "urn:ietf:params:xml:ns:yang:ietf-ip"; - prefix ip; - - import ietf-interfaces { - prefix if; - } - import ietf-inet-types { - prefix inet; - } - import ietf-yang-types { - prefix yang; - } - - organization - "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; - - contact - "WG Web: - WG List: - - WG Chair: Thomas Nadeau - - - WG Chair: Juergen Schoenwaelder - - - Editor: Martin Bjorklund - "; - - description - "This module contains a collection of YANG definitions for - configuring IP implementations. - - Copyright (c) 2014 IETF Trust and the persons identified as - authors of the code. All rights reserved. - - Redistribution and use in source and binary forms, with or - without modification, is permitted pursuant to, and subject - to the license terms contained in, the Simplified BSD License - set forth in Section 4.c of the IETF Trust's Legal Provisions - Relating to IETF Documents - (http://trustee.ietf.org/license-info). - - This version of this YANG module is part of RFC 7277; see - the RFC itself for full legal notices."; - - revision 2014-06-16 { - description - "Initial revision."; - reference - "RFC 7277: A YANG Data Model for IP Management"; - } - - /* - - * Features - */ - - feature ipv4-non-contiguous-netmasks { - description - "Indicates support for configuring non-contiguous - subnet masks."; - } - - feature ipv6-privacy-autoconf { - description - "Indicates support for Privacy Extensions for Stateless Address - Autoconfiguration in IPv6."; - reference - "RFC 4941: Privacy Extensions for Stateless Address - Autoconfiguration in IPv6"; - } - - /* - * Typedefs - */ - - typedef ip-address-origin { - type enumeration { - enum other { - description - "None of the following."; - } - enum static { - description - "Indicates that the address has been statically - configured - for example, using NETCONF or a Command Line - Interface."; - } - enum dhcp { - description - "Indicates an address that has been assigned to this - system by a DHCP server."; - } - enum link-layer { - description - "Indicates an address created by IPv6 stateless - autoconfiguration that embeds a link-layer address in its - interface identifier."; - } - enum random { - description - "Indicates an address chosen by the system at - - random, e.g., an IPv4 address within 169.254/16, an - RFC 4941 temporary address, or an RFC 7217 semantically - opaque address."; - reference - "RFC 4941: Privacy Extensions for Stateless Address - Autoconfiguration in IPv6 - RFC 7217: A Method for Generating Semantically Opaque - Interface Identifiers with IPv6 Stateless - Address Autoconfiguration (SLAAC)"; - } - } - description - "The origin of an address."; - } - - typedef neighbor-origin { - type enumeration { - enum other { - description - "None of the following."; - } - enum static { - description - "Indicates that the mapping has been statically - configured - for example, using NETCONF or a Command Line - Interface."; - } - enum dynamic { - description - "Indicates that the mapping has been dynamically resolved - using, e.g., IPv4 ARP or the IPv6 Neighbor Discovery - protocol."; - } - } - description - "The origin of a neighbor entry."; - } - - /* - * Configuration data nodes - */ - - augment "/if:interfaces/if:interface" { - description - "Parameters for configuring IP on interfaces. - - If an interface is not capable of running IP, the server - must not allow the client to configure these parameters."; - - container ipv4 { - presence - "Enables IPv4 unless the 'enabled' leaf - (which defaults to 'true') is set to 'false'"; - description - "Parameters for the IPv4 address family."; - - leaf enabled { - type boolean; - default true; - description - "Controls whether IPv4 is enabled or disabled on this - interface. When IPv4 is enabled, this interface is - connected to an IPv4 stack, and the interface can send - and receive IPv4 packets."; - } - leaf forwarding { - type boolean; - default false; - description - "Controls IPv4 packet forwarding of datagrams received by, - but not addressed to, this interface. IPv4 routers - forward datagrams. IPv4 hosts do not (except those - source-routed via the host)."; - } - leaf mtu { - type uint16 { - range "68..max"; - } - units octets; - description - "The size, in octets, of the largest IPv4 packet that the - interface will send and receive. - - The server may restrict the allowed values for this leaf, - depending on the interface's type. - - If this leaf is not configured, the operationally used MTU - depends on the interface's type."; - reference - "RFC 791: Internet Protocol"; - } - list address { - key "ip"; - description - "The list of configured IPv4 addresses on the interface."; - - leaf ip { - type inet:ipv4-address-no-zone; - description - "The IPv4 address on the interface."; - } - - choice subnet { - mandatory true; - description - "The subnet can be specified as a prefix-length, or, - if the server supports non-contiguous netmasks, as - a netmask."; - leaf prefix-length { - type uint8 { - range "0..32"; - } - description - "The length of the subnet prefix."; - } - leaf netmask { - if-feature ipv4-non-contiguous-netmasks; - type yang:dotted-quad; - description - "The subnet specified as a netmask."; - } - } - } - list neighbor { - key "ip"; - description - "A list of mappings from IPv4 addresses to - link-layer addresses. - - Entries in this list are used as static entries in the - ARP Cache."; - reference - "RFC 826: An Ethernet Address Resolution Protocol"; - - leaf ip { - type inet:ipv4-address-no-zone; - description - "The IPv4 address of the neighbor node."; - } - leaf link-layer-address { - type yang:phys-address; - mandatory true; - description - "The link-layer address of the neighbor node."; - } - } - - } - - container ipv6 { - presence - "Enables IPv6 unless the 'enabled' leaf - (which defaults to 'true') is set to 'false'"; - description - "Parameters for the IPv6 address family."; - - leaf enabled { - type boolean; - default true; - description - "Controls whether IPv6 is enabled or disabled on this - interface. When IPv6 is enabled, this interface is - connected to an IPv6 stack, and the interface can send - and receive IPv6 packets."; - } - leaf forwarding { - type boolean; - default false; - description - "Controls IPv6 packet forwarding of datagrams received by, - but not addressed to, this interface. IPv6 routers - forward datagrams. IPv6 hosts do not (except those - source-routed via the host)."; - reference - "RFC 4861: Neighbor Discovery for IP version 6 (IPv6) - Section 6.2.1, IsRouter"; - } - leaf mtu { - type uint32 { - range "1280..max"; - } - units octets; - description - "The size, in octets, of the largest IPv6 packet that the - interface will send and receive. - - The server may restrict the allowed values for this leaf, - depending on the interface's type. - - If this leaf is not configured, the operationally used MTU - depends on the interface's type."; - reference - "RFC 2460: Internet Protocol, Version 6 (IPv6) Specification - Section 5"; - } - - list address { - key "ip"; - description - "The list of configured IPv6 addresses on the interface."; - - leaf ip { - type inet:ipv6-address-no-zone; - description - "The IPv6 address on the interface."; - } - leaf prefix-length { - type uint8 { - range "0..128"; - } - mandatory true; - description - "The length of the subnet prefix."; - } - } - list neighbor { - key "ip"; - description - "A list of mappings from IPv6 addresses to - link-layer addresses. - - Entries in this list are used as static entries in the - Neighbor Cache."; - reference - "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)"; - - leaf ip { - type inet:ipv6-address-no-zone; - description - "The IPv6 address of the neighbor node."; - } - leaf link-layer-address { - type yang:phys-address; - mandatory true; - description - "The link-layer address of the neighbor node."; - } - } - - leaf dup-addr-detect-transmits { - type uint32; - default 1; - description - "The number of consecutive Neighbor Solicitation messages - sent while performing Duplicate Address Detection on a - tentative address. A value of zero indicates that - Duplicate Address Detection is not performed on - tentative addresses. A value of one indicates a single - transmission with no follow-up retransmissions."; - reference - "RFC 4862: IPv6 Stateless Address Autoconfiguration"; - } - container autoconf { - description - "Parameters to control the autoconfiguration of IPv6 - addresses, as described in RFC 4862."; - reference - "RFC 4862: IPv6 Stateless Address Autoconfiguration"; - - leaf create-global-addresses { - type boolean; - default true; - description - "If enabled, the host creates global addresses as - described in RFC 4862."; - reference - "RFC 4862: IPv6 Stateless Address Autoconfiguration - Section 5.5"; - } - leaf create-temporary-addresses { - if-feature ipv6-privacy-autoconf; - type boolean; - default false; - description - "If enabled, the host creates temporary addresses as - described in RFC 4941."; - reference - "RFC 4941: Privacy Extensions for Stateless Address - Autoconfiguration in IPv6"; - } - - leaf temporary-valid-lifetime { - if-feature ipv6-privacy-autoconf; - type uint32; - units "seconds"; - default 604800; - description - "The time period during which the temporary address - is valid."; - reference - "RFC 4941: Privacy Extensions for Stateless Address - Autoconfiguration in IPv6 - - TEMP_VALID_LIFETIME"; - } - leaf temporary-preferred-lifetime { - if-feature ipv6-privacy-autoconf; - type uint32; - units "seconds"; - default 86400; - description - "The time period during which the temporary address is - preferred."; - reference - "RFC 4941: Privacy Extensions for Stateless Address - Autoconfiguration in IPv6 - - TEMP_PREFERRED_LIFETIME"; - } - } - } - } - - /* - * Operational state data nodes - */ - - augment "/if:interfaces-state/if:interface" { - description - "Data nodes for the operational state of IP on interfaces."; - - container ipv4 { - presence "Present if IPv4 is enabled on this interface"; - config false; - description - "Interface-specific parameters for the IPv4 address family."; - - leaf forwarding { - type boolean; - description - "Indicates whether IPv4 packet forwarding is enabled or - disabled on this interface."; - } - leaf mtu { - type uint16 { - range "68..max"; - } - units octets; - description - "The size, in octets, of the largest IPv4 packet that the - interface will send and receive."; - reference - "RFC 791: Internet Protocol"; - } - list address { - key "ip"; - description - "The list of IPv4 addresses on the interface."; - - leaf ip { - type inet:ipv4-address-no-zone; - description - "The IPv4 address on the interface."; - } - choice subnet { - description - "The subnet can be specified as a prefix-length, or, - if the server supports non-contiguous netmasks, as - a netmask."; - leaf prefix-length { - type uint8 { - range "0..32"; - } - description - "The length of the subnet prefix."; - } - leaf netmask { - if-feature ipv4-non-contiguous-netmasks; - type yang:dotted-quad; - description - "The subnet specified as a netmask."; - } - } - - leaf origin { - type ip-address-origin; - description - "The origin of this address."; - } - } - list neighbor { - key "ip"; - description - "A list of mappings from IPv4 addresses to - link-layer addresses. - - This list represents the ARP Cache."; - reference - "RFC 826: An Ethernet Address Resolution Protocol"; - - leaf ip { - type inet:ipv4-address-no-zone; - description - "The IPv4 address of the neighbor node."; - } - leaf link-layer-address { - type yang:phys-address; - description - "The link-layer address of the neighbor node."; - } - leaf origin { - type neighbor-origin; - description - "The origin of this neighbor entry."; - } - } - - } - - container ipv6 { - presence "Present if IPv6 is enabled on this interface"; - config false; - description - "Parameters for the IPv6 address family."; - - leaf forwarding { - type boolean; - default false; - description - "Indicates whether IPv6 packet forwarding is enabled or - disabled on this interface."; - reference - "RFC 4861: Neighbor Discovery for IP version 6 (IPv6) - Section 6.2.1, IsRouter"; - } - leaf mtu { - type uint32 { - range "1280..max"; - } - units octets; - description - "The size, in octets, of the largest IPv6 packet that the - interface will send and receive."; - reference - "RFC 2460: Internet Protocol, Version 6 (IPv6) Specification - Section 5"; - } - list address { - key "ip"; - description - "The list of IPv6 addresses on the interface."; - - leaf ip { - type inet:ipv6-address-no-zone; - description - "The IPv6 address on the interface."; - } - leaf prefix-length { - type uint8 { - range "0..128"; - } - mandatory true; - description - "The length of the subnet prefix."; - } - leaf origin { - type ip-address-origin; - description - "The origin of this address."; - } - - leaf status { - type enumeration { - enum preferred { - description - "This is a valid address that can appear as the - destination or source address of a packet."; - } - enum deprecated { - description - "This is a valid but deprecated address that should - no longer be used as a source address in new - communications, but packets addressed to such an - address are processed as expected."; - } - enum invalid { - description - "This isn't a valid address, and it shouldn't appear - as the destination or source address of a packet."; - } - enum inaccessible { - description - "The address is not accessible because the interface - to which this address is assigned is not - operational."; - } - enum unknown { - description - "The status cannot be determined for some reason."; - } - enum tentative { - description - "The uniqueness of the address on the link is being - verified. Addresses in this state should not be - used for general communication and should only be - used to determine the uniqueness of the address."; - } - enum duplicate { - description - "The address has been determined to be non-unique on - the link and so must not be used."; - } - - enum optimistic { - description - "The address is available for use, subject to - restrictions, while its uniqueness on a link is - being verified."; - } - } - description - "The status of an address. Most of the states correspond - to states from the IPv6 Stateless Address - Autoconfiguration protocol."; - reference - "RFC 4293: Management Information Base for the - Internet Protocol (IP) - - IpAddressStatusTC - RFC 4862: IPv6 Stateless Address Autoconfiguration"; - } - } - list neighbor { - key "ip"; - description - "A list of mappings from IPv6 addresses to - link-layer addresses. - - This list represents the Neighbor Cache."; - reference - "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)"; - - leaf ip { - type inet:ipv6-address-no-zone; - description - "The IPv6 address of the neighbor node."; - } - leaf link-layer-address { - type yang:phys-address; - description - "The link-layer address of the neighbor node."; - } - leaf origin { - type neighbor-origin; - description - "The origin of this neighbor entry."; - } - leaf is-router { - type empty; - description - "Indicates that the neighbor node acts as a router."; - } - leaf state { - type enumeration { - enum incomplete { - description - "Address resolution is in progress, and the link-layer - address of the neighbor has not yet been - determined."; - } - enum reachable { - description - "Roughly speaking, the neighbor is known to have been - reachable recently (within tens of seconds ago)."; - } - enum stale { - description - "The neighbor is no longer known to be reachable, but - until traffic is sent to the neighbor no attempt - should be made to verify its reachability."; - } - enum delay { - description - "The neighbor is no longer known to be reachable, and - traffic has recently been sent to the neighbor. - Rather than probe the neighbor immediately, however, - delay sending probes for a short while in order to - give upper-layer protocols a chance to provide - reachability confirmation."; - } - enum probe { - description - "The neighbor is no longer known to be reachable, and - unicast Neighbor Solicitation probes are being sent - to verify reachability."; - } - } - description - "The Neighbor Unreachability Detection state of this - entry."; - reference - "RFC 4861: Neighbor Discovery for IP version 6 (IPv6) - Section 7.3.2"; - } - } - } - } -} diff --git a/TestData/YangSource/ietf-ipfix-psamp@2012-09-05.yang b/TestData/YangSource/ietf-ipfix-psamp@2012-09-05.yang deleted file mode 100644 index 744f096..0000000 --- a/TestData/YangSource/ietf-ipfix-psamp@2012-09-05.yang +++ /dev/null @@ -1,2232 +0,0 @@ -module ietf-ipfix-psamp { - namespace "urn:ietf:params:xml:ns:yang:ietf-ipfix-psamp"; - prefix ipfix; - - import ietf-yang-types { prefix yang; } - import ietf-inet-types { prefix inet; } - - organization - "IETF IPFIX Working Group"; - - contact - "WG Web: - WG List: - - WG Chair: Nevil Brownlee - - - WG Chair: Juergen Quittek - - - Editor: Gerhard Muenz - "; - - description - "IPFIX/PSAMP Configuration Data Model - - 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)."; - - revision 2012-09-05 { - description "Initial version"; - reference "RFC 6728: Configuration Data Model for the IP Flow - Information Export (IPFIX) and Packet Sampling (PSAMP) - Protocols"; - } - - /***************************************************************** - * Features - *****************************************************************/ - - feature exporter { - description "If supported, the Monitoring Device can be used as - an Exporter. Exporting Processes can be configured."; - } - - feature collector { - description "If supported, the Monitoring Device can be used as - a Collector. Collecting Processes can be configured."; - } - - feature meter { - description "If supported, Observation Points, Selection - Processes, and Caches can be configured."; - } - - feature psampSampCountBased { - description "If supported, the Monitoring Device supports - count-based Sampling. The Selector method sampCountBased can - be configured."; - } - - feature psampSampTimeBased { - description "If supported, the Monitoring Device supports - time-based Sampling. The Selector method sampTimeBased can - be configured."; - } - - feature psampSampRandOutOfN { - description "If supported, the Monitoring Device supports - random n-out-of-N Sampling. The Selector method - sampRandOutOfN can be configured."; - } - - feature psampSampUniProb { - description "If supported, the Monitoring Device supports - uniform probabilistic Sampling. The Selector method - sampUniProb can be configured."; - } - - feature psampFilterMatch { - description "If supported, the Monitoring Device supports - property match Filtering. The Selector method filterMatch - can be configured."; - } - - feature psampFilterHash { - description "If supported, the Monitoring Device supports - hash-based Filtering. The Selector method filterHash can be - configured."; - } - - feature immediateCache { - description "If supported, the Monitoring Device supports - Caches generating PSAMP Packet Reports by configuration with - immediateCache."; - } - - feature timeoutCache { - description "If supported, the Monitoring Device supports - Caches generating IPFIX Flow Records by configuration with - timeoutCache."; - } - - feature naturalCache { - description "If supported, the Monitoring Device supports - Caches generating IPFIX Flow Records by configuration with - naturalCache."; - } - - feature permanentCache { - description "If supported, the Monitoring Device supports - Caches generating IPFIX Flow Records by configuration with - permanentCache."; - } - - feature udpTransport { - description "If supported, the Monitoring Device supports UDP - as the transport protocol."; - } - - feature tcpTransport { - description "If supported, the Monitoring Device supports TCP - as the transport protocol."; - } - - feature fileReader { - description "If supported, the Monitoring Device supports the - configuration of Collecting Processes as File Readers."; - } - - feature fileWriter { - description "If supported, the Monitoring Device supports the - configuration of Exporting Processes as File Writers."; - } - - /***************************************************************** - * Identities - *****************************************************************/ - - /*** Hash function identities ***/ - identity hashFunction { - description "Base identity for all hash functions used for - hash-based packet Filtering. Identities derived from - this base are used by the leaf - /ipfix/selectionProcess/selector/filterHash/hashFunction."; - } - identity BOB { - base "hashFunction"; - description "BOB hash function"; - reference "RFC 5475, Section 6.2.4.1."; - } - identity IPSX { - base "hashFunction"; - description "IPSX hash function"; - reference "RFC 5475, Section 6.2.4.1."; - } - identity CRC { - base "hashFunction"; - description "CRC hash function"; - reference "RFC 5475, Section 6.2.4.1."; - } - - /*** Export mode identities ***/ - identity exportMode { - description "Base identity for different usages of export - destinations configured for an Exporting Process. - Identities derived from this base are used by the leaf - /ipfix/exportingProcess/exportMode."; - } - identity parallel { - base "exportMode"; - description "Parallel export of Data Records to all - destinations configured for the Exporting Process."; - } - identity loadBalancing { - base "exportMode"; - description "Load-balancing between the different destinations - configured for the Exporting Process."; - } - identity fallback { - base "exportMode"; - description "Export to the primary destination (i.e., the first - SCTP, UDP, TCP, or file destination configured for the - Exporting Process). If the export to the primary destination - fails, the Exporting Process tries to export to the secondary - destination. If the secondary destination fails as well, it - continues with the tertiary, etc."; - } - - /*** Options type identities ***/ - identity optionsType { - description "Base identity for report types exported with - options. Identities derived from this base are used by the leaf - /ipfix/exportingProcess/options/optionsType."; - } - identity meteringStatistics { - base "optionsType"; - description "Metering Process Statistics."; - reference "RFC 5101, Section 4.1."; - } - identity meteringReliability { - base "optionsType"; - description "Metering Process Reliability Statistics."; - reference "RFC 5101, Section 4.2."; - } - identity exportingReliability { - base "optionsType"; - description "Exporting Process Reliability - Statistics."; - reference "RFC 5101, Section 4.3."; - } - identity flowKeys { - base "optionsType"; - description "Flow Keys."; - reference "RFC 5101, Section 4.4."; - } - identity selectionSequence { - base "optionsType"; - description "Selection Sequence and Selector Reports."; - reference "RFC 5476, Sections 6.5.1 and 6.5.2."; - } - identity selectionStatistics { - base "optionsType"; - description "Selection Sequence Statistics Report."; - reference "RFC 5476, Sections 6.5.3."; - } - identity accuracy { - base "optionsType"; - description "Accuracy Report."; - reference "RFC 5476, Section 6.5.4."; - } - identity reducingRedundancy { - base "optionsType"; - description "Enables the utilization of Options Templates to - reduce redundancy in the exported Data Records."; - reference "RFC 5473."; - } - identity extendedTypeInformation { - base "optionsType"; - description "Export of extended type information for - enterprise-specific Information Elements used in the - exported Templates."; - reference "RFC 5610."; - } - - /***************************************************************** - * Type definitions - *****************************************************************/ - - typedef ieNameType { - type string { - length "1..max"; - pattern "\S+"; - } - description "Type for Information Element names. Whitespaces - are not allowed."; - } - - typedef ieIdType { - type uint16 { - range "1..32767" { - description "Valid range of Information Element - identifiers."; - reference "RFC 5102, Section 4."; - } - } - description "Type for Information Element identifiers."; - } - - typedef nameType { - type string { - length "1..max"; - pattern "\S(.*\S)?"; - } - description "Type for 'name' leafs, which are used to identify - specific instances within lists, etc. - Leading and trailing whitespaces are not allowed."; - } - - typedef ifNameType { - type string { - length "1..255"; - } - description "This corresponds to the DisplayString textual - convention of SNMPv2-TC, which is used for ifName in the IF - MIB module."; - reference "RFC 2863 (ifName)."; - } - - typedef direction { - type enumeration { - enum ingress { - description "This value is used for monitoring incoming - packets."; - } - enum egress { - description "This value is used for monitoring outgoing - packets."; - } - enum both { - description "This value is used for monitoring incoming and - outgoing packets."; - } - } - description "Direction of packets going through an interface or - linecard."; - } - - typedef transportSessionStatus { - type enumeration { - enum inactive { - description "This value MUST be used for Transport Sessions - that are specified in the system but currently not active. - The value can be used for Transport Sessions that are - backup (secondary) sessions."; - } - enum active { - description "This value MUST be used for Transport Sessions - that are currently active and transmitting or receiving - data."; - } - enum unknown { - description "This value MUST be used if the status of the - Transport Sessions cannot be detected by the device. This - value should be avoided as far as possible."; - } - } - description "Status of a Transport Session."; - reference "RFC 6615, Section 8 (ipfixTransportSessionStatus)."; - } - - /***************************************************************** - * Groupings - *****************************************************************/ - - grouping observationPointParameters { - description "Interface as input to Observation Point."; - leaf observationPointId { - type uint32; - config false; - description "Observation Point ID (i.e., the value of the - Information Element observationPointId) assigned by the - Monitoring Device."; - reference "IANA registry for IPFIX Entities, - http://www.iana.org/assignments/ipfix."; - } - leaf observationDomainId { - type uint32; - mandatory true; - description "The Observation Domain ID associates the - Observation Point to an Observation Domain. Observation - Points with identical Observation Domain IDs belong to the - same Observation Domain. - Note that this parameter corresponds to - ipfixObservationPointObservationDomainId in the IPFIX MIB - module."; - reference "RFC 5101; RFC 6615, Section 8 - (ipfixObservationPointObservationDomainId)."; - } - leaf-list ifName { - type ifNameType; - description "List of names identifying interfaces of the - Monitoring Device. The Observation Point observes packets at - the specified interfaces."; - } - leaf-list ifIndex { - type uint32; - description "List of ifIndex values pointing to entries in the - ifTable of the IF-MIB module maintained by the Monitoring - Device. The Observation Point observes packets at the - specified interfaces. - This parameter SHOULD only be used if an SNMP agent enables - access to the ifTable. - Note that this parameter corresponds to - ipfixObservationPointPhysicalInterface in the IPFIX MIB - module."; - reference "RFC 2863; RFC 6615, Section 8 - (ipfixObservationPointPhysicalInterface)."; - } - leaf-list entPhysicalName { - type string; - description "List of names identifying physical entities of the - Monitoring Device. The Observation Point observes packets at - the specified entities."; - } - leaf-list entPhysicalIndex { - type uint32; - description "List of entPhysicalIndex values pointing to - entries in the entPhysicalTable of the ENTITY-MIB module - maintained by the Monitoring Device. The Observation Point - observes packets at the specified entities. - This parameter SHOULD only be used if an SNMP agent enables - access to the entPhysicalTable. - Note that this parameter corresponds to - ipfixObservationPointPhysicalEntity in the IPFIX MIB - module."; - reference "RFC 4133; RFC 6615, Section 8 - (ipfixObservationPointPhysicalInterface)."; - } - leaf direction { - type direction; - default both; - description "Direction of packets. If not applicable (e.g., in - the case of a sniffing interface in promiscuous mode), this - parameter is ignored."; - } - } - - grouping sampCountBasedParameters { - description "Configuration parameters of a Selector applying - systematic count-based packet Sampling to the packet - stream."; - reference "RFC 5475, Section 5.1; RFC 5476, Section 6.5.2.1."; - leaf packetInterval { - type uint32; - units packets; - mandatory true; - description "The number of packets that are consecutively - sampled between gaps of length packetSpace. - This parameter corresponds to the Information Element - samplingPacketInterval and to psampSampCountBasedInterval - in the PSAMP MIB module."; - reference "RFC 5477, Section 8.2.2; RFC 6727, Section 6 - (psampSampCountBasedInterval)."; - } - leaf packetSpace { - type uint32; - units packets; - mandatory true; - description "The number of unsampled packets between two - Sampling intervals. - This parameter corresponds to the Information Element - samplingPacketSpace and to psampSampCountBasedSpace - in the PSAMP MIB module."; - reference "RFC 5477, Section 8.2.3; RFC 6727, Section 6 - (psampSampCountBasedSpace)."; - } - } - - grouping sampTimeBasedParameters { - description "Configuration parameters of a Selector applying - systematic time-based packet Sampling to the packet - stream."; - reference "RFC 5475, Section 5.1; RFC 5476, Section 6.5.2.2."; - leaf timeInterval { - type uint32; - units microseconds; - mandatory true; - description "The time interval in microseconds during - which all arriving packets are sampled between gaps - of length timeSpace. - This parameter corresponds to the Information Element - samplingTimeInterval and to psampSampTimeBasedInterval - in the PSAMP MIB module."; - reference "RFC 5477, Section 8.2.4; RFC 6727, Section 6 - (psampSampTimeBasedInterval)."; - } - leaf timeSpace { - type uint32; - units microseconds; - mandatory true; - description "The time interval in microseconds during - which no packets are sampled between two Sampling - intervals specified by timeInterval. - This parameter corresponds to the Information Element - samplingTimeInterval and to psampSampTimeBasedSpace - in the PSAMP MIB module."; - reference "RFC 5477, Section 8.2.5; RFC 6727, Section 6 - (psampSampTimeBasedSpace)."; - } - } - - grouping sampRandOutOfNParameters { - description "Configuration parameters of a Selector applying - n-out-of-N packet Sampling to the packet stream."; - reference "RFC 5475, Section 5.2.1; RFC 5476, Section 6.5.2.3."; - leaf size { - type uint32; - units packets; - mandatory true; - description "The number of elements taken from the parent - population. - This parameter corresponds to the Information Element - samplingSize and to psampSampRandOutOfNSize in the PSAMP - MIB module."; - reference "RFC 5477, Section 8.2.6; RFC 6727, Section 6 - (psampSampRandOutOfNSize)."; - } - leaf population { - type uint32; - units packets; - mandatory true; - description "The number of elements in the parent - population. - This parameter corresponds to the Information Element - samplingPopulation and to psampSampRandOutOfNPopulation - in the PSAMP MIB module."; - reference "RFC 5477, Section 8.2.7; RFC 6727, Section 6 - (psampSampRandOutOfNPopulation)."; - } - } - - grouping sampUniProbParameters { - description "Configuration parameters of a Selector applying - uniform probabilistic packet Sampling (with equal - probability per packet) to the packet stream."; - reference "RFC 5475, Section 5.2.2.1; - RFC 5476, Section 6.5.2.4."; - leaf probability { - type decimal64 { - fraction-digits 18; - range "0..1"; - } - mandatory true; - description "Probability that a packet is sampled, - expressed as a value between 0 and 1. The probability - is equal for every packet. - This parameter corresponds to the Information Element - samplingProbability and to psampSampUniProbProbability - in the PSAMP MIB module."; - reference "RFC 5477, Section 8.2.8; RFC 6727, Section 6 - (psampSampUniProbProbability)."; - } - } - - grouping filterMatchParameters { - description "Configuration parameters of a Selector applying - property match Filtering to the packet stream. - The field to be matched is specified as an Information - Element."; - reference "RFC 5475, Section 6.1; RFC 5476, Section 6.5.2.5."; - choice nameOrId { - mandatory true; - description "The field to be matched is specified by - either the name or the identifier of the Information - Element."; - leaf ieName { - type ieNameType; - description "Name of the Information Element."; - } - leaf ieId { - type ieIdType; - description "Identifier of the Information Element."; - } - } - leaf ieEnterpriseNumber { - type uint32; - default 0; - description "If this parameter is zero, the Information - Element is registered in the IANA registry of IPFIX - Information Elements. - If this parameter is configured with a non-zero private - enterprise number, the Information Element is - enterprise-specific."; - reference "IANA registry for Private Enterprise Numbers, - http://www.iana.org/assignments/enterprise-numbers; - IANA registry for IPFIX Entities, - http://www.iana.org/assignments/ipfix."; - } - leaf value { - type string; - mandatory true; - description "Matching value of the Information Element."; - } - } - - grouping filterHashParameters { - description "Configuration parameters of a Selector applying - hash-based Filtering to the packet stream."; - reference "RFC 5475, Section 6.2; RFC 5476, Section 6.5.2.6."; - leaf hashFunction { - type identityref { - base "hashFunction"; - } - default BOB; - description "Hash function to be applied. According to - RFC 5475, Section 6.2.4.1, 'BOB' must be used in order to - be compliant with PSAMP. - This parameter functionally corresponds to - psampFiltHashFunction in the PSAMP MIB module."; - reference "RFC 6727, Section 6 (psampFiltHashFunction)"; - } - leaf initializerValue { - type uint64; - description "Initializer value to the hash function. - If not configured by the user, the Monitoring Device - arbitrarily chooses an initializer value. - This parameter corresponds to the Information Element - hashInitialiserValue and to psampFiltHashInitializerValue - in the PSAMP MIB module."; - reference "RFC 5477, Section 8.3.9; RFC 6727, Section 6 - (psampFiltHashInitializerValue)."; - } - leaf ipPayloadOffset { - type uint64; - units octets; - default 0; - description "IP payload offset indicating the position of - the first payload byte considered as input to the hash - function. - Default value 0 corresponds to the minimum offset that - must be configurable according to RFC 5476, Section - 6.5.2.6. - This parameter corresponds to the Information Element - hashIPPayloadOffset and to psampFiltHashIpPayloadOffset - in the PSAMP MIB module."; - reference "RFC 5477, Section 8.3.2; RFC 6727, Section 6 - (psampFiltHashIpPayloadOffset)."; - } - leaf ipPayloadSize { - type uint64; - units octets; - default 8; - description "Number of IP payload bytes used as input to - the hash function, counted from the payload offset. - If the IP payload is shorter than the payload range, - all available payload octets are used as input. - Default value 8 corresponds to the minimum IP payload - size that must be configurable according to RFC 5476, - Section 6.5.2.6. - This parameter corresponds to the Information Element - hashIPPayloadSize and to psampFiltHashIpPayloadSize - in the PSAMP MIB module."; - reference "RFC 5477, Section 8.3.3; RFC 6727, Section 6 - (psampFiltHashIpPayloadSize)."; - } - leaf digestOutput { - type boolean; - default false; - description "If true, the output from this Selector is - included in the Packet Report as a packet digest. - Therefore, the configured Cache Layout needs to contain - a digestHashValue field. - This parameter corresponds to the Information Element - hashDigestOutput."; - reference "RFC 5477, Section 8.3.8."; - } - leaf outputRangeMin { - type uint64; - config false; - description "Beginning of the hash function's potential - range. - This parameter corresponds to the Information Element - hashOutputRangeMin and to psampFiltHashOutputRangeMin - in the PSAMP MIB module."; - reference "RFC 5477, Section 8.3.4; RFC 6727, Section 6 - (psampFiltHashOutputRangeMin)."; - } - leaf outputRangeMax { - type uint64; - config false; - description "End of the hash function's potential range. - This parameter corresponds to the Information Element - hashOutputRangeMax and to psampFiltHashOutputRangeMax - in the PSAMP MIB module."; - reference "RFC 5477, Section 8.3.5; RFC 6727, Section 6 - (psampFiltHashOutputRangeMax)."; - } - list selectedRange { - key name; - min-elements 1; - description "List of hash function return ranges for - which packets are selected."; - leaf name { - type nameType; - description "Key of this list."; - } - leaf min { - type uint64; - description "Beginning of the hash function's selected - range. - This parameter corresponds to the Information Element - hashSelectedRangeMin and to psampFiltHashSelectedRangeMin - in the PSAMP MIB module."; - reference "RFC 5477, Section 8.3.6; RFC 6727, Section 6 - (psampFiltHashSelectedRangeMin)."; - } - leaf max { - type uint64; - description "End of the hash function's selected range. - This parameter corresponds to the Information Element - hashSelectedRangeMax and to psampFiltHashSelectedRangeMax - in the PSAMP MIB module."; - reference "RFC 5477, Section 8.3.7; RFC 6727, Section 6 - (psampFiltHashSelectedRangeMax)."; - } - } - } - - grouping selectorParameters { - description "Configuration and state parameters of a Selector."; - choice Method { - mandatory true; - description "Packet selection method applied by the Selector."; - leaf selectAll { - type empty; - description "Method that selects all packets."; - } - container sampCountBased { - if-feature psampSampCountBased; - description "Systematic count-based packet Sampling."; - uses sampCountBasedParameters; - } - container sampTimeBased { - if-feature psampSampTimeBased; - description "Systematic time-based packet Sampling."; - uses sampTimeBasedParameters; - } - container sampRandOutOfN { - if-feature psampSampRandOutOfN; - description "n-out-of-N packet Sampling."; - uses sampRandOutOfNParameters; - } - container sampUniProb { - if-feature psampSampUniProb; - description "Uniform probabilistic packet Sampling."; - uses sampUniProbParameters; - } - container filterMatch { - if-feature psampFilterMatch; - description "Property match Filtering."; - uses filterMatchParameters; - } - container filterHash { - if-feature psampFilterHash; - description "Hash-based Filtering."; - uses filterHashParameters; - } - } - leaf packetsObserved { - type yang:counter64; - config false; - description "The number of packets observed at the input of - the Selector. - If this is the first Selector in the Selection Process, - this counter corresponds to the total number of packets in - all Observed Packet Streams at the input of the Selection - Process. Otherwise, the counter corresponds to the total - number of packets at the output of the preceding Selector. - 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 - selectorDiscontinuityTime. - Note that this parameter corresponds to - ipfixSelectorStatsPacketsObserved in the IPFIX MIB - module."; - reference "RFC 6615, Section 8 - (ipfixSelectorStatsPacketsObserved)."; - } - leaf packetsDropped { - type yang:counter64; - config false; - description "The total number of packets discarded by the - Selector. - 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 - selectorDiscontinuityTime. - Note that this parameter corresponds to - ipfixSelectorStatsPacketsDropped in the IPFIX MIB - module."; - reference "RFC 6615, Section 8 - (ipfixSelectorStatsPacketsDropped)."; - } - leaf selectorDiscontinuityTime { - type yang:date-and-time; - config false; - description "Timestamp of the most recent occasion at which - one or more of the Selector counters suffered a - discontinuity. - Note that this parameter functionally corresponds to - ipfixSelectionProcessStatsDiscontinuityTime in the IPFIX - MIB module. In contrast to - ipfixSelectionProcessStatsDiscontinuityTime, the time is - absolute and not relative to sysUpTime."; - reference "RFC 6615, Section 8 - (ipfixSelectionProcessStatsDiscontinuityTime)."; - } - } - grouping cacheLayoutParameters { - description "Cache Layout parameters used by immediateCache, - timeoutCache, naturalCache, and permanentCache."; - container cacheLayout { - description "Cache Layout parameters."; - list cacheField { - key name; - min-elements 1; - description "Superset of fields that are included in the - Packet Reports or Flow Records generated by the Cache."; - leaf name { - type nameType; - description "Key of this list."; - } - choice nameOrId { - mandatory true; - description "Name or identifier of the Information - Element."; - reference "RFC 5102, Section 2; IANA registry for IPFIX - Entities, http://www.iana.org/assignments/ipfix."; - leaf ieName { - type ieNameType; - description "Name of the Information Element."; - } - leaf ieId { - type ieIdType; - description "Identifier of the Information Element."; - } - } - leaf ieLength { - type uint16; - units octets; - description "Length of the field in which the Information - Element is encoded. A value of 65535 specifies a - variable-length Information Element. For Information - Elements of integer and float type, the field length MAY - be set to a smaller value than the standard length of - the abstract data type if the rules of reduced size - encoding are fulfilled. - If not configured by the user, this parameter is set by - the Monitoring Device."; - reference "RFC 5101, Section 6.2."; - } - leaf ieEnterpriseNumber { - type uint32; - default 0; - description "If this parameter is zero, the Information - Element is registered in the IANA registry of IPFIX - Information Elements. - If this parameter is configured with a non-zero private - enterprise number, the Information Element is - enterprise-specific. - If the enterprise number is set to 29305, this field - contains a Reverse Information Element. In this case, - the Cache MUST generate Data Records in accordance to - RFC 5103."; - reference "RFC 5101; RFC 5103; - IANA registry for Private Enterprise Numbers, - http://www.iana.org/assignments/enterprise-numbers; - IANA registry for IPFIX Entities, - http://www.iana.org/assignments/ipfix."; - } - leaf isFlowKey { - when "(name(../../..) != 'immediateCache') - and - ((count(../ieEnterpriseNumber) = 0) - or - (../ieEnterpriseNumber != 29305))" { - description "This parameter is not available for - Reverse Information Elements (which have enterprise - number 29305). It is also not available for - immediateCache."; - } - type empty; - description "If present, this is a flow key."; - } - } - } - } - - grouping flowCacheParameters { - description "Configuration and state parameters of a Cache - generating Flow Records."; - leaf maxFlows { - type uint32; - units flows; - description "This parameter configures the maximum number of - Flows in the Cache, which is the maximum number of Flows - that can be measured simultaneously. - The Monitoring Device MUST ensure that sufficient resources - are available to store the configured maximum number of - Flows. - If the maximum number of Flows is measured, an additional - Flow can be measured only if an existing entry is removed. - However, traffic that pertains to existing Flows can - continue to be measured."; - } - leaf activeTimeout { - when "(name(..) = 'timeoutCache') or - (name(..) = 'naturalCache')" { - description "This parameter is only available for - timeoutCache and naturalCache."; - } - type uint32; - units seconds; - description "This parameter configures the time in - seconds after which a Flow is expired even though packets - matching this Flow are still received by the Cache. - The parameter value zero indicates infinity, meaning that - there is no active timeout. - If not configured by the user, the Monitoring Device sets - this parameter. - Note that this parameter corresponds to - ipfixMeteringProcessCacheActiveTimeout in the IPFIX - MIB module."; - reference "RFC 6615, Section 8 - (ipfixMeteringProcessCacheActiveTimeout)."; - } - leaf idleTimeout { - when "(name(..) = 'timeoutCache') or - (name(..) = 'naturalCache')" { - description "This parameter is only available for - timeoutCache and naturalCache."; - } - type uint32; - units seconds; - description "This parameter configures the time in - seconds after which a Flow is expired if no more packets - matching this Flow are received by the Cache. - The parameter value zero indicates infinity, meaning that - there is no idle timeout. - If not configured by the user, the Monitoring Device sets - this parameter. - Note that this parameter corresponds to - ipfixMeteringProcessCacheIdleTimeout in the IPFIX - MIB module."; - reference "RFC 6615, Section 8 - (ipfixMeteringProcessCacheIdleTimeout)."; - } - leaf exportInterval { - when "name(..) = 'permanentCache'" { - description "This parameter is only available for - permanentCache."; - } - type uint32; - units seconds; - description "This parameter configures the interval (in - seconds) for periodical export of Flow Records. - If not configured by the user, the Monitoring Device sets - this parameter."; - } - leaf activeFlows { - type yang:gauge32; - units flows; - config false; - description "The number of Flows currently active in this - Cache. - Note that this parameter corresponds to - ipfixMeteringProcessCacheActiveFlows in the IPFIX MIB - module."; - reference "RFC 6615, Section 8 - (ipfixMeteringProcessCacheActiveFlows)."; - } - leaf unusedCacheEntries { - type yang:gauge32; - units flows; - config false; - description "The number of unused Cache entries in this - Cache. - Note that this parameter corresponds to - ipfixMeteringProcessCacheUnusedCacheEntries in the IPFIX - MIB module."; - reference "RFC 6615, Section 8 - (ipfixMeteringProcessCacheUnusedCacheEntries)."; - } - } - - grouping exportingProcessParameters { - description "Parameters of an Exporting Process."; - leaf exportingProcessId { - type uint32; - config false; - description "The identifier of the Exporting Process. - This parameter corresponds to the Information Element - exportingProcessId. Its occurrence helps to associate - Exporting Process parameters with Exporing Process - statistics exported by the Monitoring Device using the - Exporting Process Reliability Statistics Template as - defined by the IPFIX protocol specification."; - reference "RFC 5101, Section 4.3; IANA registry for IPFIX - Entities, http://www.iana.org/assignments/ipfix."; - } - leaf exportMode { - type identityref { - base "exportMode"; - } - default parallel; - description "This parameter determines to which configured - destination(s) the incoming Data Records are exported."; - } - list destination { - key name; - min-elements 1; - description "List of export destinations."; - leaf name { - type nameType; - description "Key of this list."; - } - choice DestinationParameters { - mandatory true; - description "Configuration parameters depend on whether - SCTP, UDP, or TCP is used as transport protocol, and - whether the destination is a file."; - container sctpExporter { - description "SCTP parameters."; - uses sctpExporterParameters; - } - container udpExporter { - if-feature udpTransport; - description "UDP parameters."; - uses udpExporterParameters; - } - container tcpExporter { - if-feature tcpTransport; - description "TCP parameters."; - uses tcpExporterParameters; - } - container fileWriter { - if-feature fileWriter; - description "File Writer parameters."; - uses fileWriterParameters; - } - } - } - list options { - key name; - description "List of options reported by the Exporting - Process."; - leaf name { - type nameType; - description "Key of this list."; - } - uses optionsParameters; - } - } - - grouping commonExporterParameters { - description "Parameters of en export destination that are - common to all transport protocols."; - leaf ipfixVersion { - type uint16; - default 10; - description "IPFIX version number."; - reference "RFC 5101."; - } - leaf destinationPort { - type inet:port-number; - description "If not configured by the user, the Monitoring - Device uses the default port number for IPFIX, which is - 4739 without TLS or DTLS and 4740 if TLS or DTLS is - activated."; - } - choice indexOrName { - description "Index or name of the interface as stored in the - ifTable of IF-MIB. - If configured, the Exporting Process MUST use the given - interface to export IPFIX Messages to the export - destination. - If omitted, the Exporting Process selects the outgoing - interface based on local routing decision and accepts - return traffic, such as transport-layer acknowledgments, - on all available interfaces."; - reference "RFC 2863."; - leaf ifIndex { - type uint32; - description "Index of an interface as stored in the ifTable - of IF-MIB."; - reference "RFC 2863."; - } - leaf ifName { - type string; - description "Name of an interface as stored in the ifTable - of IF-MIB."; - reference "RFC 2863."; - } - } - leaf sendBufferSize { - type uint32; - units bytes; - description "Size of the socket send buffer. - If not configured by the user, this parameter is set by - the Monitoring Device."; - } - leaf rateLimit { - type uint32; - units "bytes per second"; - description "Maximum number of bytes per second the Exporting - Process may export to the given destination. The number of - bytes is calculated from the lengths of the IPFIX Messages - exported. If not configured, no rate limiting is performed."; - reference "RFC 5476, Section 6.3."; - } - container transportLayerSecurity { - presence "If transportLayerSecurity is present, DTLS is - enabled if the transport protocol is SCTP or UDP, and TLS - is enabled if the transport protocol is TCP."; - description "TLS or DTLS configuration."; - uses transportLayerSecurityParameters; - } - container transportSession { - config false; - description "State parameters of the Transport Session - directed to the given destination."; - uses transportSessionParameters; - } - } - - grouping sctpExporterParameters { - description "SCTP-specific export destination parameters."; - uses commonExporterParameters; - leaf-list sourceIPAddress { - type inet:ip-address; - description "List of source IP addresses used by the - Exporting Process. - If configured, the specified addresses are eligible local - IP addresses of the multihomed SCTP endpoint. - If not configured, all locally assigned IP addresses are - eligible local IP addresses."; - reference "RFC 4960, Section 6.4."; - } - leaf-list destinationIPAddress { - type inet:ip-address; - min-elements 1; - description "One or more IP addresses of the Collecting - Process to which IPFIX Messages are sent. - The user MUST ensure that all configured IP addresses - belong to the same Collecting Process. - The Exporting Process tries to establish an SCTP - association to any of the configured destination IP - addresses."; - reference "RFC 4960, Section 6.4."; - } - leaf timedReliability { - type uint32; - units milliseconds; - default 0; - description "Lifetime in milliseconds until an IPFIX - Message containing Data Sets only is 'abandoned' due to - the timed reliability mechanism of PR-SCTP. - If this parameter is set to zero, reliable SCTP - transport is used for all Data Records. - Regardless of the value of this parameter, the Exporting - Process MAY use reliable SCTP transport for Data Sets - associated with Options Templates."; - reference "RFC 3758; RFC 4960."; - } - } - - grouping udpExporterParameters { - description "Parameters of a UDP export destination."; - uses commonExporterParameters; - leaf sourceIPAddress { - type inet:ip-address; - description "Source IP address used by the Exporting Process. - If not configured, the IP address assigned to the outgoing - interface is used as source IP address."; - } - leaf destinationIPAddress { - type inet:ip-address; - mandatory true; - description "IP address of the Collection Process to which - IPFIX Messages are sent."; - } - leaf maxPacketSize { - type uint16; - units octets; - description "This parameter specifies the maximum size of - IP packets sent to the Collector. If set to zero, the - Exporting Device MUST derive the maximum packet size - from path MTU discovery mechanisms. - If not configured by the user, this parameter is set by - the Monitoring Device."; - } - leaf templateRefreshTimeout { - type uint32; - units seconds; - default 600; - description "Sets time after which Templates are resent in the - UDP Transport Session. - Note that the configured lifetime MUST be adapted to the - templateLifeTime parameter value at the receiving Collecting - Process. - Note that this parameter corresponds to - ipfixTransportSessionTemplateRefreshTimeout in the IPFIX - MIB module."; - reference "RFC 5101, Section 10.3.6; RFC 6615, Section 8 - (ipfixTransportSessionTemplateRefreshTimeout)."; - } - leaf optionsTemplateRefreshTimeout { - type uint32; - units seconds; - default 600; - description "Sets time after which Options Templates are - resent in the UDP Transport Session. - Note that the configured lifetime MUST be adapted to the - optionsTemplateLifeTime parameter value at the receiving - Collecting Process. - Note that this parameter corresponds to - ipfixTransportSessionOptionsTemplateRefreshTimeout in the - IPFIX MIB module."; - reference "RFC 5101, Section 10.3.6; RFC 6615, Section 8 - (ipfixTransportSessionOptionsTemplateRefreshTimeout)."; - } - leaf templateRefreshPacket { - type uint32; - units "IPFIX Messages"; - description "Sets number of IPFIX Messages after which - Templates are resent in the UDP Transport Session. - Note that this parameter corresponds to - ipfixTransportSessionTemplateRefreshPacket in the IPFIX - MIB module. - If omitted, Templates are only resent after timeout."; - reference "RFC 5101, Section 10.3.6; RFC 6615, Section 8 - (ipfixTransportSessionTemplateRefreshPacket)."; - } - leaf optionsTemplateRefreshPacket { - type uint32; - units "IPFIX Messages"; - description "Sets number of IPFIX Messages after which - Options Templates are resent in the UDP Transport Session - protocol. - Note that this parameter corresponds to - ipfixTransportSessionOptionsTemplateRefreshPacket in the - IPFIX MIB module. - If omitted, Templates are only resent after timeout."; - reference "RFC 5101, Section 10.3.6; RFC 6615, Section 8 - (ipfixTransportSessionOptionsTemplateRefreshPacket)."; - } - } - - grouping tcpExporterParameters { - description "Parameters of a TCP export destination."; - uses commonExporterParameters; - leaf sourceIPAddress { - type inet:ip-address; - description "Source IP address used by the Exporting Process. - If not configured by the user, this parameter is set by - the Monitoring Device to an IP address assigned to the - outgoing interface."; - } - leaf destinationIPAddress { - type inet:ip-address; - mandatory true; - description "IP address of the Collection Process to which - IPFIX Messages are sent."; - } - } - - grouping fileWriterParameters { - description "File Writer parameters."; - leaf ipfixVersion { - type uint16; - default 10; - description "IPFIX version number."; - reference "RFC 5101."; - } - leaf file { - type inet:uri; - mandatory true; - description "URI specifying the location of the file."; - } - leaf bytes { - type yang:counter64; - units octets; - config false; - description "The number of bytes written by the File Writer. - 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 - fileWriterDiscontinuityTime."; - } - leaf messages { - type yang:counter64; - units "IPFIX Messages"; - config false; - description "The number of IPFIX Messages written by the File - Writer. - 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 - fileWriterDiscontinuityTime."; - } - leaf discardedMessages { - type yang:counter64; - units "IPFIX Messages"; - config false; - description "The number of IPFIX Messages that could not be - written by the File Writer due to internal buffer - overflows, limited storage capacity, etc. - 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 - fileWriterDiscontinuityTime."; - } - leaf records { - type yang:counter64; - units "Data Records"; - config false; - description "The number of Data Records written by the File - Writer. - 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 - fileWriterDiscontinuityTime."; - } - leaf templates { - type yang:counter32; - units "Templates"; - config false; - description "The number of Template Records (excluding - Options Template Records) written by the File Writer. - 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 - fileWriterDiscontinuityTime."; - } - leaf optionsTemplates { - type yang:counter32; - units "Options Templates"; - config false; - description "The number of Options Template Records written - by the File Writer. - 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 - fileWriterDiscontinuityTime."; - } - leaf fileWriterDiscontinuityTime { - type yang:date-and-time; - config false; - description "Timestamp of the most recent occasion at which - one or more File Writer counters suffered a discontinuity. - In contrast to discontinuity times in the IPFIX MIB module, - the time is absolute and not relative to sysUpTime."; - } - list template { - config false; - description "This list contains the Templates and Options - Templates that have been written by the File Reader. - Withdrawn or invalidated (Options) Templates MUST be removed - from this list."; - uses templateParameters; - } - } - - grouping optionsParameters { - description "Parameters specifying the data export using an - Options Template."; - leaf optionsType { - type identityref { - base "optionsType"; - } - mandatory true; - description "Type of the exported options data."; - } - leaf optionsTimeout { - type uint32; - units milliseconds; - description "Time interval for periodic export of the options - data. If set to zero, the export is triggered when the - options data has changed. - If not configured by the user, this parameter is set by the - Monitoring Device."; - } - } - - grouping collectingProcessParameters { - description "Parameters of a Collecting Process."; - list sctpCollector { - key name; - description "List of SCTP receivers (sockets) on which the - Collecting Process receives IPFIX Messages."; - leaf name { - type nameType; - description "Key of this list."; - } - uses sctpCollectorParameters; - } - list udpCollector { - if-feature udpTransport; - key name; - description "List of UDP receivers (sockets) on which the - Collecting Process receives IPFIX Messages."; - leaf name { - type nameType; - description "Key of this list."; - } - uses udpCollectorParameters; - } - list tcpCollector { - if-feature tcpTransport; - key name; - description "List of TCP receivers (sockets) on which the - Collecting Process receives IPFIX Messages."; - leaf name { - type nameType; - description "Key of this list."; - } - uses tcpCollectorParameters; - } - list fileReader { - if-feature fileReader; - key name; - description "List of File Readers from which the Collecting - Process reads IPFIX Messages."; - leaf name { - type nameType; - description "Key of this list."; - } - uses fileReaderParameters; - } - } - - grouping commonCollectorParameters { - description "Parameters of a Collecting Process that are - common to all transport protocols."; - leaf localPort { - type inet:port-number; - description "If not configured, the Monitoring Device uses the - default port number for IPFIX, which is 4739 without - TLS or DTLS and 4740 if TLS or DTLS is activated."; - } - container transportLayerSecurity { - presence "If transportLayerSecurity is present, DTLS is enabled - if the transport protocol is SCTP or UDP, and TLS is enabled - if the transport protocol is TCP."; - description "TLS or DTLS configuration."; - uses transportLayerSecurityParameters; - } - list transportSession { - config false; - description "This list contains the currently established - Transport Sessions terminating at the given socket."; - uses transportSessionParameters; - } - } - - grouping sctpCollectorParameters { - description "Parameters of a listening SCTP socket at a - Collecting Process."; - uses commonCollectorParameters; - leaf-list localIPAddress { - type inet:ip-address; - description "List of local IP addresses on which the - Collecting Process listens for IPFIX Messages. The IP - addresses are used as eligible local IP addresses of the - multihomed SCTP endpoint."; - reference "RFC 4960, Section 6.4."; - } - } - - grouping udpCollectorParameters { - description "Parameters of a listening UDP socket at a - Collecting Process."; - uses commonCollectorParameters; - leaf-list localIPAddress { - type inet:ip-address; - description "List of local IP addresses on which the Collecting - Process listens for IPFIX Messages."; - } - leaf templateLifeTime { - type uint32; - units seconds; - default 1800; - description "Sets the lifetime of Templates for all UDP - Transport Sessions terminating at this UDP socket. - Templates that are not received again within the configured - lifetime become invalid at the Collecting Process. - As specified in RFC 5101, the Template lifetime MUST be at - least three times higher than the templateRefreshTimeout - parameter value configured on the corresponding Exporting - Processes. - Note that this parameter corresponds to - ipfixTransportSessionTemplateRefreshTimeout in the IPFIX - MIB module."; - reference "RFC 5101, Section 10.3.7; RFC 6615, Section 8 - (ipfixTransportSessionTemplateRefreshTimeout)."; - } - leaf optionsTemplateLifeTime { - type uint32; - units seconds; - default 1800; - description "Sets the lifetime of Options Templates for all - UDP Transport Sessions terminating at this UDP socket. - Options Templates that are not received again within the - configured lifetime become invalid at the Collecting - Process. - As specified in RFC 5101, the Options Template lifetime MUST - be at least three times higher than the - optionsTemplateRefreshTimeout parameter value configured on - the corresponding Exporting Processes. - Note that this parameter corresponds to - ipfixTransportSessionOptionsTemplateRefreshTimeout in the - IPFIX MIB module."; - reference "RFC 5101, Section 10.3.7; RFC 6615, Section 8 - (ipfixTransportSessionOptionsTemplateRefreshTimeout)."; - } - leaf templateLifePacket { - type uint32; - units "IPFIX Messages"; - description "If this parameter is configured, Templates - defined in a UDP Transport Session become invalid if they - are neither included in a sequence of more than this number - of IPFIX Messages nor received again within the period of - time specified by templateLifeTime. - Note that this parameter corresponds to - ipfixTransportSessionTemplateRefreshPacket in the IPFIX - MIB module."; - reference "RFC 5101, Section 10.3.7; RFC 6615, Section 8 - (ipfixTransportSessionTemplateRefreshPacket)."; - } - leaf optionsTemplateLifePacket { - type uint32; - units "IPFIX Messages"; - description "If this parameter is configured, Options - Templates defined in a UDP Transport Session become - invalid if they are neither included in a sequence of more - than this number of IPFIX Messages nor received again - within the period of time specified by - optionsTemplateLifeTime. - Note that this parameter corresponds to - ipfixTransportSessionOptionsTemplateRefreshPacket in the - IPFIX MIB module."; - reference "RFC 5101, Section 10.3.7; RFC 6615, Section 8 - (ipfixTransportSessionOptionsTemplateRefreshPacket)."; - } - } - - grouping tcpCollectorParameters { - description "Parameters of a listening TCP socket at a - Collecting Process."; - uses commonCollectorParameters; - leaf-list localIPAddress { - type inet:ip-address; - description "List of local IP addresses on which the Collecting - Process listens for IPFIX Messages."; - } - } - - grouping fileReaderParameters { - description "File Reader parameters."; - leaf file { - type inet:uri; - mandatory true; - description "URI specifying the location of the file."; - } - leaf bytes { - type yang:counter64; - units octets; - config false; - description "The number of bytes read by the File Reader. - 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 - fileReaderDiscontinuityTime."; - } - leaf messages { - type yang:counter64; - units "IPFIX Messages"; - config false; - description "The number of IPFIX Messages read by the File - Reader. - 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 - fileReaderDiscontinuityTime."; - } - leaf records { - type yang:counter64; - units "Data Records"; - config false; - description "The number of Data Records read by the File - Reader. - 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 - fileReaderDiscontinuityTime."; - } - leaf templates { - type yang:counter32; - units "Templates"; - config false; - description "The number of Template Records (excluding - Options Template Records) read by the File Reader. - 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 - fileReaderDiscontinuityTime."; - } - leaf optionsTemplates { - type yang:counter32; - units "Options Templates"; - config false; - description "The number of Options Template Records read by - the File Reader. - 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 - fileReaderDiscontinuityTime."; - } - leaf fileReaderDiscontinuityTime { - type yang:date-and-time; - config false; - description "Timestamp of the most recent occasion at which - one or more File Reader counters suffered a discontinuity. - In contrast to discontinuity times in the IPFIX MIB module, - the time is absolute and not relative to sysUpTime."; - } - list template { - config false; - description "This list contains the Templates and Options - Templates that have been read by the File Reader. - Withdrawn or invalidated (Options) Template MUST be removed - from this list."; - uses templateParameters; - } - } - - grouping transportLayerSecurityParameters { - description "TLS or DTLS parameters."; - leaf-list localCertificationAuthorityDN { - type string; - description "Distinguished names of certification authorities - whose certificates may be used to identify the local - endpoint."; - reference "RFC 5280."; - } - leaf-list localSubjectDN { - type string; - description "Distinguished names that may be used in the - certificates to identify the local endpoint."; - reference "RFC 5280."; - } - leaf-list localSubjectFQDN { - type inet:domain-name; - description "Fully qualified domain names that may be used to - in the certificates to identify the local endpoint."; - reference "RFC 5280."; - } - leaf-list remoteCertificationAuthorityDN { - type string; - description "Distinguished names of certification authorities - whose certificates are accepted to authorize remote - endpoints."; - reference "RFC 5280."; - } - leaf-list remoteSubjectDN { - type string; - description "Distinguished names which are accepted in - certificates to authorize remote endpoints."; - reference "RFC 5280."; - } - leaf-list remoteSubjectFQDN { - type inet:domain-name; - description "Fully qualified domain names that are accepted in - certificates to authorize remote endpoints."; - reference "RFC 5280."; - } - } - - grouping templateParameters { - description "State parameters of a Template used by an Exporting - Process or received by a Collecting Process in a specific - Transport Session. Parameter names and semantics correspond to - the managed objects in IPFIX-MIB"; - reference "RFC 5101; RFC 6615, Section 8 (ipfixTemplateEntry, - ipfixTemplateDefinitionEntry, ipfixTemplateStatsEntry)"; - leaf observationDomainId { - type uint32; - description "The ID of the Observation Domain for which this - Template is defined. - Note that this parameter corresponds to - ipfixTemplateObservationDomainId in the IPFIX MIB module."; - reference "RFC 6615, Section 8 - (ipfixTemplateObservationDomainId)."; - } - leaf templateId { - type uint16 { - range "256..65535" { - description "Valid range of Template IDs."; - reference "RFC 5101"; - } - } - description "This number indicates the Template ID in the IPFIX - message. - Note that this parameter corresponds to ipfixTemplateId in - the IPFIX MIB module."; - reference "RFC 6615, Section 8 (ipfixTemplateId)."; - } - leaf setId { - type uint16; - description "This number indicates the Set ID of the Template. - Currently, there are two values defined. The value 2 is used - for Sets containing Template definitions. The value 3 is - used for Sets containing Options Template definitions. - Note that this parameter corresponds to ipfixTemplateSetId - in the IPFIX MIB module."; - reference "RFC 6615, Section 8 (ipfixTemplateSetId)."; - } - leaf accessTime { - type yang:date-and-time; - description "Used for Exporting Processes, this parameter - contains the time when this (Options) Template was last - sent to the Collector(s) or written to the file. - Used for Collecting Processes, this parameter contains the - time when this (Options) Template was last received from the - Exporter or read from the file. - Note that this parameter corresponds to - ipfixTemplateAccessTime in the IPFIX MIB module."; - reference "RFC 6615, Section 8 (ipfixTemplateAccessTime)."; - } - leaf templateDataRecords { - type yang:counter64; - description "The number of transmitted or received Data - Records defined by this (Options) Template. - 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 - templateDiscontinuityTime. - Note that this parameter corresponds to - ipfixTemplateDataRecords in the IPFIX MIB module."; - reference "RFC 6615, Section 8 (ipfixTemplateDataRecords)."; - } - leaf templateDiscontinuityTime { - type yang:date-and-time; - description "Timestamp of the most recent occasion at which - the counter templateDataRecords suffered a discontinuity. - Note that this parameter functionally corresponds to - ipfixTemplateDiscontinuityTime in the IPFIX MIB module. - In contrast to ipfixTemplateDiscontinuityTime, the time - is absolute and not relative to sysUpTime."; - reference "RFC 6615, Section 8 - (ipfixTemplateDiscontinuityTime)."; - } - list field { - description "This list contains the (Options) Template - fields of which the (Options) Template is defined. - The order of the list corresponds to the order of the fields - in the (Option) Template Record."; - leaf ieId { - type ieIdType; - description "This parameter indicates the Information - Element identifier of the field. - Note that this parameter corresponds to - ipfixTemplateDefinitionIeId in the IPFIX MIB module."; - reference "RFC 5101; RFC 6615, Section 8 - (ipfixTemplateDefinitionIeId)."; - } - leaf ieLength { - type uint16; - units octets; - description "This parameter indicates the length of the - Information Element of the field. - Note that this parameter corresponds to - ipfixTemplateDefinitionIeLength in the IPFIX MIB - module."; - reference "RFC 5101; RFC 6615, Section 8 - (ipfixTemplateDefinitionIeLength)."; - } - leaf ieEnterpriseNumber { - type uint32; - description "This parameter indicates the IANA enterprise - number of the authority defining the Information Element - identifier. - If the Information Element is not enterprise-specific, - this state parameter is zero. - Note that this parameter corresponds to - ipfixTemplateDefinitionIeEnterpriseNumber in the IPFIX - MIB module."; - reference "RFC 6615, Section 8 - (ipfixTemplateDefinitionIeEnterpriseNumber); - IANA registry for Private Enterprise Numbers, - http://www.iana.org/assignments/enterprise-numbers."; - } - leaf isFlowKey { - when "../../setId = 2" { - description "This parameter is available for non-Options - Templates (Set ID is 2)."; - } - type empty; - description "If present, this is a Flow Key field. - Note that this corresponds to flowKey(1) being set in - ipfixTemplateDefinitionFlags."; - reference "RFC 6615, Section 8 - (ipfixTemplateDefinitionFlags)."; - } - leaf isScope { - when "../../setId = 3" { - description "This parameter is available for Options - Templates (Set ID is 3)."; - } - type empty; - description "If present, this is a scope field. - Note that this corresponds to scope(0) being set in - ipfixTemplateDefinitionFlags."; - reference "RFC 6615, Section 8 - (ipfixTemplateDefinitionFlags)."; - } - } - } - - grouping transportSessionParameters { - description "State parameters of a Transport Session originating - from an Exporting Process or terminating at a Collecting - Process. Parameter names and semantics correspond to the - managed objects in IPFIX-MIB."; - reference "RFC 5101; RFC 6615, Section 8 - (ipfixTransportSessionEntry, - ipfixTransportSessionStatsEntry)."; - leaf ipfixVersion { - type uint16; - description "Used for Exporting Processes, this parameter - contains the version number of the IPFIX protocol that the - Exporter uses to export its data in this Transport Session. - Hence, it is identical to the value of the configuration - parameter ipfixVersion of the outer SctpExporter, - UdpExporter, or TcpExporter node. - Used for Collecting Processes, this parameter contains the - version number of the IPFIX protocol it receives for - this Transport Session. If IPFIX Messages of different - IPFIX protocol versions are received, this parameter - contains the maximum version number. - Note that this parameter corresponds to - ipfixTransportSessionIpfixVersion in the IPFIX MIB - module."; - reference "RFC 6615, Section 8 - (ipfixTransportSessionIpfixVersion)."; - } - leaf sourceAddress { - type inet:ip-address; - description "The source address of the Exporter of the - IPFIX Transport Session. - If the transport protocol is SCTP, this is one of the - potentially many IP addresses of the Exporter. - Preferably, the source IP address of the path that is - usually selected by the Exporter to send IPFIX Messages to - the Collector SHOULD be used. - Note that this parameter functionally corresponds to - ipfixTransportSessionSourceAddressType and - ipfixTransportSessionSourceAddress in the IPFIX MIB - module."; - reference "RFC 6615, Section 8 - (ipfixTransportSessionSourceAddressType, - ipfixTransportSessionSourceAddress); - RFC 4960, Section 6.4."; - } - leaf destinationAddress { - type inet:ip-address; - description "The destination address of the Collector of - the IPFIX Transport Session. - If the transport protocol is SCTP, this is one of the - potentially many IP addresses of the Collector. - Preferably, the destination IP address of the path that is - usually selected by the Exporter to send IPFIX Messages to - the Collector SHOULD be used. - Note that this parameter functionally corresponds to - ipfixTransportSessionDestinationAddressType and - ipfixTransportSessionDestinationAddress in the IPFIX MIB - module."; - reference "RFC 6615, Section 8 - (ipfixTransportSessionDestinationAddressType, - ipfixTransportSessionDestinationAddress); - RFC 4960, Section 6.4."; - } - leaf sourcePort { - type inet:port-number; - description "The transport-protocol port number of the - Exporter of the IPFIX Transport Session. - Note that this parameter corresponds to - ipfixTransportSessionSourcePort in the IPFIX MIB module."; - reference "RFC 6615, Section 8 - (ipfixTransportSessionSourcePort)."; - } - leaf destinationPort { - type inet:port-number; - description "The transport-protocol port number of the - Collector of the IPFIX Transport Session. - Note that this parameter corresponds to - ipfixTransportSessionDestinationPort in the IPFIX MIB - module."; - reference "RFC 6615, Section 8 - (ipfixTransportSessionDestinationPort)."; - } - leaf sctpAssocId { - type uint32; - description "The association ID used for the SCTP session - between the Exporter and the Collector of the IPFIX - Transport Session. It is equal to the sctpAssocId entry - in the sctpAssocTable defined in the SCTP-MIB. - This parameter is only available if the transport protocol - is SCTP and if an SNMP agent on the same Monitoring Device - enables access to the corresponding MIB objects in the - sctpAssocTable. - Note that this parameter corresponds to - ipfixTransportSessionSctpAssocId in the IPFIX MIB - module."; - reference "RFC 6615, Section 8 - (ipfixTransportSessionSctpAssocId); - RFC 3871"; - } - leaf status { - type transportSessionStatus; - description "Status of the Transport Session. - Note that this parameter corresponds to - ipfixTransportSessionStatus in the IPFIX MIB module."; - reference "RFC 6615, Section 8 (ipfixTransportSessionStatus)."; - } - leaf rate { - type yang:gauge32; - units "bytes per second"; - description "The number of bytes per second transmitted by the - Exporting Process or received by the Collecting Process. - This parameter is updated every second. - Note that this parameter corresponds to - ipfixTransportSessionRate in the IPFIX MIB module."; - reference "RFC 6615, Section 8 (ipfixTransportSessionRate)."; - } - leaf bytes { - type yang:counter64; - units bytes; - description "The number of bytes transmitted by the - Exporting Process or received by the Collecting Process. - 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 - transportSessionDiscontinuityTime. - Note that this parameter corresponds to - ipfixTransportSessionBytes in the IPFIX MIB module."; - reference "RFC 6615, Section 8 (ipfixTransportSessionBytes)."; - } - leaf messages { - type yang:counter64; - units "IPFIX Messages"; - description "The number of messages transmitted by the - Exporting Process or received by the Collecting Process. - 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 - transportSessionDiscontinuityTime. - Note that this parameter corresponds to - ipfixTransportSessionMessages in the IPFIX MIB module."; - reference "RFC 6615, Section 8 - (ipfixTransportSessionMessages)."; - } - leaf discardedMessages { - type yang:counter64; - units "IPFIX Messages"; - description "Used for Exporting Processes, this parameter - indicates the number of messages that could not be sent due - to internal buffer overflows, network congestion, routing - issues, etc. Used for Collecting Process, this parameter - indicates the number of received IPFIX Message that are - malformed, cannot be decoded, are received in the wrong - order or are missing according to the sequence number. - 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 - transportSessionDiscontinuityTime. - Note that this parameter corresponds to - ipfixTransportSessionDiscardedMessages in the IPFIX MIB - module."; - reference "RFC 6615, Section 8 - (ipfixTransportSessionDiscardedMessages)."; - } - leaf records { - type yang:counter64; - units "Data Records"; - description "The number of Data Records transmitted by the - Exporting Process or received by the Collecting Process. - 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 - transportSessionDiscontinuityTime. - Note that this parameter corresponds to - ipfixTransportSessionRecords in the IPFIX MIB module."; - reference "RFC 6615, Section 8 - (ipfixTransportSessionRecords)."; - } - leaf templates { - type yang:counter32; - units "Templates"; - description "The number of Templates transmitted by the - Exporting Process or received by the Collecting Process. - 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 - transportSessionDiscontinuityTime. - Note that this parameter corresponds to - ipfixTransportSessionTemplates in the IPFIX MIB module."; - reference "RFC 6615, Section 8 - (ipfixTransportSessionTemplates)."; - } - leaf optionsTemplates { - type yang:counter32; - units "Options Templates"; - description "The number of Option Templates transmitted by the - Exporting Process or received by the Collecting Process. - 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 - transportSessionDiscontinuityTime. - Note that this parameter corresponds to - ipfixTransportSessionOptionsTemplates in the IPFIX MIB - module."; - reference "RFC 6615, Section 8 - (ipfixTransportSessionOptionsTemplates)."; - } - leaf transportSessionStartTime { - type yang:date-and-time; - description "Timestamp of the start of the given Transport - Session. - This state parameter does not correspond to any object in - the IPFIX MIB module."; - } - leaf transportSessionDiscontinuityTime { - type yang:date-and-time; - description "Timestamp of the most recent occasion at which - one or more of the Transport Session counters suffered a - discontinuity. - Note that this parameter functionally corresponds to - ipfixTransportSessionDiscontinuityTime in the IPFIX MIB - module. In contrast to - ipfixTransportSessionDiscontinuityTime, the time is - absolute and not relative to sysUpTime."; - reference "RFC 6615, Section 8 - (ipfixTransportSessionDiscontinuityTime)."; - } - list template { - description "This list contains the Templates and Options - Templates that are transmitted by the Exporting Process - or received by the Collecting Process. - Withdrawn or invalidated (Options) Templates MUST be removed - from this list."; - uses templateParameters; - } - } - - /***************************************************************** - * Main container - *****************************************************************/ - - container ipfix { - description "Top-level node of the IPFIX/PSAMP configuration - data model."; - list collectingProcess { - if-feature collector; - key name; - description "Collecting Process of the Monitoring Device."; - leaf name { - type nameType; - description "Key of this list."; - } - uses collectingProcessParameters; - leaf-list exportingProcess { - if-feature exporter; - type leafref { path "/ipfix/exportingProcess/name"; } - description "Export of received records without any - modifications. Records are processed by all Exporting - Processes in the list."; - } - } - - list observationPoint { - if-feature meter; - key name; - description "Observation Point of the Monitoring Device."; - leaf name { - type nameType; - description "Key of this list."; - } - uses observationPointParameters; - leaf-list selectionProcess { - type leafref { path "/ipfix/selectionProcess/name"; } - description "Selection Processes in this list process - packets in parallel."; - } - } - - list selectionProcess { - if-feature meter; - key name; - description "Selection Process of the Monitoring Device."; - leaf name { - type nameType; - description "Key of this list."; - } - list selector { - key name; - min-elements 1; - ordered-by user; - description "List of Selectors that define the action of the - Selection Process on a single packet. The Selectors are - serially invoked in the same order as they appear in this - list."; - leaf name { - type nameType; - description "Key of this list."; - } - uses selectorParameters; - } - list selectionSequence { - config false; - description "This list contains the Selection Sequence IDs - that are assigned by the Monitoring Device to distinguish - different Selection Sequences passing through the - Selection Process. - As Selection Sequence IDs are unique per Observation - Domain, the corresponding Observation Domain IDs are - included as well. - With this information, it is possible to associate - Selection Sequence (Statistics) Report Interpretations - exported according to the PSAMP protocol with a Selection - Process in the configuration data."; - reference "RFC 5476."; - leaf observationDomainId { - type uint32; - description "Observation Domain ID for which the - Selection Sequence ID is assigned."; - } - leaf selectionSequenceId { - type uint64; - description "Selection Sequence ID used in the Selection - Sequence (Statistics) Report Interpretation."; - } - } - leaf cache { - type leafref { path "/ipfix/cache/name"; } - description "Cache that receives the output of the - Selection Process."; - } - } - - list cache { - if-feature meter; - key name; - description "Cache of the Monitoring Device."; - leaf name { - type nameType; - description "Key of this list."; - } - leaf meteringProcessId { - type uint32; - config false; - description "The identifier of the Metering Process this - Cache belongs to. - This parameter corresponds to the Information Element - meteringProcessId. Its occurrence helps to associate - Cache parameters with Metering Process statistics - exported by the Monitoring Device using the Metering - Process (Reliability) Statistics Template as - defined by the IPFIX protocol specification."; - reference "RFC 5101, Sections 4.1 and 4.2; - IANA registry for IPFIX Entities, - http://www.iana.org/assignments/ipfix."; - } - leaf dataRecords { - type yang:counter64; - units "Data Records"; - config false; - description "The number of Data Records generated by this - Cache. - 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 - cacheDiscontinuityTime. - Note that this parameter corresponds to - ipfixMeteringProcessDataRecords in the IPFIX MIB - module."; - reference "RFC 6615, Section 8 - (ipfixMeteringProcessDataRecords)."; - } - leaf cacheDiscontinuityTime { - type yang:date-and-time; - config false; - description "Timestamp of the most recent occasion at which - the counter dataRecords suffered a discontinuity. - Note that this parameter functionally corresponds to - ipfixMeteringProcessDiscontinuityTime in the IPFIX MIB - module. In contrast to - ipfixMeteringProcessDiscontinuityTime, the time is - absolute and not relative to sysUpTime."; - reference "RFC 6615, Section 8 - (ipfixMeteringProcessDiscontinuityTime)."; - } - choice CacheType { - mandatory true; - description "Type of Cache and specific parameters."; - container immediateCache { - if-feature immediateCache; - description "Flow expiration after the first packet; - generation of Packet Records."; - uses cacheLayoutParameters; - } - container timeoutCache { - if-feature timeoutCache; - description "Flow expiration after active and idle - timeout; generation of Flow Records."; - uses flowCacheParameters; - uses cacheLayoutParameters; - } - container naturalCache { - if-feature naturalCache; - description "Flow expiration after active and idle - timeout, or on natural termination (e.g., TCP FIN or - TCP RST) of the Flow; generation of Flow Records."; - uses flowCacheParameters; - uses cacheLayoutParameters; - } - container permanentCache { - if-feature permanentCache; - description "No flow expiration, periodical export with - time interval exportInterval; generation of Flow - Records."; - uses flowCacheParameters; - uses cacheLayoutParameters; - } - } - leaf-list exportingProcess { - if-feature exporter; - type leafref { path "/ipfix/exportingProcess/name"; } - description "Records are exported by all Exporting Processes - in the list."; - } - } - - list exportingProcess { - if-feature exporter; - key name; - description "Exporting Process of the Monitoring Device."; - leaf name { - type nameType; - description "Key of this list."; - } - uses exportingProcessParameters; - } - } -} diff --git a/TestData/YangSource/ietf-ipv4-unicast-routing@2016-11-04.yang b/TestData/YangSource/ietf-ipv4-unicast-routing@2016-11-04.yang deleted file mode 100644 index 6ba659a..0000000 --- a/TestData/YangSource/ietf-ipv4-unicast-routing@2016-11-04.yang +++ /dev/null @@ -1,249 +0,0 @@ -module ietf-ipv4-unicast-routing { - - yang-version "1.1"; - - namespace "urn:ietf:params:xml:ns:yang:ietf-ipv4-unicast-routing"; - - prefix "v4ur"; - - import ietf-routing { - prefix "rt"; - } - - import ietf-inet-types { - prefix "inet"; - } - organization - "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; - - contact - "WG Web: - WG List: - - WG Chair: Lou Berger - - - WG Chair: Kent Watsen - - - Editor: Ladislav Lhotka - - - Editor: Acee Lindem - "; - - description - "This YANG module augments the 'ietf-routing' module with basic - configuration and state data for IPv4 unicast routing. - - Copyright (c) 2016 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 key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL - NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'MAY', and - 'OPTIONAL' in the module text are to be interpreted as described - in RFC 2119. - - This version of this YANG module is part of RFC 8022; - see the RFC itself for full legal notices."; - - revision 2016-11-04 { - description - "Initial revision."; - reference - "RFC 8022: A YANG Data Model for Routing Management"; - } - - /* Identities */ - - identity ipv4-unicast { - base rt:ipv4; - description - "This identity represents the IPv4 unicast address family."; - } - - /* State data */ - - augment "/rt:routing-state/rt:ribs/rt:rib/rt:routes/rt:route" { - when "derived-from-or-self(../../rt:address-family, " - + "'v4ur:ipv4-unicast')" { - description - "This augment is valid only for IPv4 unicast."; - } - description - "This leaf augments an IPv4 unicast route."; - leaf destination-prefix { - type inet:ipv4-prefix; - description - "IPv4 destination prefix."; - } - } - - augment "/rt:routing-state/rt:ribs/rt:rib/rt:routes/rt:route/" - + "rt:next-hop/rt:next-hop-options/rt:simple-next-hop" { - when "derived-from-or-self(../../../rt:address-family, " - + "'v4ur:ipv4-unicast')" { - description - "This augment is valid only for IPv4 unicast."; - } - description - "Augment 'simple-next-hop' case in IPv4 unicast routes."; - leaf next-hop-address { - type inet:ipv4-address; - description - "IPv4 address of the next hop."; - } - } - - augment "/rt:routing-state/rt:ribs/rt:rib/rt:routes/rt:route/" - + "rt:next-hop/rt:next-hop-options/rt:next-hop-list/" - + "rt:next-hop-list/rt:next-hop" { - when "derived-from-or-self(../../../../../rt:address-family, " - + "'v4ur:ipv4-unicast')" { - description - "This augment is valid only for IPv4 unicast."; - } - description - "This leaf augments the 'next-hop-list' case of IPv4 unicast - routes."; - leaf address { - type inet:ipv4-address; - description - "IPv4 address of the next-hop."; - } - } - - augment - "/rt:routing-state/rt:ribs/rt:rib/rt:active-route/rt:input" { - when "derived-from-or-self(../rt:address-family, " - + "'v4ur:ipv4-unicast')" { - description - "This augment is valid only for IPv4 unicast RIBs."; - } - description - "This augment adds the input parameter of the 'active-route' - action."; - leaf destination-address { - type inet:ipv4-address; - description - "IPv4 destination address."; - } - } - - augment "/rt:routing-state/rt:ribs/rt:rib/rt:active-route/" - + "rt:output/rt:route" { - when "derived-from-or-self(../../rt:address-family, " - + "'v4ur:ipv4-unicast')" { - description - "This augment is valid only for IPv4 unicast."; - } - description - "This augment adds the destination prefix to the reply of the - 'active-route' action."; - leaf destination-prefix { - type inet:ipv4-prefix; - description - "IPv4 destination prefix."; - } - } - - augment "/rt:routing-state/rt:ribs/rt:rib/rt:active-route/" - + "rt:output/rt:route/rt:next-hop/rt:next-hop-options/" - + "rt:simple-next-hop" { - when "derived-from-or-self(../../../rt:address-family, " - + "'v4ur:ipv4-unicast')" { - description - "This augment is valid only for IPv4 unicast."; - } - description - "Augment 'simple-next-hop' case in the reply to the - 'active-route' action."; - leaf next-hop-address { - type inet:ipv4-address; - description - "IPv4 address of the next hop."; - } - } - - augment "/rt:routing-state/rt:ribs/rt:rib/rt:active-route/" - + "rt:output/rt:route/rt:next-hop/rt:next-hop-options/" - + "rt:next-hop-list/rt:next-hop-list/rt:next-hop" { - when "derived-from-or-self(../../../../../rt:address-family, " - + "'v4ur:ipv4-unicast')" { - description - "This augment is valid only for IPv4 unicast."; - } - description - "Augment 'next-hop-list' case in the reply to the - 'active-route' action."; - leaf next-hop-address { - type inet:ipv4-address; - description - "IPv4 address of the next hop."; - } - } - - /* Configuration data */ - - augment "/rt:routing/rt:control-plane-protocols/" - + "rt:control-plane-protocol/rt:static-routes" { - description - "This augment defines the configuration of the 'static' - pseudo-protocol with data specific to IPv4 unicast."; - container ipv4 { - description - "Configuration of a 'static' pseudo-protocol instance - consists of a list of routes."; - list route { - key "destination-prefix"; - description - "A list of static routes."; - leaf destination-prefix { - type inet:ipv4-prefix; - mandatory "true"; - description - "IPv4 destination prefix."; - } - leaf description { - type string; - description - "Textual description of the route."; - } - container next-hop { - description - "Configuration of next-hop."; - uses rt:next-hop-content { - augment "next-hop-options/simple-next-hop" { - description - "Augment 'simple-next-hop' case in IPv4 static - routes."; - leaf next-hop-address { - type inet:ipv4-address; - description - "IPv4 address of the next hop."; - } - } - augment "next-hop-options/next-hop-list/next-hop-list/" - + "next-hop" { - description - "Augment 'next-hop-list' case in IPv4 static - routes."; - leaf next-hop-address { - type inet:ipv4-address; - description - "IPv4 address of the next hop."; - } - } - } - } - } - } - } -} diff --git a/TestData/YangSource/ietf-ipv6-router-advertisements@2016-11-04.yang b/TestData/YangSource/ietf-ipv6-router-advertisements@2016-11-04.yang deleted file mode 100644 index 4f9b877..0000000 --- a/TestData/YangSource/ietf-ipv6-router-advertisements@2016-11-04.yang +++ /dev/null @@ -1,469 +0,0 @@ -submodule ietf-ipv6-router-advertisements { - - yang-version "1.1"; - - belongs-to ietf-ipv6-unicast-routing { - prefix "v6ur"; - } - - import ietf-inet-types { - prefix "inet"; - } - - import ietf-interfaces { - prefix "if"; - } - - import ietf-ip { - prefix "ip"; - } - - organization - "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; - contact - "WG Web: - WG List: - - WG Chair: Lou Berger - - - WG Chair: Kent Watsen - - - Editor: Ladislav Lhotka - - - Editor: Acee Lindem - "; - - description - "This YANG module augments the 'ietf-ip' module with - configuration and state data of IPv6 router advertisements. - - Copyright (c) 2016 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 key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL - NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'MAY', and - 'OPTIONAL' in the module text are to be interpreted as described - in RFC 2119. - - This version of this YANG module is part of RFC 8022; - see the RFC itself for full legal notices."; - - reference - "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)."; - - revision 2016-11-04 { - description - "Initial revision."; - reference - "RFC 8022: A YANG Data Model for Routing Management"; - } - - /* State data */ - - augment "/if:interfaces-state/if:interface/ip:ipv6" { - description - "Augment interface state data with parameters of IPv6 router - advertisements."; - container ipv6-router-advertisements { - description - "Parameters of IPv6 Router Advertisements."; - leaf send-advertisements { - type boolean; - description - "A flag indicating whether or not the router sends periodic - Router Advertisements and responds to Router - Solicitations."; - } - leaf max-rtr-adv-interval { - type uint16 { - range "4..1800"; - } - units "seconds"; - description - "The maximum time allowed between sending unsolicited - multicast Router Advertisements from the interface."; - } - leaf min-rtr-adv-interval { - type uint16 { - range "3..1350"; - } - units "seconds"; - description - "The minimum time allowed between sending unsolicited - multicast Router Advertisements from the interface."; - } - leaf managed-flag { - type boolean; - description - "The value that is placed in the 'Managed address - configuration' flag field in the Router Advertisement."; - } - leaf other-config-flag { - type boolean; - description - "The value that is placed in the 'Other configuration' flag - field in the Router Advertisement."; - } - leaf link-mtu { - type uint32; - description - "The value that is placed in MTU options sent by the - router. A value of zero indicates that no MTU options are - sent."; - } - leaf reachable-time { - type uint32 { - range "0..3600000"; - } - units "milliseconds"; - description - "The value that is placed in the Reachable Time field in - the Router Advertisement messages sent by the router. A - value of zero means unspecified (by this router)."; - } - leaf retrans-timer { - type uint32; - units "milliseconds"; - description - "The value that is placed in the Retrans Timer field in the - Router Advertisement messages sent by the router. A value - of zero means unspecified (by this router)."; - } - - leaf cur-hop-limit { - type uint8; - description - "The value that is placed in the Cur Hop Limit field in the - Router Advertisement messages sent by the router. A value - of zero means unspecified (by this router)."; - } - leaf default-lifetime { - type uint16 { - range "0..9000"; - } - units "seconds"; - description - "The value that is placed in the Router Lifetime field of - Router Advertisements sent from the interface, in seconds. - A value of zero indicates that the router is not to be - used as a default router."; - } - container prefix-list { - description - "A list of prefixes that are placed in Prefix Information - options in Router Advertisement messages sent from the - interface. - - By default, these are all prefixes that the router - advertises via routing protocols as being on-link for the - interface from which the advertisement is sent."; - list prefix { - key "prefix-spec"; - description - "Advertised prefix entry and its parameters."; - leaf prefix-spec { - type inet:ipv6-prefix; - description - "IPv6 address prefix."; - } - leaf valid-lifetime { - type uint32; - units "seconds"; - description - "The value that is placed in the Valid Lifetime in the - Prefix Information option. The designated value of - all 1's (0xffffffff) represents infinity. - - An implementation SHOULD keep this value constant in - consecutive advertisements except when it is - explicitly changed in configuration."; - } - leaf on-link-flag { - type boolean; - description - "The value that is placed in the on-link flag ('L-bit') - field in the Prefix Information option."; - } - leaf preferred-lifetime { - type uint32; - units "seconds"; - description - "The value that is placed in the Preferred Lifetime in - the Prefix Information option, in seconds. The - designated value of all 1's (0xffffffff) represents - infinity. - - An implementation SHOULD keep this value constant in - consecutive advertisements except when it is - explicitly changed in configuration."; - } - leaf autonomous-flag { - type boolean; - description - "The value that is placed in the Autonomous Flag field - in the Prefix Information option."; - } - } - } - } - } - - /* Configuration data */ - - augment "/if:interfaces/if:interface/ip:ipv6" { - description - "Augment interface configuration with parameters of IPv6 router - advertisements."; - container ipv6-router-advertisements { - description - "Configuration of IPv6 Router Advertisements."; - leaf send-advertisements { - type boolean; - default "false"; - description - "A flag indicating whether or not the router sends periodic - Router Advertisements and responds to Router - Solicitations."; - reference - "RFC 4861: Neighbor Discovery for IP version 6 (IPv6) - - AdvSendAdvertisements."; - } - leaf max-rtr-adv-interval { - type uint16 { - range "4..1800"; - } - units "seconds"; - default "600"; - description - "The maximum time allowed between sending unsolicited - multicast Router Advertisements from the interface."; - reference - "RFC 4861: Neighbor Discovery for IP version 6 (IPv6) - - MaxRtrAdvInterval."; - } - leaf min-rtr-adv-interval { - type uint16 { - range "3..1350"; - } - units "seconds"; - must ". <= 0.75 * ../max-rtr-adv-interval" { - description - "The value MUST NOT be greater than 75% of - 'max-rtr-adv-interval'."; - } - description - "The minimum time allowed between sending unsolicited - multicast Router Advertisements from the interface. - - The default value to be used operationally if this leaf is - not configured is determined as follows: - - - if max-rtr-adv-interval >= 9 seconds, the default - value is 0.33 * max-rtr-adv-interval; - - - otherwise, it is 0.75 * max-rtr-adv-interval."; - reference - "RFC 4861: Neighbor Discovery for IP version 6 (IPv6) - - MinRtrAdvInterval."; - } - leaf managed-flag { - type boolean; - default "false"; - description - "The value to be placed in the 'Managed address - configuration' flag field in the Router Advertisement."; - reference - "RFC 4861: Neighbor Discovery for IP version 6 (IPv6) - - AdvManagedFlag."; - } - leaf other-config-flag { - type boolean; - default "false"; - description - "The value to be placed in the 'Other configuration' flag - field in the Router Advertisement."; - reference - "RFC 4861: Neighbor Discovery for IP version 6 (IPv6) - - AdvOtherConfigFlag."; - } - leaf link-mtu { - type uint32; - default "0"; - description - "The value to be placed in MTU options sent by the router. - A value of zero indicates that no MTU options are sent."; - reference - "RFC 4861: Neighbor Discovery for IP version 6 (IPv6) - - AdvLinkMTU."; - } - leaf reachable-time { - type uint32 { - range "0..3600000"; - } - units "milliseconds"; - default "0"; - description - "The value to be placed in the Reachable Time field in the - Router Advertisement messages sent by the router. A value - of zero means unspecified (by this router)."; - reference - "RFC 4861: Neighbor Discovery for IP version 6 (IPv6) - - AdvReachableTime."; - } - leaf retrans-timer { - type uint32; - units "milliseconds"; - default "0"; - description - "The value to be placed in the Retrans Timer field in the - Router Advertisement messages sent by the router. A value - of zero means unspecified (by this router)."; - reference - "RFC 4861: Neighbor Discovery for IP version 6 (IPv6) - - AdvRetransTimer."; - } - leaf cur-hop-limit { - type uint8; - description - "The value to be placed in the Cur Hop Limit field in the - Router Advertisement messages sent by the router. A value - of zero means unspecified (by this router). - - If this parameter is not configured, the device SHOULD use - the value specified in IANA Assigned Numbers that was in - effect at the time of implementation."; - reference - "RFC 4861: Neighbor Discovery for IP version 6 (IPv6) - - AdvCurHopLimit. - - IANA: IP Parameters, - http://www.iana.org/assignments/ip-parameters"; - } - leaf default-lifetime { - type uint16 { - range "0..9000"; - } - units "seconds"; - description - "The value to be placed in the Router Lifetime field of - Router Advertisements sent from the interface, in seconds. - It MUST be either zero or between max-rtr-adv-interval and - 9000 seconds. A value of zero indicates that the router - is not to be used as a default router. These limits may - be overridden by specific documents that describe how IPv6 - operates over different link layers. - - If this parameter is not configured, the device SHOULD use - a value of 3 * max-rtr-adv-interval."; - reference - "RFC 4861: Neighbor Discovery for IP version 6 (IPv6) - - AdvDefaultLifeTime."; - } - container prefix-list { - description - "Configuration of prefixes to be placed in Prefix - Information options in Router Advertisement messages sent - from the interface. - - Prefixes that are advertised by default but do not have - their entries in the child 'prefix' list are advertised - with the default values of all parameters. - - The link-local prefix SHOULD NOT be included in the list - of advertised prefixes."; - reference - "RFC 4861: Neighbor Discovery for IP version 6 (IPv6) - - AdvPrefixList."; - list prefix { - key "prefix-spec"; - description - "Configuration of an advertised prefix entry."; - leaf prefix-spec { - type inet:ipv6-prefix; - description - "IPv6 address prefix."; - } - choice control-adv-prefixes { - default "advertise"; - description - "Either the prefix is explicitly removed from the - set of advertised prefixes, or the parameters with - which it is advertised are specified (default case)."; - leaf no-advertise { - type empty; - description - "The prefix will not be advertised. - - This can be used for removing the prefix from the - default set of advertised prefixes."; - } - case advertise { - leaf valid-lifetime { - type uint32; - units "seconds"; - default "2592000"; - description - "The value to be placed in the Valid Lifetime in - the Prefix Information option. The designated - value of all 1's (0xffffffff) represents - infinity."; - reference - "RFC 4861: Neighbor Discovery for IP version 6 - (IPv6) - AdvValidLifetime."; - } - leaf on-link-flag { - type boolean; - default "true"; - description - "The value to be placed in the on-link flag - ('L-bit') field in the Prefix Information - option."; - reference - "RFC 4861: Neighbor Discovery for IP version 6 - (IPv6) - AdvOnLinkFlag."; - } - leaf preferred-lifetime { - type uint32; - units "seconds"; - must ". <= ../valid-lifetime" { - description - "This value MUST NOT be greater than - valid-lifetime."; - } - default "604800"; - description - "The value to be placed in the Preferred Lifetime - in the Prefix Information option. The designated - value of all 1's (0xffffffff) represents - infinity."; - reference - "RFC 4861: Neighbor Discovery for IP version 6 - (IPv6) - AdvPreferredLifetime."; - } - leaf autonomous-flag { - type boolean; - default "true"; - description - "The value to be placed in the Autonomous Flag - field in the Prefix Information option."; - reference - "RFC 4861: Neighbor Discovery for IP version 6 - (IPv6) - AdvAutonomousFlag."; - } - } - } - } - } - } - } -} diff --git a/TestData/YangSource/ietf-ipv6-unicast-routing@2016-11-04.yang b/TestData/YangSource/ietf-ipv6-unicast-routing@2016-11-04.yang deleted file mode 100644 index f7e258e..0000000 --- a/TestData/YangSource/ietf-ipv6-unicast-routing@2016-11-04.yang +++ /dev/null @@ -1,254 +0,0 @@ -module ietf-ipv6-unicast-routing { - - yang-version "1.1"; - - namespace "urn:ietf:params:xml:ns:yang:ietf-ipv6-unicast-routing"; - - prefix "v6ur"; - - import ietf-routing { - prefix "rt"; - } - - import ietf-inet-types { - prefix "inet"; - } - - include ietf-ipv6-router-advertisements { - revision-date 2016-11-04; - } - - organization - "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; - - contact - "WG Web: - WG List: - - WG Chair: Lou Berger - - - WG Chair: Kent Watsen - - - Editor: Ladislav Lhotka - - - Editor: Acee Lindem - "; - - description - "This YANG module augments the 'ietf-routing' module with basic - configuration and state data for IPv6 unicast routing. - - Copyright (c) 2016 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 key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL - NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'MAY', and - 'OPTIONAL' in the module text are to be interpreted as described - in RFC 2119. - - This version of this YANG module is part of RFC 8022; - see the RFC itself for full legal notices."; - - revision 2016-11-04 { - description - "Initial revision."; - reference - "RFC 8022: A YANG Data Model for Routing Management"; - } - - /* Identities */ - - identity ipv6-unicast { - base rt:ipv6; - description - "This identity represents the IPv6 unicast address family."; - } - - /* State data */ - - augment "/rt:routing-state/rt:ribs/rt:rib/rt:routes/rt:route" { - when "derived-from-or-self(../../rt:address-family, " - + "'v6ur:ipv6-unicast')" { - description - "This augment is valid only for IPv6 unicast."; - } - description - "This leaf augments an IPv6 unicast route."; - leaf destination-prefix { - type inet:ipv6-prefix; - description - "IPv6 destination prefix."; - } - } - - augment "/rt:routing-state/rt:ribs/rt:rib/rt:routes/rt:route/" - + "rt:next-hop/rt:next-hop-options/rt:simple-next-hop" { - when "derived-from-or-self(../../../rt:address-family, " - + "'v6ur:ipv6-unicast')" { - description - "This augment is valid only for IPv6 unicast."; - } - description - "Augment 'simple-next-hop' case in IPv6 unicast routes."; - leaf next-hop-address { - type inet:ipv6-address; - description - "IPv6 address of the next hop."; - } - } - - augment "/rt:routing-state/rt:ribs/rt:rib/rt:routes/rt:route/" - + "rt:next-hop/rt:next-hop-options/rt:next-hop-list/" - + "rt:next-hop-list/rt:next-hop" { - when "derived-from-or-self(../../../../../rt:address-family, " - + "'v6ur:ipv6-unicast')" { - description - "This augment is valid only for IPv6 unicast."; - } - description - "This leaf augments the 'next-hop-list' case of IPv6 unicast - routes."; - leaf address { - type inet:ipv6-address; - description - "IPv6 address of the next hop."; - } - } - - augment - "/rt:routing-state/rt:ribs/rt:rib/rt:active-route/rt:input" { - when "derived-from-or-self(../rt:address-family, " - + "'v6ur:ipv6-unicast')" { - description - "This augment is valid only for IPv6 unicast RIBs."; - } - description - "This augment adds the input parameter of the 'active-route' - action."; - leaf destination-address { - type inet:ipv6-address; - description - "IPv6 destination address."; - } - } - - augment "/rt:routing-state/rt:ribs/rt:rib/rt:active-route/" - + "rt:output/rt:route" { - when "derived-from-or-self(../../rt:address-family, " - + "'v6ur:ipv6-unicast')" { - description - "This augment is valid only for IPv6 unicast."; - } - description - "This augment adds the destination prefix to the reply of the - 'active-route' action."; - leaf destination-prefix { - type inet:ipv6-prefix; - description - "IPv6 destination prefix."; - } - } - - augment "/rt:routing-state/rt:ribs/rt:rib/rt:active-route/" - + "rt:output/rt:route/rt:next-hop/rt:next-hop-options/" - + "rt:simple-next-hop" { - when "derived-from-or-self(../../../rt:address-family, " - + "'v6ur:ipv6-unicast')" { - description - "This augment is valid only for IPv6 unicast."; - } - description - "Augment 'simple-next-hop' case in the reply to the - 'active-route' action."; - leaf next-hop-address { - type inet:ipv6-address; - description - "IPv6 address of the next hop."; - } - } - - augment "/rt:routing-state/rt:ribs/rt:rib/rt:active-route/" - + "rt:output/rt:route/rt:next-hop/rt:next-hop-options/" - + "rt:next-hop-list/rt:next-hop-list/rt:next-hop" { - when "derived-from-or-self(../../../../../rt:address-family, " - + "'v6ur:ipv6-unicast')" { - description - "This augment is valid only for IPv6 unicast."; - } - description - "Augment 'next-hop-list' case in the reply to the - 'active-route' action."; - leaf next-hop-address { - type inet:ipv6-address; - description - "IPv6 address of the next hop."; - } - } - - /* Configuration data */ - - augment "/rt:routing/rt:control-plane-protocols/" - + "rt:control-plane-protocol/rt:static-routes" { - description - "This augment defines the configuration of the 'static' - pseudo-protocol with data specific to IPv6 unicast."; - container ipv6 { - description - "Configuration of a 'static' pseudo-protocol instance - consists of a list of routes."; - list route { - key "destination-prefix"; - description - "A list of static routes."; - leaf destination-prefix { - type inet:ipv6-prefix; - mandatory "true"; - description - "IPv6 destination prefix."; - } - leaf description { - type string; - description - "Textual description of the route."; - } - container next-hop { - description - "Configuration of next-hop."; - uses rt:next-hop-content { - augment "next-hop-options/simple-next-hop" { - description - "Augment 'simple-next-hop' case in IPv6 static - routes."; - leaf next-hop-address { - type inet:ipv6-address; - description - "IPv6 address of the next hop."; - } - } - augment "next-hop-options/next-hop-list/next-hop-list/" - + "next-hop" { - description - "Augment 'next-hop-list' case in IPv6 static - routes."; - leaf next-hop-address { - type inet:ipv6-address; - description - "IPv6 address of the next hop."; - } - } - } - } - } - } - } -} diff --git a/TestData/YangSource/ietf-l3-unicast-topology-state.yang b/TestData/YangSource/ietf-l3-unicast-topology-state.yang deleted file mode 100644 index 50cb8bb..0000000 --- a/TestData/YangSource/ietf-l3-unicast-topology-state.yang +++ /dev/null @@ -1 +0,0 @@ -ietf-l3-unicast-topology-state@2018-02-26.yang \ No newline at end of file diff --git a/TestData/YangSource/ietf-l3-unicast-topology.yang b/TestData/YangSource/ietf-l3-unicast-topology.yang deleted file mode 100644 index 0c33f1d..0000000 --- a/TestData/YangSource/ietf-l3-unicast-topology.yang +++ /dev/null @@ -1 +0,0 @@ -ietf-l3-unicast-topology@2018-02-26.yang \ No newline at end of file diff --git a/TestData/YangSource/ietf-l3vpn-svc@2017-01-27.yang b/TestData/YangSource/ietf-l3vpn-svc@2017-01-27.yang deleted file mode 100644 index 1e86f48..0000000 --- a/TestData/YangSource/ietf-l3vpn-svc@2017-01-27.yang +++ /dev/null @@ -1,2401 +0,0 @@ -module ietf-l3vpn-svc { - namespace "urn:ietf:params:xml:ns:yang:ietf-l3vpn-svc"; - - prefix l3vpn-svc; - - import ietf-inet-types { - prefix inet; - } - - import ietf-yang-types { - prefix yang; - } - - organization - "IETF L3SM Working Group"; - - contact - "WG List: - - Editor: - L3SM WG - - Chairs: - Adrian Farrel, Qin Wu - "; - - description - "This YANG module defines a generic service configuration - model for Layer 3 VPNs. This model is common across all - vendor implementations."; - - revision 2017-01-27 { - description - "Initial document."; - reference - "RFC 8049."; - } - - /* Features */ - - feature cloud-access { - description - "Allows the VPN to connect to a CSP."; - } - feature multicast { - description - "Enables multicast capabilities in a VPN."; - } - feature ipv4 { - description - "Enables IPv4 support in a VPN."; - } - feature ipv6 { - description - "Enables IPv6 support in a VPN."; - } - feature carrierscarrier { - description - "Enables support of CsC."; - } - feature extranet-vpn { - description - "Enables support of extranet VPNs."; - } - feature site-diversity { - description - "Enables support of site diversity constraints."; - } - feature encryption { - description - "Enables support of encryption."; - } - feature qos { - description - "Enables support of classes of services."; - } - feature qos-custom { - description - "Enables support of the custom QoS profile."; - } - feature rtg-bgp { - description - "Enables support of the BGP routing protocol."; - } - - feature rtg-rip { - description - "Enables support of the RIP routing protocol."; - } - feature rtg-ospf { - description - "Enables support of the OSPF routing protocol."; - } - feature rtg-ospf-sham-link { - description - "Enables support of OSPF sham links."; - } - feature rtg-vrrp { - description - "Enables support of the VRRP routing protocol."; - } - feature fast-reroute { - description - "Enables support of Fast Reroute."; - } - feature bfd { - description - "Enables support of BFD."; - } - feature always-on { - description - "Enables support of the 'always-on' access constraint."; - } - feature requested-type { - description - "Enables support of the 'requested-type' access constraint."; - } - feature bearer-reference { - description - "Enables support of the 'bearer-reference' access constraint."; - } - - /* Typedefs */ - - typedef svc-id { - type string; - description - "Defines a type of service component identifier."; - } - - typedef template-id { - type string; - description - "Defines a type of service template identifier."; - } - - typedef address-family { - type enumeration { - enum ipv4 { - description - "IPv4 address family."; - } - enum ipv6 { - description - "IPv6 address family."; - } - } - description - "Defines a type for the address family."; - } - - /* Identities */ - - identity site-network-access-type { - description - "Base identity for site-network-access type."; - } - identity point-to-point { - base site-network-access-type; - description - "Identity for point-to-point connection."; - } - identity multipoint { - base site-network-access-type; - description - "Identity for multipoint connection. - Example: Ethernet broadcast segment."; - } - identity placement-diversity { - description - "Base identity for site placement constraints."; - } - identity bearer-diverse { - base placement-diversity; - description - "Identity for bearer diversity. - The bearers should not use common elements."; - } - identity pe-diverse { - base placement-diversity; - description - "Identity for PE diversity."; - } - identity pop-diverse { - base placement-diversity; - description - "Identity for POP diversity."; - } - identity linecard-diverse { - base placement-diversity; - description - "Identity for linecard diversity."; - } - identity same-pe { - base placement-diversity; - description - "Identity for having sites connected on the same PE."; - } - identity same-bearer { - base placement-diversity; - description - "Identity for having sites connected using the same bearer."; - } - identity customer-application { - description - "Base identity for customer application."; - } - identity web { - base customer-application; - description - "Identity for Web application (e.g., HTTP, HTTPS)."; - } - identity mail { - base customer-application; - description - "Identity for mail application."; - } - identity file-transfer { - base customer-application; - description - "Identity for file transfer application (e.g., FTP, SFTP)."; - } - - identity database { - base customer-application; - description - "Identity for database application."; - } - identity social { - base customer-application; - description - "Identity for social-network application."; - } - identity games { - base customer-application; - description - "Identity for gaming application."; - } - identity p2p { - base customer-application; - description - "Identity for peer-to-peer application."; - } - identity network-management { - base customer-application; - description - "Identity for management application - (e.g., Telnet, syslog, SNMP)."; - } - identity voice { - base customer-application; - description - "Identity for voice application."; - } - identity video { - base customer-application; - description - "Identity for video conference application."; - } - identity site-vpn-flavor { - description - "Base identity for the site VPN service flavor."; - } - identity site-vpn-flavor-single { - base site-vpn-flavor; - description - "Base identity for the site VPN service flavor. - Used when the site belongs to only one VPN."; - } - - identity site-vpn-flavor-multi { - base site-vpn-flavor; - description - "Base identity for the site VPN service flavor. - Used when a logical connection of a site - belongs to multiple VPNs."; - } - identity site-vpn-flavor-sub { - base site-vpn-flavor; - description - "Base identity for the site VPN service flavor. - Used when a site has multiple logical connections. - Each connection may belong to different multiple VPNs."; - } - identity site-vpn-flavor-nni { - base site-vpn-flavor; - description - "Base identity for the site VPN service flavor. - Used to describe an NNI option A connection."; - } - identity management { - description - "Base identity for site management scheme."; - } - identity co-managed { - base management; - description - "Base identity for co-managed site."; - } - identity customer-managed { - base management; - description - "Base identity for customer-managed site."; - } - identity provider-managed { - base management; - description - "Base identity for provider-managed site."; - } - identity address-allocation-type { - description - "Base identity for address-allocation-type for PE-CE link."; - } - identity provider-dhcp { - base address-allocation-type; - description - "Provider network provides DHCP service to customer."; - } - identity provider-dhcp-relay { - base address-allocation-type; - description - "Provider network provides DHCP relay service to customer."; - } - identity provider-dhcp-slaac { - base address-allocation-type; - description - "Provider network provides DHCP service to customer, - as well as SLAAC."; - } - identity static-address { - base address-allocation-type; - description - "Provider-to-customer addressing is static."; - } - identity slaac { - base address-allocation-type; - description - "Use IPv6 SLAAC."; - } - - identity site-role { - description - "Base identity for site type."; - } - identity any-to-any-role { - base site-role; - description - "Site in an any-to-any IP VPN."; - } - identity spoke-role { - base site-role; - description - "Spoke site in a Hub-and-Spoke IP VPN."; - } - identity hub-role { - base site-role; - description - "Hub site in a Hub-and-Spoke IP VPN."; - } - - identity vpn-topology { - description - "Base identity for VPN topology."; - } - identity any-to-any { - base vpn-topology; - description - "Identity for any-to-any VPN topology."; - } - identity hub-spoke { - base vpn-topology; - description - "Identity for Hub-and-Spoke VPN topology."; - } - identity hub-spoke-disjoint { - base vpn-topology; - description - "Identity for Hub-and-Spoke VPN topology - where Hubs cannot communicate with each other."; - } - - identity multicast-tree-type { - description - "Base identity for multicast tree type."; - } - identity ssm-tree-type { - base multicast-tree-type; - description - "Identity for SSM tree type."; - } - identity asm-tree-type { - base multicast-tree-type; - description - "Identity for ASM tree type."; - } - identity bidir-tree-type { - base multicast-tree-type; - description - "Identity for bidirectional tree type."; - } - - identity multicast-rp-discovery-type { - description - "Base identity for RP discovery type."; - } - - identity auto-rp { - base multicast-rp-discovery-type; - description - "Base identity for Auto-RP discovery type."; - } - identity static-rp { - base multicast-rp-discovery-type; - description - "Base identity for static type."; - } - identity bsr-rp { - base multicast-rp-discovery-type; - description - "Base identity for BSR discovery type."; - } - - identity routing-protocol-type { - description - "Base identity for routing protocol type."; - } - identity ospf { - base routing-protocol-type; - description - "Identity for OSPF protocol type."; - } - identity bgp { - base routing-protocol-type; - description - "Identity for BGP protocol type."; - } - identity static { - base routing-protocol-type; - description - "Identity for static routing protocol type."; - } - identity rip { - base routing-protocol-type; - description - "Identity for RIP protocol type."; - } - identity vrrp { - base routing-protocol-type; - description - "Identity for VRRP protocol type. - This is to be used when LANs are directly connected - to PE routers."; - } - - identity direct { - base routing-protocol-type; - description - "Identity for direct protocol type."; - } - - identity protocol-type { - description - "Base identity for protocol field type."; - } - identity tcp { - base protocol-type; - description - "TCP protocol type."; - } - identity udp { - base protocol-type; - description - "UDP protocol type."; - } - identity icmp { - base protocol-type; - description - "ICMP protocol type."; - } - identity icmp6 { - base protocol-type; - description - "ICMPv6 protocol type."; - } - identity gre { - base protocol-type; - description - "GRE protocol type."; - } - identity ipip { - base protocol-type; - description - "IP-in-IP protocol type."; - } - identity hop-by-hop { - base protocol-type; - description - "Hop-by-Hop IPv6 header type."; - } - - identity routing { - base protocol-type; - description - "Routing IPv6 header type."; - } - identity esp { - base protocol-type; - description - "ESP header type."; - } - identity ah { - base protocol-type; - description - "AH header type."; - } - - /* Groupings */ - - grouping vpn-service-cloud-access { - container cloud-accesses { - if-feature cloud-access; - list cloud-access { - - key cloud-identifier; - - leaf cloud-identifier { - type string; - description - "Identification of cloud service. - Local administration meaning."; - } - choice list-flavor { - case permit-any { - leaf permit-any { - type empty; - description - "Allows all sites."; - } - } - case deny-any-except { - leaf-list permit-site { - type leafref { - path "/l3vpn-svc/sites/site/site-id"; - } - description - "Site ID to be authorized."; - } - } - case permit-any-except { - leaf-list deny-site { - type leafref { - path "/l3vpn-svc/sites/site/site-id"; - } - description - "Site ID to be denied."; - } - } - description - "Choice for cloud access policy."; - } - container authorized-sites { - list authorized-site { - key site-id; - - leaf site-id { - type leafref { - path "/l3vpn-svc/sites/site/site-id"; - } - description - "Site ID."; - } - description - "List of authorized sites."; - } - description - "Configuration of authorized sites."; - } - container denied-sites { - list denied-site { - key site-id; - - leaf site-id { - type leafref { - path "/l3vpn-svc/sites/site/site-id"; - } - description - "Site ID."; - } - description - "List of denied sites."; - } - description - "Configuration of denied sites."; - } - - container address-translation { - container nat44 { - leaf enabled { - type boolean; - default false; - description - "Controls whether or not address translation is required."; - } - leaf nat44-customer-address { - type inet:ipv4-address; - must "../enabled = 'true'" { - description - "Applicable only if address translation is enabled."; - } - description - "Address to be used for translation. - This is to be used if the customer is - providing the address."; - } - description - "IPv4-to-IPv4 translation."; - } - description - "Container for NAT."; - } - description - "Cloud access configuration."; - } - description - "Container for cloud access configurations."; - } - description - "Grouping for VPN cloud definition."; - } - - grouping multicast-rp-group-cfg { - choice group-format { - case startend { - leaf group-start { - type inet:ip-address; - description - "First group address."; - } - leaf group-end { - type inet:ip-address; - description - "Last group address."; - } - } - case singleaddress { - leaf group-address { - type inet:ip-address; - description - "Group address."; - } - } - description - "Choice for group format."; - } - description - "Definition of groups for RP-to-group mapping."; - } - - grouping vpn-service-multicast { - container multicast { - if-feature multicast; - leaf enabled { - type boolean; - default false; - description - "Enables multicast."; - } - container customer-tree-flavors { - leaf-list tree-flavor { - type identityref { - base multicast-tree-type; - } - description - "Type of tree to be used."; - } - description - "Type of trees used by customer."; - } - container rp { - container rp-group-mappings { - list rp-group-mapping { - key id; - - leaf id { - type uint16; - description - "Unique identifier for the mapping."; - } - container provider-managed { - leaf enabled { - type boolean; - default false; - description - "Set to true if the RP must be a provider-managed node. - Set to false if it is a customer-managed node."; - } - leaf rp-redundancy { - when "../enabled = 'true'" { - description - "Relevant when the RP is provider-managed."; - } - type boolean; - default false; - description - "If true, a redundancy mechanism for the RP is required."; - } - leaf optimal-traffic-delivery { - when "../enabled = 'true'" { - description - "Relevant when the RP is provider-managed."; - } - type boolean; - default false; - description - "If true, the SP must ensure that - traffic uses an optimal path."; - } - description - "Parameters for a provider-managed RP."; - } - - leaf rp-address { - when "../provider-managed/enabled = 'false'" { - description - "Relevant when the RP is provider-managed."; - } - type inet:ip-address; - description - "Defines the address of the RP. - Used if the RP is customer-managed."; - } - - container groups { - list group { - key id; - - leaf id { - type uint16; - description - "Identifier for the group."; - } - uses multicast-rp-group-cfg; - description - "List of groups."; - } - - description - "Multicast groups associated with the RP."; - } - - description - "List of RP-to-group mappings."; - } - description - "RP-to-group mappings."; - } - container rp-discovery { - leaf rp-discovery-type { - type identityref { - base multicast-rp-discovery-type; - } - default static-rp; - description - "Type of RP discovery used."; - } - - container bsr-candidates { - when "../rp-discovery-type = 'bsr-rp'" { - description - "Only applicable if discovery type is BSR-RP."; - } - leaf-list bsr-candidate-address { - type inet:ip-address; - description - "Address of BSR candidate."; - } - description - "Customer BSR candidate's address."; - } - description - "RP discovery parameters."; - } - - description - "RP parameters."; - } - description - "Multicast global parameters for the VPN service."; - } - description - "Grouping for multicast VPN definition."; - } - - grouping vpn-service-mpls { - leaf carrierscarrier { - if-feature carrierscarrier; - type boolean; - default false; - description - "The VPN is using CsC, and so MPLS is required."; - } - description - "Grouping for MPLS CsC definition."; - } - - grouping customer-location-info { - container locations { - list location { - key location-id; - - leaf location-id { - type svc-id; - description - "Identifier for a particular location."; - } - leaf address { - type string; - description - "Address (number and street) of the site."; - } - leaf postal-code { - type string; - description - "Postal code of the site."; - } - leaf state { - type string; - description - "State of the site. This leaf can also be used to describe - a region for a country that does not have states."; - } - leaf city { - type string; - description - "City of the site."; - } - leaf country-code { - type string { - pattern '[A-Z]{2}'; - } - description - "Country of the site. - Expressed as ISO ALPHA-2 code."; - } - description - "Location of the site."; - } - description - "List of locations for the site."; - } - description - "This grouping defines customer location parameters."; - } - grouping site-group { - container groups { - list group { - key group-id; - - leaf group-id { - type string; - description - "Group-id the site belongs to."; - } - description - "List of group-ids."; - } - description - "Groups the site or site-network-access belongs to."; - } - description - "Grouping definition to assign - group-ids to site or site-network-access."; - } - grouping site-diversity { - container site-diversity { - if-feature site-diversity; - - uses site-group; - - description - "Diversity constraint type. - All site-network-accesses will inherit the group values - defined here."; - } - description - "This grouping defines site diversity parameters."; - } - grouping access-diversity { - container access-diversity { - if-feature site-diversity; - - uses site-group; - - container constraints { - list constraint { - key constraint-type; - - leaf constraint-type { - type identityref { - base placement-diversity; - } - description - "Diversity constraint type."; - } - container target { - choice target-flavor { - case id { - list group { - key group-id; - - leaf group-id { - type string; - description - "The constraint will be applied against - this particular group-id."; - } - description - "List of groups."; - } - } - case all-accesses { - leaf all-other-accesses { - type empty; - description - "The constraint will be applied against - all other site network accesses of this site."; - } - } - case all-groups { - leaf all-other-groups { - type empty; - description - "The constraint will be applied against - all other groups managed by the customer."; - } - } - description - "Choice for the group definition."; - } - - description - "The constraint will be applied against - this list of groups."; - } - description - "List of constraints."; - } - description - "Placement constraints for this site network access."; - } - - description - "Diversity parameters."; - } - description - "This grouping defines access diversity parameters."; - } - - grouping operational-requirements { - leaf requested-site-start { - type yang:date-and-time; - description - "Optional leaf indicating requested date and time when the - service at a particular site is expected to start."; - } - - leaf requested-site-stop { - type yang:date-and-time; - description - "Optional leaf indicating requested date and time when the - service at a particular site is expected to stop."; - } - description - "This grouping defines some operational parameters."; - } - - grouping operational-requirements-ops { - leaf actual-site-start { - type yang:date-and-time; - config false; - description - "Optional leaf indicating actual date and time when the - service at a particular site actually started."; - } - leaf actual-site-stop { - type yang:date-and-time; - config false; - description - "Optional leaf indicating actual date and time when the - service at a particular site actually stopped."; - } - description - "This grouping defines some operational parameters."; - } - - grouping flow-definition { - container match-flow { - leaf dscp { - type inet:dscp; - description - "DSCP value."; - } - leaf dot1p { - type uint8 { - range "0..7"; - } - description - "802.1p matching."; - } - leaf ipv4-src-prefix { - type inet:ipv4-prefix; - description - "Match on IPv4 src address."; - } - leaf ipv6-src-prefix { - type inet:ipv6-prefix; - description - "Match on IPv6 src address."; - } - leaf ipv4-dst-prefix { - type inet:ipv4-prefix; - description - "Match on IPv4 dst address."; - } - leaf ipv6-dst-prefix { - type inet:ipv6-prefix; - description - "Match on IPv6 dst address."; - } - leaf l4-src-port { - type inet:port-number; - description - "Match on Layer 4 src port."; - } - leaf-list target-sites { - type svc-id; - description - "Identify a site as traffic destination."; - } - container l4-src-port-range { - leaf lower-port { - type inet:port-number; - description - "Lower boundary for port."; - } - leaf upper-port { - type inet:port-number; - must ". >= ../lower-port" { - description - "Upper boundary must be higher than lower boundary."; - } - description - "Upper boundary for port."; - } - description - "Match on Layer 4 src port range."; - } - leaf l4-dst-port { - type inet:port-number; - description - "Match on Layer 4 dst port."; - } - container l4-dst-port-range { - leaf lower-port { - type inet:port-number; - description - "Lower boundary for port."; - } - - leaf upper-port { - type inet:port-number; - must ". >= ../lower-port" { - description - "Upper boundary must be higher than lower boundary."; - } - description - "Upper boundary for port."; - } - description - "Match on Layer 4 dst port range."; - } - leaf protocol-field { - type union { - type uint8; - type identityref { - base protocol-type; - } - } - description - "Match on IPv4 protocol or IPv6 Next Header field."; - } - - description - "Describes flow-matching criteria."; - } - description - "Flow definition based on criteria."; - } - grouping site-service-basic { - leaf svc-input-bandwidth { - type uint32; - units bps; - description - "From the PE's perspective, the service input - bandwidth of the connection."; - } - leaf svc-output-bandwidth { - type uint32; - units bps; - description - "From the PE's perspective, the service output - bandwidth of the connection."; - } - - leaf svc-mtu { - type uint16; - units bytes; - description - "MTU at service level. If the service is IP, - it refers to the IP MTU."; - } - description - "Defines basic service parameters for a site."; - } - grouping site-protection { - container traffic-protection { - if-feature fast-reroute; - leaf enabled { - type boolean; - default false; - description - "Enables traffic protection of access link."; - } - description - "Fast Reroute service parameters for the site."; - } - description - "Defines protection service parameters for a site."; - } - grouping site-service-mpls { - container carrierscarrier { - if-feature carrierscarrier; - leaf signalling-type { - type enumeration { - enum "ldp" { - description - "Use LDP as the signalling protocol - between the PE and the CE."; - } - enum "bgp" { - description - "Use BGP (as per RFC 3107) as the signalling protocol - between the PE and the CE. - In this case, BGP must also be configured as - the routing protocol."; - } - } - description - "MPLS signalling type."; - } - - description - "This container is used when the customer provides - MPLS-based services. This is used in the case of CsC."; - } - description - "Defines MPLS service parameters for a site."; - } - grouping site-service-qos-profile { - container qos { - if-feature qos; - container qos-classification-policy { - list rule { - key id; - ordered-by user; - - leaf id { - type uint16; - description - "ID of the rule."; - } - - choice match-type { - case match-flow { - uses flow-definition; - } - case match-application { - leaf match-application { - type identityref { - base customer-application; - } - description - "Defines the application to match."; - } - } - description - "Choice for classification."; - } - - leaf target-class-id { - type string; - description - "Identification of the class of service. - This identifier is internal to the administration."; - } - - description - "List of marking rules."; - } - description - "Configuration of the traffic classification policy."; - } - container qos-profile { - - choice qos-profile { - description - "Choice for QoS profile. - Can be standard profile or custom."; - case standard { - leaf profile { - type string; - description - "QoS profile to be used."; - } - } - case custom { - container classes { - if-feature qos-custom; - list class { - key class-id; - - leaf class-id { - type string; - description - "Identification of the class of service. - This identifier is internal to the administration."; - } - leaf rate-limit { - type uint8; - units percent; - description - "To be used if the class must be rate-limited. - Expressed as percentage of the service bandwidth."; - } - container latency { - choice flavor { - case lowest { - leaf use-lowest-latency { - type empty; - description - "The traffic class should use the path with the - lowest latency."; - } - } - - case boundary { - leaf latency-boundary { - type uint16; - units msec; - description - "The traffic class should use a path with a - defined maximum latency."; - } - } - description - "Latency constraint on the traffic class."; - } - description - "Latency constraint on the traffic class."; - } - container jitter { - choice flavor { - case lowest { - leaf use-lowest-jitter { - type empty; - description - "The traffic class should use the path with the - lowest jitter."; - } - } - case boundary { - leaf latency-boundary { - type uint32; - units usec; - description - "The traffic class should use a path with a - defined maximum jitter."; - } - } - description - "Jitter constraint on the traffic class."; - } - description - "Jitter constraint on the traffic class."; - } - container bandwidth { - leaf guaranteed-bw-percent { - type uint8; - units percent; - description - "To be used to define the guaranteed bandwidth - as a percentage of the available service bandwidth."; - } - leaf end-to-end { - type empty; - description - "Used if the bandwidth reservation - must be done on the MPLS network too."; - } - description - "Bandwidth constraint on the traffic class."; - } - description - "List of classes of services."; - } - description - "Container for list of classes of services."; - } - - } - - } - description - "QoS profile configuration."; - } - description - "QoS configuration."; - } - description - "This grouping defines QoS parameters for a site."; - } - - grouping site-security-authentication { - container authentication { - description - "Authentication parameters."; - } - description - "This grouping defines authentication parameters for a site."; - - } - grouping site-security-encryption { - container encryption { - if-feature encryption; - leaf enabled { - type boolean; - default false; - description - "If true, access encryption is required."; - } - - leaf layer { - type enumeration { - enum layer2 { - description - "Encryption will occur at Layer 2."; - } - enum layer3 { - description - "Encryption will occur at Layer 3. - For example, IPsec may be used."; - } - } - mandatory true; - description - "Layer on which encryption is applied."; - } - container encryption-profile { - choice profile { - case provider-profile { - leaf profile-name { - type string; - description - "Name of the SP profile to be applied."; - } - } - case customer-profile { - leaf algorithm { - type string; - description - "Encryption algorithm to be used."; - } - choice key-type { - case psk { - leaf preshared-key { - type string; - description - "Key coming from customer."; - } - } - case pki { - - } - description - "Type of keys to be used."; - } - } - - description - "Choice of profile."; - } - description - "Profile of encryption to be applied."; - } - description - "Encryption parameters."; - } - description - "This grouping defines encryption parameters for a site."; - } - - grouping site-attachment-bearer { - container bearer { - container requested-type { - if-feature requested-type; - leaf requested-type { - type string; - description - "Type of requested bearer: Ethernet, DSL, - Wireless, etc. Operator specific."; - } - leaf strict { - type boolean; - default false; - description - "Defines whether requested-type is a preference - or a strict requirement."; - } - description - "Container for requested-type."; - } - leaf always-on { - if-feature always-on; - type boolean; - default true; - description - "Request for an always-on access type. - For example, this could mean no dial access type."; - } - leaf bearer-reference { - if-feature bearer-reference; - type string; - description - "This is an internal reference for the SP."; - } - - description - "Bearer-specific parameters. - To be augmented."; - } - description - "Defines physical properties of a site attachment."; - } - - grouping site-routing { - container routing-protocols { - list routing-protocol { - key type; - - leaf type { - type identityref { - base routing-protocol-type; - } - description - "Type of routing protocol."; - } - - container ospf { - when "../type = 'ospf'" { - description - "Only applies when protocol is OSPF."; - } - if-feature rtg-ospf; - leaf-list address-family { - type address-family; - - description - "Address family to be activated."; - } - leaf area-address { - type yang:dotted-quad; - description - "Area address."; - } - leaf metric { - type uint16; - description - "Metric of the PE-CE link."; - } - - container sham-links { - if-feature rtg-ospf-sham-link; - list sham-link { - key target-site; - - leaf target-site { - type svc-id; - description - "Target site for the sham link connection. - The site is referred to by its ID."; - } - leaf metric { - type uint16; - description - "Metric of the sham link."; - } - description - "Creates a sham link with another site."; - } - description - "List of sham links."; - } - description - "OSPF-specific configuration."; - } - - container bgp { - - when "../type = 'bgp'" { - description - "Only applies when protocol is BGP."; - } - if-feature rtg-bgp; - leaf autonomous-system { - type uint32; - description - "AS number."; - } - leaf-list address-family { - type address-family; - - description - "Address family to be activated."; - } - description - "BGP-specific configuration."; - } - - container static { - when "../type = 'static'" { - description - "Only applies when protocol is static."; - } - - container cascaded-lan-prefixes { - list ipv4-lan-prefixes { - if-feature ipv4; - key "lan next-hop"; - - leaf lan { - type inet:ipv4-prefix; - description - "LAN prefixes."; - } - leaf lan-tag { - type string; - description - "Internal tag to be used in VPN policies."; - } - leaf next-hop { - type inet:ipv4-address; - description - "Next-hop address to use on the customer side."; - } - description - "List of LAN prefixes for the site."; - } - list ipv6-lan-prefixes { - if-feature ipv6; - key "lan next-hop"; - - leaf lan { - type inet:ipv6-prefix; - description - "LAN prefixes."; - } - leaf lan-tag { - type string; - description - "Internal tag to be used in VPN policies."; - } - leaf next-hop { - type inet:ipv6-address; - description - "Next-hop address to use on the customer side."; - } - description - "List of LAN prefixes for the site."; - } - description - "LAN prefixes from the customer."; - } - description - "Configuration specific to static routing."; - } - container rip { - - when "../type = 'rip'" { - description - "Only applies when protocol is RIP."; - } - if-feature rtg-rip; - leaf-list address-family { - type address-family; - - description - "Address family to be activated."; - } - - description - "Configuration specific to RIP routing."; - } - - container vrrp { - - when "../type = 'vrrp'" { - description - "Only applies when protocol is VRRP."; - } - if-feature rtg-vrrp; - leaf-list address-family { - type address-family; - - description - "Address family to be activated."; - } - description - "Configuration specific to VRRP routing."; - } - - description - "List of routing protocols used on - the site. This list can be augmented."; - } - description - "Defines routing protocols."; - } - description - "Grouping for routing protocols."; - } - - grouping site-attachment-ip-connection { - container ip-connection { - container ipv4 { - if-feature ipv4; - leaf address-allocation-type { - type identityref { - base address-allocation-type; - } - default "static-address"; - description - "Defines how addresses are allocated."; - } - - leaf number-of-dynamic-address { - when "../address-allocation-type = 'provider-dhcp'" { - description - "Only applies when addresses are allocated by DHCP."; - } - type uint8; - default 1; - description - "Describes the number of IP addresses the customer requires."; - } - container dhcp-relay { - when "../address-allocation-type = 'provider-dhcp-relay'" { - description - "Only applies when provider is required to implement - DHCP relay function."; - } - container customer-dhcp-servers { - leaf-list server-ip-address { - type inet:ipv4-address; - description - "IP address of customer DHCP server."; - } - description - "Container for list of customer DHCP servers."; - } - description - "DHCP relay provided by operator."; - } - container addresses { - when "../address-allocation-type = 'static-address'" { - description - "Only applies when protocol allocation type is static."; - } - leaf provider-address { - type inet:ipv4-address; - description - "Address of provider side."; - } - leaf customer-address { - type inet:ipv4-address; - description - "Address of customer side."; - } - leaf mask { - type uint8 { - range "0..31"; - } - description - "Subnet mask expressed in bits."; - } - description - "Describes IP addresses used."; - } - - description - "IPv4-specific parameters."; - - } - container ipv6 { - if-feature ipv6; - leaf address-allocation-type { - type identityref { - base address-allocation-type; - } - default "static-address"; - description - "Defines how addresses are allocated."; - } - leaf number-of-dynamic-address { - when - "../address-allocation-type = 'provider-dhcp' "+ - "or ../address-allocation-type "+ - "= 'provider-dhcp-slaac'" { - description - "Only applies when addresses are allocated by DHCP."; - } - type uint8; - default 1; - description - "Describes the number of IP addresses the customer requires."; - } - container dhcp-relay { - when "../address-allocation-type = 'provider-dhcp-relay'" { - description - "Only applies when provider is required to implement - DHCP relay function."; - } - container customer-dhcp-servers { - leaf-list server-ip-address { - type inet:ipv6-address; - description - "IP address of customer DHCP server."; - } - description - "Container for list of customer DHCP servers."; - } - description - "DHCP relay provided by operator."; - } - container addresses { - when "../address-allocation-type = 'static-address'" { - description - "Only applies when protocol allocation type is static."; - } - leaf provider-address { - type inet:ipv6-address; - description - "Address of provider side."; - } - leaf customer-address { - type inet:ipv6-address; - description - "Address of customer side."; - } - leaf mask { - type uint8 { - range "0..127"; - } - description - "Subnet mask expressed in bits."; - } - description - "Describes IP addresses used."; - } - description - "IPv6-specific parameters."; - - } - container oam { - container bfd { - if-feature bfd; - leaf enabled { - type boolean; - default false; - description - "BFD activation."; - } - - choice holdtime { - case profile { - leaf profile-name { - type string; - description - "Well-known SP profile."; - } - description - "Well-known SP profile."; - } - case fixed { - leaf fixed-value { - type uint32; - units msec; - description - "Expected holdtime expressed in msec."; - } - } - description - "Choice for holdtime flavor."; - } - description - "Container for BFD."; - } - description - "Defines the OAM mechanisms used on the connection."; - } - description - "Defines connection parameters."; - } - description - "This grouping defines IP connection parameters."; - } - - grouping site-service-multicast { - container multicast { - if-feature multicast; - leaf multicast-site-type { - type enumeration { - enum receiver-only { - description - "The site only has receivers."; - } - enum source-only { - description - "The site only has sources."; - } - enum source-receiver { - description - "The site has both sources and receivers."; - } - } - default "source-receiver"; - description - "Type of multicast site."; - } - container multicast-address-family { - leaf ipv4 { - if-feature ipv4; - type boolean; - default true; - description - "Enables IPv4 multicast."; - } - leaf ipv6 { - if-feature ipv6; - type boolean; - default false; - description - "Enables IPv6 multicast."; - } - description - "Defines protocol to carry multicast."; - } - leaf protocol-type { - type enumeration { - enum host { - description - "Hosts are directly connected to the provider network. - Host protocols such as IGMP or MLD are required."; - } - - enum router { - description - "Hosts are behind a customer router. - PIM will be implemented."; - } - enum both { - description - "Some hosts are behind a customer router, and some others - are directly connected to the provider network. - Both host and routing protocols must be used. - Typically, IGMP and PIM will be implemented."; - } - } - default "both"; - description - "Multicast protocol type to be used with the customer site."; - } - - description - "Multicast parameters for the site."; - } - description - "Multicast parameters for the site."; - } - - grouping site-management { - container management { - leaf type { - type identityref { - base management; - } - description - "Management type of the connection."; - } - description - "Management configuration."; - } - description - "Management parameters for the site."; - } - - grouping site-devices { - container devices { - must "/l3vpn-svc/sites/site/management/type = "+ - "'provider-managed' or "+ - "/l3vpn-svc/sites/site/management/type = "+ - "'co-managed'" { - description - "Applicable only for provider-managed or co-managed device."; - } - list device { - key device-id; - - leaf device-id { - type svc-id; - description - "Identifier for the device."; - } - leaf location { - type leafref { - path "/l3vpn-svc/sites/site/locations/"+ - "location/location-id"; - } - description - "Location of the device."; - } - container management { - must "/l3vpn-svc/sites/site/management/type"+ - "= 'co-managed'" { - description - "Applicable only for co-managed device."; - } - leaf address-family { - type address-family; - - description - "Address family used for management."; - } - leaf address { - type inet:ip-address; - description - "Management address."; - } - description - "Management configuration. Applicable only for - co-managed device."; - } - - description - "Device configuration."; - } - description - "List of devices requested by customer."; - } - description - "Grouping for device allocation."; - } - grouping site-vpn-flavor { - leaf site-vpn-flavor { - type identityref { - base site-vpn-flavor; - } - default site-vpn-flavor-single; - description - "Defines whether the site is, for example, - a single VPN site or a multiVPN."; - } - description - "Grouping for site VPN flavor."; - } - - grouping site-vpn-policy { - container vpn-policies { - list vpn-policy { - key vpn-policy-id; - - leaf vpn-policy-id { - type svc-id; - description - "Unique identifier for the VPN policy."; - } - - list entries { - key id; - - leaf id { - type svc-id; - description - "Unique identifier for the policy entry."; - } - - container filter { - choice lan { - case prefixes { - leaf-list ipv4-lan-prefix { - if-feature ipv4; - type inet:ipv4-prefix; - description - "List of IPv4 prefixes to be matched."; - } - leaf-list ipv6-lan-prefix { - if-feature ipv6; - type inet:ipv6-prefix; - description - "List of IPv6 prefixes to be matched."; - } - } - case lan-tag { - leaf-list lan-tag { - type string; - description - "List of 'lan-tag' items to be matched."; - } - } - description - "Choice of ways to do LAN matching."; - } - description - "If used, it permits the splitting of - site LANs among multiple VPNs. - If no filter is used, all the LANs will be - part of the same VPNs with the same role."; - } - container vpn { - leaf vpn-id { - type leafref { - path "/l3vpn-svc/vpn-services/"+ - "vpn-service/vpn-id"; - } - mandatory true; - description - "Reference to an IP VPN."; - } - - leaf site-role { - type identityref { - base site-role; - } - default any-to-any-role; - description - "Role of the site in the IP VPN."; - } - description - "List of VPNs the LAN is associated with."; - } - description - "List of entries for export policy."; - } - description - "List of VPN policies."; - } - description - "VPN policy."; - } - description - "VPN policy parameters for the site."; - } - - grouping site-maximum-routes { - container maximum-routes { - list address-family { - key af; - - leaf af { - type address-family; - - description - "Address family."; - } - leaf maximum-routes { - type uint32; - description - "Maximum prefixes the VRF can accept for this address family."; - } - description - "List of address families."; - } - - description - "Defines 'maximum-routes' for the VRF."; - } - - description - "Defines 'maximum-routes' for the site."; - } - - grouping site-security { - container security { - uses site-security-authentication; - uses site-security-encryption; - - description - "Site-specific security parameters."; - } - description - "Grouping for security parameters."; - } - - grouping site-service { - container service { - uses site-service-qos-profile; - uses site-service-mpls; - uses site-service-multicast; - - description - "Service parameters on the attachment."; - } - description - "Grouping for service parameters."; - } - - grouping site-network-access-service { - container service { - uses site-service-basic; - uses site-service-qos-profile; - uses site-service-mpls; - uses site-service-multicast; - - description - "Service parameters on the attachment."; - } - description - "Grouping for service parameters."; - } - - grouping vpn-extranet { - container extranet-vpns { - if-feature extranet-vpn; - list extranet-vpn { - key vpn-id; - - leaf vpn-id { - type svc-id; - description - "Identifies the target VPN."; - } - leaf local-sites-role { - type identityref { - base site-role; - - } - default any-to-any-role; - description - "This describes the role of the - local sites in the target VPN topology."; - } - description - "List of extranet VPNs the local VPN is attached to."; - } - description - "Container for extranet VPN configuration."; - } - description - "Grouping for extranet VPN configuration. - This provides an easy way to interconnect - all sites from two VPNs."; - } - - grouping site-attachment-availability { - container availability { - leaf access-priority { - type uint32; - default 1; - description - "Defines the priority for the access. - The higher the access-priority value, - the higher the preference of the access will be."; - } - description - "Availability parameters (used for multihoming)."; - } - - description - "Defines availability parameters for a site."; - } - - grouping access-vpn-policy { - container vpn-attachment { - - choice attachment-flavor { - case vpn-policy-id { - leaf vpn-policy-id { - type leafref { - path "/l3vpn-svc/sites/site/"+ - "vpn-policies/vpn-policy/"+ - "vpn-policy-id"; - } - description - "Reference to a VPN policy."; - } - } - case vpn-id { - leaf vpn-id { - type leafref { - path "/l3vpn-svc/vpn-services"+ - "/vpn-service/vpn-id"; - } - description - "Reference to a VPN."; - } - leaf site-role { - type identityref { - base site-role; - } - default any-to-any-role; - description - "Role of the site in the IP VPN."; - } - } - mandatory true; - description - "Choice for VPN attachment flavor."; - } - description - "Defines VPN attachment of a site."; - } - description - "Defines the VPN attachment rules for a site's logical access."; - } - - grouping vpn-svc-cfg { - leaf vpn-id { - type svc-id; - description - "VPN identifier. Local administration meaning."; - } - leaf customer-name { - type string; - description - "Name of the customer."; - } - leaf vpn-service-topology { - type identityref { - base vpn-topology; - } - default "any-to-any"; - description - "VPN service topology."; - } - - uses vpn-service-cloud-access; - uses vpn-service-multicast; - uses vpn-service-mpls; - uses vpn-extranet; - - description - "Grouping for VPN service configuration."; - } - - grouping site-top-level-cfg { - uses operational-requirements; - uses customer-location-info; - uses site-devices; - uses site-diversity; - uses site-management; - uses site-vpn-policy; - uses site-vpn-flavor; - uses site-maximum-routes; - uses site-security; - uses site-service; - uses site-protection; - uses site-routing; - - description - "Grouping for site top-level configuration."; - } - - grouping site-network-access-top-level-cfg { - leaf site-network-access-type { - type identityref { - base site-network-access-type; - } - default "point-to-point"; - description - "Describes the type of connection, e.g., - point-to-point or multipoint."; - } - - choice location-flavor { - case location { - when "/l3vpn-svc/sites/site/management/type = "+ - "'customer-managed'" { - description - "Applicable only for customer-managed device."; - } - leaf location-reference { - type leafref { - path "/l3vpn-svc/sites/site/locations/"+ - "location/location-id"; - } - description - "Location of the site-network-access."; - } - } - case device { - when "/l3vpn-svc/sites/site/management/type = "+ - "'provider-managed' or "+ - "/l3vpn-svc/sites/site/management/type = "+ - "'co-managed'" { - description - "Applicable only for provider-managed or co-managed device."; - } - leaf device-reference { - type leafref { - path "/l3vpn-svc/sites/site/devices/"+ - "device/device-id"; - } - description - "Identifier of CE to use."; - } - } - mandatory true; - description - "Choice of how to describe the site's location."; - } - uses access-diversity; - uses site-attachment-bearer; - uses site-attachment-ip-connection; - uses site-security; - uses site-network-access-service; - uses site-routing; - uses site-attachment-availability; - uses access-vpn-policy; - - description - "Grouping for site network access top-level configuration."; - } - - /* Main blocks */ - - container l3vpn-svc { - container vpn-services { - list vpn-service { - key vpn-id; - - uses vpn-svc-cfg; - - description - "List of VPN services."; - } - description - "Top-level container for the VPN services."; - } - - container sites { - list site { - key site-id; - - leaf site-id { - type svc-id; - description - "Identifier of the site."; - } - - uses site-top-level-cfg; - uses operational-requirements-ops; - - container site-network-accesses { - list site-network-access { - key site-network-access-id; - - leaf site-network-access-id { - type svc-id; - description - "Identifier for the access."; - } - uses site-network-access-top-level-cfg; - - description - "List of accesses for a site."; - } - description - "List of accesses for a site."; - } - - description - "List of sites."; - } - description - "Container for sites."; - } - - description - "Main container for L3VPN service configuration."; - } - -} diff --git a/TestData/YangSource/ietf-mpls-ldp-extended.yang b/TestData/YangSource/ietf-mpls-ldp-extended.yang deleted file mode 100644 index 1b098a4..0000000 --- a/TestData/YangSource/ietf-mpls-ldp-extended.yang +++ /dev/null @@ -1 +0,0 @@ -ietf-mpls-ldp-extended@2022-03-14.yang \ No newline at end of file diff --git a/TestData/YangSource/ietf-netconf-acm@2012-02-22.yang b/TestData/YangSource/ietf-netconf-acm@2012-02-22.yang deleted file mode 100644 index 93ac229..0000000 --- a/TestData/YangSource/ietf-netconf-acm@2012-02-22.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/TestData/YangSource/ietf-netconf-acm@2018-02-14.yang b/TestData/YangSource/ietf-netconf-acm@2018-02-14.yang deleted file mode 100644 index bf4855f..0000000 --- a/TestData/YangSource/ietf-netconf-acm@2018-02-14.yang +++ /dev/null @@ -1,464 +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: - - Author: Andy Bierman - - - Author: Martin Bjorklund - "; - - description - "Network Configuration Access Control Model. - - Copyright (c) 2012 - 2018 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 - (https://trustee.ietf.org/license-info). - - This version of this YANG module is part of RFC 8341; see - the RFC itself for full legal notices."; - - revision "2018-02-14" { - description - "Added support for YANG 1.1 actions and notifications tied to - data nodes. Clarified how NACM extensions can be used by - other data models."; - reference - "RFC 8341: Network Configuration Access Control Model"; - } - - 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, 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. - - If the NACM module is used, then it must be enabled (i.e., - /nacm/enable-nacm object equals 'true'), or this extension - is ignored. - - 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, 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. - - If the NACM module is used, then it must be enabled (i.e., - /nacm/enable-nacm object equals 'true'), or this extension - is ignored. - - 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 - "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, action, or notification 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 that 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 XML Path Language (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. - - The accessible tree includes actions and notifications tied - to data nodes."; - } - - /* - * 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 whether or not - access is granted."; - - 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, action, or notification 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 has been 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/TestData/YangSource/ietf-netconf-monitoring@2010-10-04.yang b/TestData/YangSource/ietf-netconf-monitoring@2010-10-04.yang deleted file mode 100644 index 8193cf3..0000000 --- a/TestData/YangSource/ietf-netconf-monitoring@2010-10-04.yang +++ /dev/null @@ -1,561 +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/TestData/YangSource/ietf-netconf-notifications@2012-02-06.yang b/TestData/YangSource/ietf-netconf-notifications@2012-02-06.yang deleted file mode 100644 index e0b49a6..0000000 --- a/TestData/YangSource/ietf-netconf-notifications@2012-02-06.yang +++ /dev/null @@ -1,336 +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/TestData/YangSource/ietf-netconf-partial-lock@2009-10-19.yang b/TestData/YangSource/ietf-netconf-partial-lock@2009-10-19.yang deleted file mode 100644 index 31b6e73..0000000 --- a/TestData/YangSource/ietf-netconf-partial-lock@2009-10-19.yang +++ /dev/null @@ -1,77 +0,0 @@ -module ietf-netconf-partial-lock { - - namespace urn:ietf:params:xml:ns:netconf:partial-lock:1.0; - prefix pl; - - organization "IETF Network Configuration (netconf) Working Group"; - - contact - "Netconf Working Group - Mailing list: netconf@ietf.org - Web: http://www.ietf.org/html.charters/netconf-charter.html - - Balazs Lengyel - Ericsson - balazs.lengyel@ericsson.com"; - - description - "This YANG module defines the and - operations."; - - revision 2009-10-19 { - description - "Initial version, published as RFC 5717."; - } - - typedef lock-id-type { - type uint32; - description - "A number identifying a specific partial-lock granted to a session. - It is allocated by the system, and SHOULD be used in the - partial-unlock operation."; - } - - rpc partial-lock { - description - "A NETCONF operation that locks parts of the running datastore."; - input { - leaf-list select { - type string; - min-elements 1; - description - "XPath expression that specifies the scope of the lock. - An Instance Identifier expression MUST be used unless the - :xpath capability is supported, in which case any XPath 1.0 - expression is allowed."; - } - } - output { - leaf lock-id { - type lock-id-type; - description - "Identifies the lock, if granted. The lock-id SHOULD be - used in the partial-unlock rpc."; - } - leaf-list locked-node { - type instance-identifier; - min-elements 1; - description - "List of locked nodes in the running datastore"; - } - } - } - - rpc partial-unlock { - description - "A NETCONF operation that releases a previously acquired - partial-lock."; - input { - leaf lock-id { - type lock-id-type; - description - "Identifies the lock to be released. MUST be the value - received in the response to a partial-lock operation."; - } - } - } -} diff --git a/TestData/YangSource/ietf-netconf-time@2016-01-26.yang b/TestData/YangSource/ietf-netconf-time@2016-01-26.yang deleted file mode 100644 index b5f8803..0000000 --- a/TestData/YangSource/ietf-netconf-time@2016-01-26.yang +++ /dev/null @@ -1,378 +0,0 @@ -module ietf-netconf-time { - - namespace "urn:ietf:params:xml:ns:yang:ietf-netconf-time"; - - prefix nct; - import ietf-netconf { prefix nc; } - - import ietf-yang-types { prefix yang; } - - import ietf-netconf-monitoring { prefix ncm; } - - organization - "IETF"; - - contact - "Editor: Tal Mizrahi - - Editor: Yoram Moses - "; - - description - "This module defines a capability-based extension to the - Network Configuration Protocol (NETCONF) that allows - time-triggered configuration and management operations. - This extension allows NETCONF clients to invoke configuration - updates according to scheduled times and allows NETCONF - servers to attach timestamps to the data they send to NETCONF - clients. - - Copyright (c) 2016 IETF Trust and the persons identified as - the 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)."; - - revision 2016-01-26 { - description - "Initial version."; - reference - "RFC 7758: - Time Capability in NETCONF"; - } - - typedef time-interval { - type string { - pattern '\d{2}:\d{2}:\d{2}(\.\d+)?'; - } - description - "Defines a time interval, up to 24 hours. - The format is specified as HH:mm:ss.f, - consisting of two digits for hours, - two digits for minutes, two digits - for seconds, and zero or more digits - representing second fractions."; - } - - grouping scheduling-tolerance-parameters { - leaf sched-max-future { - type time-interval; - default 00:00:15.0; - description - "When the scheduled time is in the future, i.e., greater - than the present time, this leaf defines the maximal - difference between the scheduled time - and the present time that the server is willing to - accept. If the difference exceeds this number, the - server responds with an error."; - } - - leaf sched-max-past { - type time-interval; - default 00:00:15.0; - description - "When the scheduled time is in the past, i.e., less - than the present time, this leaf defines the maximal - difference between the present time - and the scheduled time that the server is willing to - accept. If the difference exceeds this number, the - server responds with an error."; - } - - description - "Contains the parameters of the scheduling tolerance."; - } - // extending the get-config operation - augment /nc:get-config/nc:input { - leaf scheduled-time { - type yang:date-and-time; - description - "The time at which the RPC is scheduled to be performed."; - } - - leaf get-time { - type empty; - description - "Indicates that the rpc-reply should include the - execution-time."; - } - - description - "Adds the time element to ."; - } - - augment /nc:get-config/nc:output { - leaf execution-time { - type yang:date-and-time; - description - "The time at which the RPC was executed."; - } - - description - "Adds the time element to ."; - } - - augment /nc:get/nc:input { - leaf scheduled-time { - type yang:date-and-time; - description - "The time at which the RPC is scheduled to be performed."; - } - - leaf get-time { - type empty; - description - "Indicates that the rpc-reply should include the - execution-time."; - } - - description - "Adds the time element to ."; - } - - augment /nc:get/nc:output { - leaf execution-time { - type yang:date-and-time; - description - "The time at which the RPC was executed."; - } - - description - "Adds the time element to ."; - } - - augment /nc:copy-config/nc:input { - leaf scheduled-time { - type yang:date-and-time; - description - "The time at which the RPC is scheduled to be performed."; - } - - leaf get-time { - type empty; - description - "Indicates that the rpc-reply should include the - execution-time."; - } - - description - "Adds the time element to ."; - } - - augment /nc:copy-config/nc:output { - leaf execution-time { - type yang:date-and-time; - description - "The time at which the RPC was executed."; - } - - description - "Adds the time element to ."; - } - - augment /nc:edit-config/nc:input { - leaf scheduled-time { - type yang:date-and-time; - description - "The time at which the RPC is scheduled to be performed."; - } - - leaf get-time { - type empty; - description - "Indicates that the rpc-reply should include the - execution-time."; - } - - description - "Adds the time element to ."; - } - - augment /nc:edit-config/nc:output { - leaf execution-time { - type yang:date-and-time; - description - "The time at which the RPC was executed."; - } - - description - "Adds the time element to ."; - } - - augment /nc:delete-config/nc:input { - leaf scheduled-time { - type yang:date-and-time; - description - "The time at which the RPC is scheduled to be performed."; - } - - leaf get-time { - type empty; - description - "Indicates that the rpc-reply should include the - execution-time."; - } - - description - "Adds the time element to ."; - } - - augment /nc:delete-config/nc:output { - leaf execution-time { - type yang:date-and-time; - description - "The time at which the RPC was executed."; - } - description - "Adds the time element to ."; - } - - augment /nc:lock/nc:input { - leaf scheduled-time { - type yang:date-and-time; - description - "The time at which the RPC is scheduled to be performed."; - } - - leaf get-time { - type empty; - description - "Indicates that the rpc-reply should include the - execution-time."; - } - - description - "Adds the time element to ."; - } - augment /nc:lock/nc:output { - leaf execution-time { - type yang:date-and-time; - description - "The time at which the RPC was executed."; - } - - description - "Adds the time element to ."; - } - - augment /nc:unlock/nc:input { - leaf scheduled-time { - type yang:date-and-time; - description - "The time at which the RPC is scheduled to be performed."; - } - - leaf get-time { - type empty; - description - "Indicates that the rpc-reply should include the - execution-time."; - } - - description - "Adds the time element to ."; - } - - augment /nc:unlock/nc:output { - leaf execution-time { - type yang:date-and-time; - description - "The time at which the RPC was executed."; - } - - description - "Adds the time element to ."; - } - augment /nc:commit/nc:input { - leaf scheduled-time { - type yang:date-and-time; - description - "The time at which the RPC is scheduled to be performed."; - } - - leaf get-time { - type empty; - description - "Indicates that the rpc-reply should include the - execution-time."; - } - - description - "Adds the time element to ."; - } - - augment /nc:commit/nc:output { - leaf execution-time { - type yang:date-and-time; - description - "The time at which the RPC was executed."; - } - - description - "Adds the time element to ."; - } - - augment /ncm:netconf-state { - container scheduling-tolerance { - uses scheduling-tolerance-parameters; - description - "The scheduling tolerance when the time capability - is enabled."; - } - description - "The scheduling tolerance of the server."; - } - - rpc cancel-schedule { - description - "Cancels a scheduled message."; - reference - "RFC 7758: - Time Capability in NETCONF"; - - input { - leaf cancelled-message-id { - type string; - description - "The ID of the message to be cancelled."; - } - leaf get-time { - type empty; - description - "Indicates that the rpc-reply should include - the execution-time."; - } - } - output { - leaf execution-time { - type yang:date-and-time; - description - "The time at which the RPC was executed."; - } - } - } - - notification netconf-scheduled-message { - leaf schedule-id { - type string; - description - "The ID of the scheduled message."; - } - - leaf scheduled-time { - type yang:date-and-time; - description - "The time at which the RPC is scheduled to be performed."; - } - description - "Indicates that a scheduled message was received."; - reference - "RFC 7758: - Time Capability in NETCONF"; - } - -} diff --git a/TestData/YangSource/ietf-netconf-with-defaults@2011-06-01.yang b/TestData/YangSource/ietf-netconf-with-defaults@2011-06-01.yang deleted file mode 100644 index 8a7be8c..0000000 --- a/TestData/YangSource/ietf-netconf-with-defaults@2011-06-01.yang +++ /dev/null @@ -1,138 +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/TestData/YangSource/ietf-netconf@2011-06-01.yang b/TestData/YangSource/ietf-netconf@2011-06-01.yang deleted file mode 100644 index 44c19c3..0000000 --- a/TestData/YangSource/ietf-netconf@2011-06-01.yang +++ /dev/null @@ -1,927 +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/TestData/YangSource/ietf-restconf-monitoring@2017-01-26.yang b/TestData/YangSource/ietf-restconf-monitoring@2017-01-26.yang deleted file mode 100644 index e87b00b..0000000 --- a/TestData/YangSource/ietf-restconf-monitoring@2017-01-26.yang +++ /dev/null @@ -1,150 +0,0 @@ -module ietf-restconf-monitoring { - namespace "urn:ietf:params:xml:ns:yang:ietf-restconf-monitoring"; - prefix "rcmon"; - - import ietf-yang-types { prefix yang; } - import ietf-inet-types { prefix inet; } - - organization - "IETF NETCONF (Network Configuration) Working Group"; - - contact - "WG Web: - WG List: - - Author: Andy Bierman - - - Author: Martin Bjorklund - - - Author: Kent Watsen - "; - - description - "This module contains monitoring information for the - RESTCONF protocol. - - Copyright (c) 2017 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 8040; see - the RFC itself for full legal notices."; - - revision 2017-01-26 { - description - "Initial revision."; - reference - "RFC 8040: RESTCONF Protocol."; - } - - container restconf-state { - config false; - description - "Contains RESTCONF protocol monitoring information."; - - container capabilities { - description - "Contains a list of protocol capability URIs."; - - leaf-list capability { - type inet:uri; - description - "A RESTCONF protocol capability URI."; - } - } - - container streams { - description - "Container representing the notification event streams - supported by the server."; - reference - "RFC 5277, Section 3.4, element."; - - list stream { - key name; - description - "Each entry describes an event stream supported by - the server."; - - leaf name { - type string; - description - "The stream name."; - reference - "RFC 5277, Section 3.4, element."; - } - - leaf description { - type string; - description - "Description of stream content."; - reference - "RFC 5277, Section 3.4, element."; - } - - leaf replay-support { - type boolean; - default false; - description - "Indicates if replay buffer is supported for this stream. - If 'true', then the server MUST support the 'start-time' - and 'stop-time' query parameters for this stream."; - reference - "RFC 5277, Section 3.4, element."; - } - - leaf replay-log-creation-time { - when "../replay-support" { - description - "Only present if notification replay is supported."; - } - type yang:date-and-time; - description - "Indicates the time the replay log for this stream - was created."; - reference - "RFC 5277, Section 3.4, - element."; - } - - list access { - key encoding; - min-elements 1; - description - "The server will create an entry in this list for each - encoding format that is supported for this stream. - The media type 'text/event-stream' is expected - for all event streams. This list identifies the - subtypes supported for this stream."; - - leaf encoding { - type string; - description - "This is the secondary encoding format within the - 'text/event-stream' encoding used by all streams. - The type 'xml' is supported for XML encoding. - The type 'json' is supported for JSON encoding."; - } - - leaf location { - type inet:uri; - mandatory true; - description - "Contains a URL that represents the entry point - for establishing notification delivery via - server-sent events."; - } - } - } - } - } - -} diff --git a/TestData/YangSource/ietf-routing-types@2017-12-04.yang b/TestData/YangSource/ietf-routing-types@2017-12-04.yang deleted file mode 100644 index 24319c1..0000000 --- a/TestData/YangSource/ietf-routing-types@2017-12-04.yang +++ /dev/null @@ -1,771 +0,0 @@ -module ietf-routing-types { - namespace "urn:ietf:params:xml:ns:yang:ietf-routing-types"; - prefix rt-types; - - import ietf-yang-types { - prefix yang; - } - import ietf-inet-types { - prefix inet; - } - - organization - "IETF RTGWG - Routing Area Working Group"; - contact - "WG Web: - WG List: - - Editors: Xufeng Liu - - Yingzhen Qu - - Acee Lindem - - Christian Hopps - - Lou Berger - "; - - description - "This module contains a collection of YANG data types - considered generally useful for routing protocols. - - Copyright (c) 2017 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 - (https://trustee.ietf.org/license-info). - - This version of this YANG module is part of RFC 8294; see - the RFC itself for full legal notices."; - revision 2017-12-04 { - description "Initial revision."; - reference - "RFC 8294: Common YANG Data Types for the Routing Area. - Section 3."; - } - - /*** Identities related to MPLS/GMPLS ***/ - - identity mpls-label-special-purpose-value { - description - "Base identity for deriving identities describing - special-purpose Multiprotocol Label Switching (MPLS) label - values."; - reference - "RFC 7274: Allocating and Retiring Special-Purpose MPLS - Labels."; - } - - identity ipv4-explicit-null-label { - base mpls-label-special-purpose-value; - description - "This identity represents the IPv4 Explicit NULL Label."; - reference - "RFC 3032: MPLS Label Stack Encoding. Section 2.1."; - } - - identity router-alert-label { - base mpls-label-special-purpose-value; - description - "This identity represents the Router Alert Label."; - reference - "RFC 3032: MPLS Label Stack Encoding. Section 2.1."; - } - - identity ipv6-explicit-null-label { - base mpls-label-special-purpose-value; - description - "This identity represents the IPv6 Explicit NULL Label."; - reference - "RFC 3032: MPLS Label Stack Encoding. Section 2.1."; - } - - identity implicit-null-label { - base mpls-label-special-purpose-value; - description - "This identity represents the Implicit NULL Label."; - reference - "RFC 3032: MPLS Label Stack Encoding. Section 2.1."; - } - - identity entropy-label-indicator { - base mpls-label-special-purpose-value; - description - "This identity represents the Entropy Label Indicator."; - reference - "RFC 6790: The Use of Entropy Labels in MPLS Forwarding. - Sections 3 and 10.1."; - } - - identity gal-label { - base mpls-label-special-purpose-value; - description - "This identity represents the Generic Associated Channel - (G-ACh) Label (GAL)."; - reference - "RFC 5586: MPLS Generic Associated Channel. - Sections 4 and 10."; - } - - identity oam-alert-label { - base mpls-label-special-purpose-value; - description - "This identity represents the OAM Alert Label."; - reference - "RFC 3429: Assignment of the 'OAM Alert Label' for - Multiprotocol Label Switching Architecture (MPLS) - Operation and Maintenance (OAM) Functions. - Sections 3 and 6."; - } - - identity extension-label { - base mpls-label-special-purpose-value; - description - "This identity represents the Extension Label."; - reference - "RFC 7274: Allocating and Retiring Special-Purpose MPLS - Labels. Sections 3.1 and 5."; - } - - /*** Collection of types related to routing ***/ - - typedef router-id { - type yang:dotted-quad; - description - "A 32-bit number in the dotted-quad format assigned to each - router. This number uniquely identifies the router within - an Autonomous System."; - } - - /*** Collection of types related to VPNs ***/ - - typedef route-target { - type string { - pattern - '(0:(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|' - + '6[0-4][0-9]{3}|' - + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0):(429496729[0-5]|' - + '42949672[0-8][0-9]|' - + '4294967[01][0-9]{2}|429496[0-6][0-9]{3}|' - + '42949[0-5][0-9]{4}|' - + '4294[0-8][0-9]{5}|429[0-3][0-9]{6}|' - + '42[0-8][0-9]{7}|4[01][0-9]{8}|' - + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0))|' - + '(1:((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|' - + '25[0-5])\.){3}([0-9]|[1-9][0-9]|' - + '1[0-9]{2}|2[0-4][0-9]|25[0-5])):(6553[0-5]|' - + '655[0-2][0-9]|' - + '65[0-4][0-9]{2}|6[0-4][0-9]{3}|' - + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|' - + '(2:(429496729[0-5]|42949672[0-8][0-9]|' - + '4294967[01][0-9]{2}|' - + '429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|' - + '4294[0-8][0-9]{5}|' - + '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[01][0-9]{8}|' - + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0):' - + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|' - + '6[0-4][0-9]{3}|' - + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|' - + '(6(:[a-fA-F0-9]{2}){6})|' - + '(([3-57-9a-fA-F]|[1-9a-fA-F][0-9a-fA-F]{1,3}):' - + '[0-9a-fA-F]{1,12})'; - } - - description - "A Route Target is an 8-octet BGP extended community - initially identifying a set of sites in a BGP VPN - (RFC 4364). However, it has since taken on a more general - role in BGP route filtering. A Route Target consists of two - or three fields: a 2-octet Type field, an administrator - field, and, optionally, an assigned number field. - - According to the data formats for types 0, 1, 2, and 6 as - defined in RFC 4360, RFC 5668, and RFC 7432, the encoding - pattern is defined as: - - 0:2-octet-asn:4-octet-number - 1:4-octet-ipv4addr:2-octet-number - 2:4-octet-asn:2-octet-number - 6:6-octet-mac-address - - Additionally, a generic pattern is defined for future - Route Target types: - - 2-octet-other-hex-number:6-octet-hex-number - - Some valid examples are 0:100:100, 1:1.1.1.1:100, - 2:1234567890:203, and 6:26:00:08:92:78:00."; - reference - "RFC 4360: BGP Extended Communities Attribute. - RFC 4364: BGP/MPLS IP Virtual Private Networks (VPNs). - RFC 5668: 4-Octet AS Specific BGP Extended Community. - RFC 7432: BGP MPLS-Based Ethernet VPN."; - } - - typedef ipv6-route-target { - 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]|1[0-9]{2}|[1-9]?[0-9])\.){3}' - + '(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])))' - + ':' - + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|' - + '6[0-4][0-9]{3}|' - + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0)'; - pattern '((([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|' - + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?))' - + ':' - + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|' - + '6[0-4][0-9]{3}|' - + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0)'; - } - description - "An IPv6 Route Target is a 20-octet BGP IPv6 Address - Specific Extended Community serving the same function - as a standard 8-octet Route Target, except that it only - allows an IPv6 address as the global administrator. - The format is . - - Two valid examples are 2001:db8::1:6544 and - 2001:db8::5eb1:791:6b37:17958."; - reference - "RFC 5701: IPv6 Address Specific BGP Extended Community - Attribute."; - } - - typedef route-target-type { - type enumeration { - enum import { - value 0; - description - "The Route Target applies to route import."; - } - enum export { - value 1; - description - "The Route Target applies to route export."; - } - - enum both { - value 2; - description - "The Route Target applies to both route import and - route export."; - } - } - description - "Indicates the role a Route Target takes in route filtering."; - reference - "RFC 4364: BGP/MPLS IP Virtual Private Networks (VPNs)."; - } - - typedef route-distinguisher { - type string { - pattern - '(0:(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|' - + '6[0-4][0-9]{3}|' - + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0):(429496729[0-5]|' - + '42949672[0-8][0-9]|' - + '4294967[01][0-9]{2}|429496[0-6][0-9]{3}|' - + '42949[0-5][0-9]{4}|' - + '4294[0-8][0-9]{5}|429[0-3][0-9]{6}|' - + '42[0-8][0-9]{7}|4[01][0-9]{8}|' - + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0))|' - + '(1:((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|' - + '25[0-5])\.){3}([0-9]|[1-9][0-9]|' - + '1[0-9]{2}|2[0-4][0-9]|25[0-5])):(6553[0-5]|' - + '655[0-2][0-9]|' - + '65[0-4][0-9]{2}|6[0-4][0-9]{3}|' - + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|' - + '(2:(429496729[0-5]|42949672[0-8][0-9]|' - + '4294967[01][0-9]{2}|' - + '429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|' - + '4294[0-8][0-9]{5}|' - + '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[01][0-9]{8}|' - + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0):' - + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|' - + '6[0-4][0-9]{3}|' - + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|' - + '(6(:[a-fA-F0-9]{2}){6})|' - + '(([3-57-9a-fA-F]|[1-9a-fA-F][0-9a-fA-F]{1,3}):' - + '[0-9a-fA-F]{1,12})'; - } - - description - "A Route Distinguisher is an 8-octet value used to - distinguish routes from different BGP VPNs (RFC 4364). - A Route Distinguisher will have the same format as a - Route Target as per RFC 4360 and will consist of - two or three fields: a 2-octet Type field, an administrator - field, and, optionally, an assigned number field. - - According to the data formats for types 0, 1, 2, and 6 as - defined in RFC 4360, RFC 5668, and RFC 7432, the encoding - pattern is defined as: - - 0:2-octet-asn:4-octet-number - 1:4-octet-ipv4addr:2-octet-number - 2:4-octet-asn:2-octet-number - 6:6-octet-mac-address - - Additionally, a generic pattern is defined for future - route discriminator types: - - 2-octet-other-hex-number:6-octet-hex-number - - Some valid examples are 0:100:100, 1:1.1.1.1:100, - 2:1234567890:203, and 6:26:00:08:92:78:00."; - reference - "RFC 4360: BGP Extended Communities Attribute. - RFC 4364: BGP/MPLS IP Virtual Private Networks (VPNs). - RFC 5668: 4-Octet AS Specific BGP Extended Community. - RFC 7432: BGP MPLS-Based Ethernet VPN."; - } - - typedef route-origin { - type string { - pattern - '(0:(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|' - + '6[0-4][0-9]{3}|' - + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0):(429496729[0-5]|' - + '42949672[0-8][0-9]|' - + '4294967[01][0-9]{2}|429496[0-6][0-9]{3}|' - + '42949[0-5][0-9]{4}|' - + '4294[0-8][0-9]{5}|429[0-3][0-9]{6}|' - + '42[0-8][0-9]{7}|4[01][0-9]{8}|' - + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0))|' - + '(1:((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|' - + '25[0-5])\.){3}([0-9]|[1-9][0-9]|' - + '1[0-9]{2}|2[0-4][0-9]|25[0-5])):(6553[0-5]|' - + '655[0-2][0-9]|' - + '65[0-4][0-9]{2}|6[0-4][0-9]{3}|' - + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|' - + '(2:(429496729[0-5]|42949672[0-8][0-9]|' - + '4294967[01][0-9]{2}|' - + '429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|' - + '4294[0-8][0-9]{5}|' - + '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[01][0-9]{8}|' - + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0):' - + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|' - + '6[0-4][0-9]{3}|' - + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|' - + '(6(:[a-fA-F0-9]{2}){6})|' - + '(([3-57-9a-fA-F]|[1-9a-fA-F][0-9a-fA-F]{1,3}):' - + '[0-9a-fA-F]{1,12})'; - } - description - "A Route Origin is an 8-octet BGP extended community - identifying the set of sites where the BGP route - originated (RFC 4364). A Route Origin will have the same - format as a Route Target as per RFC 4360 and will consist - of two or three fields: a 2-octet Type field, an - administrator field, and, optionally, an assigned number - field. - - According to the data formats for types 0, 1, 2, and 6 as - defined in RFC 4360, RFC 5668, and RFC 7432, the encoding - pattern is defined as: - - 0:2-octet-asn:4-octet-number - 1:4-octet-ipv4addr:2-octet-number - 2:4-octet-asn:2-octet-number - 6:6-octet-mac-address - Additionally, a generic pattern is defined for future - Route Origin types: - - 2-octet-other-hex-number:6-octet-hex-number - - Some valid examples are 0:100:100, 1:1.1.1.1:100, - 2:1234567890:203, and 6:26:00:08:92:78:00."; - reference - "RFC 4360: BGP Extended Communities Attribute. - RFC 4364: BGP/MPLS IP Virtual Private Networks (VPNs). - RFC 5668: 4-Octet AS Specific BGP Extended Community. - RFC 7432: BGP MPLS-Based Ethernet VPN."; - } - - typedef ipv6-route-origin { - 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]|1[0-9]{2}|[1-9]?[0-9])\.){3}' - + '(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])))' - + ':' - + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|' - + '6[0-4][0-9]{3}|' - + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0)'; - pattern '((([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|' - + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?))' - + ':' - + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|' - + '6[0-4][0-9]{3}|' - + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0)'; - } - description - "An IPv6 Route Origin is a 20-octet BGP IPv6 Address - Specific Extended Community serving the same function - as a standard 8-octet route, except that it only allows - an IPv6 address as the global administrator. The format - is . - - Two valid examples are 2001:db8::1:6544 and - 2001:db8::5eb1:791:6b37:17958."; - reference - "RFC 5701: IPv6 Address Specific BGP Extended Community - Attribute."; - } - - /*** Collection of types common to multicast ***/ - - typedef ipv4-multicast-group-address { - type inet:ipv4-address { - pattern '(2((2[4-9])|(3[0-9]))\.).*'; - } - description - "This type represents an IPv4 multicast group address, - which is in the range of 224.0.0.0 to 239.255.255.255."; - reference - "RFC 1112: Host Extensions for IP Multicasting."; - } - - typedef ipv6-multicast-group-address { - type inet:ipv6-address { - pattern '(([fF]{2}[0-9a-fA-F]{2}):).*'; - } - description - "This type represents an IPv6 multicast group address, - which is in the range of ff00::/8."; - reference - "RFC 4291: IP Version 6 Addressing Architecture. Section 2.7. - RFC 7346: IPv6 Multicast Address Scopes."; - } - - typedef ip-multicast-group-address { - type union { - type ipv4-multicast-group-address; - type ipv6-multicast-group-address; - } - description - "This type represents a version-neutral IP multicast group - address. The format of the textual representation implies - the IP version."; - } - - typedef ipv4-multicast-source-address { - type union { - type enumeration { - enum * { - description - "Any source address."; - } - } - type inet:ipv4-address; - } - description - "Multicast source IPv4 address type."; - } - - typedef ipv6-multicast-source-address { - type union { - type enumeration { - enum * { - description - "Any source address."; - } - } - type inet:ipv6-address; - } - description - "Multicast source IPv6 address type."; - } - - /*** Collection of types common to protocols ***/ - - typedef bandwidth-ieee-float32 { - type string { - pattern - '0[xX](0((\.0?)?[pP](\+)?0?|(\.0?))|' - + '1(\.([0-9a-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\+)?(12[0-7]|' - + '1[01][0-9]|0?[0-9]?[0-9])?)'; - } - description - "Bandwidth in IEEE 754 floating-point 32-bit binary format: - (-1)**(S) * 2**(Exponent-127) * (1 + Fraction), - where Exponent uses 8 bits and Fraction uses 23 bits. - The units are octets per second. - The encoding format is the external hexadecimal-significant - character sequences specified in IEEE 754 and ISO/IEC C99. - The format is restricted to be normalized, non-negative, and - non-fraction: 0x1.hhhhhhp{+}d, 0X1.HHHHHHP{+}D, or 0x0p0, - where 'h' and 'H' are hexadecimal digits and 'd' and 'D' are - integers in the range of [0..127]. - When six hexadecimal digits are used for 'hhhhhh' or - 'HHHHHH', the least significant digit must be an even - number. 'x' and 'X' indicate hexadecimal; 'p' and 'P' - indicate a power of two. Some examples are 0x0p0, 0x1p10, - and 0x1.abcde2p+20."; - reference - "IEEE Std 754-2008: IEEE Standard for Floating-Point - Arithmetic. - ISO/IEC C99: Information technology - Programming - Languages - C."; - } - - typedef link-access-type { - type enumeration { - enum broadcast { - description - "Specify broadcast multi-access network."; - } - enum non-broadcast-multiaccess { - description - "Specify Non-Broadcast Multi-Access (NBMA) network."; - } - enum point-to-multipoint { - description - "Specify point-to-multipoint network."; - } - enum point-to-point { - description - "Specify point-to-point network."; - } - } - description - "Link access type."; - } - - typedef timer-multiplier { - type uint8; - description - "The number of timer value intervals that should be - interpreted as a failure."; - } - - typedef timer-value-seconds16 { - type union { - type uint16 { - range "1..65535"; - } - type enumeration { - enum infinity { - description - "The timer is set to infinity."; - } - enum not-set { - description - "The timer is not set."; - } - } - } - units "seconds"; - description - "Timer value type, in seconds (16-bit range)."; - } - - typedef timer-value-seconds32 { - type union { - type uint32 { - range "1..4294967295"; - } - type enumeration { - enum infinity { - description - "The timer is set to infinity."; - } - enum not-set { - description - "The timer is not set."; - } - } - } - units "seconds"; - description - "Timer value type, in seconds (32-bit range)."; - } - - typedef timer-value-milliseconds { - type union { - type uint32 { - range "1..4294967295"; - } - type enumeration { - enum infinity { - description - "The timer is set to infinity."; - } - enum not-set { - description - "The timer is not set."; - } - } - } - units "milliseconds"; - description - "Timer value type, in milliseconds."; - } - - typedef percentage { - type uint8 { - range "0..100"; - } - description - "Integer indicating a percentage value."; - } - - 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."; - } - - typedef uint24 { - type uint32 { - range "0..16777215"; - } - description - "24-bit unsigned integer."; - } - - /*** Collection of types related to MPLS/GMPLS ***/ - - typedef generalized-label { - type binary; - description - "Generalized Label. Nodes sending and receiving the - Generalized Label are aware of the link-specific - label context and type."; - reference - "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) - Signaling Functional Description. Section 3.2."; - } - - typedef mpls-label-special-purpose { - type identityref { - base mpls-label-special-purpose-value; - } - description - "This type represents the special-purpose MPLS label values."; - reference - "RFC 3032: MPLS Label Stack Encoding. - RFC 7274: Allocating and Retiring Special-Purpose MPLS - Labels."; - } - - typedef mpls-label-general-use { - type uint32 { - range "16..1048575"; - } - description - "The 20-bit label value in an MPLS label stack as specified - in RFC 3032. This label value does not include the - encodings of Traffic Class and TTL (Time to Live). - The label range specified by this type is for general use, - with special-purpose MPLS label values excluded."; - reference - "RFC 3032: MPLS Label Stack Encoding."; - } - - typedef mpls-label { - type union { - type mpls-label-special-purpose; - type mpls-label-general-use; - } - description - "The 20-bit label value in an MPLS label stack as specified - in RFC 3032. This label value does not include the - encodings of Traffic Class and TTL."; - reference - "RFC 3032: MPLS Label Stack Encoding."; - } - - /*** Groupings **/ - - grouping mpls-label-stack { - description - "This grouping specifies an MPLS label stack. The label - stack is encoded as a list of label stack entries. The - list key is an identifier that indicates the relative - ordering of each entry, with the lowest-value identifier - corresponding to the top of the label stack."; - container mpls-label-stack { - description - "Container for a list of MPLS label stack entries."; - list entry { - key "id"; - description - "List of MPLS label stack entries."; - leaf id { - type uint8; - description - "Identifies the entry in a sequence of MPLS label - stack entries. An entry with a smaller identifier - value precedes an entry with a larger identifier - value in the label stack. The value of this ID has - no semantic meaning other than relative ordering - and referencing the entry."; - } - leaf label { - type rt-types:mpls-label; - description - "Label value."; - } - - leaf ttl { - type uint8; - description - "Time to Live (TTL)."; - reference - "RFC 3032: MPLS Label Stack Encoding."; - } - leaf traffic-class { - type uint8 { - range "0..7"; - } - description - "Traffic Class (TC)."; - reference - "RFC 5462: Multiprotocol Label Switching (MPLS) Label - Stack Entry: 'EXP' Field Renamed to 'Traffic Class' - Field."; - } - } - } - } - - grouping vpn-route-targets { - description - "A grouping that specifies Route Target import-export rules - used in BGP-enabled VPNs."; - reference - "RFC 4364: BGP/MPLS IP Virtual Private Networks (VPNs). - RFC 4664: Framework for Layer 2 Virtual Private Networks - (L2VPNs)."; - list vpn-target { - key "route-target"; - description - "List of Route Targets."; - leaf route-target { - type rt-types:route-target; - description - "Route Target value."; - } - leaf route-target-type { - type rt-types:route-target-type; - mandatory true; - description - "Import/export type of the Route Target."; - } - } - } -} diff --git a/TestData/YangSource/ietf-routing@2016-11-04.yang b/TestData/YangSource/ietf-routing@2016-11-04.yang deleted file mode 100644 index c7f061e..0000000 --- a/TestData/YangSource/ietf-routing@2016-11-04.yang +++ /dev/null @@ -1,576 +0,0 @@ -module ietf-routing { - - yang-version "1.1"; - - namespace "urn:ietf:params:xml:ns:yang:ietf-routing"; - - prefix "rt"; - - import ietf-yang-types { - prefix "yang"; - } - - import ietf-interfaces { - prefix "if"; - } - - organization - "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; - - contact - "WG Web: - WG List: - - WG Chair: Lou Berger - - - WG Chair: Kent Watsen - - - Editor: Ladislav Lhotka - - - Editor: Acee Lindem - "; - - description - "This YANG module defines essential components for the management - of a routing subsystem. - - Copyright (c) 2016 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 key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL - NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'MAY', and - 'OPTIONAL' in the module text are to be interpreted as described - in RFC 2119. - - This version of this YANG module is part of RFC 8022; - see the RFC itself for full legal notices."; - - revision 2016-11-04 { - description - "Initial revision."; - reference - "RFC 8022: A YANG Data Model for Routing Management"; - } - - /* Features */ - - feature multiple-ribs { - description - "This feature indicates that the server supports user-defined - RIBs. - - Servers that do not advertise this feature SHOULD provide - exactly one system-controlled RIB per supported address family - and make it also the default RIB. This RIB then appears as an - entry of the list /routing-state/ribs/rib."; - } - - feature router-id { - description - "This feature indicates that the server supports configuration - of an explicit 32-bit router ID that is used by some routing - protocols. - - Servers that do not advertise this feature set a router ID - algorithmically, usually to one of the configured IPv4 - addresses. However, this algorithm is implementation - specific."; - } - - /* Identities */ - - identity address-family { - description - "Base identity from which identities describing address - families are derived."; - } - - identity ipv4 { - base address-family; - description - "This identity represents IPv4 address family."; - } - - identity ipv6 { - base address-family; - description - "This identity represents IPv6 address family."; - } - - identity control-plane-protocol { - description - "Base identity from which control-plane protocol identities are - derived."; - } - - identity routing-protocol { - base control-plane-protocol; - description - "Identity from which Layer 3 routing protocol identities are - derived."; - } - - identity direct { - base routing-protocol; - description - "Routing pseudo-protocol that provides routes to directly - connected networks."; - } - - identity static { - base routing-protocol; - description - "Static routing pseudo-protocol."; - } - - /* Type Definitions */ - - typedef route-preference { - type uint32; - description - "This type is used for route preferences."; - } - - /* Groupings */ - - grouping address-family { - description - "This grouping provides a leaf identifying an address - family."; - leaf address-family { - type identityref { - base address-family; - } - mandatory "true"; - description - "Address family."; - } - } - - grouping router-id { - description - "This grouping provides router ID."; - leaf router-id { - type yang:dotted-quad; - description - "A 32-bit number in the form of a dotted quad that is used by - some routing protocols identifying a router."; - reference - "RFC 2328: OSPF Version 2."; - } - } - - grouping special-next-hop { - description - "This grouping provides a leaf with an enumeration of special - next hops."; - leaf special-next-hop { - type enumeration { - enum blackhole { - description - "Silently discard the packet."; - } - enum unreachable { - description - "Discard the packet and notify the sender with an error - message indicating that the destination host is - unreachable."; - } - enum prohibit { - description - "Discard the packet and notify the sender with an error - message indicating that the communication is - administratively prohibited."; - } - enum receive { - description - "The packet will be received by the local system."; - } - } - description - "Options for special next hops."; - } - } - - grouping next-hop-content { - description - "Generic parameters of next hops in static routes."; - choice next-hop-options { - mandatory "true"; - description - "Options for next hops in static routes. - - It is expected that further cases will be added through - augments from other modules."; - case simple-next-hop { - description - "This case represents a simple next hop consisting of the - next-hop address and/or outgoing interface. - - Modules for address families MUST augment this case with a - leaf containing a next-hop address of that address - family."; - leaf outgoing-interface { - type if:interface-ref; - description - "Name of the outgoing interface."; - } - } - case special-next-hop { - uses special-next-hop; - } - case next-hop-list { - container next-hop-list { - description - "Container for multiple next-hops."; - list next-hop { - key "index"; - description - "An entry of a next-hop list. - - Modules for address families MUST augment this list - with a leaf containing a next-hop address of that - address family."; - leaf index { - type string; - description - "A user-specified identifier utilized to uniquely - reference the next-hop entry in the next-hop list. - The value of this index has no semantic meaning - other than for referencing the entry."; - } - leaf outgoing-interface { - type if:interface-ref; - description - "Name of the outgoing interface."; - } - } - } - } - } - } - - grouping next-hop-state-content { - description - "Generic parameters of next hops in state data."; - choice next-hop-options { - mandatory "true"; - description - "Options for next hops in state data. - - It is expected that further cases will be added through - augments from other modules, e.g., for recursive - next hops."; - case simple-next-hop { - description - "This case represents a simple next hop consisting of the - next-hop address and/or outgoing interface. - - Modules for address families MUST augment this case with a - leaf containing a next-hop address of that address - family."; - leaf outgoing-interface { - type if:interface-state-ref; - description - "Name of the outgoing interface."; - } - } - case special-next-hop { - uses special-next-hop; - } - case next-hop-list { - container next-hop-list { - description - "Container for multiple next hops."; - list next-hop { - description - "An entry of a next-hop list. - - Modules for address families MUST augment this list - with a leaf containing a next-hop address of that - address family."; - leaf outgoing-interface { - type if:interface-state-ref; - description - "Name of the outgoing interface."; - } - } - } - } - } - } - - grouping route-metadata { - description - "Common route metadata."; - leaf source-protocol { - type identityref { - base routing-protocol; - } - mandatory "true"; - description - "Type of the routing protocol from which the route - originated."; - } - leaf active { - type empty; - description - "Presence of this leaf indicates that the route is preferred - among all routes in the same RIB that have the same - destination prefix."; - } - leaf last-updated { - type yang:date-and-time; - description - "Time stamp of the last modification of the route. If the - route was never modified, it is the time when the route was - inserted into the RIB."; - } - } - - /* State data */ - - container routing-state { - config "false"; - description - "State data of the routing subsystem."; - uses router-id { - description - "Global router ID. - - It may be either configured or assigned algorithmically by - the implementation."; - } - container interfaces { - description - "Network-layer interfaces used for routing."; - leaf-list interface { - type if:interface-state-ref; - description - "Each entry is a reference to the name of a configured - network-layer interface."; - } - } - container control-plane-protocols { - description - "Container for the list of routing protocol instances."; - list control-plane-protocol { - key "type name"; - description - "State data of a control-plane protocol instance. - - An implementation MUST provide exactly one - system-controlled instance of the 'direct' - pseudo-protocol. Instances of other control-plane - protocols MAY be created by configuration."; - leaf type { - type identityref { - base control-plane-protocol; - } - description - "Type of the control-plane protocol."; - } - leaf name { - type string; - description - "The name of the control-plane protocol instance. - - For system-controlled instances this name is persistent, - i.e., it SHOULD NOT change across reboots."; - } - } - } - container ribs { - description - "Container for RIBs."; - list rib { - key "name"; - min-elements "1"; - description - "Each entry represents a RIB identified by the 'name' key. - All routes in a RIB MUST belong to the same address - family. - - An implementation SHOULD provide one system-controlled - default RIB for each supported address family."; - leaf name { - type string; - description - "The name of the RIB."; - } - uses address-family; - leaf default-rib { - if-feature "multiple-ribs"; - type boolean; - default "true"; - description - "This flag has the value of 'true' if and only if the RIB - is the default RIB for the given address family. - - By default, control-plane protocols place their routes - in the default RIBs."; - } - container routes { - description - "Current content of the RIB."; - list route { - description - "A RIB route entry. This data node MUST be augmented - with information specific for routes of each address - family."; - leaf route-preference { - type route-preference; - description - "This route attribute, also known as administrative - distance, allows for selecting the preferred route - among routes with the same destination prefix. A - smaller value means a more preferred route."; - } - container next-hop { - description - "Route's next-hop attribute."; - uses next-hop-state-content; - } - uses route-metadata; - } - } - action active-route { - description - "Return the active RIB route that is used for the - destination address. - - Address-family-specific modules MUST augment input - parameters with a leaf named 'destination-address'."; - output { - container route { - description - "The active RIB route for the specified destination. - - If no route exists in the RIB for the destination - address, no output is returned. - - Address-family-specific modules MUST augment this - container with appropriate route contents."; - container next-hop { - description - "Route's next-hop attribute."; - uses next-hop-state-content; - } - uses route-metadata; - } - } - } - } - } - } - - /* Configuration Data */ - - container routing { - description - "Configuration parameters for the routing subsystem."; - uses router-id { - if-feature "router-id"; - description - "Configuration of the global router ID. Routing protocols - that use router ID can use this parameter or override it - with another value."; - } - container control-plane-protocols { - description - "Configuration of control-plane protocol instances."; - list control-plane-protocol { - key "type name"; - description - "Each entry contains configuration of a control-plane - protocol instance."; - leaf type { - type identityref { - base control-plane-protocol; - } - description - "Type of the control-plane protocol - an identity derived - from the 'control-plane-protocol' base identity."; - } - leaf name { - type string; - description - "An arbitrary name of the control-plane protocol - instance."; - } - leaf description { - type string; - description - "Textual description of the control-plane protocol - instance."; - } - container static-routes { - when "derived-from-or-self(../type, 'rt:static')" { - description - "This container is only valid for the 'static' routing - protocol."; - } - description - "Configuration of the 'static' pseudo-protocol. - - Address-family-specific modules augment this node with - their lists of routes."; - } - } - } - container ribs { - description - "Configuration of RIBs."; - list rib { - key "name"; - description - "Each entry contains configuration for a RIB identified by - the 'name' key. - - Entries having the same key as a system-controlled entry - of the list /routing-state/ribs/rib are used for - configuring parameters of that entry. Other entries - define additional user-controlled RIBs."; - leaf name { - type string; - description - "The name of the RIB. - - For system-controlled entries, the value of this leaf - must be the same as the name of the corresponding entry - in state data. - - For user-controlled entries, an arbitrary name can be - used."; - } - uses address-family { - description - "Address family of the RIB. - - It is mandatory for user-controlled RIBs. For - system-controlled RIBs it can be omitted; otherwise, it - must match the address family of the corresponding state - entry."; - refine "address-family" { - mandatory "false"; - } - } - leaf description { - type string; - description - "Textual description of the RIB."; - } - } - } - } -} diff --git a/TestData/YangSource/ietf-snmp-common@2014-12-10.yang b/TestData/YangSource/ietf-snmp-common@2014-12-10.yang deleted file mode 100644 index a7d27c2..0000000 --- a/TestData/YangSource/ietf-snmp-common@2014-12-10.yang +++ /dev/null @@ -1,184 +0,0 @@ -submodule ietf-snmp-common { - - belongs-to ietf-snmp { - prefix snmp; - } - - 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 - - - Editor: Juergen Schoenwaelder - "; - - description - "This submodule contains a collection of common YANG definitions - for configuring SNMP engines. - - 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 7407; see - the RFC itself for full legal notices."; - - revision 2014-12-10 { - description - "Initial revision."; - reference - "RFC 7407: A YANG Data Model for SNMP Configuration"; - } - - /* Collection of SNMP-specific data types */ - - typedef admin-string { - type string { - length "0..255"; - } - description - "Represents SnmpAdminString as defined in RFC 3411. - - Note that the size of an SnmpAdminString is measured in - octets, not characters."; - - reference - "RFC 3411: An Architecture for Describing Simple Network - Management Protocol (SNMP) Management Frameworks. - SNMP-FRAMEWORK-MIB.SnmpAdminString"; - } - - typedef identifier { - type admin-string { - length "1..32"; - } - description - "Identifiers are used to name items in the SNMP configuration - datastore."; - } - - typedef context-name { - type admin-string { - length "0..32"; - } - description - "The context type represents an SNMP context name."; - reference - "RFC 3411: An Architecture for Describing Simple Network - Management Protocol (SNMP) Management Frameworks"; - } - - typedef security-name { - type admin-string { - length "1..32"; - } - description - "The security-name type represents an SNMP security name."; - reference - "RFC 3411: An Architecture for Describing Simple Network - Management Protocol (SNMP) Management Frameworks"; - } - - typedef security-model { - type union { - type enumeration { - enum v1 { value 1; } - enum v2c { value 2; } - enum usm { value 3; } - enum tsm { value 4; } - } - type int32 { - range "1..2147483647"; - } - } - reference - "RFC 3411: An Architecture for Describing Simple Network - Management Protocol (SNMP) Management Frameworks"; - } - - typedef security-model-or-any { - type union { - type enumeration { - enum any { value 0; } - } - type security-model; - } - reference - "RFC 3411: An Architecture for Describing Simple Network - Management Protocol (SNMP) Management Frameworks"; - } - - typedef security-level { - type enumeration { - enum no-auth-no-priv { value 1; } - enum auth-no-priv { value 2; } - enum auth-priv { value 3; } - } - reference - "RFC 3411: An Architecture for Describing Simple Network - Management Protocol (SNMP) Management Frameworks"; - } - - typedef engine-id { - type yang:hex-string { - pattern '([0-9a-fA-F]){2}(:([0-9a-fA-F]){2}){4,31}'; - } - description - "The engine ID specified as a list of colon-specified - hexadecimal octets, e.g., '80:00:02:b8:04:61:62:63'."; - reference - "RFC 3411: An Architecture for Describing Simple Network - Management Protocol (SNMP) Management Frameworks"; - } - - typedef wildcard-object-identifier { - type string; - description - "The wildcard-object-identifier type represents an SNMP object - identifier where subidentifiers can be given either as a label, - in numeric form, or a wildcard, represented by an asterisk - ('*')."; - } - - typedef tag-value { - type string { - length "0..255"; - } - description - "Represents SnmpTagValue as defined in RFC 3413. - - Note that the size of an SnmpTagValue is measured in - octets, not characters."; - reference - "RFC 3413: Simple Network Management Protocol (SNMP) - Applications. - SNMP-TARGET-MIB.SnmpTagValue"; - } - - container snmp { - description - "Top-level container for SNMP-related configuration and - status objects."; - } - -} diff --git a/TestData/YangSource/ietf-snmp-community@2014-12-10.yang b/TestData/YangSource/ietf-snmp-community@2014-12-10.yang deleted file mode 100644 index 6bddf1a..0000000 --- a/TestData/YangSource/ietf-snmp-community@2014-12-10.yang +++ /dev/null @@ -1,241 +0,0 @@ -submodule ietf-snmp-community { - - belongs-to ietf-snmp { - prefix snmp; - } - - import ietf-netconf-acm { - prefix nacm; - } - - include ietf-snmp-common; - include ietf-snmp-target; - include ietf-snmp-proxy; - - 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 - - - Editor: Juergen Schoenwaelder - "; - - description - "This submodule contains a collection of YANG definitions - for configuring community-based SNMP. - - 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 7407; see - the RFC itself for full legal notices."; - - reference - "RFC 3584: Coexistence between Version 1, Version 2, and - Version 3 of the Internet-standard Network - Management Framework"; - - revision 2014-12-10 { - description - "Initial revision."; - reference - "RFC 7407: A YANG Data Model for SNMP Configuration"; - } - - augment /snmp:snmp { - - list community { - key index; - - description - "List of communities."; - reference - "RFC 3584: Coexistence between Version 1, Version 2, - and Version 3 of the Internet-standard - Network Management Framework. - SNMP-COMMUNITY-MIB.snmpCommunityTable"; - - leaf index { - type snmp:identifier; - description - "Index into the community list."; - reference - "RFC 3584: Coexistence between Version 1, Version 2, - and Version 3 of the Internet-standard - Network Management Framework. - SNMP-COMMUNITY-MIB.snmpCommunityIndex"; - } - choice name { - nacm:default-deny-all; - description - "The community name, specified as either a string or - a binary value. The binary name is used when the - community name contains characters that are not legal - in a string. - - If not set, the value of 'security-name' is operationally - used as the snmpCommunityName."; - reference - "RFC 3584: Coexistence between Version 1, Version 2, - and Version 3 of the Internet-standard - Network Management Framework. - SNMP-COMMUNITY-MIB.snmpCommunityName"; - leaf text-name { - type string; - description - "A community name that can be represented as a - YANG string."; - } - leaf binary-name { - type binary; - description - "A community name represented as a binary value."; - } - } - leaf security-name { - type snmp:security-name; - mandatory true; - nacm:default-deny-all; - description - "The snmpCommunitySecurityName of this entry."; - reference - "RFC 3584: Coexistence between Version 1, Version 2, - and Version 3 of the Internet-standard - Network Management Framework. - SNMP-COMMUNITY-MIB.snmpCommunitySecurityName"; - } - leaf engine-id { - if-feature snmp:proxy; - type snmp:engine-id; - description - "If not set, the value of the local SNMP engine is - operationally used by the device."; - reference - "RFC 3584: Coexistence between Version 1, Version 2, - and Version 3 of the Internet-standard - Network Management Framework. - SNMP-COMMUNITY-MIB.snmpCommunityContextEngineID"; - } - leaf context { - type snmp:context-name; - default ""; - description - "The context in which management information is accessed - when using the community string specified by this entry."; - reference - "RFC 3584: Coexistence between Version 1, Version 2, - and Version 3 of the Internet-standard - Network Management Framework. - SNMP-COMMUNITY-MIB.snmpCommunityContextName"; - } - leaf target-tag { - type snmp:tag-value; - description - "Used to limit access for this community to the specified - targets. - - Implementations MAY restrict the values of this leaf - to be one of the available values of /snmp/target/tag in - a valid configuration."; - reference - "RFC 3584: Coexistence between Version 1, Version 2, - and Version 3 of the Internet-standard - Network Management Framework. - SNMP-COMMUNITY-MIB.snmpCommunityTransportTag"; - } - } - } - - grouping v1-target-params { - container v1 { - description - "SNMPv1 parameters type. - Represents snmpTargetParamsMPModel '0', - snmpTargetParamsSecurityModel '1', and - snmpTargetParamsSecurityLevel 'noAuthNoPriv'."; - leaf security-name { - type snmp:security-name; - mandatory true; - description - "Implementations MAY restrict the values of this leaf - to be one of the available values of - /snmp/community/security-name in a valid configuration."; - reference - "RFC 3413: Simple Network Management Protocol (SNMP). - Applications. - SNMP-TARGET-MIB.snmpTargetParamsSecurityName"; - } - } - } - - grouping v2c-target-params { - container v2c { - description - "SNMPv2 community parameters type. - Represents snmpTargetParamsMPModel '1', - snmpTargetParamsSecurityModel '2', and - snmpTargetParamsSecurityLevel 'noAuthNoPriv'."; - leaf security-name { - type snmp:security-name; - mandatory true; - description - "Implementations MAY restrict the values of this leaf - to be one of the available values of - /snmp/community/security-name in a valid configuration."; - reference - "RFC 3413: Simple Network Management Protocol (SNMP). - Applications. - SNMP-TARGET-MIB.snmpTargetParamsSecurityName"; - } - } - } - - augment /snmp:snmp/snmp:target-params/snmp:params { - case v1 { - uses v1-target-params; - } - case v2c { - uses v2c-target-params; - } - } - - augment /snmp:snmp/snmp:target { - when "snmp:v1 or snmp:v2c"; - leaf mms { - type union { - type enumeration { - enum "unknown" { value 0; } - } - type int32 { - range "484..max"; - } - } - default "484"; - description - "The maximum message size."; - reference - "RFC 3584: Coexistence between Version 1, Version 2, - and Version 3 of the Internet-standard - Network Management Framework. - SNMP-COMMUNITY-MIB.snmpTargetAddrMMS"; - } - } - -} diff --git a/TestData/YangSource/ietf-snmp-engine@2014-12-10.yang b/TestData/YangSource/ietf-snmp-engine@2014-12-10.yang deleted file mode 100644 index 4b412ae..0000000 --- a/TestData/YangSource/ietf-snmp-engine@2014-12-10.yang +++ /dev/null @@ -1,155 +0,0 @@ -submodule ietf-snmp-engine { - - belongs-to ietf-snmp { - prefix snmp; - } - - import ietf-inet-types { - prefix inet; - } - - include ietf-snmp-common; - - 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 - - - Editor: Juergen Schoenwaelder - "; - - description - "This submodule contains a collection of YANG definitions - for configuring SNMP engines. - - 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 7407; see - the RFC itself for full legal notices."; - - revision 2014-12-10 { - description - "Initial revision."; - reference - "RFC 7407: A YANG Data Model for SNMP Configuration"; - } - - augment /snmp:snmp { - - container engine { - - description - "Configuration of the SNMP engine."; - - leaf enabled { - type boolean; - default "false"; - description - "Enables the SNMP engine."; - } - - list listen { - key "name"; - description - "Configuration of the transport endpoints on which the - engine listens."; - - leaf name { - type snmp:identifier; - description - "An arbitrary name for the list entry."; - } - - choice transport { - mandatory true; - description - "The transport-protocol-specific parameters for this - endpoint. Submodules providing configuration for - additional transports are expected to augment this - choice."; - case udp { - container udp { - leaf ip { - type inet:ip-address; - mandatory true; - description - "The IPv4 or IPv6 address on which the engine - listens."; - } - leaf port { - type inet:port-number; - description - "The UDP port on which the engine listens. - - If the port is not configured, an engine that - acts as a Command Responder uses port 161, and - an engine that acts as a Notification Receiver - uses port 162."; - } - } - } - } - } - - container version { - description - "SNMP version used by the engine."; - leaf v1 { - type empty; - } - leaf v2c { - type empty; - } - leaf v3 { - type empty; - } - } - - leaf engine-id { - type snmp:engine-id; - description - "The local SNMP engine's administratively assigned unique - identifier. - - If this leaf is not set, the device automatically - calculates an engine ID, as described in RFC 3411. A - server MAY initialize this leaf with the automatically - created value."; - reference - "RFC 3411: An Architecture for Describing Simple Network - Management Protocol (SNMP) Management - Frameworks. - SNMP-FRAMEWORK-MIB.snmpEngineID"; - } - - leaf enable-authen-traps { - type boolean; - description - "Indicates whether the SNMP entity is permitted to - generate authenticationFailure traps."; - reference - "RFC 3418: Management Information Base (MIB) for the - Simple Network Management Protocol (SNMP) - SNMPv2-MIB.snmpEnableAuthenTraps"; - } - } - } -} diff --git a/TestData/YangSource/ietf-snmp-notification@2014-12-10.yang b/TestData/YangSource/ietf-snmp-notification@2014-12-10.yang deleted file mode 100644 index ea4a86c..0000000 --- a/TestData/YangSource/ietf-snmp-notification@2014-12-10.yang +++ /dev/null @@ -1,204 +0,0 @@ -submodule ietf-snmp-notification { - - belongs-to ietf-snmp { - prefix snmp; - } - - include ietf-snmp-common; - include ietf-snmp-target; - - 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 - - - Editor: Juergen Schoenwaelder - "; - - description - "This submodule contains a collection of YANG definitions - for configuring SNMP notifications. - - 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 7407; see - the RFC itself for full legal notices."; - - reference - "RFC 3413: Simple Network Management Protocol (SNMP) - Applications"; - - revision 2014-12-10 { - description - "Initial revision."; - reference - "RFC 7407: A YANG Data Model for SNMP Configuration"; - } - - feature notification-filter { - description - "A server implements this feature if it supports SNMP - notification filtering."; - reference - "RFC 3413: Simple Network Management Protocol (SNMP) - Applications"; - } - - augment /snmp:snmp { - - list notify { - key name; - description - "Targets that will receive notifications. - - Entries in this list are mapped 1-1 to entries in - snmpNotifyTable, except that if an entry in snmpNotifyTable - has an snmpNotifyTag for which no snmpTargetAddrEntry - exists, then the snmpNotifyTable entry is not mapped to an - entry in this list."; - reference - "RFC 3413: Simple Network Management Protocol (SNMP). - Applications. - SNMP-NOTIFICATION-MIB.snmpNotifyTable"; - - leaf name { - type snmp:identifier; - description - "An arbitrary name for the list entry."; - reference - "RFC 3413: Simple Network Management Protocol (SNMP). - Applications. - SNMP-NOTIFICATION-MIB.snmpNotifyName"; - } - leaf tag { - type snmp:tag-value; - mandatory true; - description - "Target tag, selects a set of notification targets. - - Implementations MAY restrict the values of this leaf - to be one of the available values of /snmp/target/tag in - a valid configuration."; - reference - "RFC 3413: Simple Network Management Protocol (SNMP). - Applications. - SNMP-NOTIFICATION-MIB.snmpNotifyTag"; - } - leaf type { - type enumeration { - enum trap { value 1; } - enum inform { value 2; } - } - default trap; - description - "Defines the notification type to be generated."; - - reference - "RFC 3413: Simple Network Management Protocol (SNMP). - Applications. - SNMP-NOTIFICATION-MIB.snmpNotifyType"; - } - } - - list notify-filter-profile { - if-feature snmp:notification-filter; - key name; - - description - "Notification filter profiles. - - The leaf /snmp/target/notify-filter-profile is used - to associate a filter profile with a target. - - If an entry in this list is referred to by one or more - /snmp/target/notify-filter-profile items, each such - notify-filter-profile is represented by one - snmpNotifyFilterProfileEntry. - - If an entry in this list is not referred to by any - /snmp/target/notify-filter-profile, the entry is not mapped - to snmpNotifyFilterProfileTable."; - reference - "RFC 3413: Simple Network Management Protocol (SNMP). - Applications. - SNMP-NOTIFICATION-MIB.snmpNotifyFilterProfileTable - SNMP-NOTIFICATION-MIB.snmpNotifyFilterTable"; - - leaf name { - type snmp:identifier; - description - "Name of the filter profile."; - reference - "RFC 3413: Simple Network Management Protocol (SNMP). - Applications. - SNMP-NOTIFICATION-MIB.snmpNotifyFilterProfileName"; - } - - leaf-list include { - type snmp:wildcard-object-identifier; - description - "A family of subtrees included in this filter."; - - reference - "RFC 3413: Simple Network Management Protocol (SNMP). - Applications. - SNMP-NOTIFICATION-MIB.snmpNotifyFilterSubtree - SNMP-NOTIFICATION-MIB.snmpNotifyFilterMask - SNMP-NOTIFICATION-MIB.snmpNotifyFilterType"; - } - - leaf-list exclude { - type snmp:wildcard-object-identifier; - description - "A family of subtrees excluded from this filter."; - reference - "RFC 3413: Simple Network Management Protocol (SNMP). - Applications. - SNMP-NOTIFICATION-MIB.snmpNotifyFilterSubtree - SNMP-NOTIFICATION-MIB.snmpNotifyFilterMask - SNMP-NOTIFICATION-MIB.snmpNotifyFilterType"; - } - } - - } - - augment /snmp:snmp/snmp:target-params { - reference - "RFC 3413: Simple Network Management Protocol (SNMP). - Applications. - SNMP-NOTIFICATION-MIB.snmpNotifyFilterProfileTable"; - leaf notify-filter-profile { - if-feature snmp:notification-filter; - type leafref { - path "/snmp/notify-filter-profile/name"; - } - description - "This leafref leaf is used to represent the sparse - relationship between the /snmp/target-params list and the - /snmp/notify-filter-profile list."; - reference - "RFC 3413: Simple Network Management Protocol (SNMP). - Applications. - SNMP-NOTIFICATION-MIB.snmpNotifyFilterProfileName"; - } - } - -} diff --git a/TestData/YangSource/ietf-snmp-proxy@2014-12-10.yang b/TestData/YangSource/ietf-snmp-proxy@2014-12-10.yang deleted file mode 100644 index a28ff5c..0000000 --- a/TestData/YangSource/ietf-snmp-proxy@2014-12-10.yang +++ /dev/null @@ -1,155 +0,0 @@ -submodule ietf-snmp-proxy { - - belongs-to ietf-snmp { - prefix snmp; - } - - include ietf-snmp-common; - include ietf-snmp-target; - - 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 - - - Editor: Juergen Schoenwaelder - "; - - description - "This submodule contains a collection of YANG definitions - for configuring SNMP proxies. - - 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 7407; see - the RFC itself for full legal notices."; - reference - "RFC 3413: Simple Network Management Protocol (SNMP) - Applications"; - - revision 2014-12-10 { - description - "Initial revision."; - reference - "RFC 7407: A YANG Data Model for SNMP Configuration"; - } - - feature proxy { - description - "A server implements this feature if it can act as an - SNMP proxy."; - reference - "RFC 3413: Simple Network Management Protocol (SNMP) - Applications"; - } - - augment /snmp:snmp { - if-feature snmp:proxy; - - list proxy { - key name; - - description - "List of proxy parameters."; - reference - "RFC 3413: Simple Network Management Protocol (SNMP). - Applications. - SNMP-PROXY-MIB.snmpProxyTable"; - - leaf name { - type snmp:identifier; - description - "Identifies the proxy parameter entry."; - reference - "RFC 3413: Simple Network Management Protocol (SNMP). - Applications. - SNMP-PROXY-MIB.snmpProxyName"; - } - leaf type { - type enumeration { - enum read { value 1; } - enum write { value 2; } - enum trap { value 3; } - enum inform { value 4; } - } - mandatory true; - reference - "RFC 3413: Simple Network Management Protocol (SNMP). - Applications. - SNMP-PROXY-MIB.snmpProxyType"; - } - leaf context-engine-id { - type snmp:engine-id; - mandatory true; - reference - "RFC 3413: Simple Network Management Protocol (SNMP). - Applications. - SNMP-PROXY-MIB.snmpProxyContextEngineID"; - } - leaf context-name { - type snmp:context-name; - reference - "RFC 3413: Simple Network Management Protocol (SNMP). - Applications. - SNMP-PROXY-MIB.snmpProxyContextName"; - } - leaf target-params-in { - type snmp:identifier; - description - "The name of a target parameters list entry. - - Implementations MAY restrict the values of this - leaf to be one of the available values of - /snmp/target-params/name in a valid configuration."; - reference - "RFC 3413: Simple Network Management Protocol (SNMP). - Applications. - SNMP-PROXY-MIB.snmpProxyTargetParamsIn"; - } - leaf single-target-out { - when "../type = 'read' or ../type = 'write'"; - type snmp:identifier; - description - "Implementations MAY restrict the values of this leaf - to be one of the available values of /snmp/target/name in - a valid configuration."; - reference - "RFC 3413: Simple Network Management Protocol (SNMP). - Applications. - SNMP-PROXY-MIB.snmpProxySingleTargetOut"; - } - - leaf multiple-target-out { - when "../type = 'trap' or ../type = 'inform'"; - type snmp:tag-value; - description - "Implementations MAY restrict the values of this leaf - to be one of the available values of /snmp/target/tag in - a valid configuration."; - reference - "RFC 3413: Simple Network Management Protocol (SNMP). - Applications. - SNMP-PROXY-MIB.snmpProxyMultipleTargetOut"; - } - } - } -} diff --git a/TestData/YangSource/ietf-snmp-ssh@2014-12-10.yang b/TestData/YangSource/ietf-snmp-ssh@2014-12-10.yang deleted file mode 100644 index e7a5eac..0000000 --- a/TestData/YangSource/ietf-snmp-ssh@2014-12-10.yang +++ /dev/null @@ -1,145 +0,0 @@ -submodule ietf-snmp-ssh { - - belongs-to ietf-snmp { - prefix snmp; - } - - import ietf-inet-types { - prefix inet; - } - - include ietf-snmp-common; - include ietf-snmp-engine; - include ietf-snmp-target; - - 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 - - - Editor: Juergen Schoenwaelder - "; - - description - "This submodule contains a collection of YANG definitions for - configuring the Secure Shell Transport Model (SSHTM) - of SNMP. - - 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 7407; see - the RFC itself for full legal notices."; - - reference - "RFC 5592: Secure Shell Transport Model for the - Simple Network Management Protocol (SNMP)"; - - revision 2014-12-10 { - description - "Initial revision."; - reference - "RFC 7407: A YANG Data Model for SNMP Configuration"; - } - - feature sshtm { - description - "A server implements this feature if it supports the - Secure Shell Transport Model for SNMP."; - reference - "RFC 5592: Secure Shell Transport Model for the - Simple Network Management Protocol (SNMP)"; - } - - augment /snmp:snmp/snmp:engine/snmp:listen/snmp:transport { - if-feature sshtm; - case ssh { - container ssh { - description - "The IPv4 or IPv6 address and port to which the - engine listens for SNMP messages over SSH."; - - leaf ip { - type inet:ip-address; - mandatory true; - description - "The IPv4 or IPv6 address on which the engine listens - for SNMP messages over SSH."; - } - leaf port { - type inet:port-number; - description - "The TCP port on which the engine listens for SNMP - messages over SSH. - - If the port is not configured, an engine that - acts as a Command Responder uses port 5161, and - an engine that acts as a Notification Receiver - uses port 5162."; - } - } - } - } - - augment /snmp:snmp/snmp:target/snmp:transport { - if-feature sshtm; - case ssh { - reference - "RFC 5592: Secure Shell Transport Model for the - Simple Network Management Protocol (SNMP). - SNMP-SSH-TM-MIB.snmpSSHDomain"; - container ssh { - leaf ip { - type inet:host; - mandatory true; - reference - "RFC 3413: Simple Network Management Protocol (SNMP). - Applications. - SNMP-TARGET-MIB.snmpTargetAddrTAddress - RFC 5592: Secure Shell Transport Model for the - Simple Network Management Protocol (SNMP). - SNMP-SSH-TM-MIB.SnmpSSHAddress"; - } - leaf port { - type inet:port-number; - default 5161; - reference - "RFC 3413: Simple Network Management Protocol (SNMP). - Applications. - SNMP-TARGET-MIB.snmpTargetAddrTAddress - RFC 5592: Secure Shell Transport Model for the - Simple Network Management Protocol (SNMP). - SNMP-SSH-TM-MIB.SnmpSSHAddress"; - } - leaf username { - type string; - reference - "RFC 3413: Simple Network Management Protocol (SNMP). - Applications. - SNMP-TARGET-MIB.snmpTargetAddrTAddress - RFC 5592: Secure Shell Transport Model for the - Simple Network Management Protocol (SNMP). - SNMP-SSH-TM-MIB.SnmpSSHAddress"; - } - } - } - } -} diff --git a/TestData/YangSource/ietf-snmp-target@2014-12-10.yang b/TestData/YangSource/ietf-snmp-target@2014-12-10.yang deleted file mode 100644 index 9b1d6d1..0000000 --- a/TestData/YangSource/ietf-snmp-target@2014-12-10.yang +++ /dev/null @@ -1,207 +0,0 @@ -submodule ietf-snmp-target { - - belongs-to ietf-snmp { - prefix snmp; - } - - import ietf-inet-types { - prefix inet; - } - - include ietf-snmp-common; - - 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 - - - Editor: Juergen Schoenwaelder - "; - - description - "This submodule contains a collection of YANG definitions - for configuring SNMP targets. - - 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 7407; see - the RFC itself for full legal notices."; - - reference - "RFC 3413: Simple Network Management Protocol (SNMP) - Applications"; - - revision 2014-12-10 { - description - "Initial revision."; - reference - "RFC 7407: A YANG Data Model for SNMP Configuration"; - } - - augment /snmp:snmp { - - list target { - key name; - description - "List of targets."; - reference - "RFC 3413: Simple Network Management Protocol (SNMP) - Applications. - SNMP-TARGET-MIB.snmpTargetAddrTable"; - - leaf name { - type snmp:identifier; - description - "Identifies the target."; - reference - "RFC 3413: Simple Network Management Protocol (SNMP) - Applications. - SNMP-TARGET-MIB.snmpTargetAddrName"; - } - choice transport { - mandatory true; - description - "Transport address of the target. - - The snmpTargetAddrTDomain and snmpTargetAddrTAddress - objects are mapped to transport-specific YANG nodes. Each - transport is configured as a separate case in this - choice. Submodules providing configuration for additional - transports are expected to augment this choice."; - - reference - "RFC 3413: Simple Network Management Protocol (SNMP) - Applications. - SNMP-TARGET-MIB.snmpTargetAddrTDomain - SNMP-TARGET-MIB.snmpTargetAddrTAddress"; - case udp { - reference - "RFC 3417: Transport Mappings for the Simple Network - Management Protocol (SNMP). - SNMPv2-TM.snmpUDPDomain - RFC 3419: Textual Conventions for Transport Addresses. - TRANSPORT-ADDRESS-MIB.transportDomainUdpIpv4 - TRANSPORT-ADDRESS-MIB.transportDomainUdpIpv4z - TRANSPORT-ADDRESS-MIB.transportDomainUdpIpv6 - TRANSPORT-ADDRESS-MIB.transportDomainUdpIpv6z"; - container udp { - leaf ip { - type inet:ip-address; - mandatory true; - reference - "RFC 3413: Simple Network Management Protocol (SNMP). - SNMP-TARGET-MIB.snmpTargetAddrTAddress"; - } - leaf port { - type inet:port-number; - default 162; - description - "UDP port number."; - reference - "RFC 3413: Simple Network Management Protocol (SNMP). - SNMP-TARGET-MIB.snmpTargetAddrTAddress"; - } - leaf prefix-length { - type uint8; - description - "The value of this leaf must match the value of - ../snmp:ip. If ../snmp:ip contains an IPv4 address, - this leaf must be less than or equal to 32. If it - contains an IPv6 address, it must be less than or - equal to 128. - - Note that the prefix-length is currently only used - by the Community-based Security Model to filter - incoming messages. Furthermore, the prefix-length - filtering does not cover all possible filters - supported by the corresponding MIB object."; - - reference - "RFC 3584: Coexistence between Version 1, Version 2, - and Version 3 of the Internet-standard - Network Management Framework. - SNMP-COMMUNITY-MIB.snmpTargetAddrTMask"; - } - } - } - } - leaf-list tag { - type snmp:tag-value; - description - "List of tag values used to select target addresses."; - reference - "RFC 3413: Simple Network Management Protocol (SNMP). - Applications. - SNMP-TARGET-MIB.snmpTargetAddrTagList"; - } - leaf timeout { - type uint32; - units "0.01 seconds"; - default 1500; - description - "Needed only if this target can receive - InformRequest-PDUs."; - reference - "RFC 3413: Simple Network Management Protocol (SNMP). - Applications. - SNMP-TARGET-MIB.snmpTargetAddrTimeout"; - } - leaf retries { - type uint8; - default 3; - description - "Needed only if this target can receive - InformRequest-PDUs."; - reference - "RFC 3413: Simple Network Management Protocol (SNMP). - Applications. - SNMP-TARGET-MIB.snmpTargetAddrRetryCount"; - } - leaf target-params { - type snmp:identifier; - mandatory true; - reference - "RFC 3413: Simple Network Management Protocol (SNMP). - Applications. - SNMP-TARGET-MIB.snmpTargetAddrParams"; - } - } - - list target-params { - key name; - description - "List of target parameters."; - reference - "RFC 3413: Simple Network Management Protocol (SNMP). - Applications. - SNMP-TARGET-MIB.snmpTargetParamsTable"; - - leaf name { - type snmp:identifier; - } - choice params { - description - "This choice is augmented with case nodes containing - configuration parameters specific to the security model."; - } - } - } -} diff --git a/TestData/YangSource/ietf-snmp-tls@2014-12-10.yang b/TestData/YangSource/ietf-snmp-tls@2014-12-10.yang deleted file mode 100644 index e8ed5f7..0000000 --- a/TestData/YangSource/ietf-snmp-tls@2014-12-10.yang +++ /dev/null @@ -1,222 +0,0 @@ -submodule ietf-snmp-tls { - - belongs-to ietf-snmp { - prefix snmp; - } - - import ietf-inet-types { - prefix inet; - } - import ietf-x509-cert-to-name { - prefix x509c2n; - } - - include ietf-snmp-common; - include ietf-snmp-engine; - include ietf-snmp-target; - - 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 - - - Editor: Juergen Schoenwaelder - "; - - description - "This submodule contains a collection of YANG definitions for - configuring the Transport Layer Security Transport Model (TLSTM) - of SNMP. - - 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 7407; see - the RFC itself for full legal notices."; - - reference - "RFC 6353: Transport Layer Security (TLS) Transport Model for - the Simple Network Management Protocol (SNMP)"; - - revision 2014-12-10 { - description - "Initial revision."; - reference - "RFC 7407: A YANG Data Model for SNMP Configuration"; - } - - feature tlstm { - description - "A server implements this feature if it supports the - Transport Layer Security Transport Model for SNMP."; - reference - "RFC 6353: Transport Layer Security (TLS) Transport Model for - the Simple Network Management Protocol (SNMP)"; - } - - augment /snmp:snmp/snmp:engine/snmp:listen/snmp:transport { - if-feature tlstm; - case tls { - container tls { - description - "A list of IPv4 and IPv6 addresses and ports to which the - engine listens for SNMP messages over TLS."; - - leaf ip { - type inet:ip-address; - mandatory true; - description - "The IPv4 or IPv6 address on which the engine listens - for SNMP messages over TLS."; - } - leaf port { - type inet:port-number; - description - "The TCP port on which the engine listens for SNMP - messages over TLS. - - If the port is not configured, an engine that - acts as a Command Responder uses port 10161, and - an engine that acts as a Notification Receiver - uses port 10162."; - } - } - } - case dtls { - container dtls { - description - "A list of IPv4 and IPv6 addresses and ports to which the - engine listens for SNMP messages over DTLS."; - - leaf ip { - type inet:ip-address; - mandatory true; - description - "The IPv4 or IPv6 address on which the engine listens - for SNMP messages over DTLS."; - } - leaf port { - type inet:port-number; - description - "The UDP port on which the engine listens for SNMP - messages over DTLS. - - If the port is not configured, an engine that - acts as a Command Responder uses port 10161, and - an engine that acts as a Notification Receiver - uses port 10162."; - } - } - } - } - - augment /snmp:snmp { - if-feature tlstm; - container tlstm { - uses x509c2n:cert-to-name { - description - "Defines how certificates are mapped to names. The - resulting name is used as a security name."; - refine cert-to-name/map-type { - description - "Mappings that use the snmpTlstmCertToTSNData column - need to augment the cert-to-name list with - additional configuration objects corresponding - to the snmpTlstmCertToTSNData value. Such objects - should use the 'when' statement to make them - conditional based on the map-type."; - } - } - } - } - - grouping tls-transport { - leaf ip { - type inet:host; - mandatory true; - reference - "RFC 3413: Simple Network Management Protocol (SNMP). - Applications. - SNMP-TARGET-MIB.snmpTargetAddrTAddress - RFC 6353: Transport Layer Security (TLS) Transport Model - for the Simple Network Management Protocol (SNMP). - SNMP-TLS-TM-MIB.SnmpTLSAddress"; - } - leaf port { - type inet:port-number; - default 10161; - reference - "RFC 3413: Simple Network Management Protocol (SNMP). - Applications. - SNMP-TARGET-MIB.snmpTargetAddrTAddress - RFC 6353: Transport Layer Security (TLS) Transport Model - for the Simple Network Management Protocol (SNMP). - SNMP-TLS-TM-MIB.SnmpTLSAddress"; - } - leaf client-fingerprint { - type x509c2n:tls-fingerprint; - reference - "RFC 6353: Transport Layer Security (TLS) Transport Model - for the Simple Network Management Protocol (SNMP). - SNMP-TLS-TM-MIB.snmpTlstmParamsClientFingerprint"; - } - leaf server-fingerprint { - type x509c2n:tls-fingerprint; - reference - "RFC 6353: Transport Layer Security (TLS) Transport Model - for the Simple Network Management Protocol (SNMP). - SNMP-TLS-TM-MIB.snmpTlstmAddrServerFingerprint"; - } - leaf server-identity { - type snmp:admin-string; - reference - "RFC 6353: Transport Layer Security (TLS) Transport Model - for the Simple Network Management Protocol (SNMP). - SNMP-TLS-TM-MIB.snmpTlstmAddrServerIdentity"; - } - } - - augment /snmp:snmp/snmp:target/snmp:transport { - if-feature tlstm; - case tls { - reference - "RFC 6353: Transport Layer Security (TLS) Transport Model - for the Simple Network Management Protocol (SNMP). - SNMP-TLS-TM-MIB.snmpTLSTCPDomain"; - container tls { - uses tls-transport; - } - } - } - - augment /snmp:snmp/snmp:target/snmp:transport { - if-feature tlstm; - case dtls { - reference - "RFC 6353: Transport Layer Security (TLS) Transport Model - for the Simple Network Management Protocol (SNMP). - SNMP-TLS-TM-MIB.snmpDTLSUDPDomain"; - container dtls { - uses tls-transport; - } - } - } -} diff --git a/TestData/YangSource/ietf-snmp-tsm@2014-12-10.yang b/TestData/YangSource/ietf-snmp-tsm@2014-12-10.yang deleted file mode 100644 index 3bf9699..0000000 --- a/TestData/YangSource/ietf-snmp-tsm@2014-12-10.yang +++ /dev/null @@ -1,116 +0,0 @@ -submodule ietf-snmp-tsm { - - belongs-to ietf-snmp { - prefix snmp; - } - - include ietf-snmp-common; - include ietf-snmp-target; - include ietf-snmp-proxy; - - 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 - - - Editor: Juergen Schoenwaelder - "; - - description - "This submodule contains a collection of YANG definitions for - configuring the Transport Security Model (TSM) of SNMP. - - 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 7407; see - the RFC itself for full legal notices."; - - reference - "RFC 5591: Transport Security Model for the - Simple Network Management Protocol (SNMP)"; - - revision 2014-12-10 { - description - "Initial revision."; - reference - "RFC 7407: A YANG Data Model for SNMP Configuration"; - } - - feature tsm { - description - "A server implements this feature if it supports the - Transport Security Model for SNMP."; - reference - "RFC 5591: Transport Security Model for the - Simple Network Management Protocol (SNMP)"; - } - augment /snmp:snmp { - if-feature tsm; - container tsm { - description - "Configuration of the Transport Security Model."; - - leaf use-prefix { - type boolean; - default false; - reference - "RFC 5591: Transport Security Model for the Simple - Network Management Protocol (SNMP). - SNMP-TSM-MIB.snmpTsmConfigurationUsePrefix"; - } - } - } - - grouping tsm-target-params { - container tsm { - description - "Transport-based security SNMPv3 parameters type. - - Represents snmpTargetParamsMPModel '3' and - snmpTargetParamsSecurityModel '4'."; - leaf security-name { - type snmp:security-name; - mandatory true; - reference - "RFC 3413: Simple Network Management Protocol (SNMP). - Applications. - SNMP-TARGET-MIB.snmpTargetParamsSecurityName"; - } - leaf security-level { - type snmp:security-level; - mandatory true; - reference - "RFC 3413: Simple Network Management Protocol (SNMP). - Applications. - SNMP-TARGET-MIB.snmpTargetParamsSecurityLevel"; - } - } - } - - augment /snmp:snmp/snmp:target-params/snmp:params { - if-feature tsm; - case tsm { - uses tsm-target-params; - } - } - -} diff --git a/TestData/YangSource/ietf-snmp-usm@2014-12-10.yang b/TestData/YangSource/ietf-snmp-usm@2014-12-10.yang deleted file mode 100644 index 17024a3..0000000 --- a/TestData/YangSource/ietf-snmp-usm@2014-12-10.yang +++ /dev/null @@ -1,216 +0,0 @@ -submodule ietf-snmp-usm { - - belongs-to ietf-snmp { - prefix snmp; - } - - import ietf-yang-types { - prefix yang; - } - import ietf-netconf-acm { - prefix nacm; - } - - include ietf-snmp-common; - include ietf-snmp-target; - include ietf-snmp-proxy; - - 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 - - - Editor: Juergen Schoenwaelder - "; - - description - "This submodule contains a collection of YANG definitions for - configuring the User-based Security Model (USM) of SNMP. - - 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 7407; see - the RFC itself for full legal notices."; - - reference - "RFC 3414: User-based Security Model (USM) for version 3 of the - Simple Network Management Protocol (SNMPv3)"; - - revision 2014-12-10 { - description - "Initial revision."; - reference - "RFC 7407: A YANG Data Model for SNMP Configuration"; - } - - grouping key { - leaf key { - type yang:hex-string; - mandatory true; - nacm:default-deny-all; - description - "Localized key specified as a list of colon-specified - hexadecimal octets."; - } - } - - grouping user-list { - list user { - key "name"; - - reference - "RFC 3414: User-based Security Model (USM) for version 3 - of the Simple Network Management Protocol (SNMPv3). - SNMP-USER-BASED-SM-MIB.usmUserTable"; - - leaf name { - type snmp:identifier; - reference - "RFC 3414: User-based Security Model (USM) for version 3 - of the Simple Network Management Protocol (SNMPv3). - SNMP-USER-BASED-SM-MIB.usmUserName"; - } - container auth { - presence "enables authentication"; - description - "Enables authentication of the user."; - choice protocol { - mandatory true; - reference - "RFC 3414: User-based Security Model (USM) for version 3 - of the Simple Network Management Protocol (SNMPv3). - SNMP-USER-BASED-SM-MIB.usmUserAuthProtocol"; - container md5 { - uses key; - reference - "RFC 3414: User-based Security Model (USM) for - version 3 of the Simple Network Management Protocol - (SNMPv3). - SNMP-USER-BASED-SM-MIB.usmHMACMD5AuthProtocol"; - } - container sha { - uses key; - reference - "RFC 3414: User-based Security Model (USM) for - version 3 of the Simple Network Management Protocol - (SNMPv3). - SNMP-USER-BASED-SM-MIB.usmHMACSHAAuthProtocol"; - } - } - } - container priv { - must "../auth" { - error-message - "when privacy (confidentiality) is used, " - + "authentication must also be used"; - } - presence "enables encryption"; - description - "Enables encryption of SNMP messages."; - - choice protocol { - mandatory true; - reference - "RFC 3414: User-based Security Model (USM) for version 3 - of the Simple Network Management Protocol (SNMPv3). - SNMP-USER-BASED-SM-MIB.usmUserPrivProtocol"; - container des { - uses key; - reference - "RFC 3414: User-based Security Model (USM) for - version 3 of the Simple Network Management Protocol - (SNMPv3). - SNMP-USER-BASED-SM-MIB.usmDESPrivProtocol"; - } - container aes { - uses key; - - reference - "RFC 3826: The Advanced Encryption Standard (AES) - Cipher Algorithm in the SNMP User-based Security - Model. - SNMP-USM-AES-MIB.usmAesCfb128Protocol"; - } - } - } - } - } - - augment /snmp:snmp { - - container usm { - description - "Configuration of the User-based Security Model."; - container local { - uses user-list; - } - - list remote { - key "engine-id"; - - leaf engine-id { - type snmp:engine-id; - reference - "RFC 3414: User-based Security Model (USM) for version 3 - of the Simple Network Management Protocol (SNMPv3). - SNMP-USER-BASED-SM-MIB.usmUserEngineID"; - } - - uses user-list; - } - } - } - - grouping usm-target-params { - container usm { - description - "User-based SNMPv3 parameters type. - - Represents snmpTargetParamsMPModel '3' and - snmpTargetParamsSecurityModel '3'."; - leaf user-name { - type snmp:security-name; - mandatory true; - - reference - "RFC 3413: Simple Network Management Protocol (SNMP). - Applications. - SNMP-TARGET-MIB.snmpTargetParamsSecurityName"; - } - leaf security-level { - type snmp:security-level; - mandatory true; - reference - "RFC 3413: Simple Network Management Protocol (SNMP). - Applications. - SNMP-TARGET-MIB.snmpTargetParamsSecurityLevel"; - } - } - } - - augment /snmp:snmp/snmp:target-params/snmp:params { - case usm { - uses usm-target-params; - } - } - -} diff --git a/TestData/YangSource/ietf-snmp-vacm@2014-12-10.yang b/TestData/YangSource/ietf-snmp-vacm@2014-12-10.yang deleted file mode 100644 index c3e659c..0000000 --- a/TestData/YangSource/ietf-snmp-vacm@2014-12-10.yang +++ /dev/null @@ -1,291 +0,0 @@ -submodule ietf-snmp-vacm { - - belongs-to ietf-snmp { - prefix snmp; - } - - include ietf-snmp-common; - - 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 - - - Editor: Juergen Schoenwaelder - "; - - description - "This submodule contains a collection of YANG definitions - for configuring the View-based Access Control Model (VACM) - of SNMP. - - 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 7407; see - the RFC itself for full legal notices."; - - reference - "RFC 3415: View-based Access Control Model (VACM) for the - Simple Network Management Protocol (SNMP)"; - - revision 2014-12-10 { - description - "Initial revision."; - reference - "RFC 7407: A YANG Data Model for SNMP Configuration"; - } - - typedef view-name { - type snmp:identifier; - description - "The view-name type represents an SNMP VACM view name."; - } - - typedef group-name { - type snmp:identifier; - description - "The group-name type represents an SNMP VACM group name."; - } - - augment /snmp:snmp { - - container vacm { - description - "Configuration of the View-based Access Control Model."; - - list group { - key name; - description - "VACM groups. - - This data model has a different structure than the MIB. - Groups are explicitly defined in this list, and group - members are defined in the 'member' list (mapped to - vacmSecurityToGroupTable), and access for the group is - defined in the 'access' list (mapped to - vacmAccessTable)."; - reference - "RFC 3415: View-based Access Control Model (VACM) for the - Simple Network Management Protocol (SNMP). - SNMP-VIEW-BASED-ACM-MIB.vacmSecurityToGroupTable - SNMP-VIEW-BASED-ACM-MIB.vacmAccessTable"; - - leaf name { - type group-name; - description - "The name of this VACM group."; - reference - "RFC 3415: View-based Access Control Model (VACM) for the - Simple Network Management Protocol (SNMP). - SNMP-VIEW-BASED-ACM-MIB.vacmGroupName"; - } - - list member { - key "security-name"; - description - "A member of this VACM group. - - A specific combination of security-name and - security-model MUST NOT be present in more than - one group."; - reference - "RFC 3415: View-based Access Control Model (VACM) for the - Simple Network Management Protocol (SNMP). - SNMP-VIEW-BASED-ACM-MIB.vacmSecurityToGroupTable"; - - leaf security-name { - type snmp:security-name; - description - "The securityName of a group member."; - reference - "RFC 3415: View-based Access Control Model (VACM) for - the Simple Network Management Protocol (SNMP). - SNMP-VIEW-BASED-ACM-MIB.vacmSecurityName"; - } - - leaf-list security-model { - type snmp:security-model; - min-elements 1; - description - "The security models under which this security-name - is a member of this group."; - reference - "RFC 3415: View-based Access Control Model (VACM) for - the Simple Network Management Protocol (SNMP). - SNMP-VIEW-BASED-ACM-MIB.vacmSecurityModel"; - } - } - - list access { - key "context security-model security-level"; - description - "Definition of access right for groups."; - reference - "RFC 3415: View-based Access Control Model (VACM) for - the Simple Network Management Protocol (SNMP). - SNMP-VIEW-BASED-ACM-MIB.vacmAccessTable"; - - leaf context { - type snmp:context-name; - description - "The context (prefix) under which the access rights - apply."; - reference - "RFC 3415: View-based Access Control Model (VACM) for - the Simple Network Management Protocol (SNMP). - SNMP-VIEW-BASED-ACM-MIB.vacmAccessContextPrefix"; - } - - leaf context-match { - type enumeration { - enum exact { value 1; } - enum prefix { value 2; } - } - default exact; - reference - "RFC 3415: View-based Access Control Model (VACM) for - the Simple Network Management Protocol (SNMP). - SNMP-VIEW-BASED-ACM-MIB.vacmAccessContextMatch"; - } - - leaf security-model { - type snmp:security-model-or-any; - description - "The security model under which the access rights - apply."; - reference - "RFC 3415: View-based Access Control Model (VACM) for - the Simple Network Management Protocol (SNMP). - SNMP-VIEW-BASED-ACM-MIB.vacmAccessSecurityModel"; - } - - leaf security-level { - type snmp:security-level; - description - "The minimum security level under which the access - rights apply."; - reference - "RFC 3415: View-based Access Control Model (VACM) for - the Simple Network Management Protocol (SNMP). - SNMP-VIEW-BASED-ACM-MIB.vacmAccessSecurityLevel"; - } - - leaf read-view { - type view-name; - description - "The name of the MIB view of the SNMP context - authorizing read access. If this leaf does not - exist in a configuration, it maps to a zero-length - vacmAccessReadViewName. - - Implementations MAY restrict the values of this - leaf to be one of the available values of - /snmp/vacm/view/name in a valid configuration."; - reference - "RFC 3415: View-based Access Control Model (VACM) for - the Simple Network Management Protocol (SNMP). - SNMP-VIEW-BASED-ACM-MIB.vacmAccessReadViewName"; - } - - leaf write-view { - type view-name; - description - "The name of the MIB view of the SNMP context - authorizing write access. If this leaf does not - exist in a configuration, it maps to a zero-length - vacmAccessWriteViewName. - - Implementations MAY restrict the values of this - leaf to be one of the available values of - /snmp/vacm/view/name in a valid configuration."; - reference - "RFC 3415: View-based Access Control Model (VACM) for - the Simple Network Management Protocol (SNMP). - SNMP-VIEW-BASED-ACM-MIB.vacmAccessWriteViewName"; - } - - leaf notify-view { - type view-name; - description - "The name of the MIB view of the SNMP context - authorizing notify access. If this leaf does not - exist in a configuration, it maps to a zero-length - vacmAccessNotifyViewName. - - Implementations MAY restrict the values of this - leaf to be one of the available values of - /snmp/vacm/view/name in a valid configuration."; - reference - "RFC 3415: View-based Access Control Model (VACM) for - the Simple Network Management Protocol (SNMP). - SNMP-VIEW-BASED-ACM-MIB.vacmAccessNotifyViewName"; - } - } - } - - list view { - key name; - description - "Definition of MIB views."; - reference - "RFC 3415: View-based Access Control Model (VACM) for - the Simple Network Management Protocol (SNMP). - SNMP-VIEW-BASED-ACM-MIB.vacmViewTreeFamilyTable"; - - leaf name { - type view-name; - description - "The name of this VACM MIB view."; - - reference - "RFC 3415: View-based Access Control Model (VACM) for - the Simple Network Management Protocol (SNMP). - SNMP-VIEW-BASED-ACM-MIB.vacmViewTreeFamilyName"; - } - - leaf-list include { - type snmp:wildcard-object-identifier; - description - "A family of subtrees included in this MIB view."; - reference - "RFC 3415: View-based Access Control Model (VACM) for - the Simple Network Management Protocol (SNMP). - SNMP-VIEW-BASED-ACM-MIB.vacmViewTreeFamilySubtree - SNMP-VIEW-BASED-ACM-MIB.vacmViewTreeFamilyMask - SNMP-VIEW-BASED-ACM-MIB.vacmViewTreeFamilyType"; - } - - leaf-list exclude { - type snmp:wildcard-object-identifier; - description - "A family of subtrees excluded from this MIB view."; - reference - "RFC 3415: View-based Access Control Model (VACM) for - the Simple Network Management Protocol (SNMP). - SNMP-VIEW-BASED-ACM-MIB.vacmViewTreeFamilySubtree - SNMP-VIEW-BASED-ACM-MIB.vacmViewTreeFamilyMask - SNMP-VIEW-BASED-ACM-MIB.vacmViewTreeFamilyType"; - } - } - } - } -} diff --git a/TestData/YangSource/ietf-snmp@2014-12-10.yang b/TestData/YangSource/ietf-snmp@2014-12-10.yang deleted file mode 100644 index 60237a6..0000000 --- a/TestData/YangSource/ietf-snmp@2014-12-10.yang +++ /dev/null @@ -1,82 +0,0 @@ -module ietf-snmp { - - namespace "urn:ietf:params:xml:ns:yang:ietf-snmp"; - prefix snmp; - - include ietf-snmp-common { - revision-date 2014-12-10; - } - include ietf-snmp-engine { - revision-date 2014-12-10; - } - include ietf-snmp-target { - revision-date 2014-12-10; - } - include ietf-snmp-notification { - revision-date 2014-12-10; - } - include ietf-snmp-proxy { - revision-date 2014-12-10; - } - include ietf-snmp-community { - revision-date 2014-12-10; - } - include ietf-snmp-usm { - revision-date 2014-12-10; - } - include ietf-snmp-tsm { - revision-date 2014-12-10; - } - include ietf-snmp-vacm { - revision-date 2014-12-10; - } - include ietf-snmp-tls { - revision-date 2014-12-10; - } - include ietf-snmp-ssh { - revision-date 2014-12-10; - } - - 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 - - - Editor: Juergen Schoenwaelder - "; - description - "This module contains a collection of YANG definitions for - configuring SNMP engines. - - 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 7407; see - the RFC itself for full legal notices."; - - revision 2014-12-10 { - description - "Initial revision."; - reference - "RFC 7407: A YANG Data Model for SNMP Configuration"; - } - -} diff --git a/TestData/YangSource/ietf-system@2014-08-06.yang b/TestData/YangSource/ietf-system@2014-08-06.yang deleted file mode 100644 index 1618242..0000000 --- a/TestData/YangSource/ietf-system@2014-08-06.yang +++ /dev/null @@ -1,800 +0,0 @@ -module ietf-system { - namespace "urn:ietf:params:xml:ns:yang:ietf-system"; - prefix "sys"; - - import ietf-yang-types { - prefix yang; - } - - import ietf-inet-types { - prefix inet; - } - - import ietf-netconf-acm { - prefix nacm; - } - - import iana-crypt-hash { - prefix ianach; - } - - organization - "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; - - contact - "WG Web: - WG List: - - WG Chair: Thomas Nadeau - - - WG Chair: Juergen Schoenwaelder - - - Editor: Andy Bierman - - - Editor: Martin Bjorklund - "; - - description - "This module contains a collection of YANG definitions for the - configuration and identification of some common system - properties within a device containing a NETCONF server. This - includes data node definitions for system identification, - time-of-day management, user management, DNS resolver - configuration, and some protocol operations for system - management. - - 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 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"; - } - - /* - * Typedefs - */ - - typedef timezone-name { - type string; - description - "A time zone name as used by the Time Zone Database, - sometimes referred to as the 'Olson Database'. - - The exact set of valid values is an implementation-specific - matter. Client discovery of the exact set of time zone names - for a particular server is out of scope."; - reference - "RFC 6557: Procedures for Maintaining the Time Zone Database"; - } - - /* - * Features - */ - - feature radius { - description - "Indicates that the device can be configured as a RADIUS - client."; - reference - "RFC 2865: Remote Authentication Dial In User Service (RADIUS)"; - } - - feature authentication { - description - "Indicates that the device supports configuration of - user authentication."; - } - - feature local-users { - if-feature authentication; - description - "Indicates that the device supports configuration of - local user authentication."; - } - - feature radius-authentication { - if-feature radius; - if-feature authentication; - description - "Indicates that the device supports configuration of user - authentication over RADIUS."; - reference - "RFC 2865: Remote Authentication Dial In User Service (RADIUS) - RFC 5607: Remote Authentication Dial-In User Service (RADIUS) - Authorization for Network Access Server (NAS) - Management"; - } - - feature ntp { - description - "Indicates that the device can be configured to use one or - more NTP servers to set the system date and time."; - } - - feature ntp-udp-port { - if-feature ntp; - description - "Indicates that the device supports the configuration of - the UDP port for NTP servers. - - This is a 'feature', since many implementations do not support - any port other than the default port."; - } - - feature timezone-name { - description - "Indicates that the local time zone on the device - can be configured to use the TZ database - to set the time zone and manage daylight saving time."; - reference - "RFC 6557: Procedures for Maintaining the Time Zone Database"; - } - - feature dns-udp-tcp-port { - description - "Indicates that the device supports the configuration of - the UDP and TCP port for DNS servers. - - This is a 'feature', since many implementations do not support - any port other than the default port."; - } - - /* - * Identities - */ - - identity authentication-method { - description - "Base identity for user authentication methods."; - } - - identity radius { - base authentication-method; - description - "Indicates user authentication using RADIUS."; - reference - "RFC 2865: Remote Authentication Dial In User Service (RADIUS) - RFC 5607: Remote Authentication Dial-In User Service (RADIUS) - Authorization for Network Access Server (NAS) - Management"; - } - - identity local-users { - base authentication-method; - description - "Indicates password-based authentication of locally - configured users."; - } - - identity radius-authentication-type { - description - "Base identity for RADIUS authentication types."; - } - - identity radius-pap { - base radius-authentication-type; - description - "The device requests Password Authentication Protocol (PAP) - authentication from the RADIUS server."; - reference - "RFC 2865: Remote Authentication Dial In User Service (RADIUS)"; - } - - identity radius-chap { - base radius-authentication-type; - description - "The device requests Challenge Handshake Authentication - Protocol (CHAP) authentication from the RADIUS server."; - reference - "RFC 2865: Remote Authentication Dial In User Service (RADIUS)"; - } - - /* - * Configuration data nodes - */ - - container system { - description - "System group configuration."; - - leaf contact { - type string; - description - "The administrator contact information for the system. - - A server implementation MAY map this leaf to the sysContact - MIB object. Such an implementation needs to use some - mechanism to handle the differences in size and characters - allowed between this leaf and sysContact. The definition of - such a mechanism is outside the scope of this document."; - reference - "RFC 3418: Management Information Base (MIB) for the - Simple Network Management Protocol (SNMP) - SNMPv2-MIB.sysContact"; - } - leaf hostname { - type inet:domain-name; - description - "The name of the host. This name can be a single domain - label or the fully qualified domain name of the host."; - } - leaf location { - type string; - description - "The system location. - - A server implementation MAY map this leaf to the sysLocation - MIB object. Such an implementation needs to use some - mechanism to handle the differences in size and characters - allowed between this leaf and sysLocation. The definition - of such a mechanism is outside the scope of this document."; - reference - "RFC 3418: Management Information Base (MIB) for the - Simple Network Management Protocol (SNMP) - SNMPv2-MIB.sysLocation"; - } - - container clock { - description - "Configuration of the system date and time properties."; - - choice timezone { - description - "The system time zone information."; - - case timezone-name { - if-feature timezone-name; - leaf timezone-name { - type timezone-name; - description - "The TZ database name to use for the system, such - as 'Europe/Stockholm'."; - } - } - case timezone-utc-offset { - leaf timezone-utc-offset { - type int16 { - range "-1500 .. 1500"; - } - units "minutes"; - description - "The number of minutes to add to UTC time to - identify the time zone for this system. For example, - 'UTC - 8:00 hours' would be represented as '-480'. - Note that automatic daylight saving time adjustment - is not provided if this object is used."; - } - } - } - } - - container ntp { - if-feature ntp; - presence - "Enables the NTP client unless the 'enabled' leaf - (which defaults to 'true') is set to 'false'"; - description - "Configuration of the NTP client."; - - leaf enabled { - type boolean; - default true; - description - "Indicates that the system should attempt to - synchronize the system clock with an NTP server - from the 'ntp/server' list."; - } - list server { - key name; - description - "List of NTP servers to use for system clock - synchronization. If '/system/ntp/enabled' - is 'true', then the system will attempt to - contact and utilize the specified NTP servers."; - - leaf name { - type string; - description - "An arbitrary name for the NTP server."; - } - choice transport { - mandatory true; - description - "The transport-protocol-specific parameters for this - server."; - - case udp { - container udp { - description - "Contains UDP-specific configuration parameters - for NTP."; - leaf address { - type inet:host; - mandatory true; - description - "The address of the NTP server."; - } - leaf port { - if-feature ntp-udp-port; - type inet:port-number; - default 123; - description - "The port number of the NTP server."; - } - } - } - } - leaf association-type { - type enumeration { - enum server { - description - "Use client association mode. This device - will not provide synchronization to the - configured NTP server."; - } - enum peer { - description - "Use symmetric active association mode. - This device may provide synchronization - to the configured NTP server."; - } - enum pool { - description - "Use client association mode with one or - more of the NTP servers found by DNS - resolution of the domain name given by - the 'address' leaf. This device will not - provide synchronization to the servers."; - } - } - default server; - description - "The desired association type for this NTP server."; - } - leaf iburst { - type boolean; - default false; - description - "Indicates whether this server should enable burst - synchronization or not."; - } - leaf prefer { - type boolean; - default false; - description - "Indicates whether this server should be preferred - or not."; - } - } - } - - container dns-resolver { - description - "Configuration of the DNS resolver."; - - leaf-list search { - type inet:domain-name; - ordered-by user; - description - "An ordered list of domains to search when resolving - a host name."; - } - list server { - key name; - ordered-by user; - description - "List of the DNS servers that the resolver should query. - - When the resolver is invoked by a calling application, it - sends the query to the first name server in this list. If - no response has been received within 'timeout' seconds, - the resolver continues with the next server in the list. - If no response is received from any server, the resolver - continues with the first server again. When the resolver - has traversed the list 'attempts' times without receiving - any response, it gives up and returns an error to the - calling application. - - Implementations MAY limit the number of entries in this - list."; - - leaf name { - type string; - description - "An arbitrary name for the DNS server."; - } - choice transport { - mandatory true; - description - "The transport-protocol-specific parameters for this - server."; - - case udp-and-tcp { - container udp-and-tcp { - description - "Contains UDP- and TCP-specific configuration - parameters for DNS."; - reference - "RFC 1035: Domain Names - Implementation and - Specification - RFC 5966: DNS Transport over TCP - Implementation - Requirements"; - - leaf address { - type inet:ip-address; - mandatory true; - description - "The address of the DNS server."; - } - leaf port { - if-feature dns-udp-tcp-port; - type inet:port-number; - default 53; - description - "The UDP and TCP port number of the DNS server."; - } - } - } - } - } - container options { - description - "Resolver options. The set of available options has been - limited to those that are generally available across - different resolver implementations and generally useful."; - leaf timeout { - type uint8 { - range "1..max"; - } - units "seconds"; - default "5"; - description - "The amount of time the resolver will wait for a - response from each remote name server before - retrying the query via a different name server."; - } - leaf attempts { - type uint8 { - range "1..max"; - } - default "2"; - description - "The number of times the resolver will send a query to - all of its name servers before giving up and returning - an error to the calling application."; - } - } - } - - container radius { - if-feature radius; - - description - "Configuration of the RADIUS client."; - - list server { - key name; - ordered-by user; - description - "List of RADIUS servers used by the device. - - When the RADIUS client is invoked by a calling - application, it sends the query to the first server in - this list. If no response has been received within - 'timeout' seconds, the client continues with the next - server in the list. If no response is received from any - server, the client continues with the first server again. - When the client has traversed the list 'attempts' times - without receiving any response, it gives up and returns an - error to the calling application."; - - leaf name { - type string; - description - "An arbitrary name for the RADIUS server."; - } - choice transport { - mandatory true; - description - "The transport-protocol-specific parameters for this - server."; - - case udp { - container udp { - description - "Contains UDP-specific configuration parameters - for RADIUS."; - leaf address { - type inet:host; - mandatory true; - description - "The address of the RADIUS server."; - } - - leaf authentication-port { - type inet:port-number; - default "1812"; - description - "The port number of the RADIUS server."; - } - leaf shared-secret { - type string; - mandatory true; - nacm:default-deny-all; - description - "The shared secret, which is known to both the - RADIUS client and server."; - reference - "RFC 2865: Remote Authentication Dial In User - Service (RADIUS)"; - } - } - } - } - leaf authentication-type { - type identityref { - base radius-authentication-type; - } - default radius-pap; - description - "The authentication type requested from the RADIUS - server."; - } - } - container options { - description - "RADIUS client options."; - - leaf timeout { - type uint8 { - range "1..max"; - } - units "seconds"; - default "5"; - description - "The number of seconds the device will wait for a - response from each RADIUS server before trying with a - different server."; - } - - leaf attempts { - type uint8 { - range "1..max"; - } - default "2"; - description - "The number of times the device will send a query to - all of its RADIUS servers before giving up."; - } - } - } - - container authentication { - nacm:default-deny-write; - if-feature authentication; - - description - "The authentication configuration subtree."; - - leaf-list user-authentication-order { - type identityref { - base authentication-method; - } - must '(. != "sys:radius" or ../../radius/server)' { - error-message - "When 'radius' is used, a RADIUS server" - + " must be configured."; - description - "When 'radius' is used as an authentication method, - a RADIUS server must be configured."; - } - ordered-by user; - - description - "When the device authenticates a user with a password, - it tries the authentication methods in this leaf-list in - order. If authentication with one method fails, the next - method is used. If no method succeeds, the user is - denied access. - - An empty user-authentication-order leaf-list still allows - authentication of users using mechanisms that do not - involve a password. - - If the 'radius-authentication' feature is advertised by - the NETCONF server, the 'radius' identity can be added to - this list. - - If the 'local-users' feature is advertised by the - NETCONF server, the 'local-users' identity can be - added to this list."; - } - - list user { - if-feature local-users; - key name; - description - "The list of local users configured on this device."; - - leaf name { - type string; - description - "The user name string identifying this entry."; - } - leaf password { - type ianach:crypt-hash; - description - "The password for this entry."; - } - list authorized-key { - key name; - description - "A list of public SSH keys for this user. These keys - are allowed for SSH authentication, as described in - RFC 4253."; - reference - "RFC 4253: The Secure Shell (SSH) Transport Layer - Protocol"; - - leaf name { - type string; - description - "An arbitrary name for the SSH key."; - } - - leaf algorithm { - type string; - mandatory true; - description - "The public key algorithm name for this SSH key. - - Valid values are the values in the IANA 'Secure Shell - (SSH) Protocol Parameters' registry, Public Key - Algorithm Names."; - reference - "IANA 'Secure Shell (SSH) Protocol Parameters' - registry, Public Key Algorithm Names"; - } - leaf key-data { - type binary; - mandatory true; - description - "The binary public key data for this SSH key, as - specified by RFC 4253, Section 6.6, i.e.: - - string certificate or public key format - identifier - byte[n] key/certificate data."; - reference - "RFC 4253: The Secure Shell (SSH) Transport Layer - Protocol"; - } - } - } - } - } - - /* - * Operational state data nodes - */ - - container system-state { - config false; - description - "System group operational state."; - - container platform { - description - "Contains vendor-specific information for - identifying the system platform and operating system."; - reference - "IEEE Std 1003.1-2008 - sys/utsname.h"; - - leaf os-name { - type string; - description - "The name of the operating system in use - - for example, 'Linux'."; - reference - "IEEE Std 1003.1-2008 - utsname.sysname"; - } - leaf os-release { - type string; - description - "The current release level of the operating - system in use. This string MAY indicate - the OS source code revision."; - reference - "IEEE Std 1003.1-2008 - utsname.release"; - } - leaf os-version { - type string; - description - "The current version level of the operating - system in use. This string MAY indicate - the specific OS build date and target variant - information."; - reference - "IEEE Std 1003.1-2008 - utsname.version"; - } - leaf machine { - type string; - description - "A vendor-specific identifier string representing - the hardware in use."; - reference - "IEEE Std 1003.1-2008 - utsname.machine"; - } - } - - container clock { - description - "Monitoring of the system date and time properties."; - - leaf current-datetime { - type yang:date-and-time; - description - "The current system date and time."; - } - - leaf boot-datetime { - type yang:date-and-time; - description - "The system date and time when the system last restarted."; - } - } - } - - rpc set-current-datetime { - nacm:default-deny-all; - description - "Set the /system-state/clock/current-datetime leaf - to the specified value. - - If the system is using NTP (i.e., /system/ntp/enabled - is set to 'true'), then this operation will fail with - error-tag 'operation-failed' and error-app-tag value of - 'ntp-active'."; - input { - leaf current-datetime { - type yang:date-and-time; - mandatory true; - description - "The current system date and time."; - } - } - } - - rpc system-restart { - nacm:default-deny-all; - description - "Request that the entire system be restarted immediately. - A server SHOULD send an rpc reply to the client before - restarting the system."; - } - - rpc system-shutdown { - nacm:default-deny-all; - description - "Request that the entire system be shut down immediately. - A server SHOULD send an rpc reply to the client before - shutting down the system."; - } - -} diff --git a/TestData/YangSource/ietf-template@2010-05-18.yang b/TestData/YangSource/ietf-template@2010-05-18.yang deleted file mode 100644 index 873b995..0000000 --- a/TestData/YangSource/ietf-template@2010-05-18.yang +++ /dev/null @@ -1,83 +0,0 @@ -module ietf-template { - - // replace this string with a unique namespace URN value - namespace - "urn:ietf:params:xml:ns:yang:ietf-template"; - - // replace this string, and try to pick a unique prefix - prefix "temp"; - - // import statements here: e.g., - // import ietf-yang-types { prefix yang; } - // import ietf-inet-types { prefix inet; } - - // identify the IETF working group if applicable - organization - "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; - - // update this contact statement with your info - contact - "WG Web: - WG List: - - WG Chair: your-WG-chair - - - Editor: your-name - "; - - // replace the first sentence in this description statement. - // replace the copyright notice with the most recent - // version, if it has been updated since the publication - // of this document - description - "This module defines a template for other YANG modules. - - Copyright (c) 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 - - reference "RFC XXXX"; - - // RFC Ed.: remove this note - // Note: extracted from RFC 6087 - - // replace '2010-05-18' with the module publication date - // The format is (year-month-day) - revision "2010-05-18" { - description - "Initial version"; - } - - // extension statements - - // feature statements - - // identity statements - - // typedef statements - - // grouping statements - - // data definition statements - - // augment statements - - // rpc statements - - // notification statements - - // DO NOT put deviation statements in a published module - -} diff --git a/TestData/YangSource/ietf-x509-cert-to-name@2014-12-10.yang b/TestData/YangSource/ietf-x509-cert-to-name@2014-12-10.yang deleted file mode 100644 index cbc9be2..0000000 --- a/TestData/YangSource/ietf-x509-cert-to-name@2014-12-10.yang +++ /dev/null @@ -1,303 +0,0 @@ -module ietf-x509-cert-to-name { - - namespace "urn:ietf:params:xml:ns:yang:ietf-x509-cert-to-name"; - prefix x509c2n; - - 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 - - - Editor: Juergen Schoenwaelder - "; - - description - "This module contains a collection of YANG definitions for - extracting a name from an X.509 certificate. - The algorithm used to extract a name from an X.509 certificate - was first defined in RFC 6353. - - 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 7407; see - the RFC itself for full legal notices."; - - reference - "RFC 6353: Transport Layer Security (TLS) Transport Model for - the Simple Network Management Protocol (SNMP)"; - - revision 2014-12-10 { - description - "Initial revision."; - reference - "RFC 7407: A YANG Data Model for SNMP Configuration"; - - } - - typedef tls-fingerprint { - type yang:hex-string { - pattern '([0-9a-fA-F]){2}(:([0-9a-fA-F]){2}){0,254}'; - } - description - "A fingerprint value that can be used to uniquely reference - other data of potentially arbitrary length. - - A tls-fingerprint value is composed of a 1-octet hashing - algorithm identifier followed by the fingerprint value. The - first octet value identifying the hashing algorithm is taken - from the IANA 'TLS HashAlgorithm Registry' (RFC 5246). The - remaining octets are filled using the results of the hashing - algorithm."; - reference - "RFC 6353: Transport Layer Security (TLS) Transport Model - for the Simple Network Management Protocol (SNMP). - SNMP-TLS-TM-MIB.SnmpTLSFingerprint"; - } - - /* Identities */ - - identity cert-to-name { - description - "Base identity for algorithms to derive a name from a - certificate."; - } - - identity specified { - base cert-to-name; - description - "Directly specifies the name to be used for the certificate. - The value of the leaf 'name' in the cert-to-name list is - used."; - reference - "RFC 6353: Transport Layer Security (TLS) Transport Model - for the Simple Network Management Protocol (SNMP). - SNMP-TLS-TM-MIB.snmpTlstmCertSpecified"; - } - - identity san-rfc822-name { - base cert-to-name; - description - "Maps a subjectAltName's rfc822Name to a name. The local part - of the rfc822Name is passed unaltered, but the host-part of - the name must be passed in lowercase. For example, the - rfc822Name field FooBar@Example.COM is mapped to name - FooBar@example.com."; - reference - "RFC 6353: Transport Layer Security (TLS) Transport Model - for the Simple Network Management Protocol (SNMP). - SNMP-TLS-TM-MIB.snmpTlstmCertSANRFC822Name"; - } - - identity san-dns-name { - base cert-to-name; - description - "Maps a subjectAltName's dNSName to a name after first - converting it to all lowercase (RFC 5280 does not specify - converting to lowercase, so this involves an extra step). - This mapping results in a 1:1 correspondence between - subjectAltName dNSName values and the name values."; - reference - "RFC 6353: Transport Layer Security (TLS) Transport Model - for the Simple Network Management Protocol (SNMP). - SNMP-TLS-TM-MIB.snmpTlstmCertSANDNSName"; - } - - identity san-ip-address { - base cert-to-name; - description - "Maps a subjectAltName's iPAddress to a name by - transforming the binary-encoded address as follows: - - 1) for IPv4, the value is converted into a - decimal-dotted quad address (e.g., '192.0.2.1'). - - 2) for IPv6 addresses, the value is converted into a - 32-character, all-lowercase hexadecimal string - without any colon separators. - - This mapping results in a 1:1 correspondence between - subjectAltName iPAddress values and the name values."; - reference - "RFC 6353: Transport Layer Security (TLS) Transport Model - for the Simple Network Management Protocol (SNMP). - SNMP-TLS-TM-MIB.snmpTlstmCertSANIpAddress"; - } - - identity san-any { - base cert-to-name; - description - "Maps any of the following fields using the corresponding - mapping algorithms: - - +------------+-----------------+ - | Type | Algorithm | - |------------+-----------------| - | rfc822Name | san-rfc822-name | - | dNSName | san-dns-name | - | iPAddress | san-ip-address | - +------------+-----------------+ - - The first matching subjectAltName value found in the - certificate of the above types MUST be used when deriving - the name. The mapping algorithm specified in the - 'Algorithm' column MUST be used to derive the name. - - This mapping results in a 1:1 correspondence between - subjectAltName values and name values. The three sub-mapping - algorithms produced by this combined algorithm cannot produce - conflicting results between themselves."; - reference - "RFC 6353: Transport Layer Security (TLS) Transport Model - for the Simple Network Management Protocol (SNMP). - SNMP-TLS-TM-MIB.snmpTlstmCertSANAny"; - } - - identity common-name { - base cert-to-name; - description - "Maps a certificate's CommonName to a name after converting - it to a UTF-8 encoding. The usage of CommonNames is - deprecated, and users are encouraged to use subjectAltName - mapping methods instead. This mapping results in a 1:1 - correspondence between certificate CommonName values and name - values."; - reference - "RFC 6353: Transport Layer Security (TLS) Transport Model - for the Simple Network Management Protocol (SNMP). - SNMP-TLS-TM-MIB.snmpTlstmCertCommonName"; - } - - /* - * Groupings - */ - - grouping cert-to-name { - description - "Defines nodes for mapping certificates to names. Modules - that use this grouping should describe how the resulting - name is used."; - - list cert-to-name { - key id; - description - "This list defines how certificates are mapped to names. - The name is derived by considering each cert-to-name - list entry in order. The cert-to-name entry's fingerprint - determines whether the list entry is a match: - - 1) If the cert-to-name list entry's fingerprint value - matches that of the presented certificate, then consider - the list entry a successful match. - - 2) If the cert-to-name list entry's fingerprint value - matches that of a locally held copy of a trusted CA - certificate, and that CA certificate was part of the CA - certificate chain to the presented certificate, then - consider the list entry a successful match. - - Once a matching cert-to-name list entry has been found, the - map-type is used to determine how the name associated with - the certificate should be determined. See the map-type - leaf's description for details on determining the name value. - If it is impossible to determine a name from the cert-to-name - list entry's data combined with the data presented in the - certificate, then additional cert-to-name list entries MUST - be searched to look for another potential match. - - Security administrators are encouraged to make use of - certificates with subjectAltName fields that can be mapped to - names so that a single root CA certificate can allow all - child certificates' subjectAltName fields to map directly to - a name via a 1:1 transformation."; - reference - "RFC 6353: Transport Layer Security (TLS) Transport Model - for the Simple Network Management Protocol (SNMP). - SNMP-TLS-TM-MIB.snmpTlstmCertToTSNEntry"; - - leaf id { - type uint32; - description - "The id specifies the order in which the entries in the - cert-to-name list are searched. Entries with lower - numbers are searched first."; - reference - "RFC 6353: Transport Layer Security (TLS) Transport Model - for the Simple Network Management Protocol - (SNMP). - SNMP-TLS-TM-MIB.snmpTlstmCertToTSNID"; - } - - leaf fingerprint { - type x509c2n:tls-fingerprint; - mandatory true; - description - "Specifies a value with which the fingerprint of the - full certificate presented by the peer is compared. If - the fingerprint of the full certificate presented by the - peer does not match the fingerprint configured, then the - entry is skipped, and the search for a match continues."; - reference - "RFC 6353: Transport Layer Security (TLS) Transport Model - for the Simple Network Management Protocol - (SNMP). - SNMP-TLS-TM-MIB.snmpTlstmCertToTSNFingerprint"; - } - - leaf map-type { - type identityref { - base cert-to-name; - } - mandatory true; - description - "Specifies the algorithm used to map the certificate - presented by the peer to a name. - - Mappings that need additional configuration objects should - use the 'when' statement to make them conditional based on - the map-type."; - reference - "RFC 6353: Transport Layer Security (TLS) Transport Model - for the Simple Network Management Protocol - (SNMP). - SNMP-TLS-TM-MIB.snmpTlstmCertToTSNMapType"; - } - - leaf name { - when "../map-type = 'x509c2n:specified'"; - type string; - mandatory true; - description - "Directly specifies the NETCONF username when the - map-type is 'specified'."; - reference - "RFC 6353: Transport Layer Security (TLS) Transport Model - for the Simple Network Management Protocol - (SNMP). - SNMP-TLS-TM-MIB.snmpTlstmCertToTSNData"; - } - } - } -} diff --git a/TestData/YangSource/ietf-yang-library@2016-06-21.yang b/TestData/YangSource/ietf-yang-library@2016-06-21.yang deleted file mode 100644 index e6221a6..0000000 --- a/TestData/YangSource/ietf-yang-library@2016-06-21.yang +++ /dev/null @@ -1,244 +0,0 @@ -module ietf-yang-library { - namespace "urn:ietf:params:xml:ns:yang:ietf-yang-library"; - prefix "yanglib"; - - 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: Mahesh Jethanandani - - - Editor: Andy Bierman - - - Editor: Martin Bjorklund - - - Editor: Kent Watsen - "; - - description - "This module contains monitoring information about the YANG - modules and submodules that are used within a YANG-based - server. - - Copyright (c) 2016 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 7895; see - the RFC itself for full legal notices."; - - revision 2016-06-21 { - description - "Initial revision."; - reference - "RFC 7895: YANG Module Library."; - } - - /* - * Typedefs - */ - - typedef revision-identifier { - type string { - pattern '\d{4}-\d{2}-\d{2}'; - } - description - "Represents a specific date in YYYY-MM-DD format."; - } - - /* - * Groupings - */ - - grouping module-list { - description - "The module data structure is represented as a grouping - so it can be reused in configuration or another monitoring - data structure."; - - grouping common-leafs { - description - "Common parameters for YANG modules and submodules."; - - leaf name { - type yang:yang-identifier; - description - "The YANG module or submodule name."; - } - leaf revision { - type union { - type revision-identifier; - type string { length 0; } - } - description - "The YANG module or submodule revision date. - A zero-length string is used if no revision statement - is present in the YANG module or submodule."; - } - } - - grouping schema-leaf { - description - "Common schema leaf parameter for modules and submodules."; - - leaf schema { - type inet:uri; - description - "Contains a URL that represents the YANG schema - resource for this module or submodule. - - This leaf will only be present if there is a URL - available for retrieval of the schema for this entry."; - } - } - - list module { - key "name revision"; - description - "Each entry represents one revision of one module - currently supported by the server."; - - uses common-leafs; - uses schema-leaf; - - leaf namespace { - type inet:uri; - mandatory true; - description - "The XML namespace identifier for this module."; - } - leaf-list feature { - type yang:yang-identifier; - description - "List of YANG feature names from this module that are - supported by the server, regardless of whether they are - defined in the module or any included submodule."; - } - list deviation { - key "name revision"; - description - "List of YANG deviation module names and revisions - used by this server to modify the conformance of - the module associated with this entry. Note that - the same module can be used for deviations for - multiple modules, so the same entry MAY appear - within multiple 'module' entries. - - The deviation module MUST be present in the 'module' - list, with the same name and revision values. - The 'conformance-type' value will be 'implement' for - the deviation module."; - uses common-leafs; - } - leaf conformance-type { - type enumeration { - enum implement { - description - "Indicates that the server implements one or more - protocol-accessible objects defined in the YANG module - identified in this entry. This includes deviation - statements defined in the module. - - For YANG version 1.1 modules, there is at most one - module entry with conformance type 'implement' for a - particular module name, since YANG 1.1 requires that, - at most, one revision of a module is implemented. - - For YANG version 1 modules, there SHOULD NOT be more - than one module entry for a particular module name."; - } - enum import { - description - "Indicates that the server imports reusable definitions - from the specified revision of the module but does - not implement any protocol-accessible objects from - this revision. - - Multiple module entries for the same module name MAY - exist. This can occur if multiple modules import the - same module but specify different revision dates in - the import statements."; - } - } - mandatory true; - description - "Indicates the type of conformance the server is claiming - for the YANG module identified by this entry."; - } - list submodule { - key "name revision"; - description - "Each entry represents one submodule within the - parent module."; - uses common-leafs; - uses schema-leaf; - } - } - } - - /* - * Operational state data nodes - */ - - container modules-state { - config false; - description - "Contains YANG module monitoring information."; - - leaf module-set-id { - type string; - mandatory true; - description - "Contains a server-specific identifier representing - the current set of modules and submodules. The - server MUST change the value of this leaf if the - information represented by the 'module' list instances - has changed."; - } - - uses module-list; - } - - /* - * Notifications - */ - - notification yang-library-change { - description - "Generated when the set of modules and submodules supported - by the server has changed."; - leaf module-set-id { - type leafref { - path "/yanglib:modules-state/yanglib:module-set-id"; - } - mandatory true; - description - "Contains the module-set-id value representing the - set of modules and submodules supported at the server at - the time the notification is generated."; - } - } - -} diff --git a/TestData/YangSource/ietf-yang-metadata@2016-08-05.yang b/TestData/YangSource/ietf-yang-metadata@2016-08-05.yang deleted file mode 100644 index 5939eeb..0000000 --- a/TestData/YangSource/ietf-yang-metadata@2016-08-05.yang +++ /dev/null @@ -1,84 +0,0 @@ -module ietf-yang-metadata { - - namespace "urn:ietf:params:xml:ns:yang:ietf-yang-metadata"; - - prefix "md"; - - organization - "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; - - contact - "WG Web: - - WG List: - - WG Chair: Lou Berger - - - WG Chair: Kent Watsen - - - Editor: Ladislav Lhotka - "; - - description - "This YANG module defines an 'extension' statement that allows - for defining metadata annotations. - - Copyright (c) 2016 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 7952 - (http://www.rfc-editor.org/info/rfc7952); see the RFC itself - for full legal notices."; - - revision 2016-08-05 { - description - "Initial revision."; - reference - "RFC 7952: Defining and Using Metadata with YANG"; - } - - extension annotation { - argument name; - description - "This extension allows for defining metadata annotations in - YANG modules. The 'md:annotation' statement can appear only - at the top level of a YANG module or submodule, i.e., it - becomes a new alternative in the ABNF production rule for - 'body-stmts' (Section 14 in RFC 7950). - - The argument of the 'md:annotation' statement defines the name - of the annotation. Syntactically, it is a YANG identifier as - defined in Section 6.2 of RFC 7950. - - An annotation defined with this 'extension' statement inherits - the namespace and other context from the YANG module in which - it is defined. - - The data type of the annotation value is specified in the same - way as for a leaf data node using the 'type' statement. - - The semantics of the annotation and other documentation can be - specified using the following standard YANG substatements (all - are optional): 'description', 'if-feature', 'reference', - 'status', and 'units'. - - A server announces support for a particular annotation by - including the module in which the annotation is defined among - the advertised YANG modules, e.g., in a NETCONF - message or in the YANG library (RFC 7950). The annotation can - then be attached to any instance of a data node defined in any - YANG module that is advertised by the server. - - XML encoding and JSON encoding of annotations are defined in - RFC 7952."; - } -} diff --git a/TestData/YangSource/ietf-yang-smiv2@2012-06-22.yang b/TestData/YangSource/ietf-yang-smiv2@2012-06-22.yang deleted file mode 100644 index 5127e22..0000000 --- a/TestData/YangSource/ietf-yang-smiv2@2012-06-22.yang +++ /dev/null @@ -1,146 +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) 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 6643; see - the RFC itself for full legal notices."; - - revision 2012-06-22 { - description - "Initial revision."; - reference - "RFC 6643: Translation of Structure of Management Information - Version 2 (SMIv2) MIB Modules to YANG Modules"; - } - - 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 - "RFC 2579: 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. - - The MAX-ACCESS value is SMIv2 specific and has no impact on - the access provided to YANG objects through protocols such - as NETCONF."; - reference - "RFC 2578: 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 - "RFC 2578: 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 - "RFC 2578: 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 - "RFC 2578: 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 - "RFC 2578: 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 an smiv2:oid or smiv2:subid substatement."; - reference - "RFC 2578: Structure of Management Information Version 2 (SMIv2)"; - } - -} diff --git a/TestData/YangSource/ietf-yang-types@2010-09-24.yang b/TestData/YangSource/ietf-yang-types@2010-09-24.yang deleted file mode 100644 index 5e9e0f2..0000000 --- a/TestData/YangSource/ietf-yang-types@2010-09-24.yang +++ /dev/null @@ -1,392 +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 Partain - - WG Chair: David Kessens - - - Editor: Juergen Schoenwaelder - "; - - description - "This module contains a collection of generally useful derived - YANG data types. - - 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 6021; see - the RFC itself for full legal notices."; - - 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-identifier. 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)"; - } - - /*** collection of date and time related types ***/ - - 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"; - } - -} diff --git a/TestData/YangSource/ietf-yang-types@2013-07-15.yang b/TestData/YangSource/ietf-yang-types@2013-07-15.yang deleted file mode 100644 index ee58fa3..0000000 --- a/TestData/YangSource/ietf-yang-types@2013-07-15.yang +++ /dev/null @@ -1,474 +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/YangParser/Generator/YangGenerator.cs b/YangParser/Generator/YangGenerator.cs index 07a8d8e..9edc737 100644 --- a/YangParser/Generator/YangGenerator.cs +++ b/YangParser/Generator/YangGenerator.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using System.Text; using Microsoft.CodeAnalysis; @@ -59,6 +60,7 @@ private void MakeClasses(SourceProductionContext context, AdditionalText text) WalkTree(context, ns, statement, functions); context.AddSource(ns, $$""" using System; + using System.Xml.Linq; namespace {{ns}}; public static class RemoteProcedureCalls { @@ -77,13 +79,25 @@ private static bool MakeSemanticModel(SourceProductionContext context, YangState { model = StatementFactory.Create(statement); } + catch (SemanticError e) + { + context.ReportDiagnostic( + Diagnostic.Create( + SemanticError, + e.Location, + e.Message + ) + ); + model = null!; + return false; + } catch (Exception e) { context.ReportDiagnostic( Diagnostic.Create( SemanticError, Location.Create(statement.Metadata.Source, new TextSpan(), new LinePositionSpan()), - e.Message + e.Message + e.StackTrace ) ); model = null!; @@ -137,11 +151,27 @@ private static bool Parse(SourceProductionContext context, AdditionalText text, private void WalkTree(SourceProductionContext context, string Namespace, IStatement statement, List functions) { + if (statement.Children.FirstOrDefault(x => x is Uses) is Uses uses) + { + UnwrapUses(uses); + } + foreach (var child in statement.Children) { + if (child is ICommentSource commentSource) + { + if (commentSource.Parent is ICommentable commentable) + { + commentable.Comments.Add("///" + commentSource.Argument); + } + + continue; + } + if (child is IClassSource classSource) { MakeClass(context, Namespace, classSource, functions); + continue; } if (child is IFunctionSource functionSource) @@ -151,25 +181,34 @@ private void WalkTree(SourceProductionContext context, string Namespace, IStatem } } + private void UnwrapUses(Uses uses) + { + var index = Array.IndexOf(uses.Parent!.Children, uses); + } + private string MakeFunction(IFunctionSource functionSource) { - return "dummy"; + return $"public static XElement {MakeClassName(functionSource.Argument)}() => new XElement(\"dummy\");"; } private void MakeClass(SourceProductionContext context, string Namespace, IClassSource classSource, List functions) { var name = MakeClassName(classSource.Argument); - context.AddSource(name, $$""" - using System; - - namespace {{Namespace}}; - public class {{name}} - { - public string Dummy; - } - """); - WalkTree(context, Namespace, classSource, functions); + var childNamespaces = Namespace + "." + name; + WalkTree(context, childNamespaces, classSource, functions); + context.AddSource(childNamespaces, $$""" + using System; + + namespace {{Namespace}}; + /// + {{string.Join("\n", classSource.Comments)}} + /// + public class {{name}} + { + public string Dummy; + } + """); } private string Capitalize(string section) diff --git a/YangParser/Parser/YangStatementScanner.cs b/YangParser/Parser/YangStatementScanner.cs index f41fc91..42507a7 100644 --- a/YangParser/Parser/YangStatementScanner.cs +++ b/YangParser/Parser/YangStatementScanner.cs @@ -118,8 +118,8 @@ private static (string Prf, string Kw, Position KwPosition) ParseIdentifier(Pars while (state.LookAhead.Symbol == TermSymbol.StringConcat) { - str = (state.Match(TermSymbol.String).Value as string)!; state.Match(TermSymbol.StringConcat); + str = (state.Match(TermSymbol.String).Value as string)!; strings.Add(str); } diff --git a/YangParser/SemanticModel/Action.cs b/YangParser/SemanticModel/Action.cs index c5ead61..ce1c109 100644 --- a/YangParser/SemanticModel/Action.cs +++ b/YangParser/SemanticModel/Action.cs @@ -10,7 +10,7 @@ public class Action : Statement public Action(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Children = statement.Children.Select(StatementFactory.Create).ToArray(); diff --git a/YangParser/SemanticModel/AnyXml.cs b/YangParser/SemanticModel/AnyXml.cs index 0d584f5..ed003c0 100644 --- a/YangParser/SemanticModel/AnyXml.cs +++ b/YangParser/SemanticModel/AnyXml.cs @@ -9,14 +9,17 @@ public class AnyXml : Statement public AnyXml(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Children = statement.Children.Select(StatementFactory.Create).ToArray(); } + public const string Keyword = "anyxml"; - public override ChildRule[] PermittedChildren { get; } = [ - new ChildRule(StateData.Keyword), + + public override ChildRule[] PermittedChildren { get; } = + [ + new ChildRule(Config.Keyword), new ChildRule(Description.Keyword), new ChildRule(FeatureFlag.Keyword, Cardinality.ZeroOrMore), new ChildRule(Mandatory.Keyword), @@ -26,3 +29,29 @@ public AnyXml(YangStatement statement) new ChildRule(When.Keyword) ]; } + +public class AnyData : Statement +{ + public AnyData(YangStatement statement) + { + if (statement.Keyword != Keyword) + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); + Argument = statement.Argument!.ToString(); + ValidateChildren(statement); + Children = statement.Children.Select(StatementFactory.Create).ToArray(); + } + + public const string Keyword = "anydata"; + + public override ChildRule[] PermittedChildren { get; } = + [ + new ChildRule(Config.Keyword), + new ChildRule(Description.Keyword), + new ChildRule(FeatureFlag.Keyword, Cardinality.ZeroOrMore), + new ChildRule(Mandatory.Keyword), + new ChildRule(Must.Keyword, Cardinality.ZeroOrMore), + new ChildRule(Reference.Keyword), + new ChildRule(Status.Keyword), + new ChildRule(When.Keyword) + ]; +} \ No newline at end of file diff --git a/YangParser/SemanticModel/Argument.cs b/YangParser/SemanticModel/Argument.cs index 5054cc9..6d0862a 100644 --- a/YangParser/SemanticModel/Argument.cs +++ b/YangParser/SemanticModel/Argument.cs @@ -9,7 +9,7 @@ public class Argument : Statement public Argument(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); ValidateChildren(statement); Children = statement.Children.Select(StatementFactory.Create).ToArray(); } diff --git a/YangParser/SemanticModel/Augment.cs b/YangParser/SemanticModel/Augment.cs index 5dbb10e..9f7c5e6 100644 --- a/YangParser/SemanticModel/Augment.cs +++ b/YangParser/SemanticModel/Augment.cs @@ -9,7 +9,7 @@ public class Augment : Statement public Augment(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Children = statement.Children.Select(StatementFactory.Create).ToArray(); @@ -19,6 +19,7 @@ public Augment(YangStatement statement) public override ChildRule[] PermittedChildren { get; } = [ + new ChildRule(AnyData.Keyword, Cardinality.ZeroOrMore), new ChildRule(Description.Keyword), new ChildRule(Reference.Keyword), new ChildRule(FeatureFlag.Keyword, Cardinality.ZeroOrMore), diff --git a/YangParser/SemanticModel/Base.cs b/YangParser/SemanticModel/Base.cs index b743a95..5ad72d7 100644 --- a/YangParser/SemanticModel/Base.cs +++ b/YangParser/SemanticModel/Base.cs @@ -9,7 +9,7 @@ public class Base : Statement public Base(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Children = statement.Children.Select(StatementFactory.Create).ToArray(); diff --git a/YangParser/SemanticModel/Bit.cs b/YangParser/SemanticModel/Bit.cs index e930252..b24b59d 100644 --- a/YangParser/SemanticModel/Bit.cs +++ b/YangParser/SemanticModel/Bit.cs @@ -9,7 +9,7 @@ public class Bit : Statement public Bit(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Children = statement.Children.Select(StatementFactory.Create).ToArray(); diff --git a/YangParser/SemanticModel/Case.cs b/YangParser/SemanticModel/Case.cs index 1a791c7..3e90070 100644 --- a/YangParser/SemanticModel/Case.cs +++ b/YangParser/SemanticModel/Case.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Linq; using YangParser.Parser; @@ -71,10 +72,11 @@ namespace YangParser.SemanticModel; /// public class Case : Statement, IClassSource { + public List Comments { get; } = new(); public Case(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Children = statement.Children.Select(StatementFactory.Create).ToArray(); @@ -84,6 +86,7 @@ public Case(YangStatement statement) public override ChildRule[] PermittedChildren { get; } = [ + new ChildRule(AnyData.Keyword, Cardinality.ZeroOrMore), new ChildRule(AnyXml.Keyword, Cardinality.ZeroOrMore), new ChildRule(Choice.Keyword, Cardinality.ZeroOrMore), new ChildRule(Container.Keyword, Cardinality.ZeroOrMore), diff --git a/YangParser/SemanticModel/Choice.cs b/YangParser/SemanticModel/Choice.cs index fe08426..03db8dd 100644 --- a/YangParser/SemanticModel/Choice.cs +++ b/YangParser/SemanticModel/Choice.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Linq; using YangParser.Parser; @@ -9,18 +10,20 @@ public class Choice : Statement, IClassSource public Choice(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Children = statement.Children.Select(StatementFactory.Create).ToArray(); } public const string Keyword = "choice"; + public override ChildRule[] PermittedChildren { get; } = [ + new ChildRule(AnyData.Keyword, Cardinality.ZeroOrMore), new ChildRule(AnyXml.Keyword, Cardinality.ZeroOrMore), new ChildRule(Case.Keyword, Cardinality.ZeroOrMore), - new ChildRule(StateData.Keyword), + new ChildRule(Config.Keyword), new ChildRule(Container.Keyword, Cardinality.ZeroOrMore), new ChildRule(DefaultValue.Keyword), new ChildRule(Description.Keyword), @@ -33,4 +36,6 @@ public Choice(YangStatement statement) new ChildRule(Status.Keyword), new ChildRule(When.Keyword, Cardinality.ZeroOrMore) ]; + + public List Comments { get; } = new(); } \ No newline at end of file diff --git a/YangParser/SemanticModel/StateData.cs b/YangParser/SemanticModel/Config.cs similarity index 75% rename from YangParser/SemanticModel/StateData.cs rename to YangParser/SemanticModel/Config.cs index 95656df..ae574d9 100644 --- a/YangParser/SemanticModel/StateData.cs +++ b/YangParser/SemanticModel/Config.cs @@ -2,9 +2,9 @@ namespace YangParser.SemanticModel; -public class StateData : Statement +public class Config : Statement { - public StateData(YangStatement statement) + public Config(YangStatement statement) { ValidateChildren(statement); Value = bool.Parse(statement.Argument!.ToString()); diff --git a/YangParser/SemanticModel/Contact.cs b/YangParser/SemanticModel/Contact.cs index 2413708..060285b 100644 --- a/YangParser/SemanticModel/Contact.cs +++ b/YangParser/SemanticModel/Contact.cs @@ -16,7 +16,7 @@ public class Contact : Statement public Contact(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Children = statement.Children.Select(StatementFactory.Create).ToArray(); diff --git a/YangParser/SemanticModel/Container.cs b/YangParser/SemanticModel/Container.cs index 105d91e..aaea44b 100644 --- a/YangParser/SemanticModel/Container.cs +++ b/YangParser/SemanticModel/Container.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Linq; using YangParser.Parser; @@ -6,21 +7,24 @@ namespace YangParser.SemanticModel; public class Container : Statement, IClassSource { + public List Comments { get; } = new(); public Container(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Children = statement.Children.Select(StatementFactory.Create).ToArray(); } public const string Keyword = "container"; + public override ChildRule[] PermittedChildren { get; } = [ + new ChildRule(Action.Keyword, Cardinality.ZeroOrMore), new ChildRule(AnyXml.Keyword, Cardinality.ZeroOrMore), new ChildRule(Choice.Keyword, Cardinality.ZeroOrMore), - new ChildRule(StateData.Keyword), + new ChildRule(Config.Keyword), new ChildRule(Keyword, Cardinality.ZeroOrMore), new ChildRule(Description.Keyword), new ChildRule(Grouping.Keyword, Cardinality.ZeroOrMore), @@ -43,7 +47,7 @@ public class Presence : Statement public Presence(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Children = statement.Children.Select(StatementFactory.Create).ToArray(); diff --git a/YangParser/SemanticModel/DefaultValue.cs b/YangParser/SemanticModel/DefaultValue.cs index e82212a..42b903d 100644 --- a/YangParser/SemanticModel/DefaultValue.cs +++ b/YangParser/SemanticModel/DefaultValue.cs @@ -9,7 +9,7 @@ public class DefaultValue : Statement public DefaultValue(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Children = statement.Children.Select(StatementFactory.Create).ToArray(); diff --git a/YangParser/SemanticModel/Deviate.cs b/YangParser/SemanticModel/Deviate.cs index cd581b6..e912334 100644 --- a/YangParser/SemanticModel/Deviate.cs +++ b/YangParser/SemanticModel/Deviate.cs @@ -49,7 +49,7 @@ public class Deviate : Statement public Deviate(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); Children = statement.Children.Select(StatementFactory.Create).ToArray(); switch (Argument) @@ -68,7 +68,7 @@ public Deviate(YangStatement statement) public override ChildRule[] PermittedChildren { get; } = [ - new ChildRule(StateData.Keyword), + new ChildRule(Config.Keyword), new ChildRule(DefaultValue.Keyword), new ChildRule(Mandatory.Keyword), new ChildRule(MaxElements.Keyword), diff --git a/YangParser/SemanticModel/Deviation.cs b/YangParser/SemanticModel/Deviation.cs index e04a705..bbd9876 100644 --- a/YangParser/SemanticModel/Deviation.cs +++ b/YangParser/SemanticModel/Deviation.cs @@ -9,7 +9,7 @@ public class Deviation : Statement public Deviation(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Children = statement.Children.Select(StatementFactory.Create).ToArray(); diff --git a/YangParser/SemanticModel/Enum.cs b/YangParser/SemanticModel/Enum.cs index a1549f9..056b9db 100644 --- a/YangParser/SemanticModel/Enum.cs +++ b/YangParser/SemanticModel/Enum.cs @@ -9,18 +9,20 @@ public class Enum : Statement public Enum(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Children = statement.Children.Select(StatementFactory.Create).ToArray(); } public const string Keyword = "enum"; + public override ChildRule[] PermittedChildren { get; } = [ new ChildRule(Value.Keyword), + new ChildRule(FeatureFlag.Keyword, Cardinality.ZeroOrMore), new ChildRule(Description.Keyword), new ChildRule(Reference.Keyword), new ChildRule(Status.Keyword) ]; -} +} \ No newline at end of file diff --git a/YangParser/SemanticModel/ErrorAppTag.cs b/YangParser/SemanticModel/ErrorAppTag.cs index 48c46b1..5447808 100644 --- a/YangParser/SemanticModel/ErrorAppTag.cs +++ b/YangParser/SemanticModel/ErrorAppTag.cs @@ -9,7 +9,7 @@ public class ErrorAppTag : Statement public ErrorAppTag(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Children = statement.Children.Select(StatementFactory.Create).ToArray(); diff --git a/YangParser/SemanticModel/ErrorMessage.cs b/YangParser/SemanticModel/ErrorMessage.cs index 31d38f1..f28e2da 100644 --- a/YangParser/SemanticModel/ErrorMessage.cs +++ b/YangParser/SemanticModel/ErrorMessage.cs @@ -9,7 +9,7 @@ public class ErrorMessage : Statement public ErrorMessage(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Children = statement.Children.Select(StatementFactory.Create).ToArray(); diff --git a/YangParser/SemanticModel/Extension.cs b/YangParser/SemanticModel/Extension.cs index 718f7a6..7d96226 100644 --- a/YangParser/SemanticModel/Extension.cs +++ b/YangParser/SemanticModel/Extension.cs @@ -9,7 +9,7 @@ public class Extension : Statement public Extension(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Children = statement.Children.Select(StatementFactory.Create).ToArray(); diff --git a/YangParser/SemanticModel/Feature.cs b/YangParser/SemanticModel/Feature.cs index 8ccb971..b7b4a75 100644 --- a/YangParser/SemanticModel/Feature.cs +++ b/YangParser/SemanticModel/Feature.cs @@ -9,7 +9,7 @@ public class Feature : Statement public Feature(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Children = statement.Children.Select(StatementFactory.Create).ToArray(); diff --git a/YangParser/SemanticModel/FeatureFlag.cs b/YangParser/SemanticModel/FeatureFlag.cs index fdc2702..38c00e8 100644 --- a/YangParser/SemanticModel/FeatureFlag.cs +++ b/YangParser/SemanticModel/FeatureFlag.cs @@ -9,7 +9,7 @@ public class FeatureFlag : Statement public FeatureFlag(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Children = statement.Children.Select(StatementFactory.Create).ToArray(); diff --git a/YangParser/SemanticModel/FractionDigits.cs b/YangParser/SemanticModel/FractionDigits.cs new file mode 100644 index 0000000..518b610 --- /dev/null +++ b/YangParser/SemanticModel/FractionDigits.cs @@ -0,0 +1,17 @@ +using System; +using YangParser.Parser; + +namespace YangParser.SemanticModel; + +public class FractionDigits : Statement +{ + public const string Keyword = "fraction-digits"; + + public FractionDigits(YangStatement statement) + { + if (statement.Keyword != Keyword) + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); + Argument = statement.Argument!.ToString(); + ValidateChildren(statement); + } +} \ No newline at end of file diff --git a/YangParser/SemanticModel/Grouping.cs b/YangParser/SemanticModel/Grouping.cs index 0a6136f..ad0dd53 100644 --- a/YangParser/SemanticModel/Grouping.cs +++ b/YangParser/SemanticModel/Grouping.cs @@ -4,18 +4,19 @@ namespace YangParser.SemanticModel; -public class Grouping : Statement, IClassSource +public class Grouping : Statement { public Grouping(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Children = statement.Children.Select(StatementFactory.Create).ToArray(); } public const string Keyword = "grouping"; + public override ChildRule[] PermittedChildren { get; } = [ new ChildRule(AnyXml.Keyword, Cardinality.ZeroOrMore), @@ -30,5 +31,6 @@ public Grouping(YangStatement statement) new ChildRule(Status.Keyword), new ChildRule(TypeDefinition.Keyword, Cardinality.ZeroOrMore), new ChildRule(Uses.Keyword, Cardinality.ZeroOrMore), + new ChildRule(AnyData.Keyword, Cardinality.ZeroOrMore) ]; } \ No newline at end of file diff --git a/YangParser/SemanticModel/IStatement.cs b/YangParser/SemanticModel/IStatement.cs index f11d647..0de9cf8 100644 --- a/YangParser/SemanticModel/IStatement.cs +++ b/YangParser/SemanticModel/IStatement.cs @@ -1,3 +1,5 @@ +using System.Collections.Generic; + namespace YangParser.SemanticModel; public interface IStatement @@ -8,9 +10,15 @@ public interface IStatement IStatement? Parent { get; set; } } -public interface IFunctionSource : IStatement; +public interface ICommentable : IStatement +{ + List Comments { get; } +} +public interface IFunctionSource : ICommentable; + +public interface IClassSource : ICommentable; -public interface IClassSource : IStatement; +public interface ICommentSource : IStatement; public interface IAttributeSource : IStatement { diff --git a/YangParser/SemanticModel/Identity.cs b/YangParser/SemanticModel/Identity.cs index 791a382..a18d449 100644 --- a/YangParser/SemanticModel/Identity.cs +++ b/YangParser/SemanticModel/Identity.cs @@ -9,16 +9,20 @@ public class Identity : Statement public Identity(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Children = statement.Children.Select(StatementFactory.Create).ToArray(); } + public const string Keyword = "identity"; - public override ChildRule[] PermittedChildren { get; } = [ + + public override ChildRule[] PermittedChildren { get; } = + [ new ChildRule(Description.Keyword), new ChildRule(Reference.Keyword), new ChildRule(Status.Keyword), - new ChildRule(Base.Keyword), + new ChildRule(Base.Keyword, Cardinality.ZeroOrMore), + new ChildRule(FeatureFlag.Keyword, Cardinality.ZeroOrMore) ]; -} +} \ No newline at end of file diff --git a/YangParser/SemanticModel/Import.cs b/YangParser/SemanticModel/Import.cs index 8cfc26d..206eac1 100644 --- a/YangParser/SemanticModel/Import.cs +++ b/YangParser/SemanticModel/Import.cs @@ -9,7 +9,7 @@ public class Import : Statement public Import(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Children = statement.Children.Select(StatementFactory.Create).ToArray(); @@ -19,7 +19,9 @@ public Import(YangStatement statement) public override ChildRule[] PermittedChildren { get; } = [ + new ChildRule(Description.Keyword), new ChildRule(Prefix.Keyword, Cardinality.Required), new ChildRule(RevisionDate.Keyword), + new ChildRule(Reference.Keyword) ]; } \ No newline at end of file diff --git a/YangParser/SemanticModel/Include.cs b/YangParser/SemanticModel/Include.cs index 5578d8e..3d0ab90 100644 --- a/YangParser/SemanticModel/Include.cs +++ b/YangParser/SemanticModel/Include.cs @@ -9,7 +9,7 @@ public class Include : Statement public Include(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Children = statement.Children.Select(StatementFactory.Create).ToArray(); diff --git a/YangParser/SemanticModel/Input.cs b/YangParser/SemanticModel/Input.cs index 96e195d..6b24db7 100644 --- a/YangParser/SemanticModel/Input.cs +++ b/YangParser/SemanticModel/Input.cs @@ -9,7 +9,7 @@ public class Input : Statement public Input(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); ValidateChildren(statement); Children = statement.Children.Select(StatementFactory.Create).ToArray(); } diff --git a/YangParser/SemanticModel/Key.cs b/YangParser/SemanticModel/Key.cs index 4a01e28..c1a01bc 100644 --- a/YangParser/SemanticModel/Key.cs +++ b/YangParser/SemanticModel/Key.cs @@ -9,7 +9,7 @@ public class Key : Statement public Key(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Children = statement.Children.Select(StatementFactory.Create).ToArray(); diff --git a/YangParser/SemanticModel/Leaf.cs b/YangParser/SemanticModel/Leaf.cs index 5357667..7c332c9 100644 --- a/YangParser/SemanticModel/Leaf.cs +++ b/YangParser/SemanticModel/Leaf.cs @@ -4,11 +4,11 @@ namespace YangParser.SemanticModel; -public class Leaf : Statement, IClassSource +public class Leaf : Statement { public override ChildRule[] PermittedChildren { get; } = [ - new ChildRule(StateData.Keyword), + new ChildRule(Config.Keyword), new ChildRule(DefaultValue.Keyword), new ChildRule(Description.Keyword), new ChildRule(FeatureFlag.Keyword, Cardinality.ZeroOrMore), @@ -24,7 +24,7 @@ public class Leaf : Statement, IClassSource public Leaf(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Children = statement.Children.Select(StatementFactory.Create).ToArray(); diff --git a/YangParser/SemanticModel/LeafList.cs b/YangParser/SemanticModel/LeafList.cs index c1e16cb..5495e06 100644 --- a/YangParser/SemanticModel/LeafList.cs +++ b/YangParser/SemanticModel/LeafList.cs @@ -4,11 +4,11 @@ namespace YangParser.SemanticModel; -public class LeafList : Statement, IClassSource +public class LeafList : Statement { public override ChildRule[] PermittedChildren { get; } = [ - new ChildRule(StateData.Keyword), + new ChildRule(Config.Keyword), new ChildRule(Description.Keyword), new ChildRule(FeatureFlag.Keyword, Cardinality.ZeroOrMore), new ChildRule(MaxElements.Keyword), @@ -19,13 +19,14 @@ public class LeafList : Statement, IClassSource new ChildRule(Status.Keyword), new ChildRule(Type.Keyword, Cardinality.Required), new ChildRule(Units.Keyword), + new ChildRule(DefaultValue.Keyword), new ChildRule(When.Keyword) ]; public LeafList(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Children = statement.Children.Select(StatementFactory.Create).ToArray(); diff --git a/YangParser/SemanticModel/Length.cs b/YangParser/SemanticModel/Length.cs index 9568735..ce0c9e5 100644 --- a/YangParser/SemanticModel/Length.cs +++ b/YangParser/SemanticModel/Length.cs @@ -9,7 +9,7 @@ public class Length : Statement public Length(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Children = statement.Children.Select(StatementFactory.Create).ToArray(); diff --git a/YangParser/SemanticModel/List.cs b/YangParser/SemanticModel/List.cs index 2775f57..1bff805 100644 --- a/YangParser/SemanticModel/List.cs +++ b/YangParser/SemanticModel/List.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Linq; using YangParser.Parser; @@ -6,11 +7,15 @@ namespace YangParser.SemanticModel; public class List : Statement, IClassSource { + private YangStatement m_source; + public override ChildRule[] PermittedChildren { get; } = [ + new ChildRule(AnyData.Keyword, Cardinality.ZeroOrMore), new ChildRule(AnyXml.Keyword, Cardinality.ZeroOrMore), + new ChildRule(Action.Keyword, Cardinality.ZeroOrMore), new ChildRule(Choice.Keyword, Cardinality.ZeroOrMore), - new ChildRule(StateData.Keyword), + new ChildRule(Config.Keyword), new ChildRule(Container.Keyword, Cardinality.ZeroOrMore), new ChildRule(Description.Keyword), new ChildRule(Grouping.Keyword, Cardinality.ZeroOrMore), @@ -19,6 +24,7 @@ public class List : Statement, IClassSource new ChildRule(Leaf.Keyword, Cardinality.ZeroOrMore), new ChildRule(LeafList.Keyword, Cardinality.ZeroOrMore), new ChildRule(Keyword, Cardinality.ZeroOrMore), + new ChildRule(Notification.Keyword, Cardinality.ZeroOrMore), new ChildRule(MaxElements.Keyword), new ChildRule(MinElements.Keyword), new ChildRule(Must.Keyword, Cardinality.ZeroOrMore), @@ -34,17 +40,13 @@ public class List : Statement, IClassSource public List(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Children = statement.Children.Select(StatementFactory.Create).ToArray(); - var key = Children.OfType().FirstOrDefault(); - var stateData = Children.OfType().FirstOrDefault(); - if (stateData == null || stateData.Argument != "true") - { - if (key == null) throw new InvalidOperationException("List must have a key when it represents configuration data"); - } + m_source = statement; } public const string Keyword = "list"; -} + public List Comments { get; } = new(); +} \ No newline at end of file diff --git a/YangParser/SemanticModel/MaxElements.cs b/YangParser/SemanticModel/MaxElements.cs index 18f09ac..85a0c56 100644 --- a/YangParser/SemanticModel/MaxElements.cs +++ b/YangParser/SemanticModel/MaxElements.cs @@ -11,7 +11,7 @@ public class MaxElements : Statement public MaxElements(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Value = int.Parse(Argument); diff --git a/YangParser/SemanticModel/MinElements.cs b/YangParser/SemanticModel/MinElements.cs index f952aeb..9a457ef 100644 --- a/YangParser/SemanticModel/MinElements.cs +++ b/YangParser/SemanticModel/MinElements.cs @@ -11,7 +11,7 @@ public class MinElements : Statement public MinElements(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Value = int.Parse(Argument); diff --git a/YangParser/SemanticModel/Module.cs b/YangParser/SemanticModel/Module.cs index 9cc8b2b..db52969 100644 --- a/YangParser/SemanticModel/Module.cs +++ b/YangParser/SemanticModel/Module.cs @@ -9,7 +9,7 @@ public class Module : Statement public Module(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Children = statement.Children.Select(StatementFactory.Create).ToArray(); @@ -45,7 +45,7 @@ public Module(YangStatement statement) new ChildRule(Rpc.Keyword, Cardinality.ZeroOrMore), new ChildRule(TypeDefinition.Keyword, Cardinality.ZeroOrMore), new ChildRule(Uses.Keyword, Cardinality.ZeroOrMore), - new ChildRule(YangVersion.Keyword) + new ChildRule(YangVersion.Keyword, Cardinality.Required), ]; public const string Keyword = "module"; diff --git a/YangParser/SemanticModel/Must.cs b/YangParser/SemanticModel/Must.cs index e3b538f..10bdf48 100644 --- a/YangParser/SemanticModel/Must.cs +++ b/YangParser/SemanticModel/Must.cs @@ -9,7 +9,7 @@ public class Must : Statement public Must(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Children = statement.Children.Select(StatementFactory.Create).ToArray(); diff --git a/YangParser/SemanticModel/Namespace.cs b/YangParser/SemanticModel/Namespace.cs index de4ac46..9b40356 100644 --- a/YangParser/SemanticModel/Namespace.cs +++ b/YangParser/SemanticModel/Namespace.cs @@ -9,7 +9,7 @@ public class Namespace : Statement public Namespace(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Children = statement.Children.Select(StatementFactory.Create).ToArray(); diff --git a/YangParser/SemanticModel/Notification.cs b/YangParser/SemanticModel/Notification.cs index 951bb0f..429d806 100644 --- a/YangParser/SemanticModel/Notification.cs +++ b/YangParser/SemanticModel/Notification.cs @@ -9,7 +9,7 @@ public class Notification : Statement public Notification(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Children = statement.Children.Select(StatementFactory.Create).ToArray(); @@ -19,6 +19,7 @@ public Notification(YangStatement statement) public override ChildRule[] PermittedChildren { get; } = [ + new ChildRule(AnyData.Keyword, Cardinality.ZeroOrMore), new ChildRule(AnyXml.Keyword, Cardinality.ZeroOrMore), new ChildRule(Choice.Keyword, Cardinality.ZeroOrMore), new ChildRule(Container.Keyword, Cardinality.ZeroOrMore), diff --git a/YangParser/SemanticModel/OrderedBy.cs b/YangParser/SemanticModel/OrderedBy.cs index 9d71b68..da29ed5 100644 --- a/YangParser/SemanticModel/OrderedBy.cs +++ b/YangParser/SemanticModel/OrderedBy.cs @@ -9,7 +9,7 @@ public class OrderedBy : Statement public OrderedBy(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); switch (Argument) diff --git a/YangParser/SemanticModel/Organization.cs b/YangParser/SemanticModel/Organization.cs index 8c44190..0aae989 100644 --- a/YangParser/SemanticModel/Organization.cs +++ b/YangParser/SemanticModel/Organization.cs @@ -9,7 +9,7 @@ public class Organization : Statement public Organization(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Children = statement.Children.Select(StatementFactory.Create).ToArray(); diff --git a/YangParser/SemanticModel/Output.cs b/YangParser/SemanticModel/Output.cs index d5e27a4..a6ee237 100644 --- a/YangParser/SemanticModel/Output.cs +++ b/YangParser/SemanticModel/Output.cs @@ -9,7 +9,7 @@ public class Output : Statement public Output(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); ValidateChildren(statement); Children = statement.Children.Select(StatementFactory.Create).ToArray(); } @@ -17,6 +17,7 @@ public Output(YangStatement statement) public const string Keyword = "output"; public override ChildRule[] PermittedChildren { get; } = [ + new ChildRule(AnyData.Keyword, Cardinality.ZeroOrMore), new ChildRule(AnyXml.Keyword, Cardinality.ZeroOrMore), new ChildRule(Choice.Keyword, Cardinality.ZeroOrMore), new ChildRule(Container.Keyword, Cardinality.ZeroOrMore), diff --git a/YangParser/SemanticModel/Path.cs b/YangParser/SemanticModel/Path.cs index c196f27..f11ab89 100644 --- a/YangParser/SemanticModel/Path.cs +++ b/YangParser/SemanticModel/Path.cs @@ -49,7 +49,7 @@ public class Path : Statement public Path(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Children = statement.Children.Select(StatementFactory.Create).ToArray(); diff --git a/YangParser/SemanticModel/Pattern.cs b/YangParser/SemanticModel/Pattern.cs index f8ec474..6b466de 100644 --- a/YangParser/SemanticModel/Pattern.cs +++ b/YangParser/SemanticModel/Pattern.cs @@ -54,7 +54,7 @@ public class Pattern : Statement public Pattern(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Children = statement.Children.Select(StatementFactory.Create).ToArray(); @@ -67,6 +67,24 @@ public Pattern(YangStatement statement) new ChildRule(Description.Keyword), new ChildRule(ErrorAppTag.Keyword), new ChildRule(ErrorMessage.Keyword), + new ChildRule(Modifier.Keyword), new ChildRule(Reference.Keyword) ]; +} + +public class Modifier : Statement +{ + public Modifier(YangStatement statement) + { + if (statement.Keyword != Keyword) + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); + Argument = statement.Argument!.ToString(); + ValidateChildren(statement); + if (Argument != "invert-match") + { + throw new SemanticError($"Invalid argument for '{statement.Keyword}', expected 'invert-match'", statement); + } + } + + public const string Keyword = "modifier"; } \ No newline at end of file diff --git a/YangParser/SemanticModel/Position.cs b/YangParser/SemanticModel/Position.cs index 55cc356..2f3a570 100644 --- a/YangParser/SemanticModel/Position.cs +++ b/YangParser/SemanticModel/Position.cs @@ -9,7 +9,7 @@ public class Position : Statement public Position(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Children = statement.Children.Select(StatementFactory.Create).ToArray(); diff --git a/YangParser/SemanticModel/Prefix.cs b/YangParser/SemanticModel/Prefix.cs index 572cc9b..af02939 100644 --- a/YangParser/SemanticModel/Prefix.cs +++ b/YangParser/SemanticModel/Prefix.cs @@ -9,7 +9,7 @@ public class Prefix : Statement public Prefix(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Children = statement.Children.Select(StatementFactory.Create).ToArray(); diff --git a/YangParser/SemanticModel/Range.cs b/YangParser/SemanticModel/Range.cs index 8f4f16a..3a7bda8 100644 --- a/YangParser/SemanticModel/Range.cs +++ b/YangParser/SemanticModel/Range.cs @@ -9,7 +9,7 @@ public class Range : Statement public Range(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); } diff --git a/YangParser/SemanticModel/Reference.cs b/YangParser/SemanticModel/Reference.cs index 19ade8d..7ef7685 100644 --- a/YangParser/SemanticModel/Reference.cs +++ b/YangParser/SemanticModel/Reference.cs @@ -4,12 +4,12 @@ namespace YangParser.SemanticModel; -public class Reference : Statement +public class Reference : Statement, ICommentSource { public Reference(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Children = statement.Children.Select(StatementFactory.Create).ToArray(); diff --git a/YangParser/SemanticModel/Refine.cs b/YangParser/SemanticModel/Refine.cs index 2d536bc..b122a99 100644 --- a/YangParser/SemanticModel/Refine.cs +++ b/YangParser/SemanticModel/Refine.cs @@ -9,7 +9,7 @@ public class Refine : Statement public Refine(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Children = statement.Children.Select(StatementFactory.Create).ToArray(); @@ -26,6 +26,6 @@ public Refine(YangStatement statement) new ChildRule(Must.Keyword, Cardinality.ZeroOrMore), new ChildRule(MinElements.Keyword), new ChildRule(MaxElements.Keyword), - new ChildRule(StateData.Keyword) + new ChildRule(Config.Keyword) ]; } \ No newline at end of file diff --git a/YangParser/SemanticModel/RequireInstance.cs b/YangParser/SemanticModel/RequireInstance.cs index b9fbb6b..eb5146d 100644 --- a/YangParser/SemanticModel/RequireInstance.cs +++ b/YangParser/SemanticModel/RequireInstance.cs @@ -9,7 +9,7 @@ public class RequireInstance : Statement public RequireInstance(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Value = bool.Parse(Argument); diff --git a/YangParser/SemanticModel/Revision.cs b/YangParser/SemanticModel/Revision.cs index f2ff9b2..b7e3c0b 100644 --- a/YangParser/SemanticModel/Revision.cs +++ b/YangParser/SemanticModel/Revision.cs @@ -9,7 +9,7 @@ public class Revision : Statement public Revision(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Children = statement.Children.Select(StatementFactory.Create).ToArray(); diff --git a/YangParser/SemanticModel/RevisionDate.cs b/YangParser/SemanticModel/RevisionDate.cs index 0f3f475..3ff930e 100644 --- a/YangParser/SemanticModel/RevisionDate.cs +++ b/YangParser/SemanticModel/RevisionDate.cs @@ -9,7 +9,7 @@ public class RevisionDate : Statement public RevisionDate(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Children = statement.Children.Select(StatementFactory.Create).ToArray(); diff --git a/YangParser/SemanticModel/Rpc.cs b/YangParser/SemanticModel/Rpc.cs index a54d714..815ff6e 100644 --- a/YangParser/SemanticModel/Rpc.cs +++ b/YangParser/SemanticModel/Rpc.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Linq; using YangParser.Parser; @@ -6,10 +7,12 @@ namespace YangParser.SemanticModel; public class Rpc : Statement, IFunctionSource { + + public List Comments { get; } = new(); public Rpc(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Children = statement.Children.Select(StatementFactory.Create).ToArray(); diff --git a/YangParser/SemanticModel/SemanticError.cs b/YangParser/SemanticModel/SemanticError.cs new file mode 100644 index 0000000..ebdfb26 --- /dev/null +++ b/YangParser/SemanticModel/SemanticError.cs @@ -0,0 +1,21 @@ +using System; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.Text; +using YangParser.Parser; + +namespace YangParser.SemanticModel; + +public class SemanticError(string message, YangStatement source) : Exception(message) +{ + public Location Location => Location.Create( + source.Metadata.Source, + new TextSpan( + source.Metadata.Position.Offset, + source.Metadata.Length + ), + new LinePositionSpan( + new LinePosition(source.Metadata.Position.Line, source.Metadata.Position.Column), + new LinePosition(source.Metadata.Position.Line, source.Metadata.Position.Column + source.Metadata.Length) + ) + ); +} \ No newline at end of file diff --git a/YangParser/SemanticModel/Statement.cs b/YangParser/SemanticModel/Statement.cs index 8441158..9302d48 100644 --- a/YangParser/SemanticModel/Statement.cs +++ b/YangParser/SemanticModel/Statement.cs @@ -10,11 +10,18 @@ public abstract class Statement : IStatement private IStatement[] _children = []; private IStatement? _parent; + /// + /// + /// + /// + /// + /// protected void ValidateChildren(YangStatement statement) { Dictionary occurances = new(); foreach (var child in statement.Children) { + if (!string.IsNullOrWhiteSpace(child.Prefix)) continue; if (PermittedChildren.Any(p => p.Keyword == child.Keyword)) { if (occurances.ContainsKey(child.Keyword)) @@ -29,8 +36,8 @@ protected void ValidateChildren(YangStatement statement) continue; } - throw new InvalidOperationException( - $"Child of type {child.Keyword} is not permitted inside statement of type {GetType()}"); + throw new SemanticError( + $"Child of type {child.Keyword} is not permitted inside statement of type {GetType()}", statement); } foreach (var allowed in PermittedChildren) @@ -40,17 +47,17 @@ protected void ValidateChildren(YangStatement statement) case Cardinality.Required when occurances.TryGetValue(allowed.Keyword, out var count): { if (count == 1) break; - throw new InvalidOperationException( - $"Child of type {allowed.Keyword} can only exist once in {GetType()}"); + throw new SemanticError( + $"Child of type {allowed.Keyword} can only exist once in {GetType()}", statement); } case Cardinality.Required: - throw new InvalidOperationException( - $"Child of type {allowed.Keyword} must exist in type {GetType()}"); + throw new SemanticError( + $"Child of type {allowed.Keyword} must exist in type {GetType()}", statement); case Cardinality.ZeroOrOne when occurances.TryGetValue(allowed.Keyword, out var count): { if (count <= 1) break; - throw new InvalidOperationException( - $"Child of type {allowed.Keyword} can only exist up to once in {GetType()}"); + throw new SemanticError( + $"Child of type {allowed.Keyword} can only exist up to once in {GetType()}", statement); } case Cardinality.ZeroOrOne: case Cardinality.ZeroOrMore: @@ -91,6 +98,5 @@ public IStatement? Parent protected virtual void ValidateParent() { - } } \ No newline at end of file diff --git a/YangParser/SemanticModel/StatementFactory.cs b/YangParser/SemanticModel/StatementFactory.cs index 5070cc1..50d1546 100644 --- a/YangParser/SemanticModel/StatementFactory.cs +++ b/YangParser/SemanticModel/StatementFactory.cs @@ -1,12 +1,30 @@ using System; +using System.Linq; using YangParser.Parser; namespace YangParser.SemanticModel; +public class KeywordReference : Statement +{ + public KeywordReference(YangStatement statement) + { + ReferenceNamespace = statement.Prefix; + Argument = statement.Argument?.ToString() ?? string.Empty; + Children = statement.Children.Select(StatementFactory.Create).ToArray(); + } + + public string ReferenceNamespace { get; set; } +} + public static class StatementFactory { public static IStatement Create(YangStatement source) { + if (!string.IsNullOrWhiteSpace(source.Prefix)) + { + return new KeywordReference(source); + } + return source.Keyword switch { Module.Keyword => new Module(source), @@ -39,7 +57,7 @@ public static IStatement Create(YangStatement source) Status.Keyword => new Status(source), DefaultValue.Keyword => new DefaultValue(source), Mandatory.Keyword => new Mandatory(source), - StateData.Keyword => new StateData(source), + Config.Keyword => new Config(source), Reference.Keyword => new Reference(source), Units.Keyword => new Units(source), Must.Keyword => new Must(source), @@ -60,6 +78,21 @@ public static IStatement Create(YangStatement source) Input.Keyword => new Input(source), Output.Keyword => new Output(source), Presence.Keyword => new Presence(source), + YangVersion.Keyword => new YangVersion(source), + Base.Keyword => new Base(source), + Feature.Keyword => new Feature(source), + FractionDigits.Keyword => new FractionDigits(source), + Range.Keyword => new Range(source), + Argument.Keyword => new Argument(source), + YinElement.Keyword => new YinElement(source), + Position.Keyword => new Position(source), + ErrorMessage.Keyword => new ErrorMessage(source), + Submodule.Keyword => new Submodule(source), + Refine.Keyword => new Refine(source), + RevisionDate.Keyword => new RevisionDate(source), + AnyData.Keyword => new AnyData(source), + Modifier.Keyword => new Modifier(source), + BelongsTo.Keyword => new BelongsTo(source), _ => throw new InvalidOperationException($"Unknown keyword {source.Keyword}") }; } diff --git a/YangParser/SemanticModel/Status.cs b/YangParser/SemanticModel/Status.cs index dad44eb..9db2079 100644 --- a/YangParser/SemanticModel/Status.cs +++ b/YangParser/SemanticModel/Status.cs @@ -9,7 +9,7 @@ public class Status : Statement, IAttributeSource public Status(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); switch (Argument) diff --git a/YangParser/SemanticModel/Submodule.cs b/YangParser/SemanticModel/Submodule.cs new file mode 100644 index 0000000..ffec50d --- /dev/null +++ b/YangParser/SemanticModel/Submodule.cs @@ -0,0 +1,69 @@ +using System; +using System.Linq; +using YangParser.Parser; + +namespace YangParser.SemanticModel; + +public class Submodule : Statement +{ + public Submodule(YangStatement statement) + { + if (statement.Keyword != Keyword) + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); + Argument = statement.Argument!.ToString(); + ValidateChildren(statement); + Children = statement.Children.Select(StatementFactory.Create).ToArray(); + } + + + public override ChildRule[] PermittedChildren { get; } = + [ + new ChildRule(AnyData.Keyword, Cardinality.ZeroOrMore), + new ChildRule(AnyXml.Keyword, Cardinality.ZeroOrMore), + new ChildRule(Augment.Keyword, Cardinality.ZeroOrMore), + new ChildRule(BelongsTo.Keyword, Cardinality.Required), + new ChildRule(Choice.Keyword, Cardinality.ZeroOrMore), + new ChildRule(Contact.Keyword), + new ChildRule(Container.Keyword, Cardinality.ZeroOrMore), + new ChildRule(Description.Keyword), + new ChildRule(Deviation.Keyword, Cardinality.ZeroOrMore), + new ChildRule(Extension.Keyword, Cardinality.ZeroOrMore), + new ChildRule(Feature.Keyword, Cardinality.ZeroOrMore), + new ChildRule(Grouping.Keyword, Cardinality.ZeroOrMore), + new ChildRule(Identity.Keyword, Cardinality.ZeroOrMore), + new ChildRule(Import.Keyword, Cardinality.ZeroOrMore), + new ChildRule(Include.Keyword, Cardinality.ZeroOrMore), + new ChildRule(Leaf.Keyword, Cardinality.ZeroOrMore), + new ChildRule(LeafList.Keyword, Cardinality.ZeroOrMore), + new ChildRule(List.Keyword, Cardinality.ZeroOrMore), + new ChildRule(Notification.Keyword, Cardinality.ZeroOrMore), + new ChildRule(Organization.Keyword), + new ChildRule(Reference.Keyword), + new ChildRule(Revision.Keyword, Cardinality.ZeroOrMore), + new ChildRule(Rpc.Keyword, Cardinality.ZeroOrMore), + new ChildRule(TypeDefinition.Keyword, Cardinality.ZeroOrMore), + new ChildRule(Uses.Keyword, Cardinality.ZeroOrMore), + new ChildRule(YangVersion.Keyword, Cardinality.Required), + ]; + + public const string Keyword = "submodule"; +} + +public class BelongsTo : Statement +{ + public BelongsTo(YangStatement statement) + { + if (statement.Keyword != Keyword) + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); + Argument = statement.Argument!.ToString(); + ValidateChildren(statement); + Children = statement.Children.Select(StatementFactory.Create).ToArray(); + } + + public const string Keyword = "belongs-to"; + + public override ChildRule[] PermittedChildren { get; } = + [ + new ChildRule(Prefix.Keyword, Cardinality.Required) + ]; +} \ No newline at end of file diff --git a/YangParser/SemanticModel/Type.cs b/YangParser/SemanticModel/Type.cs index 224aa54..2943ff7 100644 --- a/YangParser/SemanticModel/Type.cs +++ b/YangParser/SemanticModel/Type.cs @@ -9,13 +9,14 @@ public class Type : Statement public Type(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Children = statement.Children.Select(StatementFactory.Create).ToArray(); } public const string Keyword = "type"; + public override ChildRule[] PermittedChildren { get; } = [ new ChildRule(Enum.Keyword, Cardinality.ZeroOrMore), @@ -25,6 +26,8 @@ public Type(YangStatement statement) new ChildRule(Path.Keyword), new ChildRule(Range.Keyword), new ChildRule(RequireInstance.Keyword), + new ChildRule(FractionDigits.Keyword), + new ChildRule(Base.Keyword), new ChildRule(Keyword, Cardinality.ZeroOrMore), ]; -} +} \ No newline at end of file diff --git a/YangParser/SemanticModel/TypeDefinition.cs b/YangParser/SemanticModel/TypeDefinition.cs index 20cf843..9f8559e 100644 --- a/YangParser/SemanticModel/TypeDefinition.cs +++ b/YangParser/SemanticModel/TypeDefinition.cs @@ -1,22 +1,25 @@ using System; +using System.Collections.Generic; using System.Linq; using YangParser.Parser; namespace YangParser.SemanticModel; -public class TypeDefinition : Statement, IClassSource +public class TypeDefinition : Statement, IFunctionSource { public TypeDefinition(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Children = statement.Children.Select(StatementFactory.Create).ToArray(); } public const string Keyword = "typedef"; - public override ChildRule[] PermittedChildren { get; } = [ + + public override ChildRule[] PermittedChildren { get; } = + [ new ChildRule(DefaultValue.Keyword), new ChildRule(Description.Keyword), new ChildRule(Reference.Keyword), @@ -24,4 +27,6 @@ public TypeDefinition(YangStatement statement) new ChildRule(Type.Keyword, Cardinality.Required), new ChildRule(Units.Keyword), ]; + + public List Comments { get; } = new(); } \ No newline at end of file diff --git a/YangParser/SemanticModel/Unique.cs b/YangParser/SemanticModel/Unique.cs index d6710ca..22ba6b8 100644 --- a/YangParser/SemanticModel/Unique.cs +++ b/YangParser/SemanticModel/Unique.cs @@ -9,7 +9,7 @@ public class Unique : Statement public Unique(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Identifiers = Argument.Split(' '); diff --git a/YangParser/SemanticModel/Units.cs b/YangParser/SemanticModel/Units.cs index af56af8..566153f 100644 --- a/YangParser/SemanticModel/Units.cs +++ b/YangParser/SemanticModel/Units.cs @@ -9,7 +9,7 @@ public class Units : Statement public Units(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); } diff --git a/YangParser/SemanticModel/Uses.cs b/YangParser/SemanticModel/Uses.cs index 30d39be..eaf4030 100644 --- a/YangParser/SemanticModel/Uses.cs +++ b/YangParser/SemanticModel/Uses.cs @@ -9,16 +9,17 @@ public class Uses : Statement public Uses(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Children = statement.Children.Select(StatementFactory.Create).ToArray(); } public const string Keyword = "uses"; + public override ChildRule[] PermittedChildren { get; } = [ - new ChildRule(Augment.Keyword), + new ChildRule(Augment.Keyword, Cardinality.ZeroOrMore), new ChildRule(Description.Keyword), new ChildRule(FeatureFlag.Keyword, Cardinality.ZeroOrMore), new ChildRule(Refine.Keyword, Cardinality.ZeroOrMore), diff --git a/YangParser/SemanticModel/Value.cs b/YangParser/SemanticModel/Value.cs index b4c3ff2..5b3b1be 100644 --- a/YangParser/SemanticModel/Value.cs +++ b/YangParser/SemanticModel/Value.cs @@ -8,7 +8,7 @@ public class Value : Statement public Value(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Integer = int.Parse(Argument); diff --git a/YangParser/SemanticModel/When.cs b/YangParser/SemanticModel/When.cs index ade5638..9308d81 100644 --- a/YangParser/SemanticModel/When.cs +++ b/YangParser/SemanticModel/When.cs @@ -9,11 +9,17 @@ public class When : Statement public When(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Children = statement.Children.Select(StatementFactory.Create).ToArray(); } + public override ChildRule[] PermittedChildren { get; } = + [ + new ChildRule(Description.Keyword), + new ChildRule(Reference.Keyword) + ]; + public const string Keyword = "when"; } \ No newline at end of file diff --git a/YangParser/SemanticModel/YangVersion.cs b/YangParser/SemanticModel/YangVersion.cs index 5bfe4f1..d598385 100644 --- a/YangParser/SemanticModel/YangVersion.cs +++ b/YangParser/SemanticModel/YangVersion.cs @@ -9,7 +9,7 @@ public class YangVersion : Statement public YangVersion(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Children = statement.Children.Select(StatementFactory.Create).ToArray(); diff --git a/YangParser/SemanticModel/YinElement.cs b/YangParser/SemanticModel/YinElement.cs index 75ac0ff..a12d828 100644 --- a/YangParser/SemanticModel/YinElement.cs +++ b/YangParser/SemanticModel/YinElement.cs @@ -9,7 +9,7 @@ public class YinElement : Statement public YinElement(YangStatement statement) { if (statement.Keyword != Keyword) - throw new InvalidOperationException($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}"); + throw new SemanticError($"Non-matching Keyword '{statement.Keyword}', expected {Keyword}", statement); Argument = statement.Argument!.ToString(); ValidateChildren(statement); Value = bool.Parse(Argument);