--- /dev/null
+module ietf-dhcpv6-common {
+ yang-version 1.1;
+ namespace "urn:ietf:params:xml:ns:yang:ietf-dhcpv6-common";
+ prefix "dhcpv6-common";
+
+ import ietf-yang-types {
+ prefix yang;
+ reference
+ "RFC 6991: Common YANG Data Types";
+ }
+
+ organization "DHC WG";
+ contact
+ "yong@csnet1.cs.tsinghua.edu.cn
+ lh.sunlinh@gmail.com
+ ian.farrer@telekom.de
+ sladjana.zechlin@telekom.de
+ hezihao9512@gmail.com";
+
+ description "This YANG module defines common components
+ used for the configuration and management of DHCPv6.
+
+ 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
+ (http://trustee.ietf.org/license-info).
+
+ This version of this YANG module is part of RFC 8513; see
+ the RFC itself for full legal notices.";
+
+ revision 2021-01-29 {
+ description "Version update for draft -17 publication.";
+ reference "I-D: draft-ietf-dhc-dhcpv6-yang-17";
+ }
+
+ revision 2021-01-06 {
+ description "Version update for draft -16 publication.";
+ reference "I-D: draft-ietf-dhc-dhcpv6-yang-16";
+ }
+
+ revision 2020-12-22 {
+ description "Version update for draft -13 publication.";
+ reference "I-D: draft-ietf-dhc-dhcpv6-yang-15";
+ }
+
+ revision 2020-12-10 {
+ description "Version update for draft -13 publication.";
+ reference "I-D: draft-ietf-dhc-dhcpv6-yang-13";
+ }
+
+ revision 2020-12-01 {
+ description "Version update for draft -12 publication.";
+ reference "I-D: draft-ietf-dhc-dhcpv6-yang-12";
+ }
+
+ revision 2020-05-26 {
+ description "Version update for draft -11 publication and
+ to align revisions across the different modules.";
+ reference "I-D: draft-ietf-dhc-dhcpv6-yang-11";
+ }
+
+ revision 2018-09-04 {
+ description "";
+ reference "I-D: draft-ietf-dhc-dhcpv6-yang";
+ }
+
+ revision 2018-01-30 {
+ description "Initial revision";
+ reference "I-D: draft-ietf-dhc-dhcpv6-yang";
+ }
+
+ typedef threshold {
+ type union {
+ type uint16 {
+ range 0..100;
+ }
+ type enumeration {
+ enum "disabled" {
+ description "No threshold";
+ }
+ }
+ }
+ description "Threshold value in percent";
+ }
+
+ typedef timer-seconds32 {
+ type uint32 {
+ range "1..4294967295";
+ }
+ units "seconds";
+ description
+ "Timer value type, in seconds (32-bit range).";
+ }
+
+/*
+* Groupings
+*/
+
+ grouping duid {
+ description "Each server and client has only one DUID (DHCP
+ Unique Identifier). The DUID here identifies a unique
+ DHCPv6 server for clients. DUID consists of a two-octet
+ type field and an arbitrary length (no more than 128 bytes)
+ content field. Currently there are four defined types of
+ DUIDs in RFC8415 and RFC6355 - DUID-LLT, DUID-EN, DUID-LL
+ and DUID-UUID. DUID-unstructured represents DUIDs which
+ do not follow any of the defined formats.";
+ reference "RFC8415: Section 11 and RFC6355: Section 4";
+ leaf type-code {
+ type uint16;
+ default 65535;
+ description "Type code of this DUID.";
+ }
+ choice duid-type {
+ default duid-unstructured;
+ description "Selects the format of the DUID.";
+ case duid-llt {
+ description "DUID Based on Link-layer Address Plus Time
+ (Type 1 - DUID-LLT).";
+ reference "RFC8415 Section 11.2";
+ leaf duid-llt-hardware-type {
+ type uint16;
+ description "Hardware type as assigned by IANA (RFC826).";
+ }
+ leaf duid-llt-time {
+ type yang:timeticks;
+ description "The time that the DUID is generated
+ represented in seconds since midnight (UTC),
+ January 1, 2000, modulo 2^32.";
+ }
+ leaf duid-llt-link-layer-address {
+ type yang:mac-address;
+ description "Link-layer address as described in RFC2464.";
+ }
+ }
+ case duid-en {
+ description "DUID Assigned by Vendor Based on Enterprise
+ Number (Type 2 - DUID-EN).";
+ reference "RFC8415 Section 11.3";
+ leaf duid-en-enterprise-number {
+ type uint32;
+ description "Vendor's registered Private Enterprise Number
+ as maintained by IANA.";
+ }
+ leaf duid-en-identifier {
+ type string;
+ description "Identifier, unique to the device.";
+ }
+ }
+ case duid-ll {
+ description "DUID Based on Link-layer Address
+ (Type 3 - DUID-LL).";
+ reference "RFC8415 Section 11.4";
+ leaf duid-ll-hardware-type {
+ type uint16;
+ description "Hardware type, as assigned by IANA (RFC826).";
+ }
+ leaf duid-ll-link-layer-address {
+ type yang:mac-address;
+ description "Link-layer address, as described in RFC2464";
+ }
+ }
+ case duid-uuid {
+ description "DUID Based on Universally Unique Identifier
+ (Type 4 - DUID-UUID).";
+ reference "RFC6335 Definition of the UUID-Based Unique
+ Identifier";
+ leaf uuid {
+ type yang:uuid;
+ description "A Universally Unique Identifier in the string
+ representation, defined in RFC4122. The canonical
+ representation uses lowercase characters.";
+ }
+ }
+ case duid-unstructured {
+ description "DUID which does not follow any of the other
+ structures, expressed as bytes.";
+ leaf data {
+ type binary;
+ description "The bits to be used as the identifier.";
+ }
+ }
+ }
+ leaf active-duid {
+ type binary;
+ config "false";
+ description "The DUID which is currently in use.";
+ }
+ }
+
+ grouping auth-option-group {
+ description "OPTION_AUTH (11) Authentication Option.";
+ reference "RFC8415: Dynamic Host Configuration Protocol
+ for IPv6 (DHCPv6)";
+ container auth-option {
+ description "OPTION_AUTH (11) Authentication Option
+ container.";
+ leaf protocol {
+ type uint8;
+ description "The authentication protocol used in this
+ Authentication option.";
+ }
+ leaf algorithm {
+ type uint8;
+ description "The algorithm used in the authentication
+ protocol.";
+ }
+ leaf rdm {
+ type uint8;
+ description "The replay detection method used
+ in this Authentication option.";
+ }
+ leaf replay-detection {
+ type uint64;
+ description "The replay detection information for the RDM.";
+ }
+ leaf auth-information {
+ type string;
+ description "The authentication information, as specified
+ by the protocol and algorithm used in this Authentication
+ option.";
+ }
+ }
+ }
+ grouping status-code-option-group {
+ description "OPTION_STATUS_CODE (13) Status Code Option.";
+ reference "RFC8415: Dynamic Host Configuration Protocol
+ for IPv6 (DHCPv6)";
+ container status-code-option {
+ description "OPTION_STATUS_CODE (13) Status Code Option
+ container.";
+ leaf status-code {
+ type uint16;
+ description "The numeric code for the status encoded
+ in this option. See the Status Codes registry at
+ <https://www.iana.org/assignments/dhcpv6-parameters>
+ for the current list of status codes.";
+ }
+ leaf status-message {
+ type string;
+ description "A UTF-8 encoded text string suitable for
+ display to an end user. MUST NOT be null-terminated.";
+ }
+ }
+ }
+
+ grouping rapid-commit-option-group {
+ description "OPTION_RAPID_COMMIT (14) Rapid Commit Option.";
+ reference "RFC8415: Dynamic Host Configuration Protocol for
+ IPv6 (DHCPv6)";
+ container rapid-commit-option {
+ presence "Enable sending of this option";
+ description "OPTION_RAPID_COMMIT (14) Rapid Commit Option
+ container.";
+ }
+ }
+
+ grouping vendor-specific-information-option-group {
+ description "OPTION_VENDOR_OPTS (17) Vendor-specific
+ Information Option.";
+ reference "RFC8415: Dynamic Host Configuration Protocol
+ for IPv6 (DHCPv6)";
+ container vendor-specific-information-option {
+ description "OPTION_VENDOR_OPTS (17) Vendor-specific
+ Information Option container.";
+ list vendor-specific-information-option-instances {
+ key enterprise-number;
+ description "The vendor specific information option allows
+ for multiple instances in a single message. Each list entry
+ defines the contents of an instance of the option.";
+ leaf enterprise-number {
+ type uint32;
+ description "The vendor's registered Enterprise Number,
+ as maintained by IANA.";
+ }
+ list vendor-option-data {
+ key sub-option-code;
+ description "Vendor options, interpreted by vendor-specific
+ client/server functions.";
+ leaf sub-option-code {
+ type uint16;
+ description "The code for the sub-option.";
+ }
+ leaf sub-option-data {
+ type string;
+ description "The data area for the sub-option.";
+ }
+ }
+ }
+ }
+ }
+
+ grouping reconfigure-accept-option-group {
+ description "OPTION_RECONF_ACCEPT (20) Reconfigure Accept
+ Option.
+ A client uses the Reconfigure Accept option to announce to
+ the server whether the client is willing to accept Reconfigure
+ messages, and a server uses this option to tell the client
+ whether or not to accept Reconfigure messages. In the absence
+ of this option, the default behavior is that the client is
+ unwilling to accept Reconfigure messages. The presence node
+ is used to enable the option.";
+ reference "RFC8415: Dynamic Host Configuration Protocol
+ for IPv6 (DHCPv6)";
+ container reconfigure-accept-option {
+ presence "Enable sending of this option";
+ description "OPTION_RECONF_ACCEPT (20) Reconfigure Accept
+ Option container.";
+ }
+ }
+}