YANGTOOLS-706: Split out yang-parser-rfc7950
[yangtools.git] / yang / yang-parser-rfc7950 / src / test / resources / semantic-statement-parser / yin / modules / ietf-yang-types.yin
1 <?xml version="1.0" encoding="UTF-8"?>\r
2 <module name="ietf-yang-types"\r
3         xmlns="urn:ietf:params:xml:ns:yang:yin:1"\r
4         xmlns:yang="urn:ietf:params:xml:ns:yang:ietf-yang-types">\r
5   <namespace uri="urn:ietf:params:xml:ns:yang:ietf-yang-types"/>\r
6   <prefix value="yang"/>\r
7   <organization>\r
8     <text>IETF NETMOD (NETCONF Data Modeling Language) Working Group</text>\r
9   </organization>\r
10   <contact>\r
11     <text>WG Web:   &lt;http://tools.ietf.org/wg/netmod/&gt;\r
12 WG List:  &lt;mailto:netmod@ietf.org&gt;\r
13 \r
14 WG Chair: David Partain\r
15           &lt;mailto:david.partain@ericsson.com&gt;\r
16 \r
17 WG Chair: David Kessens\r
18           &lt;mailto:david.kessens@nsn.com&gt;\r
19 \r
20 Editor:   Juergen Schoenwaelder\r
21           &lt;mailto:j.schoenwaelder@jacobs-university.de&gt;</text>\r
22   </contact>\r
23   <description>\r
24     <text>This module contains a collection of generally useful derived\r
25 YANG data types.\r
26 \r
27 Copyright (c) 2010 IETF Trust and the persons identified as\r
28 authors of the code.  All rights reserved.\r
29 \r
30 Redistribution and use in source and binary forms, with or without\r
31 modification, is permitted pursuant to, and subject to the license\r
32 terms contained in, the Simplified BSD License set forth in Section\r
33 4.c of the IETF Trust's Legal Provisions Relating to IETF Documents\r
34 (http://trustee.ietf.org/license-info).\r
35 \r
36 This version of this YANG module is part of RFC 6021; see\r
37 the RFC itself for full legal notices.</text>\r
38   </description>\r
39   <revision date="2010-09-24">\r
40     <description>\r
41       <text>Initial revision.</text>\r
42     </description>\r
43     <reference>\r
44       <text>RFC 6021: Common YANG Data Types</text>\r
45     </reference>\r
46   </revision>\r
47   <typedef name="counter32">\r
48     <type name="uint32"/>\r
49     <description>\r
50       <text>The counter32 type represents a non-negative integer\r
51 that monotonically increases until it reaches a\r
52 maximum value of 2^32-1 (4294967295 decimal), when it\r
53 wraps around and starts increasing again from zero.\r
54 \r
55 Counters have no defined 'initial' value, and thus, a\r
56 single value of a counter has (in general) no information\r
57 content.  Discontinuities in the monotonically increasing\r
58 value normally occur at re-initialization of the\r
59 management system, and at other times as specified in the\r
60 description of a schema node using this type.  If such\r
61 other times can occur, for example, the creation of\r
62 a schema node of type counter32 at times other than\r
63 re-initialization, then a corresponding schema node\r
64 should be defined, with an appropriate type, to indicate\r
65 the last discontinuity.\r
66 \r
67 The counter32 type should not be used for configuration\r
68 schema nodes.  A default statement SHOULD NOT be used in\r
69 combination with the type counter32.\r
70 \r
71 In the value set and its semantics, this type is equivalent\r
72 to the Counter32 type of the SMIv2.</text>\r
73     </description>\r
74     <reference>\r
75       <text>RFC 2578: Structure of Management Information Version 2 (SMIv2)</text>\r
76     </reference>\r
77   </typedef>\r
78   <typedef name="zero-based-counter32">\r
79     <type name="yang:counter32"/>\r
80     <default value="0"/>\r
81     <description>\r
82       <text>The zero-based-counter32 type represents a counter32\r
83 that has the defined 'initial' value zero.\r
84 \r
85 A schema node of this type will be set to zero (0) on creation\r
86 and will thereafter increase monotonically until it reaches\r
87 a maximum value of 2^32-1 (4294967295 decimal), when it\r
88 wraps around and starts increasing again from zero.\r
89 \r
90 Provided that an application discovers a new schema node\r
91 of this type within the minimum time to wrap, it can use the\r
92 'initial' value as a delta.  It is important for a management\r
93 station to be aware of this minimum time and the actual time\r
94 between polls, and to discard data if the actual time is too\r
95 long or there is no defined minimum time.\r
96 \r
97 In the value set and its semantics, this type is equivalent\r
98 to the ZeroBasedCounter32 textual convention of the SMIv2.</text>\r
99     </description>\r
100     <reference>\r
101       <text>RFC 4502: Remote Network Monitoring Management Information\r
102           Base Version 2</text>\r
103     </reference>\r
104   </typedef>\r
105   <typedef name="counter64">\r
106     <type name="uint64"/>\r
107     <description>\r
108       <text>The counter64 type represents a non-negative integer\r
109 that monotonically increases until it reaches a\r
110 maximum value of 2^64-1 (18446744073709551615 decimal),\r
111 when it wraps around and starts increasing again from zero.\r
112 \r
113 Counters have no defined 'initial' value, and thus, a\r
114 single value of a counter has (in general) no information\r
115 content.  Discontinuities in the monotonically increasing\r
116 value normally occur at re-initialization of the\r
117 management system, and at other times as specified in the\r
118 description of a schema node using this type.  If such\r
119 other times can occur, for example, the creation of\r
120 a schema node of type counter64 at times other than\r
121 re-initialization, then a corresponding schema node\r
122 should be defined, with an appropriate type, to indicate\r
123 the last discontinuity.\r
124 \r
125 The counter64 type should not be used for configuration\r
126 schema nodes.  A default statement SHOULD NOT be used in\r
127 combination with the type counter64.\r
128 \r
129 In the value set and its semantics, this type is equivalent\r
130 to the Counter64 type of the SMIv2.</text>\r
131     </description>\r
132     <reference>\r
133       <text>RFC 2578: Structure of Management Information Version 2 (SMIv2)</text>\r
134     </reference>\r
135   </typedef>\r
136   <typedef name="zero-based-counter64">\r
137     <type name="yang:counter64"/>\r
138     <default value="0"/>\r
139     <description>\r
140       <text>The zero-based-counter64 type represents a counter64 that\r
141 has the defined 'initial' value zero.\r
142 \r
143 A schema node of this type will be set to zero (0) on creation\r
144 and will thereafter increase monotonically until it reaches\r
145 a maximum value of 2^64-1 (18446744073709551615 decimal),\r
146 when it wraps around and starts increasing again from zero.\r
147 \r
148 Provided that an application discovers a new schema node\r
149 of this type within the minimum time to wrap, it can use the\r
150 'initial' value as a delta.  It is important for a management\r
151 station to be aware of this minimum time and the actual time\r
152 between polls, and to discard data if the actual time is too\r
153 long or there is no defined minimum time.\r
154 \r
155 In the value set and its semantics, this type is equivalent\r
156 to the ZeroBasedCounter64 textual convention of the SMIv2.</text>\r
157     </description>\r
158     <reference>\r
159       <text>RFC 2856: Textual Conventions for Additional High Capacity\r
160           Data Types</text>\r
161     </reference>\r
162   </typedef>\r
163   <typedef name="gauge32">\r
164     <type name="uint32"/>\r
165     <description>\r
166       <text>The gauge32 type represents a non-negative integer, which\r
167 may increase or decrease, but shall never exceed a maximum\r
168 value, nor fall below a minimum value.  The maximum value\r
169 cannot be greater than 2^32-1 (4294967295 decimal), and\r
170 the minimum value cannot be smaller than 0.  The value of\r
171 a gauge32 has its maximum value whenever the information\r
172 being modeled is greater than or equal to its maximum\r
173 value, and has its minimum value whenever the information\r
174 being modeled is smaller than or equal to its minimum value.\r
175 If the information being modeled subsequently decreases\r
176 below (increases above) the maximum (minimum) value, the\r
177 gauge32 also decreases (increases).\r
178 \r
179 In the value set and its semantics, this type is equivalent\r
180 to the Gauge32 type of the SMIv2.</text>\r
181     </description>\r
182     <reference>\r
183       <text>RFC 2578: Structure of Management Information Version 2 (SMIv2)</text>\r
184     </reference>\r
185   </typedef>\r
186   <typedef name="gauge64">\r
187     <type name="uint64"/>\r
188     <description>\r
189       <text>The gauge64 type represents a non-negative integer, which\r
190 may increase or decrease, but shall never exceed a maximum\r
191 value, nor fall below a minimum value.  The maximum value\r
192 cannot be greater than 2^64-1 (18446744073709551615), and\r
193 the minimum value cannot be smaller than 0.  The value of\r
194 a gauge64 has its maximum value whenever the information\r
195 being modeled is greater than or equal to its maximum\r
196 value, and has its minimum value whenever the information\r
197 being modeled is smaller than or equal to its minimum value.\r
198 If the information being modeled subsequently decreases\r
199 below (increases above) the maximum (minimum) value, the\r
200 gauge64 also decreases (increases).\r
201 \r
202 In the value set and its semantics, this type is equivalent\r
203 to the CounterBasedGauge64 SMIv2 textual convention defined\r
204 in RFC 2856</text>\r
205     </description>\r
206     <reference>\r
207       <text>RFC 2856: Textual Conventions for Additional High Capacity\r
208           Data Types</text>\r
209     </reference>\r
210   </typedef>\r
211   <typedef name="object-identifier">\r
212     <type name="string">\r
213       <pattern value="(([0-1](\.[1-3]?[0-9]))|(2\.(0|([1-9]\d*))))(\.(0|([1-9]\d*)))*"/>\r
214     </type>\r
215     <description>\r
216       <text>The object-identifier type represents administratively\r
217 assigned names in a registration-hierarchical-name tree.\r
218 \r
219 Values of this type are denoted as a sequence of numerical\r
220 non-negative sub-identifier values.  Each sub-identifier\r
221 value MUST NOT exceed 2^32-1 (4294967295).  Sub-identifiers\r
222 are separated by single dots and without any intermediate\r
223 whitespace.\r
224 \r
225 The ASN.1 standard restricts the value space of the first\r
226 sub-identifier to 0, 1, or 2.  Furthermore, the value space\r
227 of the second sub-identifier is restricted to the range\r
228 0 to 39 if the first sub-identifier is 0 or 1.  Finally,\r
229 the ASN.1 standard requires that an object identifier\r
230 has always at least two sub-identifier.  The pattern\r
231 captures these restrictions.\r
232 \r
233 Although the number of sub-identifiers is not limited,\r
234 module designers should realize that there may be\r
235 implementations that stick with the SMIv2 limit of 128\r
236 sub-identifiers.\r
237 \r
238 This type is a superset of the SMIv2 OBJECT IDENTIFIER type\r
239 since it is not restricted to 128 sub-identifiers.  Hence,\r
240 this type SHOULD NOT be used to represent the SMIv2 OBJECT\r
241 IDENTIFIER type, the object-identifier-128 type SHOULD be\r
242 used instead.</text>\r
243     </description>\r
244     <reference>\r
245       <text>ISO9834-1: Information technology -- Open Systems\r
246 Interconnection -- Procedures for the operation of OSI\r
247 Registration Authorities: General procedures and top\r
248 arcs of the ASN.1 Object Identifier tree</text>\r
249     </reference>\r
250   </typedef>\r
251   <typedef name="object-identifier-128">\r
252     <type name="object-identifier">\r
253       <pattern value="\d*(\.\d*){1,127}"/>\r
254     </type>\r
255     <description>\r
256       <text>This type represents object-identifiers restricted to 128\r
257 sub-identifiers.\r
258 \r
259 In the value set and its semantics, this type is equivalent\r
260 to the OBJECT IDENTIFIER type of the SMIv2.</text>\r
261     </description>\r
262     <reference>\r
263       <text>RFC 2578: Structure of Management Information Version 2 (SMIv2)</text>\r
264     </reference>\r
265   </typedef>\r
266   <typedef name="date-and-time">\r
267     <type name="string">\r
268       <pattern value="\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[\+\-]\d{2}:\d{2})"/>\r
269     </type>\r
270     <description>\r
271       <text>The date-and-time type is a profile of the ISO 8601\r
272 standard for representation of dates and times using the\r
273 Gregorian calendar.  The profile is defined by the\r
274 date-time production in Section 5.6 of RFC 3339.\r
275 \r
276 The date-and-time type is compatible with the dateTime XML\r
277 schema type with the following notable exceptions:\r
278 \r
279 (a) The date-and-time type does not allow negative years.\r
280 \r
281 (b) The date-and-time time-offset -00:00 indicates an unknown\r
282     time zone (see RFC 3339) while -00:00 and +00:00 and Z all\r
283     represent the same time zone in dateTime.\r
284 \r
285 (c) The canonical format (see below) of data-and-time values\r
286     differs from the canonical format used by the dateTime XML\r
287     schema type, which requires all times to be in UTC using the\r
288     time-offset 'Z'.\r
289 \r
290 This type is not equivalent to the DateAndTime textual\r
291 convention of the SMIv2 since RFC 3339 uses a different\r
292 separator between full-date and full-time and provides\r
293 higher resolution of time-secfrac.\r
294 \r
295 The canonical format for date-and-time values with a known time\r
296 zone uses a numeric time zone offset that is calculated using\r
297 the device's configured known offset to UTC time.  A change of\r
298 the device's offset to UTC time will cause date-and-time values\r
299 to change accordingly.  Such changes might happen periodically\r
300 in case a server follows automatically daylight saving time\r
301 (DST) time zone offset changes.  The canonical format for\r
302 date-and-time values with an unknown time zone (usually referring\r
303 to the notion of local time) uses the time-offset -00:00.</text>\r
304     </description>\r
305     <reference>\r
306       <text>RFC 3339: Date and Time on the Internet: Timestamps\r
307 RFC 2579: Textual Conventions for SMIv2\r
308 XSD-TYPES: XML Schema Part 2: Datatypes Second Edition</text>\r
309     </reference>\r
310   </typedef>\r
311   <typedef name="timeticks">\r
312     <type name="uint32"/>\r
313     <description>\r
314       <text>The timeticks type represents a non-negative integer that\r
315 represents the time, modulo 2^32 (4294967296 decimal), in\r
316 hundredths of a second between two epochs.  When a schema\r
317 node is defined that uses this type, the description of\r
318 the schema node identifies both of the reference epochs.\r
319 \r
320 In the value set and its semantics, this type is equivalent\r
321 to the TimeTicks type of the SMIv2.</text>\r
322     </description>\r
323     <reference>\r
324       <text>RFC 2578: Structure of Management Information Version 2 (SMIv2)</text>\r
325     </reference>\r
326   </typedef>\r
327   <typedef name="timestamp">\r
328     <type name="yang:timeticks"/>\r
329     <description>\r
330       <text>The timestamp type represents the value of an associated\r
331 timeticks schema node at which a specific occurrence happened.\r
332 The specific occurrence must be defined in the description\r
333 of any schema node defined using this type.  When the specific\r
334 occurrence occurred prior to the last time the associated\r
335 timeticks attribute was zero, then the timestamp value is\r
336 zero.  Note that this requires all timestamp values to be\r
337 reset to zero when the value of the associated timeticks\r
338 attribute reaches 497+ days and wraps around to zero.\r
339 \r
340 The associated timeticks schema node must be specified\r
341 in the description of any schema node using this type.\r
342 \r
343 In the value set and its semantics, this type is equivalent\r
344 to the TimeStamp textual convention of the SMIv2.</text>\r
345     </description>\r
346     <reference>\r
347       <text>RFC 2579: Textual Conventions for SMIv2</text>\r
348     </reference>\r
349   </typedef>\r
350   <typedef name="phys-address">\r
351     <type name="string">\r
352       <pattern value="([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?"/>\r
353     </type>\r
354     <description>\r
355       <text>Represents media- or physical-level addresses represented\r
356 as a sequence octets, each octet represented by two hexadecimal\r
357 numbers.  Octets are separated by colons.  The canonical\r
358 representation uses lowercase characters.\r
359 \r
360 In the value set and its semantics, this type is equivalent\r
361 to the PhysAddress textual convention of the SMIv2.</text>\r
362     </description>\r
363     <reference>\r
364       <text>RFC 2579: Textual Conventions for SMIv2</text>\r
365     </reference>\r
366   </typedef>\r
367   <typedef name="mac-address">\r
368     <type name="string">\r
369       <pattern value="[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}"/>\r
370     </type>\r
371     <description>\r
372       <text>The mac-address type represents an IEEE 802 MAC address.\r
373 The canonical representation uses lowercase characters.\r
374 \r
375 In the value set and its semantics, this type is equivalent\r
376 to the MacAddress textual convention of the SMIv2.</text>\r
377     </description>\r
378     <reference>\r
379       <text>IEEE 802: IEEE Standard for Local and Metropolitan Area\r
380           Networks: Overview and Architecture\r
381 RFC 2579: Textual Conventions for SMIv2</text>\r
382     </reference>\r
383   </typedef>\r
384   <typedef name="xpath1.0">\r
385     <type name="string"/>\r
386     <description>\r
387       <text>This type represents an XPATH 1.0 expression.\r
388 \r
389 When a schema node is defined that uses this type, the\r
390 description of the schema node MUST specify the XPath\r
391 context in which the XPath expression is evaluated.</text>\r
392     </description>\r
393     <reference>\r
394       <text>XPATH: XML Path Language (XPath) Version 1.0</text>\r
395     </reference>\r
396   </typedef>\r
397 </module>\r