Added Support for Union Type def resolving and bug fixes.
[controller.git] / opendaylight / sal / yang-prototype / code-generator / binding-generator-impl / src / test / resources / augment-relative-xpath-models / ietf-interfaces@2012-11-15.yang
1 module ietf-interfaces {
2
3   namespace "urn:ietf:params:xml:ns:yang:ietf-interfaces";
4   prefix if;
5
6   import ietf-yang-types {
7     prefix yang;
8   }
9   import iana-if-type {
10     prefix ianaift;
11   }
12
13   organization
14     "IETF NETMOD (NETCONF Data Modeling Language) Working Group";
15
16   contact
17     "WG Web:   <http://tools.ietf.org/wg/netmod/>
18      WG List:  <mailto:netmod@ietf.org>
19
20      WG Chair: David Kessens
21                <mailto:david.kessens@nsn.com>
22
23      WG Chair: Juergen Schoenwaelder
24                <mailto:j.schoenwaelder@jacobs-university.de>
25
26      Editor:   Martin Bjorklund
27                <mailto:mbj@tail-f.com>";
28
29   description
30     "This module contains a collection of YANG definitions for
31      managing network interfaces.
32
33      Copyright (c) 2012 IETF Trust and the persons identified as
34      authors of the code.  All rights reserved.
35
36      Redistribution and use in source and binary forms, with or
37      without modification, is permitted pursuant to, and subject
38      to the license terms contained in, the Simplified BSD License
39      set forth in Section 4.c of the IETF Trust's Legal Provisions
40      Relating to IETF Documents
41      (http://trustee.ietf.org/license-info).
42
43      This version of this YANG module is part of RFC XXXX; see
44      the RFC itself for full legal notices.";
45
46   // RFC Ed.: replace XXXX with actual RFC number and remove this
47   // note.
48
49   // RFC Ed.: update the date below with the date of RFC publication
50   // and remove this note.
51   revision 2012-11-15 {
52     description
53       "Initial revision.";
54     reference
55       "RFC XXXX: A YANG Data Model for Interface Management";
56   }
57
58   /* Typedefs */
59
60   typedef interface-ref {
61     type leafref {
62       path "/if:interfaces/if:interface/if:name";
63     }
64     description
65       "This type is used by data models that need to reference
66        interfaces.";
67   }
68
69   /* Features */
70
71   feature arbitrary-names {
72     description
73       "This feature indicates that the server allows interfaces to
74        be named arbitrarily.";
75   }
76
77   feature if-mib {
78     description
79       "This feature indicates that the server implements IF-MIB.";
80     reference
81       "RFC 2863: The Interfaces Group MIB";
82   }
83
84   /* Data nodes */
85
86   container interfaces {
87     description
88       "Interface parameters.";
89
90     list interface {
91       key "name";
92       unique "type location";
93
94       description
95         "The list of interfaces on the device.";
96
97       leaf name {
98         type string;
99         description
100           "The name of the interface.
101
102            A device MAY restrict the allowed values for this leaf,
103            possibly depending on the type and location.
104
105            If the device allows arbitrarily named interfaces, the
106            feature 'arbitrary-names' is advertised.
107
108            This leaf MAY be mapped to ifName by an implementation.
109            Such an implementation MAY restrict the allowed values for
110            this leaf so that it matches the restrictions of ifName.
111            If a NETCONF server that implements this restriction is
112            sent a value that doesn't match the restriction, it MUST
113            reply with an rpc-error with the error-tag
114            'invalid-value'.";
115         reference
116           "RFC 2863: The Interfaces Group MIB - ifName";
117       }
118
119       leaf description {
120         type string;
121         description
122           "A textual description of the interface.
123
124            This leaf MAY be mapped to ifAlias by an implementation.
125            Such an implementation MAY restrict the allowed values for
126            this leaf so that it matches the restrictions of ifAlias.
127            If a NETCONF server that implements this restriction is
128            sent a value that doesn't match the restriction, it MUST
129            reply with an rpc-error with the error-tag
130            'invalid-value'.";
131         reference
132           "RFC 2863: The Interfaces Group MIB - ifAlias";
133       }
134
135       leaf type {
136         type ianaift:iana-if-type;
137         mandatory true;
138         description
139           "The type of the interface.
140
141            When an interface entry is created, a server MAY
142            initialize the type leaf with a valid value, e.g., if it
143            is possible to derive the type from the name of the
144            interface.";
145         reference
146           "RFC 2863: The Interfaces Group MIB - ifType";
147       }
148
149       leaf location {
150         type string;
151         description
152           "The device-specific location of the interface of a
153            particular type.  The format of the location string
154            depends on the interface type and the device.
155
156            If the interface's type represents a physical interface,
157            this leaf MUST be set.
158
159            When an interface entry is created, a server MAY
160            initialize the location leaf with a valid value, e.g., if
161            it is possible to derive the location from the name of
162            the interface.";
163       }
164
165       leaf enabled {
166         type boolean;
167         default "true";
168         description
169           "The desired state of the interface.
170
171            This leaf contains the configured, desired state of the
172            interface.  Systems that implement the IF-MIB use the
173            value of this leaf to set IF-MIB.ifAdminStatus to 'up' or
174            'down' after an ifEntry has been initialized, as described
175            in RFC 2863.";
176         reference
177           "RFC 2863: The Interfaces Group MIB - ifAdminStatus";
178       }
179
180       leaf oper-status {
181         type enumeration {
182           enum up {
183             value 1;
184             description
185               "Ready to pass packets.";
186           }
187           enum down {
188             value 2;
189             description
190               "The interface does not pass any packets.";
191           }
192           enum testing {
193             value 3;
194             description
195               "In some test mode.  No operational packets can
196                be passed.";
197           }
198           enum unknown {
199             value 4;
200             description
201               "Status cannot be determined for some reason.";
202           }
203           enum dormant {
204             value 5;
205             description
206               "Waiting for some external event.";
207           }
208           enum not-present {
209             value 6;
210             description
211               "Some component is missing.";
212           }
213           enum lower-layer-down {
214             value 7;
215             description
216               "Down due to state of lower-layer interface(s).";
217           }
218         }
219         config false;
220         description
221           "The current operational state of the interface.
222
223            If 'enabled' is 'false' then 'oper-status'
224            should be 'down'.  If 'enabled' is changed to 'true'
225            then 'oper-status' should change to 'up' if the interface
226            is ready to transmit and receive network traffic; it
227            should change to 'dormant' if the interface is waiting for
228            external actions (such as a serial line waiting for an
229            incoming connection); it should remain in the 'down' state
230            if and only if there is a fault that prevents it from
231            going to the 'up' state; it should remain in the
232            'not-present' state if the interface has missing
233            (typically, hardware) components.";
234         reference
235           "RFC 2863: The Interfaces Group MIB - ifOperStatus";
236       }
237
238       leaf last-change {
239         type yang:date-and-time;
240         config false;
241         description
242           "The time the interface entered its current operational
243            state.  If the current state was entered prior to the
244            last re-initialization of the local network management
245            subsystem, then this node is not present.";
246         reference
247           "RFC 2863: The Interfaces Group MIB - ifLastChange";
248       }
249
250       leaf if-index {
251         if-feature if-mib;
252         type int32 {
253           range "1..2147483647";
254         }
255         config false;
256         description
257           "The ifIndex value for the ifEntry represented by this
258            interface.
259
260            Media-specific modules must specify how the type is
261            mapped to entries in the ifTable.";
262         reference
263           "RFC 2863: The Interfaces Group MIB - ifIndex";
264       }
265
266       leaf link-up-down-trap-enable {
267         if-feature if-mib;
268         type enumeration {
269           enum enabled {
270             value 1;
271           }
272           enum disabled {
273             value 2;
274           }
275         }
276         description
277           "Indicates whether linkUp/linkDown SNMP notifications
278            should be generated for this interface.
279            If this node is not configured, the value 'enabled' is
280            operationally used by the server for interfaces which do
281            not operate on top of any other interface (i.e., there are
282            no 'lower-layer-if' entries), and 'disabled' otherwise.";
283         reference
284           "RFC 2863: The Interfaces Group MIB -
285                      ifLinkUpDownTrapEnable";
286       }
287
288       leaf phys-address {
289         type yang:phys-address;
290         config false;
291         description
292           "The interface's address at its protocol sub-layer.  For
293           example, for an 802.x interface, this object normally
294           contains a MAC address.  The interface's media-specific
295           modules must define the bit and byte ordering and the
296           format of the value of this object.  For interfaces that do
297           not have such an address (e.g., a serial line), this node
298           is not present.";
299         reference
300           "RFC 2863: The Interfaces Group MIB - ifPhysAddress";
301       }
302
303       leaf-list higher-layer-if {
304         type interface-ref;
305         config false;
306         description
307           "A list of references to interfaces layered on top of this
308            interface.";
309         reference
310           "RFC 2863: The Interfaces Group MIB - ifStackTable";
311       }
312
313       leaf-list lower-layer-if {
314         type interface-ref;
315         config false;
316         description
317           "A list of references to interfaces layered underneath this
318            interface.";
319         reference
320           "RFC 2863: The Interfaces Group MIB - ifStackTable";
321       }
322
323       leaf speed {
324         type yang:gauge64;
325         units "bits / second";
326         config false;
327         description
328             "An estimate of the interface's current bandwidth in bits
329              per second.  For interfaces which do not vary in
330              bandwidth or for those where no accurate estimation can
331              be made, this node should contain the nominal bandwidth.
332              For interfaces that has no concept of bandwidth, this
333              node is not present.";
334         reference
335           "RFC 2863: The Interfaces Group MIB -
336                      ifSpeed, ifHighSpeed";
337       }
338
339       container statistics {
340         config false;
341         description
342           "A collection of interface-related statistics objects.";
343
344         leaf discontinuity-time {
345           type yang:date-and-time;
346           description
347             "The time on the most recent occasion at which any one or
348              more of this interface's counters suffered a
349              discontinuity.  If no such discontinuities have occurred
350              since the last re-initialization of the local management
351              subsystem, then this node contains the time the local
352              management subsystem re-initialized itself.";
353         }
354
355         leaf in-octets {
356           type yang:counter64;
357           description
358             "The total number of octets received on the interface,
359              including framing characters.
360
361              Discontinuities in the value of this counter can occur
362              at re-initialization of the management system, and at
363              other times as indicated by the value of
364              'discontinuity-time'.";
365           reference
366             "RFC 2863: The Interfaces Group MIB - ifHCInOctets";
367         }
368         leaf in-unicast-pkts {
369           type yang:counter64;
370           description
371             "The number of packets, delivered by this sub-layer to a
372              higher (sub-)layer, which were not addressed to a
373              multicast or broadcast address at this sub-layer.
374
375              Discontinuities in the value of this counter can occur
376              at re-initialization of the management system, and at
377              other times as indicated by the value of
378              'discontinuity-time'.";
379           reference
380             "RFC 2863: The Interfaces Group MIB - ifHCInUcastPkts";
381         }
382         leaf in-broadcast-pkts {
383           type yang:counter64;
384           description
385             "The number of packets, delivered by this sub-layer to a
386              higher (sub-)layer, which were addressed to a broadcast
387              address at this sub-layer.
388
389              Discontinuities in the value of this counter can occur
390              at re-initialization of the management system, and at
391              other times as indicated by the value of
392              'discontinuity-time'.";
393           reference
394             "RFC 2863: The Interfaces Group MIB -
395                        ifHCInBroadcastPkts";
396         }
397         leaf in-multicast-pkts {
398           type yang:counter64;
399           description
400             "The number of packets, delivered by this sub-layer to a
401              higher (sub-)layer, which were addressed to a multicast
402              address at this sub-layer.  For a MAC layer protocol,
403              this includes both Group and Functional addresses.
404
405              Discontinuities in the value of this counter can occur
406              at re-initialization of the management system, and at
407              other times as indicated by the value of
408              'discontinuity-time'.";
409           reference
410             "RFC 2863: The Interfaces Group MIB -
411                        ifHCInMulticastPkts";
412         }
413         leaf in-discards {
414           type yang:counter32;
415           description
416             "The number of inbound packets which were chosen to be
417              discarded even though no errors had been detected to
418              prevent their being deliverable to a higher-layer
419              protocol.  One possible reason for discarding such a
420              packet could be to free up buffer space.
421
422              Discontinuities in the value of this counter can occur
423              at re-initialization of the management system, and at
424              other times as indicated by the value of
425              'discontinuity-time'.";
426           reference
427             "RFC 2863: The Interfaces Group MIB - ifInDiscards";
428         }
429         leaf in-errors {
430           type yang:counter32;
431           description
432             "For packet-oriented interfaces, the number of inbound
433              packets that contained errors preventing them from being
434              deliverable to a higher-layer protocol.  For character-
435              oriented or fixed-length interfaces, the number of
436              inbound transmission units that contained errors
437              preventing them from being deliverable to a higher-layer
438              protocol.
439
440              Discontinuities in the value of this counter can occur
441              at re-initialization of the management system, and at
442              other times as indicated by the value of
443              'discontinuity-time'.";
444           reference
445             "RFC 2863: The Interfaces Group MIB - ifInErrors";
446         }
447         leaf in-unknown-protos {
448           type yang:counter32;
449           description
450             "For packet-oriented interfaces, the number of packets
451              received via the interface which were discarded because
452              of an unknown or unsupported protocol.  For
453              character-oriented or fixed-length interfaces that
454              support protocol multiplexing the number of transmission
455              units received via the interface which were discarded
456              because of an unknown or unsupported protocol.  For any
457              interface that does not support protocol multiplexing,
458              this counter is not present.
459
460              Discontinuities in the value of this counter can occur
461              at re-initialization of the management system, and at
462              other times as indicated by the value of
463              'discontinuity-time'.";
464           reference
465             "RFC 2863: The Interfaces Group MIB - ifInUnknownProtos";
466         }
467
468         leaf out-octets {
469           type yang:counter64;
470           description
471             "The total number of octets transmitted out of the
472              interface, including framing characters.
473
474              Discontinuities in the value of this counter can occur
475              at re-initialization of the management system, and at
476              other times as indicated by the value of
477              'discontinuity-time'.";
478           reference
479             "RFC 2863: The Interfaces Group MIB - ifHCOutOctets";
480         }
481         leaf out-unicast-pkts {
482           type yang:counter64;
483           description
484             "The total number of packets that higher-level protocols
485              requested be transmitted, and which were not addressed
486              to a multicast or broadcast address at this sub-layer,
487              including those that were discarded or not sent.
488
489              Discontinuities in the value of this counter can occur
490              at re-initialization of the management system, and at
491              other times as indicated by the value of
492              'discontinuity-time'.";
493           reference
494             "RFC 2863: The Interfaces Group MIB - ifHCOutUcastPkts";
495         }
496         leaf out-broadcast-pkts {
497           type yang:counter64;
498           description
499             "The total number of packets that higher-level protocols
500              requested be transmitted, and which were addressed to a
501              broadcast address at this sub-layer, including those
502              that were discarded or not sent.
503
504              Discontinuities in the value of this counter can occur
505              at re-initialization of the management system, and at
506              other times as indicated by the value of
507              'discontinuity-time'.";
508           reference
509             "RFC 2863: The Interfaces Group MIB -
510                        ifHCOutBroadcastPkts";
511         }
512         leaf out-multicast-pkts {
513           type yang:counter64;
514           description
515             "The total number of packets that higher-level protocols
516              requested be transmitted, and which were addressed to a
517              multicast address at this sub-layer, including those
518              that were discarded or not sent.  For a MAC layer
519              protocol, this includes both Group and Functional
520              addresses.
521
522              Discontinuities in the value of this counter can occur
523              at re-initialization of the management system, and at
524              other times as indicated by the value of
525              'discontinuity-time'.";
526           reference
527             "RFC 2863: The Interfaces Group MIB -
528                        ifHCOutMulticastPkts";
529         }
530         leaf out-discards {
531           type yang:counter32;
532           description
533             "The number of outbound packets which were chosen to be
534              discarded even though no errors had been detected to
535              prevent their being transmitted.  One possible reason
536              for discarding such a packet could be to free up buffer
537              space.
538
539              Discontinuities in the value of this counter can occur
540              at re-initialization of the management system, and at
541              other times as indicated by the value of
542              'discontinuity-time'.";
543           reference
544             "RFC 2863: The Interfaces Group MIB - ifOutDiscards";
545         }
546         leaf out-errors {
547           type yang:counter32;
548           description
549             "For packet-oriented interfaces, the number of outbound
550              packets that could not be transmitted because of errors.
551              For character-oriented or fixed-length interfaces, the
552              number of outbound transmission units that could not be
553              transmitted because of errors.
554
555              Discontinuities in the value of this counter can occur
556              at re-initialization of the management system, and at
557              other times as indicated by the value of
558              'discontinuity-time'.";
559           reference
560             "RFC 2863: The Interfaces Group MIB - ifOutErrors";
561         }
562       }
563     }
564   }
565 }