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