Support of WG4 OpenFronthaul Management-Plane VES
[scp/oam/modeling.git] / data-model / yang / published / ietf / ietf-dhcpv6-common@2021-01-29.yang
1 module ietf-dhcpv6-common {
2   yang-version 1.1;
3   namespace "urn:ietf:params:xml:ns:yang:ietf-dhcpv6-common";
4   prefix "dhcpv6-common";
5
6   import ietf-yang-types {
7     prefix yang;
8     reference
9       "RFC 6991: Common YANG Data Types";
10   }
11
12   organization "DHC WG";
13   contact
14     "yong@csnet1.cs.tsinghua.edu.cn
15     lh.sunlinh@gmail.com
16     ian.farrer@telekom.de
17     sladjana.zechlin@telekom.de
18     hezihao9512@gmail.com";
19
20   description "This YANG module defines common components
21     used for the configuration and management of DHCPv6.
22
23     Copyright (c) 2021 IETF Trust and the persons identified as
24     authors of the code.  All rights reserved.
25
26     Redistribution and use in source and binary forms, with or
27     without modification, is permitted pursuant to, and subject
28     to the license terms contained in, the Simplified BSD License
29     set forth in Section 4.c of the IETF Trust's Legal Provisions
30     Relating to IETF Documents
31     (http://trustee.ietf.org/license-info).
32
33     This version of this YANG module is part of RFC 8513; see
34     the RFC itself for full legal notices.";
35
36   revision 2021-01-29 {
37     description "Version update for draft -17 publication.";
38     reference "I-D: draft-ietf-dhc-dhcpv6-yang-17";
39   }
40
41   revision 2021-01-06 {
42     description "Version update for draft -16 publication.";
43     reference "I-D: draft-ietf-dhc-dhcpv6-yang-16";
44   }
45
46   revision 2020-12-22 {
47     description "Version update for draft -13 publication.";
48     reference "I-D: draft-ietf-dhc-dhcpv6-yang-15";
49   }
50
51   revision 2020-12-10 {
52     description "Version update for draft -13 publication.";
53     reference "I-D: draft-ietf-dhc-dhcpv6-yang-13";
54   }
55
56   revision 2020-12-01 {
57     description "Version update for draft -12 publication.";
58     reference "I-D: draft-ietf-dhc-dhcpv6-yang-12";
59   }
60
61   revision 2020-05-26 {
62     description "Version update for draft -11 publication and
63       to align revisions across the different modules.";
64     reference "I-D: draft-ietf-dhc-dhcpv6-yang-11";
65   }
66
67   revision 2018-09-04 {
68     description "";
69     reference "I-D: draft-ietf-dhc-dhcpv6-yang";
70   }
71
72   revision 2018-01-30 {
73     description "Initial revision";
74     reference "I-D: draft-ietf-dhc-dhcpv6-yang";
75   }
76
77   typedef threshold {
78     type union {
79       type uint16 {
80         range 0..100;
81       }
82       type enumeration {
83         enum "disabled" {
84           description "No threshold";
85         }
86       }
87     }
88     description "Threshold value in percent";
89   }
90
91   typedef timer-seconds32 {
92     type uint32 {
93       range "1..4294967295";
94     }
95     units "seconds";
96     description
97       "Timer value type, in seconds (32-bit range).";
98   }
99
100 /*
101 * Groupings
102 */
103
104   grouping duid {
105     description "Each server and client has only one DUID (DHCP
106       Unique Identifier). The DUID here identifies a unique
107       DHCPv6 server for clients.  DUID consists of a two-octet
108       type field and an arbitrary length (no more than 128 bytes)
109       content field.  Currently there are four defined types of
110       DUIDs in RFC8415 and RFC6355 - DUID-LLT, DUID-EN, DUID-LL
111       and DUID-UUID.  DUID-unstructured represents DUIDs which
112       do not follow any of the defined formats.";
113     reference "RFC8415: Section 11 and RFC6355: Section 4";
114     leaf type-code {
115       type uint16;
116       default 65535;
117       description "Type code of this DUID.";
118     }
119     choice duid-type {
120       default duid-unstructured;
121       description "Selects the format of the DUID.";
122       case duid-llt {
123         description "DUID Based on Link-layer Address Plus Time
124           (Type 1 - DUID-LLT).";
125         reference "RFC8415 Section 11.2";
126         leaf duid-llt-hardware-type {
127           type uint16;
128           description "Hardware type as assigned by IANA (RFC826).";
129         }
130         leaf duid-llt-time {
131           type yang:timeticks;
132           description "The time that the DUID is generated
133             represented in seconds since midnight (UTC),
134             January 1, 2000, modulo 2^32.";
135         }
136         leaf duid-llt-link-layer-address {
137           type yang:mac-address;
138           description "Link-layer address as described in RFC2464.";
139         }
140       }
141       case duid-en {
142         description "DUID Assigned by Vendor Based on Enterprise
143           Number (Type 2 - DUID-EN).";
144         reference "RFC8415 Section 11.3";
145         leaf duid-en-enterprise-number {
146           type uint32;
147           description "Vendor's registered Private Enterprise Number
148             as maintained by IANA.";
149         }
150         leaf duid-en-identifier {
151           type string;
152           description "Identifier, unique to the device.";
153         }
154       }
155       case duid-ll {
156         description "DUID Based on Link-layer Address
157           (Type 3 - DUID-LL).";
158         reference "RFC8415 Section 11.4";
159         leaf duid-ll-hardware-type {
160           type uint16;
161           description "Hardware type, as assigned by IANA (RFC826).";
162         }
163         leaf duid-ll-link-layer-address {
164           type yang:mac-address;
165           description "Link-layer address, as described in RFC2464";
166         }
167       }
168       case duid-uuid {
169         description "DUID Based on Universally Unique Identifier
170           (Type 4 - DUID-UUID).";
171         reference "RFC6335 Definition of the UUID-Based Unique
172           Identifier";
173         leaf uuid {
174           type yang:uuid;
175           description "A Universally Unique Identifier in the string
176             representation, defined in RFC4122. The canonical
177             representation uses lowercase characters.";
178         }
179       }
180       case duid-unstructured {
181         description "DUID which does not follow any of the other
182           structures, expressed as bytes.";
183         leaf data {
184           type binary;
185           description "The bits to be used as the identifier.";
186         }
187       }
188     }
189     leaf active-duid {
190       type binary;
191       config "false";
192       description "The DUID which is currently in use.";
193     }
194   }
195
196   grouping auth-option-group {
197     description "OPTION_AUTH (11) Authentication Option.";
198     reference "RFC8415: Dynamic Host Configuration Protocol
199       for IPv6 (DHCPv6)";
200     container auth-option {
201       description "OPTION_AUTH (11) Authentication Option
202         container.";
203       leaf protocol {
204         type uint8;
205         description "The authentication protocol used in this
206           Authentication option.";
207       }
208       leaf algorithm {
209         type uint8;
210         description "The algorithm used in the authentication
211           protocol.";
212       }
213       leaf rdm {
214         type uint8;
215         description "The replay detection method used
216           in this Authentication option.";
217       }
218       leaf replay-detection {
219         type uint64;
220         description "The replay detection information for the RDM.";
221       }
222       leaf auth-information {
223         type string;
224         description "The authentication information, as specified
225           by the protocol and algorithm used in this Authentication
226           option.";
227       }
228     }
229   }
230   grouping status-code-option-group {
231     description "OPTION_STATUS_CODE (13) Status Code Option.";
232     reference "RFC8415: Dynamic Host Configuration Protocol
233       for IPv6 (DHCPv6)";
234     container status-code-option {
235       description "OPTION_STATUS_CODE (13) Status Code Option
236         container.";
237       leaf status-code {
238         type uint16;
239         description "The numeric code for the status encoded
240           in this option. See the Status Codes registry at
241           <https://www.iana.org/assignments/dhcpv6-parameters>
242           for the current list of status codes.";
243       }
244       leaf status-message {
245         type string;
246         description "A UTF-8 encoded text string suitable for
247           display to an end user. MUST NOT be null-terminated.";
248       }
249     }
250   }
251
252   grouping rapid-commit-option-group {
253     description "OPTION_RAPID_COMMIT (14) Rapid Commit Option.";
254     reference "RFC8415: Dynamic Host Configuration Protocol for
255       IPv6 (DHCPv6)";
256     container rapid-commit-option {
257       presence "Enable sending of this option";
258       description "OPTION_RAPID_COMMIT (14) Rapid Commit Option
259         container.";
260     }
261   }
262
263   grouping vendor-specific-information-option-group {
264     description "OPTION_VENDOR_OPTS (17) Vendor-specific
265       Information Option.";
266     reference "RFC8415: Dynamic Host Configuration Protocol
267       for IPv6 (DHCPv6)";
268     container vendor-specific-information-option {
269       description "OPTION_VENDOR_OPTS (17) Vendor-specific
270         Information Option container.";
271       list vendor-specific-information-option-instances {
272         key enterprise-number;
273         description "The vendor specific information option allows
274           for multiple instances in a single message. Each list entry
275           defines the contents of an instance of the option.";
276         leaf enterprise-number {
277           type uint32;
278           description "The vendor's registered Enterprise Number,
279             as maintained by IANA.";
280         }
281         list vendor-option-data {
282           key sub-option-code;
283           description "Vendor options, interpreted by vendor-specific
284             client/server functions.";
285           leaf sub-option-code {
286             type uint16;
287             description "The code for the sub-option.";
288           }
289           leaf sub-option-data {
290             type string;
291             description "The data area for the sub-option.";
292           }
293         }
294       }
295     }
296   }
297
298   grouping reconfigure-accept-option-group {
299     description "OPTION_RECONF_ACCEPT (20)  Reconfigure Accept
300       Option.
301       A client uses the Reconfigure Accept option to announce to
302       the server whether the client is willing to accept Reconfigure
303       messages, and a server uses this option to tell the client
304       whether or not to accept Reconfigure messages.  In the absence
305       of this option, the default behavior is that the client is
306       unwilling to accept Reconfigure messages.  The presence node
307       is used to enable the option.";
308     reference "RFC8415: Dynamic Host Configuration Protocol
309       for IPv6 (DHCPv6)";
310     container reconfigure-accept-option {
311       presence "Enable sending of this option";
312       description "OPTION_RECONF_ACCEPT (20)  Reconfigure Accept
313         Option container.";
314     }
315   }
316 }