1 module ietf-yang-types {
3 namespace "urn:ietf:params:xml:ns:yang:ietf-yang-types";
7 "IETF NETMOD (NETCONF Data Modeling Language) Working Group";
10 "WG Web: <http://tools.ietf.org/wg/netmod/>
11 WG List: <mailto:netmod@ietf.org>
13 WG Chair: David Partain
14 <mailto:david.partain@ericsson.com>
16 WG Chair: David Kessens
17 <mailto:david.kessens@nsn.com>
19 Editor: Juergen Schoenwaelder
20 <mailto:j.schoenwaelder@jacobs-university.de>";
23 "This module contains a collection of generally useful derived
26 Copyright (c) 2010 IETF Trust and the persons identified as
27 authors of the code. All rights reserved.
29 Redistribution and use in source and binary forms, with or without
30 modification, is permitted pursuant to, and subject to the license
31 terms contained in, the Simplified BSD License set forth in Section
32 4.c of the IETF Trust's Legal Provisions Relating to IETF Documents
33 (http://trustee.ietf.org/license-info).
35 This version of this YANG module is part of RFC 6021; see
36 the RFC itself for full legal notices.";
42 "RFC 6021: Common YANG Data Types";
45 /*** collection of counter and gauge types ***/
50 "The counter32 type represents a non-negative integer
51 that monotonically increases until it reaches a
52 maximum value of 2^32-1 (4294967295 decimal), when it
53 wraps around and starts increasing again from zero.
55 Counters have no defined 'initial' value, and thus, a
56 single value of a counter has (in general) no information
57 content. Discontinuities in the monotonically increasing
58 value normally occur at re-initialization of the
59 management system, and at other times as specified in the
60 description of a schema node using this type. If such
61 other times can occur, for example, the creation of
62 a schema node of type counter32 at times other than
63 re-initialization, then a corresponding schema node
64 should be defined, with an appropriate type, to indicate
65 the last discontinuity.
67 The counter32 type should not be used for configuration
68 schema nodes. A default statement SHOULD NOT be used in
69 combination with the type counter32.
71 In the value set and its semantics, this type is equivalent
72 to the Counter32 type of the SMIv2.";
74 "RFC 2578: Structure of Management Information Version 2 (SMIv2)";
77 typedef zero-based-counter32 {
81 "The zero-based-counter32 type represents a counter32
82 that has the defined 'initial' value zero.
84 A schema node of this type will be set to zero (0) on creation
85 and will thereafter increase monotonically until it reaches
86 a maximum value of 2^32-1 (4294967295 decimal), when it
87 wraps around and starts increasing again from zero.
89 Provided that an application discovers a new schema node
90 of this type within the minimum time to wrap, it can use the
91 'initial' value as a delta. It is important for a management
92 station to be aware of this minimum time and the actual time
93 between polls, and to discard data if the actual time is too
94 long or there is no defined minimum time.
96 In the value set and its semantics, this type is equivalent
97 to the ZeroBasedCounter32 textual convention of the SMIv2.";
99 "RFC 4502: Remote Network Monitoring Management Information
106 "The counter64 type represents a non-negative integer
107 that monotonically increases until it reaches a
108 maximum value of 2^64-1 (18446744073709551615 decimal),
109 when it wraps around and starts increasing again from zero.
111 Counters have no defined 'initial' value, and thus, a
112 single value of a counter has (in general) no information
113 content. Discontinuities in the monotonically increasing
114 value normally occur at re-initialization of the
115 management system, and at other times as specified in the
116 description of a schema node using this type. If such
117 other times can occur, for example, the creation of
118 a schema node of type counter64 at times other than
119 re-initialization, then a corresponding schema node
120 should be defined, with an appropriate type, to indicate
121 the last discontinuity.
123 The counter64 type should not be used for configuration
124 schema nodes. A default statement SHOULD NOT be used in
125 combination with the type counter64.
127 In the value set and its semantics, this type is equivalent
128 to the Counter64 type of the SMIv2.";
130 "RFC 2578: Structure of Management Information Version 2 (SMIv2)";
133 typedef zero-based-counter64 {
137 "The zero-based-counter64 type represents a counter64 that
138 has the defined 'initial' value zero.
140 A schema node of this type will be set to zero (0) on creation
141 and will thereafter increase monotonically until it reaches
142 a maximum value of 2^64-1 (18446744073709551615 decimal),
143 when it wraps around and starts increasing again from zero.
145 Provided that an application discovers a new schema node
146 of this type within the minimum time to wrap, it can use the
147 'initial' value as a delta. It is important for a management
148 station to be aware of this minimum time and the actual time
149 between polls, and to discard data if the actual time is too
150 long or there is no defined minimum time.
152 In the value set and its semantics, this type is equivalent
153 to the ZeroBasedCounter64 textual convention of the SMIv2.";
155 "RFC 2856: Textual Conventions for Additional High Capacity
162 "The gauge32 type represents a non-negative integer, which
163 may increase or decrease, but shall never exceed a maximum
164 value, nor fall below a minimum value. The maximum value
165 cannot be greater than 2^32-1 (4294967295 decimal), and
166 the minimum value cannot be smaller than 0. The value of
167 a gauge32 has its maximum value whenever the information
168 being modeled is greater than or equal to its maximum
169 value, and has its minimum value whenever the information
170 being modeled is smaller than or equal to its minimum value.
171 If the information being modeled subsequently decreases
172 below (increases above) the maximum (minimum) value, the
173 gauge32 also decreases (increases).
175 In the value set and its semantics, this type is equivalent
176 to the Gauge32 type of the SMIv2.";
178 "RFC 2578: Structure of Management Information Version 2 (SMIv2)";
184 "The gauge64 type represents a non-negative integer, which
185 may increase or decrease, but shall never exceed a maximum
186 value, nor fall below a minimum value. The maximum value
187 cannot be greater than 2^64-1 (18446744073709551615), and
188 the minimum value cannot be smaller than 0. The value of
189 a gauge64 has its maximum value whenever the information
190 being modeled is greater than or equal to its maximum
191 value, and has its minimum value whenever the information
192 being modeled is smaller than or equal to its minimum value.
193 If the information being modeled subsequently decreases
194 below (increases above) the maximum (minimum) value, the
195 gauge64 also decreases (increases).
197 In the value set and its semantics, this type is equivalent
198 to the CounterBasedGauge64 SMIv2 textual convention defined
201 "RFC 2856: Textual Conventions for Additional High Capacity
205 /*** collection of identifier related types ***/
207 typedef object-identifier {
209 pattern '(([0-1](\.[1-3]?[0-9]))|(2\.(0|([1-9]\d*))))'
210 + '(\.(0|([1-9]\d*)))*';
213 "The object-identifier type represents administratively
214 assigned names in a registration-hierarchical-name tree.
216 Values of this type are denoted as a sequence of numerical
217 non-negative sub-identifier values. Each sub-identifier
218 value MUST NOT exceed 2^32-1 (4294967295). Sub-identifiers
219 are separated by single dots and without any intermediate
222 The ASN.1 standard restricts the value space of the first
223 sub-identifier to 0, 1, or 2. Furthermore, the value space
224 of the second sub-identifier is restricted to the range
225 0 to 39 if the first sub-identifier is 0 or 1. Finally,
226 the ASN.1 standard requires that an object identifier
227 has always at least two sub-identifier. The pattern
228 captures these restrictions.
230 Although the number of sub-identifiers is not limited,
231 module designers should realize that there may be
232 implementations that stick with the SMIv2 limit of 128
235 This type is a superset of the SMIv2 OBJECT IDENTIFIER type
236 since it is not restricted to 128 sub-identifiers. Hence,
237 this type SHOULD NOT be used to represent the SMIv2 OBJECT
238 IDENTIFIER type, the object-identifier-128 type SHOULD be
241 "ISO9834-1: Information technology -- Open Systems
242 Interconnection -- Procedures for the operation of OSI
243 Registration Authorities: General procedures and top
244 arcs of the ASN.1 Object Identifier tree";
250 typedef object-identifier-128 {
251 type object-identifier {
252 pattern '\d*(\.\d*){1,127}';
255 "This type represents object-identifiers restricted to 128
258 In the value set and its semantics, this type is equivalent
259 to the OBJECT IDENTIFIER type of the SMIv2.";
261 "RFC 2578: Structure of Management Information Version 2 (SMIv2)";
264 /*** collection of date and time related types ***/
266 typedef date-and-time {
268 pattern '\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?'
269 + '(Z|[\+\-]\d{2}:\d{2})';
272 "The date-and-time type is a profile of the ISO 8601
273 standard for representation of dates and times using the
274 Gregorian calendar. The profile is defined by the
275 date-time production in Section 5.6 of RFC 3339.
277 The date-and-time type is compatible with the dateTime XML
278 schema type with the following notable exceptions:
280 (a) The date-and-time type does not allow negative years.
282 (b) The date-and-time time-offset -00:00 indicates an unknown
283 time zone (see RFC 3339) while -00:00 and +00:00 and Z all
284 represent the same time zone in dateTime.
286 (c) The canonical format (see below) of data-and-time values
287 differs from the canonical format used by the dateTime XML
288 schema type, which requires all times to be in UTC using the
291 This type is not equivalent to the DateAndTime textual
292 convention of the SMIv2 since RFC 3339 uses a different
293 separator between full-date and full-time and provides
294 higher resolution of time-secfrac.
296 The canonical format for date-and-time values with a known time
297 zone uses a numeric time zone offset that is calculated using
298 the device's configured known offset to UTC time. A change of
299 the device's offset to UTC time will cause date-and-time values
300 to change accordingly. Such changes might happen periodically
301 in case a server follows automatically daylight saving time
302 (DST) time zone offset changes. The canonical format for
303 date-and-time values with an unknown time zone (usually referring
304 to the notion of local time) uses the time-offset -00:00.";
306 "RFC 3339: Date and Time on the Internet: Timestamps
307 RFC 2579: Textual Conventions for SMIv2
308 XSD-TYPES: XML Schema Part 2: Datatypes Second Edition";
314 "The timeticks type represents a non-negative integer that
315 represents the time, modulo 2^32 (4294967296 decimal), in
316 hundredths of a second between two epochs. When a schema
317 node is defined that uses this type, the description of
318 the schema node identifies both of the reference epochs.
320 In the value set and its semantics, this type is equivalent
321 to the TimeTicks type of the SMIv2.";
323 "RFC 2578: Structure of Management Information Version 2 (SMIv2)";
329 "The timestamp type represents the value of an associated
330 timeticks schema node at which a specific occurrence happened.
331 The specific occurrence must be defined in the description
332 of any schema node defined using this type. When the specific
333 occurrence occurred prior to the last time the associated
334 timeticks attribute was zero, then the timestamp value is
335 zero. Note that this requires all timestamp values to be
336 reset to zero when the value of the associated timeticks
337 attribute reaches 497+ days and wraps around to zero.
339 The associated timeticks schema node must be specified
340 in the description of any schema node using this type.
342 In the value set and its semantics, this type is equivalent
343 to the TimeStamp textual convention of the SMIv2.";
345 "RFC 2579: Textual Conventions for SMIv2";
348 /*** collection of generic address types ***/
350 typedef phys-address {
352 pattern '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?';
355 "Represents media- or physical-level addresses represented
356 as a sequence octets, each octet represented by two hexadecimal
357 numbers. Octets are separated by colons. The canonical
358 representation uses lowercase characters.
360 In the value set and its semantics, this type is equivalent
361 to the PhysAddress textual convention of the SMIv2.";
363 "RFC 2579: Textual Conventions for SMIv2";
366 typedef mac-address {
368 pattern '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}';
371 "The mac-address type represents an IEEE 802 MAC address.
372 The canonical representation uses lowercase characters.
374 In the value set and its semantics, this type is equivalent
375 to the MacAddress textual convention of the SMIv2.";
377 "IEEE 802: IEEE Standard for Local and Metropolitan Area
378 Networks: Overview and Architecture
379 RFC 2579: Textual Conventions for SMIv2";
382 /*** collection of XML specific types ***/
387 "This type represents an XPATH 1.0 expression.
389 When a schema node is defined that uses this type, the
390 description of the schema node MUST specify the XPath
391 context in which the XPath expression is evaluated.";
393 "XPATH: XML Path Language (XPath) Version 1.0";