diff --git a/iana-display-hints.yang b/iana-display-hints.yang new file mode 100644 index 0000000..f3a48ad --- /dev/null +++ b/iana-display-hints.yang @@ -0,0 +1,178 @@ +module iana-display-hints { + yang-version 1.1; + namespace "ari://iana-display-hints"; + prefix ianadh; + + import ietf-amm { + prefix amm; + } + + organization + "IANA"; + contact + "WG Web: + WG List: + + Editor: Brian Sipos + "; + description + "This module defines intermediate and leaf IDENT objects usable as + display-hint annotations derived from the base + object. + + The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL + NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED', + 'MAY', and 'OPTIONAL' in this document are to be interpreted as + described in BCP 14 (RFC 2119) (RFC 8174) when, and only when, + they appear in all capitals, as shown here. + + Copyright (c) 2024 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 Revised 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). + + The initial version of this YANG module is part of RFC XXXX + (https://www.rfc-editor.org/info/rfcXXXX); see the RFC itself + for full legal notices."; + reference + "https://www.iana.org/assignments/DTNMA-TBA"; + + revision 2024-07-20 { + description + "Updated for latest ADM document."; + reference + "draft-ietf-dtn-adm-yang"; + } + amm:enum 0; + + // Integer number hints + amm:ident base-integer { + amm:enum 1; + description + "Intermediate base IDENT of display hints for integer values. + Hints derived from this object SHALL only apply to built-in types + BYTE, INT, UINT, VAST, and UVAST."; + amm:base "//ietf-amm/IDENT/display-hint"; + } + amm:ident display-int-dec { + amm:enum 2; + description + "Display integers as decimal (base 10)."; + amm:base "//ietf-amm/IDENT/base-integer"; + } + amm:ident display-int-bin { + amm:enum 3; + description + "Display integers as binary (base 2)."; + amm:base "//ietf-amm/IDENT/base-integer"; + } + amm:ident display-int-hex { + amm:enum 4; + description + "Display integers as hexadecimal (base 16)."; + amm:base "//ietf-amm/IDENT/base-integer"; + } + + // Floating-point number hints + amm:ident base-float { + amm:enum 5; + description + "Intermediate base IDENT of display hints for floating point values. + Hints derived from this object SHALL only apply to built-in types + REAL32 and REAL64."; + amm:base "//ietf-amm/IDENT/display-hint"; + } + amm:ident display-float-dec { + amm:enum 6; + description + "Display floating point values as decimal fraction."; + amm:base "//ietf-amm/IDENT/base-float"; + } + amm:ident display-float-exp { + amm:enum 7; + description + "Display floating point values as decimal exponential form."; + amm:base "//ietf-amm/IDENT/base-float"; + } + amm:ident display-float-hex { + amm:enum 8; + description + "Display floating point values as hexadecimal exponential form."; + amm:base "//ietf-amm/IDENT/base-float"; + } + + // Byte-string hints + amm:ident base-bstr { + amm:enum 9; + description + "Intermediate base IDENT of display hints for byte string values. + Hints derived from this object SHALL only apply to built-in type + BYTESTR."; + amm:base "//ietf-amm/IDENT/display-hint"; + } + amm:ident display-bstr-text { + amm:enum 10; + description + "Display byte string values as UTF-8 text where possible. + The base16 encoding is used otherwise."; + reference + "draft-ietf-dtn-ari"; + amm:base "//ietf-amm/IDENT/base-bstr"; + } + amm:ident display-bstr-base16 { + amm:enum 11; + description + "Display byte string values as base16-encoded."; + reference + "draft-ietf-dtn-ari"; + amm:base "//ietf-amm/IDENT/base-bstr"; + } + amm:ident display-bstr-base64 { + amm:enum 12; + description + "Display byte string values as base64url-encoded."; + reference + "draft-ietf-dtn-ari"; + amm:base "//ietf-amm/IDENT/base-bstr"; + } + amm:ident display-bstr-ipaddress { + amm:enum 16; + description + "Display byte string values as either IPv4 address (4-octet length) + or IPv6 address (16-octet length)."; + reference + "RFC 4001: Textual Conventions for Internet Network Addresses"; + amm:base "//ietf-amm/IDENT/base-bstr"; + } + + // TIME type (TP or TD built-ins) hints + amm:ident base-time { + amm:enum 13; + description + "Intermediate base IDENT of display hints for time values. + Hints derived from this object SHALL only apply to built-in types + TP and TD."; + amm:base "//ietf-amm/IDENT/display-hint"; + } + amm:ident display-time-text { + amm:enum 14; + description + "Display TP and TD values as text in accordance with RFC 3339."; + reference + "draft-ietf-dtn-ari"; + amm:base "//ietf-amm/IDENT/base-time"; + } + amm:ident display-time-dec { + amm:enum 15; + description + "Display TP and TD values as decimal fraction."; + reference + "draft-ietf-dtn-ari"; + amm:base "//ietf-amm/IDENT/base-time"; + } +} diff --git a/ietf-amm.yang b/ietf-amm.yang index 20a5433..c9109bb 100644 --- a/ietf-amm.yang +++ b/ietf-amm.yang @@ -1,8 +1,7 @@ module ietf-amm { yang-version 1.1; - namespace "ari://ietf-amm/"; + namespace "ari://ietf-amm"; prefix amm; - amm:enum 0; organization "IETF Delay Tolerant Networking (DTN) Working Group"; @@ -10,12 +9,32 @@ module ietf-amm { "WG Web: WG List: - Author: Brian Sipos + Editor: Brian Sipos "; description "This module defines the DTN Management Architecture (DTNMA) Application Management Model (AMM) extensions within YANG. - It also defines the base TYPEDEF objects."; + It also defines the base TYPEDEF objects. + + The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL + NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED', + 'MAY', and 'OPTIONAL' in this document are to be interpreted as + described in BCP 14 (RFC 2119) (RFC 8174) when, and only when, + they appear in all capitals, as shown here. + + Copyright (c) 2024 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 Revised 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 XXXX + (https://www.rfc-editor.org/info/rfcXXXX); see the RFC itself + for full legal notices."; reference "draft-ietf-dtn-adm-yang"; @@ -178,7 +197,7 @@ module ietf-amm { description "Reference an IDENT object which indicates how a value should be displayed for human consumption. - The base of the IDENT is the ./IDENT/display-hint object."; + The base of the IDENT SHALL be the ./IDENT/display-hint object."; } extension int-labels { @@ -253,6 +272,7 @@ module ietf-amm { "Type for a union of other types."; } + amm:enum 0; amm:ident display-hint { amm:enum 0; description @@ -260,103 +280,21 @@ module ietf-amm { 'amm:display-hint' extension. This object itself provides no display hint purpose."; } - amm:ident display-hint-integer { - amm:base "./IDENT/display-hint"; - description - "Intermediate base IDENT of display hints for integer values."; - } - amm:ident display-int-dec { - amm:base "./IDENT/display-hint-integer"; - description - "Display integers as decimal (base 10)."; - } - amm:ident display-int-bin { - amm:base "./IDENT/display-hint-integer"; - description - "Display integers as binary (base 2)."; - } - amm:ident display-int-hex { - amm:base "./IDENT/display-hint-integer"; - description - "Display integers as hexadecimal (base 16)."; - } - amm:ident display-hint-float { - amm:base "./IDENT/display-hint"; - description - "Intermediate base IDENT of display hints for floating point values."; - } - amm:ident display-float-dec { - amm:base "./IDENT/display-hint-float"; - description - "Display floating point values as decimal fraction."; - } - amm:ident display-float-exp { - amm:base "./IDENT/display-hint-float"; - description - "Display floating point values as decimal exponential form."; - } - amm:ident display-float-hex { - amm:base "./IDENT/display-hint-float"; - description - "Display floating point values as hexadecimal exponential form."; - } - amm:ident display-hint-bstr { - amm:base "./IDENT/display-hint"; - description - "Intermediate base IDENT of display hints for BYTESTR values."; - } - amm:ident display-bstr-text { - amm:base "./IDENT/display-hint-bstr"; - reference - "draft-ietf-dtn-ari"; - description - "Display byte string values as UTF-8 text where possible. - The base16 encoding is used otherwise."; - } - amm:ident display-bstr-base16 { - amm:base "./IDENT/display-hint-bstr"; - reference - "draft-ietf-dtn-ari"; - description - "Display byte string values as base16-encoded."; - } - amm:ident display-bstr-base64 { - amm:base "./IDENT/display-hint-bstr"; - reference - "draft-ietf-dtn-ari"; - description - "Display byte string values as base64url-encoded."; - } - amm:ident display-hint-time { - amm:base "./IDENT/display-hint"; - description - "Intermediate base IDENT of display hints for TP and TD values."; - } - amm:ident display-time-text { - amm:base "./IDENT/display-hint-time"; - reference - "draft-ietf-dtn-ari"; - description - "Display TP and TD values as text in accordance with RFC 3339."; - } - amm:ident display-time-dec { - amm:base "./IDENT/display-hint-time"; - reference - "draft-ietf-dtn-ari"; - description - "Display TP and TD values as decimal fraction."; - } // Named type unions amm:typedef TYPE-REF { + amm:enum 0; + description + "Reference to either a literal type or a typedef."; amm:union { amm:type "/ARITYPE/ARITYPE"; amm:type "/ARITYPE/TYPEDEF"; } - description - "Reference to either a literal type or a typedef."; } amm:typedef INTEGER { + amm:enum 1; + description + "Any type which represents a discrete integer."; amm:union { amm:type "/ARITYPE/BYTE"; amm:type "/ARITYPE/UINT"; @@ -364,26 +302,29 @@ module ietf-amm { amm:type "/ARITYPE/UVAST"; amm:type "/ARITYPE/VAST"; } - description - "Any type which represents a discrete integer."; } amm:typedef FLOAT { + amm:enum 2; + description + "Any type which represents a floating point number."; amm:union { amm:type "/ARITYPE/REAL32"; amm:type "/ARITYPE/REAL64"; } - description - "Any type which represents a floating point number."; } amm:typedef NUMERIC { + amm:enum 3; + description + "Any type which can be used with numeric expressions."; amm:union { amm:type "./TYPEDEF/INTEGER"; amm:type "./TYPEDEF/FLOAT"; } - description - "Any type which can be used with numeric expressions."; } amm:typedef PRIMITIVE { + amm:enum 4; + description + "Any primitive type."; amm:union { amm:type "/ARITYPE/NULL"; amm:type "/ARITYPE/BOOL"; @@ -391,109 +332,122 @@ module ietf-amm { amm:type "/ARITYPE/TEXTSTR"; amm:type "/ARITYPE/BYTESTR"; } - description - "Any primitive type."; } amm:typedef TIME { + amm:enum 5; + description + "Any type which can be used with time expressions."; amm:union { amm:type "/ARITYPE/TP"; amm:type "/ARITYPE/TD"; } - description - "Any type which can be used with time expressions."; } amm:typedef SIMPLE { + amm:enum 6; + description + "Any type which contains a single literal value (not nested)."; amm:union { amm:type "./TYPEDEF/PRIMITIVE"; amm:type "./TYPEDEF/TIME"; } - description - "Any type which contains a single literal value (not nested)."; } amm:typedef NESTED { + amm:enum 7; + description + "A literal type which contains other ARI values."; amm:union { amm:type "/ARITYPE/AC"; amm:type "/ARITYPE/AM"; amm:type "/ARITYPE/TBL"; } - description - "A literal type which contains other ARI values."; } amm:typedef ANY { + amm:enum 8; + description + "Any value representable by an ARI."; // These type names are built-in amm:union { amm:type "/ARITYPE/LITERAL"; amm:type "/ARITYPE/OBJECT"; } - description - "Any value representable by an ARI."; } amm:typedef VALUE-OBJ { + amm:enum 9; + description + "A reference to an object which can produce a value."; amm:union { amm:type "/ARITYPE/CONST"; amm:type "/ARITYPE/EDD"; amm:type "/ARITYPE/VAR"; } - description - "A reference to an object which can produce a value."; } amm:typedef NONCE { + amm:enum 10; + description + "This type union is used to correlate Agent-Manager messages."; amm:union { amm:type "/ARITYPE/BYTESTR"; amm:type "/ARITYPE/UVAST"; amm:type "/ARITYPE/NULL"; } - description - "This type union is used to correlate Agent-Manager messages."; } // operational semantic types amm:typedef counter32 { - amm:type "/ARITYPE/UINT"; + amm:enum 11; description "A 32-bit counter with an arbitrary initial value that only increments. When the value reaches the upper range it wraps around to zero. At least two samples of this value need to be compared over time."; + amm:type "/ARITYPE/UINT"; } amm:typedef counter64 { - amm:type "/ARITYPE/UVAST"; + amm:enum 12; description "A 64-bit counter with an arbitrary initial value that only increments. When the value reaches the upper range it wraps around to zero. At least two samples of this value need to be compared over time."; + amm:type "/ARITYPE/UVAST"; } amm:typedef gauge32 { - amm:type "/ARITYPE/INT"; + amm:enum 13; description "A 32-bit value sampling some quantized measurement. The value can increase or decrease arbitrarily over time."; + amm:type "/ARITYPE/INT"; } amm:typedef gauge64 { - amm:type "/ARITYPE/VAST"; + amm:enum 14; description "A 64-bit value sampling some quantized measurement. The value can increase or decrease arbitrarily over time."; + amm:type "/ARITYPE/VAST"; } amm:typedef timestamp { - amm:type "/ARITYPE/TP"; + amm:enum 15; description "A time point representing the system clock at which a specific occurrence happened. The specific occurrence must be defined in the description of any node defined using this type."; + amm:type "/ARITYPE/TP"; } // Restrictions on AC item types for Evaluation and EXPR amm:typedef eval-tgt { + amm:enum 16; + description + "A value which can be the target of an evaluation."; amm:union { amm:type "./TYPEDEF/SIMPLE"; // special case of literal value result amm:type "./TYPEDEF/VALUE-OBJ"; // produces an eval-tgt amm:type "./TYPEDEF/EXPR"; } - description - "A value which can be the target of an evaluation."; } amm:typedef EXPR-item { + amm:enum 17; + description + "Each item of an EXPR list."; amm:union { amm:type "./TYPEDEF/SIMPLE"; amm:type "./TYPEDEF/VALUE-OBJ"; // produces an eval-tgt @@ -501,68 +455,73 @@ module ietf-amm { amm:type "/ARITYPE/LABEL"; // substitutable label amm:type "/ARITYPE/OPER"; } - description - "Each item of an EXPR list."; } amm:typedef EXPR { + amm:enum 18; + description + "The contents of an EXPR container."; amm:ulist { amm:type "./TYPEDEF/EXPR-item"; } - description - "The contents of an EXPR container."; } // Restrictions on AC item types for Execution and MAC amm:typedef exec-tgt { + amm:enum 19; + description + "A value which can be the target of an execution."; amm:union { amm:type "./TYPEDEF/exec-item"; amm:type "./TYPEDEF/MAC"; } - description - "A value which can be the target of an execution."; } amm:typedef exec-item { + amm:enum 20; + description + "A reference to an object which can be executed. + The value-object must be typed to contain an exec-tgt."; amm:union { amm:type "/ARITYPE/CTRL"; amm:type "./TYPEDEF/VALUE-OBJ"; // produces an exec-tgt } - description - "A reference to an object which can be executed. - The value-object must be typed to contain an exec-tgt."; } amm:typedef MAC { - amm:ulist { - amm:type "./TYPEDEF/EXEC-item"; - } + amm:enum 21; description "The contents of a MAC container are an ordered list of executable values."; + amm:ulist { + amm:type "./TYPEDEF/EXEC-item"; + } } // Restrictions on AC item types for Reporting and RPTT amm:typedef rpt-tgt { + amm:enum 22; + description + "A value which can be the target of reporting."; amm:union { amm:type "./TYPEDEF/VALUE-OBJ"; // produces an RPTT amm:type "./TYPEDEF/RPTT"; } - description - "A value which can be the target of reporting."; } amm:typedef RPTT-item { - amm:union { - amm:type "./TYPEDEF/VALUE-OBJ"; - amm:type "./TYPEDEF/EXPR"; - } + amm:enum 23; description "Each item of a RPTT. Each item references a value-producing object or contains an expression to be evaluated."; + amm:union { + amm:type "./TYPEDEF/VALUE-OBJ"; + amm:type "./TYPEDEF/EXPR"; + } } amm:typedef RPTT { + amm:enum 24; + description + "The contents of a report template, encoded as the sequence of items."; amm:ulist { amm:type "./TYPEDEF/RPTT-item"; } - description - "The contents of a report template, encoded as the sequence of items."; } } diff --git a/ietf-dtnma-agent-acl.yang b/ietf-dtnma-agent-acl.yang index 8fd4f32..d5d1635 100644 --- a/ietf-dtnma-agent-acl.yang +++ b/ietf-dtnma-agent-acl.yang @@ -2,7 +2,6 @@ module ietf-dtnma-agent-acl { yang-version 1.1; namespace "ari://ietf-dtnma-agent-acl"; prefix acl; - amm:enum 2; import ietf-amm { prefix amm; @@ -21,7 +20,21 @@ module ietf-dtnma-agent-acl { "; description "This module implements the DTN Management Architecture (DTNMA) - Agent Access Control List (ACL) functionality."; + Agent Access Control List (ACL) functionality. + + Copyright (c) 2024 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 Revised 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 XXXX + (https://www.rfc-editor.org/info/rfcXXXX); see the RFC itself + for full legal notices."; reference "draft-ietf-dtn-adm-yang"; @@ -37,12 +50,15 @@ module ietf-dtnma-agent-acl { reference "draft-birrane-dtn-adm"; } + amm:enum 2; amm:typedef tag { - amm:type "./TYPEDEF/permissions"; + amm:enum 0; description "Datatype for access control list tags"; + amm:type "./TYPEDEF/permissions"; } amm:typedef permissions { + amm:enum 1; amm:type "/ARITYPE/BYTE" { amm:int-labels { bit tag-read { @@ -64,19 +80,22 @@ module ietf-dtnma-agent-acl { } } amm:typedef entry-id { - amm:type "/ARITYPE/UVAST"; + amm:enum 2; description "The identifier for an entry in any access control table."; + amm:type "/ARITYPE/UVAST"; } amm:typedef optional-entry-id { + amm:enum 3; + description + "An optional entry identifier (or a null value)."; amm:union { amm:type "./TYPEDEF/entry-id"; amm:type "/ARITYPE/null"; } - description - "An optional entry identifier (or a null value)."; } amm:typedef result { + amm:enum 4; amm:type "/ARITYPE/INT" { amm:int-labels { enum success { @@ -101,153 +120,156 @@ module ietf-dtnma-agent-acl { // Default access permission amm:var default-access { amm:enum 1; - amm:type "./TYPEDEF/tag"; description "The default permission for any object if no specific access are present in the ./EDD/access-list table."; + amm:type "./TYPEDEF/tag"; } // Access control table and modifier controls amm:edd access-list { amm:enum 2; + description + "List the current group--object access."; amm:tblt { amm:key "id"; amm:column id { amm:type "./TYPEDEF/entry-id"; } amm:column group { - amm:type "./TYPEDEF/optional-entry-id"; description "A cross-reference to the group getting access, or null to match all groups."; + amm:type "./TYPEDEF/optional-entry-id"; } amm:column object-pattern { - amm:type "/ARITYPE/TEXTSTR"; description "A pattern for objects being accessed, which may match all objects."; + amm:type "/ARITYPE/TEXTSTR"; } amm:column tag { - amm:type "./TYPEDEF/tag"; description "A pattern for objects being accessed, which may match all objects."; + amm:type "./TYPEDEF/tag"; } } - description - "List the current group--object access."; } amm:ctrl ensure-access { amm:enum 3; + description + "Ensures that an access control permission is set for the given group and ARI pattern."; amm:parameter group { - amm:type "./TYPEDEF/optional-entry-id"; description "Identify the group being assigned the permission"; + amm:type "./TYPEDEF/optional-entry-id"; } amm:parameter object-pattern { - amm:type "/ARITYPE/TEXTSTR"; description "ARI pattern to determine which objects shall be assigned the permission"; + amm:type "/ARITYPE/TEXTSTR"; } amm:parameter tag { - amm:type "./TYPEDEF/tag"; - amm:default "0"; description "Permission tag value to set"; + amm:default "0"; + amm:type "./TYPEDEF/tag"; } amm:result error-code { - amm:type "./TYPEDEF/result"; description "If non-zero, an indicator of an error."; + amm:type "./TYPEDEF/result"; } - description - "Ensures that an access control permission is set for the given group and ARI pattern."; } amm:ctrl discard-access { amm:enum 4; + description + "Discard any permissions for the given group and ARI pattern."; amm:parameter group { - amm:type "./TYPEDEF/optional-entry-id"; description "Identify the group"; + amm:type "./TYPEDEF/optional-entry-id"; } amm:parameter object-pattern { - amm:type "/ARITYPE/TEXTSTR"; description "ARI pattern"; + amm:type "/ARITYPE/TEXTSTR"; } amm:result error-code { - amm:type "./TYPEDEF/result"; description "If non-zero, an indicator of an error."; + amm:type "./TYPEDEF/result"; } - description - "Discard any permissions for the given group and ARI pattern."; } // // Group management // amm:typedef transport-endpoint-pattern { + amm:enum 5; amm:type "/ARITYPE/IDENT" { amm:base "//ietf-dtnma-agent/IDENT/transport-endpoint-pattern"; } } amm:edd current-group-id { amm:enum 3; - amm:type "./TYPEDEF/entry-id"; description "Get the group ID for the current execution context, which may be the implicit Agent group ID zero."; + amm:type "./TYPEDEF/entry-id"; } amm:edd group-list { amm:enum 4; + description + "Get the defined access control groups."; amm:tblt { amm:key "id"; amm:column id { - amm:type "./TYPEDEF/entry-id"; description "The unique identifier for a group. The agent itself has implicit group ID zero."; + amm:type "./TYPEDEF/entry-id"; } amm:column name { - amm:type "/ARITYPE/TEXTSTR"; description "The human-friendly name of the group."; + amm:type "/ARITYPE/TEXTSTR"; } amm:column members { + description + "The list of members of the group, identified by matching transport endpoint."; amm:ulist { amm:type "./TYPEDEF/transport-endpoint-pattern"; } - description - "The list of members of the group, identified by matching transport endpoint."; } } - description - "Get the defined access control groups."; } amm:ctrl ensure-group { amm:enum 5; + description + "Ensure that after the control completes a group exists with the given information"; amm:parameter id { - amm:type "./TYPEDEF/entry-id"; description "Uniquely identify the group"; + amm:type "./TYPEDEF/entry-id"; } amm:parameter name { - amm:type "/ARITYPE/TEXTSTR"; description "Name of the group"; + amm:type "/ARITYPE/TEXTSTR"; } amm:result error-code { - amm:type "./TYPEDEF/result"; description "If non-zero, an indicator of an error."; + amm:type "./TYPEDEF/result"; } - description - "Ensure that after the control completes a group exists with the given information"; } amm:ctrl ensure-group-members { amm:enum 7; + description + "Ensure that the membership of a group has a specific set of endpoint patterns."; amm:parameter id { - amm:type "./TYPEDEF/entry-id"; description "Uniquely identify the group"; + amm:type "./TYPEDEF/entry-id"; } amm:parameter members { amm:ulist { @@ -255,26 +277,24 @@ module ietf-dtnma-agent-acl { } } amm:result error-code { - amm:type "./TYPEDEF/result"; description "If non-zero, an indicator of an error."; + amm:type "./TYPEDEF/result"; } - description - "Ensure that the membership of a group has a specific set of endpoint patterns."; } amm:ctrl discard-group { amm:enum 6; + description + "Discard any group with the given ID."; amm:parameter group { - amm:type "./TYPEDEF/entry-id"; description "Uniquely identify the group"; + amm:type "./TYPEDEF/entry-id"; } amm:result error-code { - amm:type "./TYPEDEF/result"; description "If non-zero, an indicator of an error."; + amm:type "./TYPEDEF/result"; } - description - "Discard any group with the given ID."; } } diff --git a/ietf-dtnma-agent.yang b/ietf-dtnma-agent.yang index 63ec4c7..0226bc0 100644 --- a/ietf-dtnma-agent.yang +++ b/ietf-dtnma-agent.yang @@ -1,8 +1,7 @@ module ietf-dtnma-agent { yang-version 1.1; - namespace "ari://ietf-dtnma-agent/"; + namespace "ari://ietf-dtnma-agent"; prefix da; - amm:enum 1; import ietf-amm { prefix amm; @@ -18,7 +17,21 @@ module ietf-dtnma-agent { "; description "This module implements the DTN Management Architecture (DTNMA) - Agent core functionality."; + Agent core functionality. + + Copyright (c) 2024 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 Revised 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 XXXX + (https://www.rfc-editor.org/info/rfcXXXX); see the RFC itself + for full legal notices."; reference "draft-ietf-dtn-adm-yang"; @@ -41,76 +54,218 @@ module ietf-dtnma-agent { state-based autonomy rules."; } - amm:edd sw_vendor { - amm:type "/ARITYPE/TEXTSTR"; + grouping obj-list-params { description - "The vendor for this Agent implementation."; + "Common parameters for object listing"; + amm:parameter include-adm { + description + "If true, listings will include objects from ADMs"; + amm:default "false"; + amm:type "/ARITYPE/BOOL"; + } + } + + grouping any-binary-operands { + description + "Any-value bianry operands"; + amm:operand left { + description + "The left-side operand."; + amm:type "//ietf-amm/TYPEDEF/ANY"; + } + amm:operand right { + description + "The left-side operand."; + amm:type "//ietf-amm/TYPEDEF/ANY"; + } + } + + grouping numeric-unary-operands { + description + "Numeric unary operand"; + amm:operand val { + description + "The single value."; + amm:type "//ietf-amm/TYPEDEF/NUMERIC"; + } + } + + grouping numeric-binary-operands { + description + "Numeric bianry operands"; + amm:operand left { + description + "The left-side operand."; + amm:type "//ietf-amm/TYPEDEF/NUMERIC"; + } + amm:operand right { + description + "The left-side operand."; + amm:type "//ietf-amm/TYPEDEF/NUMERIC"; + } + } + + grouping numeric-unary-result { + description + "Numeric result"; + amm:result result { + description + "The single value."; + amm:type "//ietf-amm/TYPEDEF/NUMERIC"; + } + } + + grouping integer-unary-operands { + description + "Integer unary operand"; + amm:operand val { + description + "The single value."; + amm:type "//ietf-amm/TYPEDEF/INTEGER"; + } + } + + grouping integer-binary-operands { + description + "Integer bianry operands"; + amm:operand left { + description + "The left-side operand."; + amm:type "//ietf-amm/TYPEDEF/INTEGER"; + } + amm:operand right { + description + "The left-side operand."; + amm:type "//ietf-amm/TYPEDEF/INTEGER"; + } + } + + grouping integer-unary-result { + description + "Integer result"; + amm:result result { + description + "The single value."; + amm:type "//ietf-amm/TYPEDEF/INTEGER"; + } + } + + grouping bool-unary-operands { + description + "Boolean unary operand"; + amm:operand val { + description + "The single value."; + amm:type "/ARITYPE/BOOL"; + } + } + + grouping bool-binary-operands { + description + "Boolean bianry operands"; + amm:operand left { + description + "The left-side operand."; + amm:type "/ARITYPE/BOOL"; + } + amm:operand right { + description + "The left-side operand."; + amm:type "/ARITYPE/BOOL"; + } + } + + grouping bool-unary-result { + description + "Boolean result"; + amm:result result { + description + "The single value."; + amm:type "/ARITYPE/BOOL"; + } } - amm:edd sw_version { + + amm:enum 1; + amm:edd sw-vendor { + amm:enum 0; + description + "The vendor for this Agent implementation."; amm:type "/ARITYPE/TEXTSTR"; + } + amm:edd sw-version { + amm:enum 1; description "The version for this Agent implementation."; + amm:type "/ARITYPE/TEXTSTR"; } amm:edd capability { + amm:enum 2; + description + "A table to indicate the ADM capability of the sending agent."; amm:tblt { - amm:key "adm_name"; - amm:column adm_name { - amm:type "/ARITYPE/TEXTSTR"; + amm:key "adm-name"; + amm:column adm-name { description "The module name of the ADM"; + amm:type "/ARITYPE/TEXTSTR"; } amm:column enum { - amm:type "/ARITYPE/VAST"; description "The module enumeration of the ADM"; + amm:type "/ARITYPE/VAST"; } amm:column revision { - amm:type "/ARITYPE/TEXTSTR"; description "The specific revision the agent supports."; + amm:type "/ARITYPE/TEXTSTR"; } amm:column features { + description + "The features of the ADM which the agent supports."; amm:ulist { amm:type "/ARITYPE/TEXTSTR"; } - description - "The features of the ADM which the agent supports."; } } - description - "A table to indicate the ADM capability of the sending agent."; } amm:const hello { amm:enum 0; - amm:type "//ietf-amm/TYPEDEF/RPTT"; - amm:init-value "/AC/(./EDD/sw_vendor,./EDD/sw_version,./EDD/capability)"; description "A report template to indicate the presence of an agent on a network."; + amm:init-value "/AC/(./EDD/sw-vendor,./EDD/sw-version,./EDD/capability)"; + amm:type "//ietf-amm/TYPEDEF/RPTT"; } // Messaging counters - amm:edd num_msg_rx { + amm:edd num-msg-rx { + amm:enum 3; amm:type "//ietf-amm/TYPEDEF/counter64"; } - amm:edd num_msg_rx_failed { + amm:edd num-msg-rx-failed { + amm:enum 4; amm:type "//ietf-amm/TYPEDEF/counter64"; } - amm:edd num_msg_tx { + amm:edd num-msg-tx { + amm:enum 5; amm:type "//ietf-amm/TYPEDEF/counter64"; } // Execution counters and states - amm:edd num_exec_started { + amm:edd num-exec-started { + amm:enum 6; amm:type "//ietf-amm/TYPEDEF/counter64"; } - amm:edd num_exec_succeeded { + amm:edd num-exec-succeeded { + amm:enum 7; amm:type "//ietf-amm/TYPEDEF/counter64"; } - amm:edd num_exec_failed { + amm:edd num-exec-failed { + amm:enum 8; amm:type "//ietf-amm/TYPEDEF/counter64"; } - amm:edd exec_running { + amm:edd exec-running { + amm:enum 9; amm:tblt { amm:key "pid"; amm:column pid { @@ -124,9 +279,13 @@ module ietf-dtnma-agent { amm:int-labels { enum waiting { value 0; + description + "The execution is waiting on a condition or timer to continue."; } enum running { value 1; + description + "The execution is currently running."; } } } @@ -135,166 +294,167 @@ module ietf-dtnma-agent { } // MAC helper controls - amm:ctrl if_then_else { + amm:ctrl if-then-else { + amm:enum 0; + description + "Evaluate an expression and follow one of two branches of + further evaluation."; amm:parameter condition { - amm:type "//ietf-amm/TYPEDEF/eval-tgt"; description "The condition to evaluate."; + amm:type "//ietf-amm/TYPEDEF/eval-tgt"; } - amm:parameter on_truthy { + amm:parameter on-truthy { + description + "The object to execute when the condition is truthy."; + amm:default "null"; amm:union { amm:type "//ietf-amm/TYPEDEF/exec-tgt"; amm:type "/ARITYPE/NULL"; } - amm:default "null"; - description - "The object to execute when the condition is truthy."; } - amm:parameter on_falsy { + amm:parameter on-falsy { + description + "An optional execution when the condition is falsey."; + amm:default "null"; amm:union { amm:type "//ietf-amm/TYPEDEF/exec-tgt"; amm:type "/ARITYPE/NULL"; } - amm:default "null"; - description - "An optional execution when the condition is falsey."; } amm:result branch { - amm:type "/ARITYPE/BOOL"; description "Indication of which branch was executed."; + amm:type "/ARITYPE/BOOL"; } - description - "Evaluate an expression and follow one of two branches of - further evaluation."; } amm:ctrl catch { + amm:enum 1; + description + "Attempt to execute a target, and if there is some failure catch it + and execute an alternative target."; amm:parameter try { - amm:type "//ietf-amm/TYPEDEF/exec-tgt"; description "The object to execute."; + amm:type "//ietf-amm/TYPEDEF/exec-tgt"; } - amm:parameter on_failure { + amm:parameter on-failure { + description + "An optional execution after failure."; + amm:default "null"; amm:union { amm:type "//ietf-amm/TYPEDEF/exec-tgt"; amm:type "/ARITYPE/NULL"; } - amm:default "null"; - description - "An optional execution after failure."; } - amm:result try_success { - amm:type "/ARITYPE/BOOL"; + amm:result try-success { description "True if the try target succeeded without exception."; + amm:type "/ARITYPE/BOOL"; } - description - "Attempt to execute a target, and if there is some failure catch it - and execute an alternative target."; } - amm:ctrl wait_for { - amm:parameter duration { - amm:type "/ARITYPE/TD"; - } + amm:ctrl wait-for { + amm:enum 2; description "This control causes the execution to pause for a given amount of time. This is intended to be used within a macro to separate controls in time."; - } - amm:ctrl wait_until { - amm:parameter time { - amm:type "/ARITYPE/TP"; + amm:parameter duration { + amm:type "/ARITYPE/TD"; } + } + amm:ctrl wait-until { + amm:enum 3; description "This control causes the execution to pause until a specific absolute time point. This is intended to be used within a macro to separate controls in time or as a first macro item to delay execution after the time of reception."; - } - amm:ctrl wait_cond { - amm:parameter condition { - amm:type "//ietf-amm/TYPEDEF/eval-tgt"; + amm:parameter time { + amm:type "/ARITYPE/TP"; } + } + amm:ctrl wait-cond { + amm:enum 4; description "This control causes the execution to pause until a condition expression evaluates to truthy. This is intended to be used within a macro to separate controls in time or as a first macro item to delay execution until the condition is met."; + amm:parameter condition { + amm:type "//ietf-amm/TYPEDEF/eval-tgt"; + } } // Value production and reporting amm:ctrl inspect { + amm:enum 5; + description + "Produce a result value to inspect the agent state. + This does not perform any EXPR evaluation or RPTT handling."; amm:parameter ref { - amm:type "//ietf-amm/TYPEDEF/VALUE-OBJ"; description "An object to produce a value from."; + amm:type "//ietf-amm/TYPEDEF/VALUE-OBJ"; } amm:result val { - amm:type "//ietf-amm/TYPEDEF/ANY"; description "The produced value."; + amm:type "//ietf-amm/TYPEDEF/ANY"; } - description - "Produce a result value to inspect the agent state. - This does not perform any EXPR evaluation or RPTT handling."; } - amm:ctrl report_on { - amm:parameter rptt { - amm:type "//ietf-amm/TYPEDEF/rpt-tgt"; - } + amm:ctrl report-on { + amm:enum 6; description "Generate a report on an object without needing to define an object. The parameter is a single RPTT list that would be produced by an object. If used for more than one-shot diagnostics, defining a RPTT (e.g. in a VAR) is more efficient because the RPTT item would not be present in the report."; + amm:parameter rptt { + amm:type "//ietf-amm/TYPEDEF/rpt-tgt"; + } } // Helpers for VAR - amm:ctrl var_reset { + amm:ctrl var-reset { + amm:enum 7; + description + "Modify a VAR state to its default value."; amm:parameter target { - amm:type "/ARITYPE/VAR"; description "The VAR object to affect."; + amm:type "/ARITYPE/VAR"; } - description - "Modify a VAR state to its default value."; } - amm:ctrl var_store { + amm:ctrl var-store { + amm:enum 8; + description + "Modify a VAR state to a specific value."; amm:parameter target { - amm:type "/ARITYPE/VAR"; description "The VAR object to affect."; + amm:type "/ARITYPE/VAR"; } amm:parameter value { - amm:type "//ietf-amm/TYPEDEF/ANY"; description "The exact value to store in the VAR."; + amm:type "//ietf-amm/TYPEDEF/ANY"; } - description - "Modify a VAR state to a specific value."; - } - - grouping obj-list-params { - amm:parameter include_adm { - amm:type "/ARITYPE/BOOL"; - amm:default "false"; - description - "If true, listings will include objects from ADMs"; - } - description - "Common parameters for object listing"; } - amm:typedef hellotyp { + amm:enum 0; amm:union { amm:type "/ARITYPE/BYTE"; amm:type "/ARITYPE/UINT"; } } - amm:edd typedef_list { + amm:edd typedef-list { + amm:enum 10; + description + "A table of TYPEDEF within the agent."; uses obj-list-params; amm:tblt { amm:key "obj"; @@ -302,12 +462,13 @@ module ietf-dtnma-agent { amm:type "/ARITYPE/TYPEDEF"; } } - description - "A table of TYPEDEF within the agent."; } // Objects related to VAR handling - amm:edd var_list { + amm:edd var-list { + amm:enum 11; + description + "A table of VAR within the agent."; uses obj-list-params; amm:tblt { amm:key "obj"; @@ -318,372 +479,276 @@ module ietf-dtnma-agent { amm:type "//ietf-amm/TYPEDEF/TYPE-REF"; } } - description - "A table of VAR within the agent."; } - amm:ctrl ensure_var { + amm:ctrl ensure-var { + amm:enum 9; + description + "Ensure a specific VAR is present."; amm:parameter obj { - amm:type "/ARITYPE/VAR"; description "A reference to a VAR within an ODM only."; + amm:type "/ARITYPE/VAR"; } amm:parameter type { - amm:type "//ietf-amm/TYPEDEF/TYPE-REF"; description "The type for the VAR object."; + amm:type "//ietf-amm/TYPEDEF/TYPE-REF"; } amm:parameter init { + description + "An optional initializer expression."; + amm:default "null"; amm:union { amm:type "/ARITYPE/NULL"; amm:type "//ietf-amm/TYPEDEF/EXPR"; } - amm:default "null"; - description - "An optional initializer expression."; } - description - "Ensure a specific VAR is present."; } - amm:ctrl discard_var { + amm:ctrl discard-var { + amm:enum 10; + description + "Discard a specific VAR if it is present."; amm:parameter obj { - amm:type "/ARITYPE/VAR"; description "A reference to a VAR within an ODM only."; + amm:type "/ARITYPE/VAR"; } - description - "Discard a specific VAR if it is present."; } // Objects related to SBR handling - amm:edd sbr_list { + amm:edd sbr-list { if-feature "rules"; + amm:enum 12; amm:tblt { amm:key "obj"; amm:column obj { amm:type "/ARITYPE/SBR"; } amm:column action { - amm:type "//ietf-amm/TYPEDEF/MAC"; description "The execution when this rule triggers."; + amm:type "//ietf-amm/TYPEDEF/MAC"; } - amm:column start_time { + amm:column start-time { amm:type "//ietf-amm/TYPEDEF/TIME"; } amm:column condition { amm:type "//ietf-amm/TYPEDEF/EXPR"; } - amm:column min_interval { + amm:column min-interval { amm:type "/ARITYPE/TD"; } - amm:column max_count { + amm:column max-count { amm:type "/ARITYPE/UVAST"; } } } - amm:edd tbr_list { + amm:edd tbr-list { if-feature "rules"; + amm:enum 13; amm:tblt { amm:key "obj"; amm:column obj { amm:type "/ARITYPE/TBR"; } amm:column action { - amm:type "//ietf-amm/TYPEDEF/MAC"; description "The execution when this rule triggers."; + amm:type "//ietf-amm/TYPEDEF/MAC"; } - amm:column start_time { + amm:column start-time { amm:type "//ietf-amm/TYPEDEF/TIME"; } amm:column period { amm:type "/ARITYPE/TD"; } - amm:column max_count { + amm:column max-count { amm:type "/ARITYPE/UVAST"; } } } - grouping any-binary-operands { - amm:operand left { - amm:type "//ietf-amm/TYPEDEF/ANY"; - description - "The left-side operand."; - } - amm:operand right { - amm:type "//ietf-amm/TYPEDEF/ANY"; - description - "The left-side operand."; - } - description - "Any-value bianry operands"; - } - - grouping numeric-unary-operands { - amm:operand val { - amm:type "//ietf-amm/TYPEDEF/NUMERIC"; - description - "The single value."; - } - description - "Numeric unary operand"; - } - - grouping numeric-binary-operands { - amm:operand left { - amm:type "//ietf-amm/TYPEDEF/NUMERIC"; - description - "The left-side operand."; - } - amm:operand right { - amm:type "//ietf-amm/TYPEDEF/NUMERIC"; - description - "The left-side operand."; - } - description - "Numeric bianry operands"; - } - - grouping numeric-unary-result { - amm:result val { - amm:type "//ietf-amm/TYPEDEF/NUMERIC"; - description - "The single value."; - } - description - "Numeric result"; - } - - grouping integer-unary-operands { - amm:operand val { - amm:type "//ietf-amm/TYPEDEF/INTEGER"; - description - "The single value."; - } - description - "Integer unary operand"; - } - - grouping integer-binary-operands { - amm:operand left { - amm:type "//ietf-amm/TYPEDEF/INTEGER"; - description - "The left-side operand."; - } - amm:operand right { - amm:type "//ietf-amm/TYPEDEF/INTEGER"; - description - "The left-side operand."; - } - description - "Integer bianry operands"; - } - - grouping integer-unary-result { - amm:result val { - amm:type "//ietf-amm/TYPEDEF/INTEGER"; - description - "The single value."; - } - description - "Integer result"; - } - - grouping bool-unary-operands { - amm:operand val { - amm:type "/ARITYPE/BOOL"; - description - "The single value."; - } - description - "Boolean unary operand"; - } - - grouping bool-binary-operands { - amm:operand left { - amm:type "/ARITYPE/BOOL"; - description - "The left-side operand."; - } - amm:operand right { - amm:type "/ARITYPE/BOOL"; - description - "The left-side operand."; - } - description - "Boolean bianry operands"; - } - - grouping bool-unary-result { - amm:result val { - amm:type "/ARITYPE/BOOL"; - description - "The single value."; - } - description - "Boolean result"; - } - // Numeric operators amm:oper negate { - uses numeric-unary-operands; - uses numeric-unary-result; + amm:enum 0; description "Negate a value. This is equivalent to multiplying by -1 but a shorter expression."; + uses numeric-unary-operands; + uses numeric-unary-result; } amm:oper add { - uses numeric-binary-operands; - uses numeric-unary-result; + amm:enum 1; description "Add two numeric values. The operands are cast to the least compatible numeric type before the arithmetic."; + uses numeric-binary-operands; + uses numeric-unary-result; } amm:oper sub { + amm:enum 2; uses numeric-binary-operands; uses numeric-unary-result; } amm:oper multiply { + amm:enum 3; uses numeric-binary-operands; uses numeric-unary-result; } amm:oper divide { + amm:enum 4; uses numeric-binary-operands; uses numeric-unary-result; } amm:oper remainder { + amm:enum 5; uses numeric-binary-operands; uses numeric-unary-result; } // Bitwise operators - amm:oper bit_not { + amm:oper bit-not { + amm:enum 6; uses integer-unary-operands; uses integer-unary-result; } - amm:oper bit_and { + amm:oper bit-and { + amm:enum 7; uses integer-binary-operands; uses integer-unary-result; } - amm:oper bit_or { + amm:oper bit-or { + amm:enum 8; uses integer-binary-operands; uses integer-unary-result; } - amm:oper bit_xor { + amm:oper bit-xor { + amm:enum 9; uses integer-binary-operands; uses integer-unary-result; } // Boolean operators - amm:oper bool_not { + amm:oper bool-not { + amm:enum 10; uses bool-binary-operands; uses bool-unary-result; } - amm:oper bool_and { + amm:oper bool-and { + amm:enum 11; uses bool-binary-operands; uses bool-unary-result; } - amm:oper bool_or { + amm:oper bool-or { + amm:enum 12; uses bool-binary-operands; uses bool-unary-result; } - amm:oper bool_xor { + amm:oper bool-xor { + amm:enum 13; uses bool-binary-operands; uses bool-unary-result; } // Value comparison - amm:oper compare_eq { + amm:oper compare-eq { + amm:enum 14; uses any-binary-operands; uses bool-unary-result; } - amm:oper compare_ne { + amm:oper compare-ne { + amm:enum 15; uses any-binary-operands; uses bool-unary-result; } // Numeric comparison - amm:oper compare_gt { - uses numeric-binary-operands; - uses bool-unary-result; + amm:oper compare-gt { + amm:enum 16; description "Compare two numbers by value. The result is true if the left value is greater than the right. The operands are cast to the least compatible numeric type before the comparison."; - } - amm:oper compare_ge { uses numeric-binary-operands; uses bool-unary-result; + } + amm:oper compare-ge { + amm:enum 17; description "Compare two numbers by value. The result is true if the left value is greater than or equal to the right. The operands are cast to the least compatible numeric type before the comparison."; - } - amm:oper compare_lt { uses numeric-binary-operands; uses bool-unary-result; + } + amm:oper compare-lt { + amm:enum 18; description "Compare two operands by value. The result is true if the left value is less than the right. The operands are cast to the least compatible numeric type before the comparison."; - } - amm:oper compare_le { uses numeric-binary-operands; uses bool-unary-result; + } + amm:oper compare-le { + amm:enum 19; description "Compare two operands by value. The result is true if the left value is less than or equal to the right. The operands are cast to the least compatible numeric type before the comparison."; + uses numeric-binary-operands; + uses bool-unary-result; } // Table filtering amm:typedef column-id { + amm:enum 1; + description + "Name or index of an individual column in a table."; amm:union { amm:type "/ARITYPE/UVAST"; amm:type "/ARITYPE/TEXTSTR"; } - description - "Name or index of an individual column in a table."; } - amm:oper tbl_filter { - amm:parameter row_match { - amm:ulist { - amm:type "//ietf-amm/TYPEDEF/EXPR"; - } + amm:oper tbl-filter { + amm:enum 20; + description + "Filter a table first by rows and then by columns."; + amm:parameter row-match { description "A filter to match rows with specific cell contents. Each key is a column to compare and each value is an expression with LABEL values substituted by column names."; - } - amm:parameter columns { amm:ulist { - amm:type "./TYPEDEF/column-id"; + amm:type "//ietf-amm/TYPEDEF/EXPR"; } + } + amm:parameter columns { description "A filter to match rows with specific cell contents. Each key is a column to compare and each value is an expression with LABEL values substituted by column names."; + amm:ulist { + amm:type "./TYPEDEF/column-id"; + } } amm:operand in { - amm:type "/ARITYPE/TBL"; description "Table to filter."; + amm:type "/ARITYPE/TBL"; } amm:result out { - amm:type "/ARITYPE/TBL"; description "The filtered table."; + amm:type "/ARITYPE/TBL"; } - description - "Filter a table first by rows and then by columns."; } }