hiroki | 4ecc871 | 2018-05-08 13:23:37 -0700 | [diff] [blame] | 1 | module openconfig-types { |
| 2 | yang-version "1"; |
| 3 | |
| 4 | namespace "http://openconfig.net/yang/openconfig-types"; |
| 5 | |
| 6 | prefix "oc-types"; |
| 7 | |
| 8 | // import statements |
| 9 | import openconfig-extensions { |
| 10 | prefix oc-ext; |
| 11 | revision-date "2015-10-09"; |
| 12 | } |
| 13 | |
| 14 | // meta |
| 15 | organization |
| 16 | "OpenConfig working group"; |
| 17 | |
| 18 | contact |
| 19 | "OpenConfig working group |
| 20 | netopenconfig@googlegroups.com"; |
| 21 | |
| 22 | description |
| 23 | "This module contains a set of general type definitions that |
| 24 | are used across OpenConfig models. It can be imported by modules |
| 25 | that make use of these types."; |
| 26 | |
| 27 | oc-ext:openconfig-version "0.3.2"; |
| 28 | |
| 29 | revision "2017-01-13" { |
| 30 | description |
| 31 | "Add ADDRESS_FAMILY identity"; |
| 32 | reference "0.3.2"; |
| 33 | } |
| 34 | |
| 35 | revision "2016-11-14" { |
| 36 | description |
| 37 | "Correct length of ieeefloat32"; |
| 38 | reference "0.3.1"; |
| 39 | } |
| 40 | |
| 41 | revision "2016-11-11" { |
| 42 | description |
| 43 | "Additional types - ieeefloat32 and routing-password"; |
| 44 | reference "0.3.0"; |
| 45 | } |
| 46 | |
| 47 | revision "2016-05-31" { |
| 48 | description |
| 49 | "OpenConfig public release"; |
| 50 | reference "0.2.0"; |
| 51 | } |
| 52 | |
| 53 | typedef percentage { |
| 54 | type uint8 { |
| 55 | range "0..100"; |
| 56 | } |
| 57 | description |
| 58 | "Integer indicating a percentage value"; |
| 59 | } |
| 60 | |
| 61 | typedef std-regexp { |
| 62 | type string; |
| 63 | description |
| 64 | "This type definition is a placeholder for a standard |
| 65 | definition of a regular expression that can be utilised in |
| 66 | OpenConfig models. Further discussion is required to |
| 67 | consider the type of regular expressions that are to be |
| 68 | supported. An initial proposal is POSIX compatible."; |
| 69 | } |
| 70 | |
| 71 | typedef timeticks64 { |
| 72 | type uint64; |
| 73 | description |
| 74 | "This type is based on the timeticks type defined in |
| 75 | RFC 6991, but with 64-bit width. It represents the time, |
| 76 | modulo 2^64, in hundredths of a second between two epochs."; |
| 77 | reference |
| 78 | "RFC 6991 - Common YANG Data Types"; |
| 79 | } |
| 80 | |
| 81 | typedef ieeefloat32 { |
| 82 | type binary { |
| 83 | length "32"; |
| 84 | } |
| 85 | description |
| 86 | "An IEEE 32-bit floating point number. The format of this number |
| 87 | is of the form: |
| 88 | 1-bit sign |
| 89 | 8-bit exponent |
| 90 | 24-bit fraction |
| 91 | The floating point value is calculated using: |
| 92 | (-1)**S * 2**(Exponent-127) * (1+Fraction)"; |
| 93 | } |
| 94 | |
| 95 | typedef routing-password { |
| 96 | type string; |
| 97 | description |
| 98 | "This type is indicative of a password that is used within |
| 99 | a routing protocol which can be returned in plain text to the |
| 100 | NMS by the local system. Such passwords are typically stored |
| 101 | as encrypted strings. Since the encryption used is generally |
| 102 | well known, it is possible to extract the original value from |
| 103 | the string - and hence this format is not considered secure. |
| 104 | Leaves specified with this type should not be modified by |
| 105 | the system, and should be returned to the end-user in plain |
| 106 | text. This type exists to differentiate passwords, which |
| 107 | may be sensitive, from other string leaves. It could, for |
| 108 | example, be used by the NMS to censor this data when |
| 109 | viewed by particular users."; |
| 110 | } |
| 111 | |
| 112 | grouping avg-min-max-stats-precision1 { |
| 113 | description |
| 114 | "Common nodes for recording average, minimum, and |
| 115 | maximum values for a statistic. These values all have |
| 116 | fraction-digits set to 1."; |
| 117 | |
| 118 | leaf avg { |
| 119 | type decimal64 { |
| 120 | fraction-digits 1; |
| 121 | } |
| 122 | description |
| 123 | "The arithmetic mean value of the statistic over the |
| 124 | sampling period."; |
| 125 | } |
| 126 | |
| 127 | leaf min { |
| 128 | type decimal64 { |
| 129 | fraction-digits 1; |
| 130 | } |
| 131 | description |
| 132 | "The minimum value of the statistic over the sampling |
| 133 | period"; |
| 134 | } |
| 135 | |
| 136 | leaf max { |
| 137 | type decimal64 { |
| 138 | fraction-digits 1; |
| 139 | } |
| 140 | description |
| 141 | "The maximum value of the statitic over the sampling |
| 142 | period"; |
| 143 | } |
| 144 | } |
| 145 | |
| 146 | grouping avg-min-max-instant-stats-precision1 { |
| 147 | description |
| 148 | "Common grouping for recording an instantaneous statistic value |
| 149 | in addition to avg-min-max stats"; |
| 150 | |
| 151 | leaf instant { |
| 152 | type decimal64 { |
| 153 | fraction-digits 1; |
| 154 | } |
| 155 | description |
| 156 | "The instantaneous value of the statistic."; |
| 157 | } |
| 158 | |
| 159 | uses avg-min-max-stats-precision1; |
| 160 | } |
| 161 | |
| 162 | grouping avg-min-max-instant-stats-precision2-dB { |
| 163 | description |
| 164 | "Common grouping for recording dB values with 2 decimal |
| 165 | precision. Values include the instantaneous, average, |
| 166 | minimum, and maximum statistics"; |
| 167 | |
| 168 | leaf instant { |
| 169 | type decimal64 { |
| 170 | fraction-digits 2; |
| 171 | } |
| 172 | units dB; |
| 173 | description |
| 174 | "The instantaneous value of the statistic."; |
| 175 | } |
| 176 | |
| 177 | leaf avg { |
| 178 | type decimal64 { |
| 179 | fraction-digits 2; |
| 180 | } |
| 181 | units dB; |
| 182 | description |
| 183 | "The arithmetic mean value of the statistic over the |
| 184 | sampling period."; |
| 185 | } |
| 186 | |
| 187 | leaf min { |
| 188 | type decimal64 { |
| 189 | fraction-digits 2; |
| 190 | } |
| 191 | units dB; |
| 192 | description |
| 193 | "The minimum value of the statistic over the sampling |
| 194 | period"; |
| 195 | } |
| 196 | |
| 197 | leaf max { |
| 198 | type decimal64 { |
| 199 | fraction-digits 2; |
| 200 | } |
| 201 | units dB; |
| 202 | description |
| 203 | "The maximum value of the statistic over the sampling |
| 204 | period"; |
| 205 | } |
| 206 | } |
| 207 | |
| 208 | grouping avg-min-max-instant-stats-precision2-dBm { |
| 209 | description |
| 210 | "Common grouping for recording dBm values with 2 decimal |
| 211 | precision. Values include the instantaneous, average, |
| 212 | minimum, and maximum statistics"; |
| 213 | |
| 214 | leaf instant { |
| 215 | type decimal64 { |
| 216 | fraction-digits 2; |
| 217 | } |
| 218 | units dBm; |
| 219 | description |
| 220 | "The instantaneous value of the statistic."; |
| 221 | } |
| 222 | |
| 223 | leaf avg { |
| 224 | type decimal64 { |
| 225 | fraction-digits 2; |
| 226 | } |
| 227 | units dBm; |
| 228 | description |
| 229 | "The arithmetic mean value of the statistic over the |
| 230 | sampling period."; |
| 231 | } |
| 232 | |
| 233 | leaf min { |
| 234 | type decimal64 { |
| 235 | fraction-digits 2; |
| 236 | } |
| 237 | units dBm; |
| 238 | description |
| 239 | "The minimum value of the statistic over the sampling |
| 240 | period"; |
| 241 | } |
| 242 | |
| 243 | leaf max { |
| 244 | type decimal64 { |
| 245 | fraction-digits 2; |
| 246 | } |
| 247 | units dBm; |
| 248 | description |
| 249 | "The maximum value of the statistic over the sampling |
| 250 | period"; |
| 251 | } |
| 252 | } |
| 253 | |
| 254 | grouping avg-min-max-instant-stats-precision2-mA { |
| 255 | description |
| 256 | "Common grouping for recording mA values with 2 decimal |
| 257 | precision. Values include the instantaneous, average, |
| 258 | minimum, and maximum statistics"; |
| 259 | |
| 260 | leaf instant { |
| 261 | type decimal64 { |
| 262 | fraction-digits 2; |
| 263 | } |
| 264 | units mA; |
| 265 | description |
| 266 | "The instantaneous value of the statistic."; |
| 267 | } |
| 268 | |
| 269 | leaf avg { |
| 270 | type decimal64 { |
| 271 | fraction-digits 2; |
| 272 | } |
| 273 | units mA; |
| 274 | description |
| 275 | "The arithmetic mean value of the statistic over the |
| 276 | sampling period."; |
| 277 | } |
| 278 | |
| 279 | leaf min { |
| 280 | type decimal64 { |
| 281 | fraction-digits 2; |
| 282 | } |
| 283 | units mA; |
| 284 | description |
| 285 | "The minimum value of the statistic over the sampling |
| 286 | period"; |
| 287 | } |
| 288 | |
| 289 | leaf max { |
| 290 | type decimal64 { |
| 291 | fraction-digits 2; |
| 292 | } |
| 293 | units mA; |
| 294 | description |
| 295 | "The maximum value of the statistic over the sampling |
| 296 | period"; |
| 297 | } |
| 298 | } |
| 299 | |
| 300 | identity ADDRESS_FAMILY { |
| 301 | description |
| 302 | "A base identity for all address families"; |
| 303 | } |
| 304 | |
| 305 | identity IPV4 { |
| 306 | base ADDRESS_FAMILY; |
| 307 | description |
| 308 | "The IPv4 address family"; |
| 309 | } |
| 310 | |
| 311 | identity IPV6 { |
| 312 | base ADDRESS_FAMILY; |
| 313 | description |
| 314 | "The IPv6 address family"; |
| 315 | } |
| 316 | |
| 317 | identity MPLS { |
| 318 | base ADDRESS_FAMILY; |
| 319 | description |
| 320 | "The MPLS address family"; |
| 321 | } |
| 322 | |
| 323 | identity L2_ETHERNET { |
| 324 | base ADDRESS_FAMILY; |
| 325 | description |
| 326 | "The 802.3 Ethernet address family"; |
| 327 | } |
| 328 | } |