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