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 typedef yang-identifier {
267 pattern '[a-zA-Z_][a-zA-Z0-9\-_.]*';
268 pattern '.|..|[^xX].*|.[^mM].*|..[^lL].*';
271 "A YANG identifier string as defined by the 'identifier'
272 rule in Section 12 of RFC 6020. An identifier must
273 start with an alphabetic character or an underscore
274 followed by an arbitrary sequence of alphabetic or
275 numeric characters, underscores, hyphens, or dots.
277 A YANG identifier MUST NOT start with any possible
278 combination of the lowercase or uppercase character
281 "RFC 6020: YANG - A Data Modeling Language for the Network
282 Configuration Protocol (NETCONF)";
285 /*** collection of date and time related types ***/
287 typedef date-and-time {
289 pattern '\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?'
290 + '(Z|[\+\-]\d{2}:\d{2})';
293 "The date-and-time type is a profile of the ISO 8601
294 standard for representation of dates and times using the
295 Gregorian calendar. The profile is defined by the
296 date-time production in Section 5.6 of RFC 3339.
298 The date-and-time type is compatible with the dateTime XML
299 schema type with the following notable exceptions:
301 (a) The date-and-time type does not allow negative years.
303 (b) The date-and-time time-offset -00:00 indicates an unknown
304 time zone (see RFC 3339) while -00:00 and +00:00 and Z all
305 represent the same time zone in dateTime.
307 (c) The canonical format (see below) of data-and-time values
308 differs from the canonical format used by the dateTime XML
309 schema type, which requires all times to be in UTC using the
312 This type is not equivalent to the DateAndTime textual
313 convention of the SMIv2 since RFC 3339 uses a different
314 separator between full-date and full-time and provides
315 higher resolution of time-secfrac.
317 The canonical format for date-and-time values with a known time
318 zone uses a numeric time zone offset that is calculated using
319 the device's configured known offset to UTC time. A change of
320 the device's offset to UTC time will cause date-and-time values
321 to change accordingly. Such changes might happen periodically
322 in case a server follows automatically daylight saving time
323 (DST) time zone offset changes. The canonical format for
324 date-and-time values with an unknown time zone (usually referring
325 to the notion of local time) uses the time-offset -00:00.";
327 "RFC 3339: Date and Time on the Internet: Timestamps
328 RFC 2579: Textual Conventions for SMIv2
329 XSD-TYPES: XML Schema Part 2: Datatypes Second Edition";
335 "The timeticks type represents a non-negative integer that
336 represents the time, modulo 2^32 (4294967296 decimal), in
337 hundredths of a second between two epochs. When a schema
338 node is defined that uses this type, the description of
339 the schema node identifies both of the reference epochs.
341 In the value set and its semantics, this type is equivalent
342 to the TimeTicks type of the SMIv2.";
344 "RFC 2578: Structure of Management Information Version 2 (SMIv2)";
350 "The timestamp type represents the value of an associated
351 timeticks schema node at which a specific occurrence happened.
352 The specific occurrence must be defined in the description
353 of any schema node defined using this type. When the specific
354 occurrence occurred prior to the last time the associated
355 timeticks attribute was zero, then the timestamp value is
356 zero. Note that this requires all timestamp values to be
357 reset to zero when the value of the associated timeticks
358 attribute reaches 497+ days and wraps around to zero.
360 The associated timeticks schema node must be specified
361 in the description of any schema node using this type.
363 In the value set and its semantics, this type is equivalent
364 to the TimeStamp textual convention of the SMIv2.";
366 "RFC 2579: Textual Conventions for SMIv2";
369 /*** collection of generic address types ***/
371 typedef phys-address {
373 pattern '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?';
376 "Represents media- or physical-level addresses represented
377 as a sequence octets, each octet represented by two hexadecimal
378 numbers. Octets are separated by colons. The canonical
379 representation uses lowercase characters.
381 In the value set and its semantics, this type is equivalent
382 to the PhysAddress textual convention of the SMIv2.";
384 "RFC 2579: Textual Conventions for SMIv2";
387 typedef mac-address {
389 pattern '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}';
392 "The mac-address type represents an IEEE 802 MAC address.
393 The canonical representation uses lowercase characters.
395 In the value set and its semantics, this type is equivalent
396 to the MacAddress textual convention of the SMIv2.";
398 "IEEE 802: IEEE Standard for Local and Metropolitan Area
399 Networks: Overview and Architecture
400 RFC 2579: Textual Conventions for SMIv2";
403 /*** collection of XML specific types ***/
408 "This type represents an XPATH 1.0 expression.
410 When a schema node is defined that uses this type, the
411 description of the schema node MUST specify the XPath
412 context in which the XPath expression is evaluated.";
414 "XPATH: XML Path Language (XPath) Version 1.0";