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