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