| rfc9907v4.txt | rfc9907.txt | |||
|---|---|---|---|---|
| skipping to change at line 974 ¶ | skipping to change at line 974 ¶ | |||
| } | } | |||
| leaf ipv6-site-of-origin { | leaf ipv6-site-of-origin { | |||
| type rt-types:ipv6-route-origin; | type rt-types:ipv6-route-origin; | |||
| description | description | |||
| "The IPv6 Site of Origin attribute is encoded as an IPv6 | "The IPv6 Site of Origin attribute is encoded as an IPv6 | |||
| Route Origin Extended Community. It is meant to uniquely | Route Origin Extended Community. It is meant to uniquely | |||
| identify the set of routes learned from a site."; | identify the set of routes learned from a site."; | |||
| reference | reference | |||
| "RFC 5701"; | "RFC 5701"; | |||
| } | } | |||
| } | ||||
| 3.10. Validation Tools | 3.10. Validation Tools | |||
| All modules need to be validated before submission in an I-D. The | All modules need to be validated before submission in an I-D. The | |||
| 'pyang' YANG compiler is freely available from GitHub: | 'pyang' YANG compiler is freely available from GitHub: | |||
| <https://github.com/mbj4668/pyang>. | <https://github.com/mbj4668/pyang>. | |||
| If the 'pyang' compiler is used to validate a normative module, then | If the 'pyang' compiler is used to validate a normative module, then | |||
| the "--ietf" command-line option MUST be used to identify any IETF | the "--ietf" command-line option MUST be used to identify any IETF | |||
| guideline issues. | guideline issues. | |||
| skipping to change at line 1001 ¶ | skipping to change at line 1000 ¶ | |||
| command "pyang -f yang --keep-comments --yang-line-length 69" should | command "pyang -f yang --keep-comments --yang-line-length 69" should | |||
| be used. | be used. | |||
| The "yanglint" program is also freely available from GitHub: | The "yanglint" program is also freely available from GitHub: | |||
| <https://github.com/CESNET/libyang>. | <https://github.com/CESNET/libyang>. | |||
| This tool can be used to validate "XPath" statements within YANG | This tool can be used to validate "XPath" statements within YANG | |||
| modules. | modules. | |||
| To check that JSON-encoded examples [RFC7951] comply with the target | To check that JSON-encoded examples [RFC7951] comply with the target | |||
| data models, programs such as "yangson" or "yanglint" should be used. | data models, programs such as 'yangson' or 'yanglint' should be used. | |||
| Both programs are freely available from GitHub: <https://github.com/ | Both programs are freely available from GitHub: <https://github.com/ | |||
| CZ-NIC/yangson> and <https://github.com/CESNET/libyang>. | CZ-NIC/yangson> and <https://github.com/CESNET/libyang>. | |||
| 3.11. Module Extraction Tools | 3.11. Module Extraction Tools | |||
| A version of 'rfcstrip' that will extract YANG modules from an I-D or | A version of 'rfcstrip' that will extract YANG modules from an I-D or | |||
| RFC is freely available at: <https://github.com/mbj4668/rfcstrip>. | RFC is freely available at: <https://github.com/mbj4668/rfcstrip>. | |||
| This tool can be used to verify that the "<CODE BEGINS>" and "<CODE | This tool can be used to verify that the "<CODE BEGINS>" and "<CODE | |||
| ENDS>" tags are used correctly and that the normative YANG modules | ENDS>" tags are used correctly and that the normative YANG modules | |||
| skipping to change at line 2408 ¶ | skipping to change at line 2407 ¶ | |||
| 4.18. YANG Data Node Constraints | 4.18. YANG Data Node Constraints | |||
| 4.18.1. Controlling Quantity | 4.18.1. Controlling Quantity | |||
| The "min-elements" and "max-elements" statements can be used to | The "min-elements" and "max-elements" statements can be used to | |||
| control how many list or leaf-list instances are required for a | control how many list or leaf-list instances are required for a | |||
| particular data node. YANG constraint statements SHOULD be used to | particular data node. YANG constraint statements SHOULD be used to | |||
| identify conditions that apply to all implementations of the data | identify conditions that apply to all implementations of the data | |||
| model. If platform-specific limitations (e.g., the "max-elements" | model. If platform-specific limitations (e.g., the "max-elements" | |||
| supported for a particular list) are relevant to operations, then a | supported for a particular list) are relevant to operations, then a | |||
| data model "definition" statement (e.g., "max-ports" leaf) SHOULD be | data model definition statement (e.g., "max-ports" leaf) SHOULD be | |||
| used to identify the limit. | used to identify the limit. | |||
| 4.18.2. "must" versus "when" | 4.18.2. "must" versus "when" | |||
| "must" and "when" YANG statements are used to provide cross-object | "must" and "when" YANG statements are used to provide cross-object | |||
| referential tests. They have very different behavior. The "when" | referential tests. They have very different behavior. The "when" | |||
| statement causes data node instances to be silently deleted as soon | statement causes data node instances to be silently deleted as soon | |||
| as the condition becomes false. A false "when" statement is not | as the condition becomes false. A false "when" statement is not | |||
| considered to be an error. | considered to be an error. | |||
| skipping to change at line 2432 ¶ | skipping to change at line 2431 ¶ | |||
| list key leafs). | list key leafs). | |||
| The "must" statement causes a datastore validation error if the | The "must" statement causes a datastore validation error if the | |||
| condition is false. This statement SHOULD be used for enforcing | condition is false. This statement SHOULD be used for enforcing | |||
| parameter value restrictions that involve more than one data node | parameter value restrictions that involve more than one data node | |||
| (e.g., end-time parameter must be after the start-time parameter). | (e.g., end-time parameter must be after the start-time parameter). | |||
| 4.19. "augment" Statements | 4.19. "augment" Statements | |||
| The YANG "augment" statement is used to define a set of data | The YANG "augment" statement is used to define a set of data | |||
| "definition" statements that will be added as child nodes of a target | definition statements that will be added as child nodes of a target | |||
| data node. The module namespace for these data nodes will be the | data node. The module namespace for these data nodes will be the | |||
| augmenting module, not the augmented module. | augmenting module, not the augmented module. | |||
| A top-level "augment" statement SHOULD NOT be used if the target data | A top-level "augment" statement SHOULD NOT be used if the target data | |||
| node is in the same module or submodule as the evaluated "augment" | node is in the same module or submodule as the evaluated "augment" | |||
| statement. The data "definition" statements SHOULD be added inline | statement. The data definition statements SHOULD be added inline | |||
| instead. | instead. | |||
| 4.19.1. Conditional Augment Statements | 4.19.1. Conditional Augment Statements | |||
| The "augment" statement is often used together with the "when" | The "augment" statement is often used together with the "when" | |||
| statement and/or "if-feature" statement to make the augmentation | statement and/or "if-feature" statement to make the augmentation | |||
| conditional on some portion of the data model. | conditional on some portion of the data model. | |||
| The following example from [RFC8343] shows how a conditional | The following example from [RFC8343] shows how a conditional | |||
| container called "ethernet" is added to the "interface" list only for | container called "ethernet" is added to the "interface" list only for | |||
| skipping to change at line 2522 ¶ | skipping to change at line 2521 ¶ | |||
| } | } | |||
| } | } | |||
| } | } | |||
| Note that this practice is safe only for creating data resources. It | Note that this practice is safe only for creating data resources. It | |||
| is not safe for replacing or modifying resources if the client does | is not safe for replacing or modifying resources if the client does | |||
| not know about the new condition. The YANG data model MUST be | not know about the new condition. The YANG data model MUST be | |||
| packaged in a way that requires the client to be aware of the | packaged in a way that requires the client to be aware of the | |||
| mandatory data nodes if it is aware of the condition for this data. | mandatory data nodes if it is aware of the condition for this data. | |||
| In the example above, the "some-new-iftype" identity is defined in | In the example above, the "some-new-iftype" identity is defined in | |||
| the same module as the "mandatory-leaf" data "definition" statement. | the same module as the "mandatory-leaf" data definition statement. | |||
| This practice is not safe for identities defined in a common module | This practice is not safe for identities defined in a common module | |||
| such as "iana-if-type" because the client is not required to know | such as "iana-if-type" because the client is not required to know | |||
| about "my-module" just because it knows about the "iana-if-type" | about "my-module" just because it knows about the "iana-if-type" | |||
| module. | module. | |||
| 4.20. Deviation Statements | 4.20. Deviation Statements | |||
| Per Section 7.20.3 of [RFC7950], the YANG "deviation" statement is | Per Section 7.20.3 of [RFC7950], the YANG "deviation" statement is | |||
| not allowed to appear in IETF YANG modules, but it can be useful for | not allowed to appear in IETF YANG modules, but it can be useful for | |||
| skipping to change at line 3084 ¶ | skipping to change at line 3083 ¶ | |||
| Authors can use existing standard tags or use new tags defined in the | Authors can use existing standard tags or use new tags defined in the | |||
| model definition, as appropriate. For IETF modules, new tags MUST be | model definition, as appropriate. For IETF modules, new tags MUST be | |||
| assigned in the IANA "IETF YANG Module Tags" registry within the | assigned in the IANA "IETF YANG Module Tags" registry within the | |||
| "YANG Module Tags" registry group [IANA-TAGS]. | "YANG Module Tags" registry group [IANA-TAGS]. | |||
| 4.29. Modeling Abstract Data Structures | 4.29. Modeling Abstract Data Structures | |||
| For contexts where YANG is used to model abstract data structures | For contexts where YANG is used to model abstract data structures | |||
| (e.g., protocol messages), the use of the "structure" extension | (e.g., protocol messages), the use of the "structure" extension | |||
| statement [RFC8791] is RECOMMENDED compared to the "yang-data" | statement [RFC8791] is RECOMMENDED compared to the "yang-data" | |||
| "extension" statement [RFC8040]. Examples of modules that rely upon | extension statement [RFC8040]. Examples of modules that rely upon | |||
| the "structure" extension statement from [RFC8791] can be found in | the "structure" extension statement from [RFC8791] can be found in | |||
| [RFC9132] or [RFC9195]. | [RFC9132] or [RFC9195]. | |||
| Abstract data structures can be augmented using the "augment- | Abstract data structures can be augmented using the "augment- | |||
| structure" statement [RFC8791]. Examples of modules that augment | structure" statement [RFC8791]. Examples of modules that augment | |||
| abstract data structures can be found in [RFC9244] and [RFC9362]. | abstract data structures can be found in [RFC9244] and [RFC9362]. | |||
| 4.30. IANA-Maintained YANG Modules | 4.30. IANA-Maintained YANG Modules | |||
| 4.30.1. Context | 4.30.1. Context | |||
| skipping to change at line 3295 ¶ | skipping to change at line 3294 ¶ | |||
| with the naming conventions listed in Section 4.3.1, IANA | with the naming conventions listed in Section 4.3.1, IANA | |||
| should check if guidance to generate legal identifiers was | should check if guidance to generate legal identifiers was | |||
| supplied in the RFC that specified the initial version of the | supplied in the RFC that specified the initial version of the | |||
| module. If no such guidance is available, IANA should check | module. If no such guidance is available, IANA should check | |||
| the latest revision of the IANA-maintained YANG module for | the latest revision of the IANA-maintained YANG module for | |||
| similar patterns. If all else fails, IANA should seek advice | similar patterns. If all else fails, IANA should seek advice | |||
| from relevant registry experts (e.g., designated experts for a | from relevant registry experts (e.g., designated experts for a | |||
| registry using the Expert Review policy (Section 4.5 of | registry using the Expert Review policy (Section 4.5 of | |||
| [RFC8126]) or responsible area director). | [RFC8126]) or responsible area director). | |||
| The IANA Considerations Section MAY also provide the following | ||||
| information if a default action is expected: | ||||
| * A note whether unassigned or reserved values should be present in | * A note whether unassigned or reserved values should be present in | |||
| the IANA-maintained YANG module. If no instruction is provided, | the IANA-maintained YANG module. If no instruction is provided, | |||
| unassigned or reserved values must not be present in the IANA- | unassigned or reserved values must not be present in the IANA- | |||
| maintained YANG module. | maintained YANG module. | |||
| * An instruction whether experimental values should be included in | * An instruction whether experimental values should be included in | |||
| the IANA-maintained YANG module. If no instruction is provided, | the IANA-maintained YANG module. If no instruction is provided, | |||
| experimental values MUST NOT be listed in the IANA-maintained YANG | experimental values MUST NOT be listed in the IANA-maintained YANG | |||
| module. | module. | |||
| End of changes. 8 change blocks. | ||||
| 7 lines changed or deleted | 9 lines changed or added | |||
This html diff was produced by rfcdiff 1.48. | ||||