Support of WG4 OpenFronthaul Management-Plane VES
[scp/oam/modeling.git] / data-model / yang / published / ietf / ietf-dhcpv6-types@2018-09-04.yang
1 module ietf-dhcpv6-types {
2   yang-version 1.1;
3   namespace "urn:ietf:params:xml:ns:yang:ietf-dhcpv6-types";
4   prefix "dhcpv6-types";
5
6   import ietf-inet-types {
7     prefix inet;
8   }
9   import ietf-yang-types {
10     prefix yang;
11   }
12
13   organization "DHC WG";
14   contact
15    "cuiyong@tsinghua.edu.cn
16     lh.sunlinh@gmail.com
17     ian.farrer@telekom.de
18     sladjana.zechlin@telekom.de
19     hezihao9512@gmail.com";
20
21   description "This model defines a YANG data model that can be
22     used to define some commonly used DHCPv6 types";
23
24   revision 2018-09-04 {
25     description "";
26     reference "I-D: draft-ietf-dhc-dhcpv6-yang";
27   }
28
29   revision 2018-01-30 {
30     description "Initial revision";
31     reference "I-D: draft-ietf-dhc-dhcpv6-yang";
32   }
33
34   /*
35   * Grouping
36   */
37   grouping vendor-infor {
38     description "Vendor information.";
39     container vendor-info {
40       description "";
41       leaf ent-num {
42         type uint32;
43         mandatory true;
44         description "enterprise number";
45       }
46       leaf-list data {
47         type string;
48         description "specific vendor info";
49       }
50     }
51   }
52
53   grouping duid {
54     description
55       "Each server and client has only one DUID (DHCP Unique Identifier).
56       The DUID here identifies a unique DHCPv6 server for clients. DUID
57       consists of a two-octet type field and an arbitrary length (no more
58       than 128 bytes) content field. Currently there are four defined types
59       of DUIDs in RFC3315 and RFC6355 - DUID-LLT, DUID-EN, DUID-LL and
60       DUID-UUID. DUID-Unknown represents those unconventional DUIDs.";
61     reference "RFC3315: Section 9 and RFC6355: Section 4";
62     leaf type-code {
63       type uint16;
64       default 65535;
65       description "Type code of this DUID";
66     }
67     choice duid-type {
68     default duid-unknown;
69       description "Selects the format for the DUID.";
70       case duid-llt {
71         description "DUID Based on Link-layer Address Plus Time
72           (Type 1 - DUID-LLT)";
73         reference "RFC3315 Section 9.2";
74         leaf duid-llt-hardware-type {
75           type uint16;
76           description "Hardware type as assigned by IANA (RFC826).";
77         }
78         leaf duid-llt-time {
79           type yang:timeticks;
80           description "The time value is the time that the DUID is
81           generated represented in seconds since midnight (UTC),
82           January 1, 2000, modulo 2^32.";
83         }
84         leaf duid-llt-link-layer-addr {
85           type yang:mac-address;
86           description "Link-layer address as described in RFC2464";
87         }
88       }
89       case duid-en {
90         description "DUID Assigned by Vendor Based on Enterprise Number
91           (Type 2 - DUID-EN)";
92         reference "RFC3315 Section 9.3";
93         leaf duid-en-enterprise-number {
94           type uint32;
95           description "Vendor's registered Private Enterprise Number as
96             maintained by IANA";
97         }
98         leaf duid-en-identifier {
99           type string;
100           description "Identifier, unique to the device that is
101           using it";
102         }
103       }
104       case duid-ll {
105           description "DUID Based on Link-layer Address (Type 3 - DUID-LL)";
106           reference "RFC3315 Section 9.4";
107           leaf duid-ll-hardware-type {
108             type uint16;
109             description "Hardware type as assigned by IANA (RFC826).";
110           }
111           leaf duid-ll-link-layer-addr {
112             type yang:mac-address;
113             description "Link-layer address as described in RFC2464";
114         }
115       }
116       case duid-uuid {
117         description "DUID Based on Universally Unique Identifier
118           (Type 4 - DUID-UUID)";
119         reference "RFC6335 Definition of the UUID-Based Unique Identifier";
120         leaf uuid {
121           type yang:uuid;
122           description "A Universally Unique IDentifier in the string
123             representation defined in RFC 4122. The canonical
124             representation uses lowercase characters";
125         }
126       }
127       case duid-unknown {
128         description "DUID based on free raw bytes";
129         leaf data {
130           type binary;
131           description "The bits to be used as the identifier";
132         }
133       }
134     }
135   }
136
137   grouping portset-param {
138     description "portset parameters";
139     container port-parameter {
140       description "port parameter";
141       leaf offset {
142         type uint8;
143         mandatory true;
144         description "offset in a port set";
145       }
146       leaf psid-len {
147         type uint8;
148         mandatory true;
149         description "length of a psid";
150       }
151       leaf psid {
152         type uint16;
153         mandatory true;
154         description "psid value";
155       }
156     }
157   }
158
159   grouping iaid {
160     description "IA is a construct through which a server and a
161         client can identify, group, and manage a set of related IPv6
162         addresses. The key of the list is a 4-byte number IAID defined
163         in [RFC3315].";
164     list identity-association {
165       config "false";
166       description "IA";
167       leaf iaid {
168         type uint32;
169         mandatory true;
170         description "IAID";
171       }
172       leaf ia-type {
173         type string;
174         mandatory true;
175         description "IA type";
176       }
177       leaf-list ipv6-addr {
178         type inet:ipv6-address;
179         description "ipv6 address";
180       }
181       leaf-list ipv6-prefix {
182         type inet:ipv6-prefix;
183         description "ipv6 prefix";
184       }
185       leaf-list prefix-length {
186         type uint8;
187         description "ipv6 prefix length";
188       }
189       leaf t1-time {
190         type yang:timeticks;
191         mandatory true;
192         description "t1 time";
193       }
194       leaf t2-time {
195         type yang:timeticks;
196         mandatory true;
197         description "t2 time";
198       }
199       leaf preferred-lifetime {
200         type yang:timeticks;
201         mandatory true;
202         description "preferred lifetime";
203       }
204       leaf valid-lifetime {
205         type yang:timeticks;
206         mandatory true;
207         description "valid lifetime";
208       }
209     }
210   }
211 }