| module openconfig-yang-types { |
| |
| yang-version "1"; |
| namespace "http://openconfig.net/yang/types/yang"; |
| prefix "oc-yang"; |
| |
| import openconfig-extensions { prefix "oc-ext"; } |
| |
| organization |
| "OpenConfig working group"; |
| |
| contact |
| "OpenConfig working group |
| www.openconfig.net"; |
| |
| description |
| "This module contains a set of extension types to the |
| YANG builtin types that are used across multiple |
| OpenConfig models. |
| |
| Portions of this code were derived from IETF RFC 6021. |
| Please reproduce this note if possible. |
| |
| IETF code is subject to the following copyright and license: |
| Copyright (c) IETF Trust and the persons identified as authors of |
| the code. |
| All rights reserved. |
| |
| Redistribution and use in source and binary forms, with or without |
| modification, is permitted pursuant to, and subject to the license |
| terms contained in, the Simplified BSD License set forth in |
| Section 4.c of the IETF Trust's Legal Provisions Relating |
| to IETF Documents (http://trustee.ietf.org/license-info)."; |
| |
| oc-ext:openconfig-version "0.1.2"; |
| |
| revision 2017-07-30 { |
| description |
| "Fixed unprintable character"; |
| reference "0.1.2"; |
| } |
| |
| revision 2017-04-03 { |
| description |
| "Update copyright notice."; |
| reference "0.1.1"; |
| } |
| |
| revision 2017-01-26 { |
| description |
| "Initial module for inet types"; |
| reference "0.1.0"; |
| } |
| |
| typedef dotted-quad { |
| type string { |
| 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])$'; |
| } |
| description |
| "An unsigned 32-bit integer expressed as a dotted quad. The |
| format is four octets written as decimal numbers separated |
| with a period character."; |
| } |
| |
| typedef hex-string { |
| type string { |
| pattern '^[0-9a-fA-F]*$'; |
| } |
| description |
| "A string consisting of a hexadecimal characters."; |
| } |
| |
| typedef counter32 { |
| type uint32; |
| description |
| |
| "A 32-bit counter. A counter value is a monotonically increasing |
| value which is used to express a count of a number of |
| occurrences of a particular event or entity. When the counter |
| reaches its maximum value, in this case 2^32-1, it wraps to 0. |
| |
| Discontinuities in the counter are generally triggered only when |
| the counter is reset to zero."; |
| } |
| |
| typedef counter64 { |
| type uint64; |
| description |
| |
| "A 64-bit counter. A counter value is a monotonically increasing |
| value which is used to express a count of a number of |
| occurrences of a particular event or entity. When a counter64 |
| reaches its maximum value, 2^64-1, it loops to zero. |
| Discontinuities in a counter are generally triggered only when |
| the counter is reset to zero, through operator or system |
| intervention."; |
| } |
| |
| typedef date-and-time { |
| type string { |
| pattern |
| '^[0-9]{4}\-[0-9]{2}\-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}' + |
| '(\.[0-9]+)?Z[+-][0-9]{2}:[0-9]{2}$'; |
| } |
| description |
| "A date and time, expressed in the format described in RFC3339. |
| That is to say: |
| |
| YYYY-MM-DDTHH:MM:SSZ+-hh:mm |
| |
| where YYYY is the year, MM is the month expressed as a two-digit |
| month (zero padding if required), DD is the day of the month, |
| expressed as a two digit value. T is the literal character 'T', |
| HH is the hour of the day expressed as a two digit number, using |
| the 24-hour clock, MM is the minute of the hour expressed as a |
| two digit number. Z is the literal character 'Z', followed by a |
| timezone offset expressed in hours (hh) and minutes (mm), both |
| expressed as two digit numbers. The time offset is specified as |
| a positive or negative offset to UTC using the '+' or '-' |
| character preceding the offset. |
| |
| Optionally, fractional seconds can be expressed after the minute |
| of the hour as a decimal number of unspecified precision |
| reflecting fractions of a second."; |
| reference |
| "RFC3339 - Date and Time on the Internet: Timestamps"; |
| } |
| |
| typedef gauge64 { |
| type uint64; |
| description |
| "A gauge value may increase or decrease - and reflects a value |
| at a particular point in time. If the value of the variable |
| being modeled using the gauge exceeds its maximum - 2^64-1 in |
| this case - the gauge is set to its maximum value."; |
| } |
| |
| typedef phys-address { |
| type string { |
| pattern '^([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?$'; |
| } |
| description |
| "A physical layer address, expressed as a series of pairs of |
| hexadecimal digits."; |
| } |
| |
| typedef mac-address { |
| type string { |
| pattern '^[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}$'; |
| } |
| description |
| "An IEEE 802 MAC address"; |
| } |
| } |