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