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