2c95ea434a245f91faaa93bac81c12a10cec0709
[transportpce.git] / tests / honeynode / 2.2.1 / honeynode-plugin-api / src / main / yang / openconfig / openconfig-interfaces@2018-01-05.yang
1 module openconfig-interfaces {
2
3   yang-version "1";
4
5   // namespace
6   namespace "http://openconfig.net/yang/interfaces";
7
8   prefix "oc-if";
9
10   // import some basic types
11   import ietf-interfaces { prefix ietf-if; }
12   import openconfig-yang-types { prefix oc-yang; }
13   import openconfig-types { prefix oc-types; }
14   import openconfig-extensions { prefix oc-ext; }
15
16   // meta
17   organization "OpenConfig working group";
18
19   contact
20     "OpenConfig working group
21     netopenconfig@googlegroups.com";
22
23   description
24     "Model for managing network interfaces and subinterfaces.  This
25     module also defines convenience types / groupings for other
26     models to create references to interfaces:
27
28       base-interface-ref (type) -  reference to a base interface
29       interface-ref (grouping) -  container for reference to a
30         interface + subinterface
31       interface-ref-state (grouping) - container for read-only
32         (opstate) reference to interface + subinterface
33
34     This model reuses data items defined in the IETF YANG model for
35     interfaces described by RFC 7223 with an alternate structure
36     (particularly for operational state data) and with
37     additional configuration items.
38
39     Portions of this code were derived from IETF RFC 7223.
40     Please reproduce this note if possible.
41
42     IETF code is subject to the following copyright and license:
43     Copyright (c) IETF Trust and the persons identified as authors of
44     the code.
45     All rights reserved.
46
47     Redistribution and use in source and binary forms, with or without
48     modification, is permitted pursuant to, and subject to the license
49     terms contained in, the Simplified BSD License set forth in
50     Section 4.c of the IETF Trust's Legal Provisions Relating
51     to IETF Documents (http://trustee.ietf.org/license-info).";
52
53   oc-ext:openconfig-version "2.3.0";
54
55   revision "2018-01-05" {
56     description
57       "Add logical loopback to interface.";
58     reference "2.3.0";
59   }
60
61   revision "2017-12-22" {
62     description
63       "Add IPv4 proxy ARP configuration.";
64     reference "2.2.0";
65   }
66
67   revision "2017-12-21" {
68     description
69       "Added IPv6 router advertisement configuration.";
70     reference "2.1.0";
71   }
72
73   revision "2017-07-14" {
74     description
75       "Added Ethernet/IP state data; Add dhcp-client;
76       migrate to OpenConfig types modules; Removed or
77       renamed opstate values";
78     reference "2.0.0";
79   }
80
81   revision "2017-04-03" {
82     description
83       "Update copyright notice.";
84     reference "1.1.1";
85   }
86
87   revision "2016-12-22" {
88     description
89       "Fixes to Ethernet interfaces model";
90     reference "1.1.0";
91   }
92
93
94   // typedef statements
95
96   typedef base-interface-ref {
97     type leafref {
98       path "/oc-if:interfaces/oc-if:interface/oc-if:name";
99     }
100     description
101       "Reusable type for by-name reference to a base interface.
102       This type may be used in cases where ability to reference
103       a subinterface is not required.";
104   }
105
106   typedef interface-id {
107     type string;
108     description
109       "User-defined identifier for an interface, generally used to
110       name a interface reference.  The id can be arbitrary but a
111       useful convention is to use a combination of base interface
112       name and subinterface index.";
113   }
114
115   // grouping statements
116
117   grouping interface-ref-common {
118     description
119       "Reference leafrefs to interface / subinterface";
120
121     leaf interface {
122       type leafref {
123         path "/oc-if:interfaces/oc-if:interface/oc-if:name";
124       }
125       description
126         "Reference to a base interface.  If a reference to a
127         subinterface is required, this leaf must be specified
128         to indicate the base interface.";
129     }
130
131     leaf subinterface {
132       type leafref {
133         path "/oc-if:interfaces/" +
134           "oc-if:interface[oc-if:name=current()/../interface]/" +
135           "oc-if:subinterfaces/oc-if:subinterface/oc-if:index";
136       }
137       description
138         "Reference to a subinterface -- this requires the base
139         interface to be specified using the interface leaf in
140         this container.  If only a reference to a base interface
141         is requuired, this leaf should not be set.";
142     }
143   }
144
145   grouping interface-ref-state-container {
146     description
147       "Reusable opstate w/container for a reference to an
148       interface or subinterface";
149
150     container state {
151       config false;
152       description
153         "Operational state for interface-ref";
154
155       uses interface-ref-common;
156     }
157   }
158
159   grouping interface-ref {
160     description
161       "Reusable definition for a reference to an interface or
162       subinterface";
163
164     container interface-ref {
165       description
166         "Reference to an interface or subinterface";
167
168       container config {
169         description
170           "Configured reference to interface / subinterface";
171
172         uses interface-ref-common;
173       }
174
175       uses interface-ref-state-container;
176     }
177   }
178
179   grouping interface-ref-state {
180     description
181       "Reusable opstate w/container for a reference to an
182       interface or subinterface";
183
184     container interface-ref {
185       description
186         "Reference to an interface or subinterface";
187
188       uses interface-ref-state-container;
189     }
190   }
191
192   grouping base-interface-ref-state {
193     description
194       "Reusable opstate w/container for a reference to a
195       base interface (no subinterface).";
196
197       container state {
198         config false;
199         description
200           "Operational state for base interface reference";
201
202         leaf interface {
203           type base-interface-ref;
204           description
205             "Reference to a base interface.";
206         }
207       }
208   }
209
210
211   grouping interface-common-config {
212     description
213       "Configuration data data nodes common to physical interfaces
214       and subinterfaces";
215
216     leaf description {
217       type string;
218       description
219         "A textual description of the interface.
220
221         A server implementation MAY map this leaf to the ifAlias
222         MIB object.  Such an implementation needs to use some
223         mechanism to handle the differences in size and characters
224         allowed between this leaf and ifAlias.  The definition of
225         such a mechanism is outside the scope of this document.
226
227         Since ifAlias is defined to be stored in non-volatile
228         storage, the MIB implementation MUST map ifAlias to the
229         value of 'description' in the persistently stored
230         datastore.
231
232         Specifically, if the device supports ':startup', when
233         ifAlias is read the device MUST return the value of
234         'description' in the 'startup' datastore, and when it is
235         written, it MUST be written to the 'running' and 'startup'
236         datastores.  Note that it is up to the implementation to
237
238         decide whether to modify this single leaf in 'startup' or
239         perform an implicit copy-config from 'running' to
240         'startup'.
241
242         If the device does not support ':startup', ifAlias MUST
243         be mapped to the 'description' leaf in the 'running'
244         datastore.";
245       reference
246         "RFC 2863: The Interfaces Group MIB - ifAlias";
247     }
248
249     leaf enabled {
250       type boolean;
251       default "true";
252       description
253         "This leaf contains the configured, desired state of the
254         interface.
255
256         Systems that implement the IF-MIB use the value of this
257         leaf in the 'running' datastore to set
258         IF-MIB.ifAdminStatus to 'up' or 'down' after an ifEntry
259         has been initialized, as described in RFC 2863.
260
261         Changes in this leaf in the 'running' datastore are
262         reflected in ifAdminStatus, but if ifAdminStatus is
263         changed over SNMP, this leaf is not affected.";
264       reference
265         "RFC 2863: The Interfaces Group MIB - ifAdminStatus";
266     }
267
268   }
269
270   grouping interface-phys-config {
271     description
272       "Configuration data for physical interfaces";
273
274     leaf name {
275       type string;
276       description
277         "The name of the interface.
278
279         A device MAY restrict the allowed values for this leaf,
280         possibly depending on the type of the interface.
281         For system-controlled interfaces, this leaf is the
282         device-specific name of the interface.  The 'config false'
283         list interfaces/interface[name]/state contains the currently
284         existing interfaces on the device.
285
286         If a client tries to create configuration for a
287         system-controlled interface that is not present in the
288         corresponding state list, the server MAY reject
289         the request if the implementation does not support
290         pre-provisioning of interfaces or if the name refers to
291         an interface that can never exist in the system.  A
292         NETCONF server MUST reply with an rpc-error with the
293         error-tag 'invalid-value' in this case.
294
295         The IETF model in RFC 7223 provides YANG features for the
296         following (i.e., pre-provisioning and arbitrary-names),
297         however they are omitted here:
298
299           If the device supports pre-provisioning of interface
300           configuration, the 'pre-provisioning' feature is
301           advertised.
302
303           If the device allows arbitrarily named user-controlled
304           interfaces, the 'arbitrary-names' feature is advertised.
305
306         When a configured user-controlled interface is created by
307         the system, it is instantiated with the same name in the
308         /interfaces/interface[name]/state list.";
309     }
310
311     leaf type {
312       type identityref {
313         base ietf-if:interface-type;
314       }
315       mandatory true;
316       description
317         "The type of the interface.
318
319         When an interface entry is created, a server MAY
320         initialize the type leaf with a valid value, e.g., if it
321         is possible to derive the type from the name of the
322         interface.
323
324         If a client tries to set the type of an interface to a
325         value that can never be used by the system, e.g., if the
326         type is not supported or if the type does not match the
327         name of the interface, the server MUST reject the request.
328         A NETCONF server MUST reply with an rpc-error with the
329         error-tag 'invalid-value' in this case.";
330       reference
331         "RFC 2863: The Interfaces Group MIB - ifType";
332     }
333
334     leaf mtu {
335       type uint16;
336       description
337         "Set the max transmission unit size in octets
338         for the physical interface.  If this is not set, the mtu is
339         set to the operational default -- e.g., 1514 bytes on an
340         Ethernet interface.";
341     }
342
343     leaf loopback-mode {
344       type boolean;
345       default false;
346       description
347         "When set to true, the interface is logically looped back,
348         such that packets that are forwarded via the interface
349         are received on the same interface.";
350     }
351
352     uses interface-common-config;
353   }
354
355   grouping interface-phys-holdtime-config {
356     description
357       "Configuration data for interface hold-time settings --
358       applies to physical interfaces.";
359
360     leaf up {
361       type uint32;
362       units milliseconds;
363       default 0;
364       description
365         "Dampens advertisement when the interface
366         transitions from down to up.  A zero value means dampening
367         is turned off, i.e., immediate notification.";
368     }
369
370     leaf down {
371       type uint32;
372       units milliseconds;
373       default 0;
374       description
375         "Dampens advertisement when the interface transitions from
376         up to down.  A zero value means dampening is turned off,
377         i.e., immediate notification.";
378     }
379   }
380
381   grouping interface-phys-holdtime-state {
382     description
383       "Operational state data for interface hold-time.";
384   }
385
386   grouping interface-phys-holdtime-top {
387     description
388       "Top-level grouping for setting link transition
389       dampening on physical and other types of interfaces.";
390
391     container hold-time {
392       description
393         "Top-level container for hold-time settings to enable
394         dampening advertisements of interface transitions.";
395
396       container config {
397         description
398           "Configuration data for interface hold-time settings.";
399
400         uses interface-phys-holdtime-config;
401       }
402
403       container state {
404
405         config false;
406
407         description
408           "Operational state data for interface hold-time.";
409
410         uses interface-phys-holdtime-config;
411         uses interface-phys-holdtime-state;
412       }
413     }
414   }
415
416   grouping interface-common-state {
417     description
418       "Operational state data (in addition to intended configuration)
419       at the global level for this interface";
420
421     leaf ifindex {
422       type uint32;
423       description
424         "System assigned number for each interface.  Corresponds to
425         ifIndex object in SNMP Interface MIB";
426       reference
427         "RFC 2863 - The Interfaces Group MIB";
428     }
429
430     leaf admin-status {
431       type enumeration {
432         enum UP {
433           description
434             "Ready to pass packets.";
435         }
436         enum DOWN {
437           description
438             "Not ready to pass packets and not in some test mode.";
439         }
440         enum TESTING {
441           //TODO: This is generally not supported as a configured
442           //admin state, though it's in the standard interfaces MIB.
443           //Consider removing it.
444           description
445             "In some test mode.";
446         }
447       }
448       //TODO:consider converting to an identity to have the
449       //flexibility to remove some values defined by RFC 7223 that
450       //are not used or not implemented consistently.
451       mandatory true;
452       description
453         "The desired state of the interface.  In RFC 7223 this leaf
454         has the same read semantics as ifAdminStatus.  Here, it
455         reflects the administrative state as set by enabling or
456         disabling the interface.";
457       reference
458         "RFC 2863: The Interfaces Group MIB - ifAdminStatus";
459     }
460
461     leaf oper-status {
462       type enumeration {
463         enum UP {
464           value 1;
465           description
466             "Ready to pass packets.";
467         }
468         enum DOWN {
469           value 2;
470           description
471             "The interface does not pass any packets.";
472         }
473         enum TESTING {
474           value 3;
475           description
476             "In some test mode.  No operational packets can
477              be passed.";
478         }
479         enum UNKNOWN {
480           value 4;
481           description
482             "Status cannot be determined for some reason.";
483         }
484         enum DORMANT {
485           value 5;
486           description
487             "Waiting for some external event.";
488         }
489         enum NOT_PRESENT {
490           value 6;
491           description
492             "Some component (typically hardware) is missing.";
493         }
494         enum LOWER_LAYER_DOWN {
495           value 7;
496           description
497             "Down due to state of lower-layer interface(s).";
498         }
499       }
500       //TODO:consider converting to an identity to have the
501       //flexibility to remove some values defined by RFC 7223 that
502       //are not used or not implemented consistently.
503       mandatory true;
504       description
505         "The current operational state of the interface.
506
507          This leaf has the same semantics as ifOperStatus.";
508       reference
509         "RFC 2863: The Interfaces Group MIB - ifOperStatus";
510     }
511
512     leaf last-change {
513       type oc-types:timeticks64;
514       units nanoseconds;
515       description
516         "This timestamp indicates the time of the last state change
517         of the interface (e.g., up-to-down transition). This
518         corresponds to the ifLastChange object in the standard
519         interface MIB.
520
521         The value is the timestamp in nanoseconds relative to
522         the Unix Epoch (Jan 1, 1970 00:00:00 UTC).";
523       reference
524         "RFC 2863: The Interfaces Group MIB - ifLastChange";
525     }
526
527   }
528
529
530   grouping interface-counters-state {
531     description
532       "Operational state representing interface counters
533       and statistics.";
534
535       //TODO: we may need to break this list of counters into those
536       //that would appear for physical vs. subinterface or logical
537       //interfaces.  For now, just replicating the full stats
538       //grouping to both interface and subinterface.
539
540     container counters {
541       description
542         "A collection of interface-related statistics objects.";
543
544       leaf in-octets {
545         type oc-yang:counter64;
546         description
547           "The total number of octets received on the interface,
548           including framing characters.
549
550           Discontinuities in the value of this counter can occur
551           at re-initialization of the management system, and at
552           other times as indicated by the value of
553           'last-clear'.";
554         reference
555           "RFC 2863: The Interfaces Group MIB - ifHCInOctets";
556       }
557
558       leaf in-unicast-pkts {
559         type oc-yang:counter64;
560         description
561           "The number of packets, delivered by this sub-layer to a
562           higher (sub-)layer, that were not addressed to a
563           multicast or broadcast address at this sub-layer.
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           'last-clear'.";
569         reference
570           "RFC 2863: The Interfaces Group MIB - ifHCInUcastPkts";
571       }
572
573       leaf in-broadcast-pkts {
574         type oc-yang:counter64;
575         description
576           "The number of packets, delivered by this sub-layer to a
577           higher (sub-)layer, that were addressed to a broadcast
578           address at this sub-layer.
579
580           Discontinuities in the value of this counter can occur
581           at re-initialization of the management system, and at
582           other times as indicated by the value of
583           'last-clear'.";
584         reference
585           "RFC 2863: The Interfaces Group MIB -
586                      ifHCInBroadcastPkts";
587       }
588
589       leaf in-multicast-pkts {
590         type oc-yang:counter64;
591         description
592           "The number of packets, delivered by this sub-layer to a
593           higher (sub-)layer, that were addressed to a multicast
594           address at this sub-layer.  For a MAC-layer protocol,
595           this includes both Group and Functional addresses.
596
597           Discontinuities in the value of this counter can occur
598           at re-initialization of the management system, and at
599           other times as indicated by the value of
600           'last-clear'.";
601         reference
602           "RFC 2863: The Interfaces Group MIB -
603                      ifHCInMulticastPkts";
604       }
605
606       leaf in-discards {
607         type oc-yang:counter64;
608         description
609           "The number of inbound packets that were chosen to be
610           discarded even though no errors had been detected to
611           prevent their being deliverable to a higher-layer
612           protocol.  One possible reason for discarding such a
613           packet could be to free up buffer space.
614
615           Discontinuities in the value of this counter can occur
616           at re-initialization of the management system, and at
617           other times as indicated by the value of
618           'last-clear'.";
619
620
621         reference
622           "RFC 2863: The Interfaces Group MIB - ifInDiscards";
623       }
624
625       leaf in-errors {
626         type oc-yang:counter64;
627         description
628           "For packet-oriented interfaces, the number of inbound
629           packets that contained errors preventing them from being
630           deliverable to a higher-layer protocol.  For character-
631           oriented or fixed-length interfaces, the number of
632           inbound transmission units that contained errors
633           preventing them from being deliverable to a higher-layer
634           protocol.
635
636           Discontinuities in the value of this counter can occur
637           at re-initialization of the management system, and at
638           other times as indicated by the value of
639           'last-clear'.";
640         reference
641           "RFC 2863: The Interfaces Group MIB - ifInErrors";
642       }
643
644       leaf in-unknown-protos {
645         type oc-yang:counter64;
646         description
647           "For packet-oriented interfaces, the number of packets
648           received via the interface that were discarded because
649           of an unknown or unsupported protocol.  For
650           character-oriented or fixed-length interfaces that
651           support protocol multiplexing, the number of
652           transmission units received via the interface that were
653           discarded because of an unknown or unsupported protocol.
654           For any interface that does not support protocol
655           multiplexing, this counter is not present.
656
657           Discontinuities in the value of this counter can occur
658           at re-initialization of the management system, and at
659           other times as indicated by the value of
660           'last-clear'.";
661         reference
662           "RFC 2863: The Interfaces Group MIB - ifInUnknownProtos";
663       }
664
665       leaf in-fcs-errors {
666         type oc-yang:counter64;
667         description
668           "Number of received packets which had errors in the
669           frame check sequence (FCS), i.e., framing errors.
670
671           Discontinuities in the value of this counter can occur
672           when the device is re-initialization as indicated by the
673           value of 'last-clear'.";
674       }
675
676       leaf out-octets {
677         type oc-yang:counter64;
678         description
679           "The total number of octets transmitted out of the
680           interface, including framing characters.
681
682           Discontinuities in the value of this counter can occur
683           at re-initialization of the management system, and at
684           other times as indicated by the value of
685           'last-clear'.";
686         reference
687           "RFC 2863: The Interfaces Group MIB - ifHCOutOctets";
688       }
689
690       leaf out-unicast-pkts {
691         type oc-yang:counter64;
692         description
693           "The total number of packets that higher-level protocols
694           requested be transmitted, and that were not addressed
695           to a multicast or broadcast address at this sub-layer,
696           including those that were discarded or not sent.
697
698           Discontinuities in the value of this counter can occur
699           at re-initialization of the management system, and at
700           other times as indicated by the value of
701           'last-clear'.";
702         reference
703           "RFC 2863: The Interfaces Group MIB - ifHCOutUcastPkts";
704       }
705
706       leaf out-broadcast-pkts {
707         type oc-yang:counter64;
708         description
709           "The total number of packets that higher-level protocols
710           requested be transmitted, and that were addressed to a
711           broadcast address at this sub-layer, including those
712           that were discarded or not sent.
713
714           Discontinuities in the value of this counter can occur
715           at re-initialization of the management system, and at
716           other times as indicated by the value of
717           'last-clear'.";
718         reference
719           "RFC 2863: The Interfaces Group MIB -
720                      ifHCOutBroadcastPkts";
721       }
722
723
724       leaf out-multicast-pkts {
725         type oc-yang:counter64;
726         description
727           "The total number of packets that higher-level protocols
728           requested be transmitted, and that were addressed to a
729           multicast address at this sub-layer, including those
730           that were discarded or not sent.  For a MAC-layer
731           protocol, this includes both Group and Functional
732           addresses.
733
734           Discontinuities in the value of this counter can occur
735           at re-initialization of the management system, and at
736           other times as indicated by the value of
737           'last-clear'.";
738         reference
739           "RFC 2863: The Interfaces Group MIB -
740                      ifHCOutMulticastPkts";
741       }
742
743       leaf out-discards {
744         type oc-yang:counter64;
745         description
746           "The number of outbound packets that were chosen to be
747           discarded even though no errors had been detected to
748           prevent their being transmitted.  One possible reason
749           for discarding such a packet could be to free up buffer
750           space.
751
752           Discontinuities in the value of this counter can occur
753           at re-initialization of the management system, and at
754           other times as indicated by the value of
755           'last-clear'.";
756         reference
757           "RFC 2863: The Interfaces Group MIB - ifOutDiscards";
758       }
759
760       leaf out-errors {
761         type oc-yang:counter64;
762         description
763           "For packet-oriented interfaces, the number of outbound
764           packets that could not be transmitted because of errors.
765           For character-oriented or fixed-length interfaces, the
766           number of outbound transmission units that could not be
767           transmitted because of errors.
768
769           Discontinuities in the value of this counter can occur
770           at re-initialization of the management system, and at
771           other times as indicated by the value of
772           'last-clear'.";
773         reference
774           "RFC 2863: The Interfaces Group MIB - ifOutErrors";
775       }
776
777       leaf carrier-transitions {
778         type oc-yang:counter64;
779         description
780           "Number of times the interface state has transitioned
781           between up and down since the time the device restarted
782           or the last-clear time, whichever is most recent.";
783       }
784
785       leaf last-clear {
786         type oc-types:timeticks64;
787         units nanoseconds;
788         description
789           "Timestamp of the last time the interface counters were
790           cleared.
791
792           The value is the timestamp in nanoseconds relative to
793           the Unix Epoch (Jan 1, 1970 00:00:00 UTC).";
794       }
795     }
796   }
797
798   // data definition statements
799
800   grouping sub-unnumbered-config {
801     description
802       "Configuration data for unnumbered subinterfaces";
803
804     leaf enabled {
805       type boolean;
806       default false;
807       description
808         "Indicates that the subinterface is unnumbered.  By default
809         the subinterface is numbered, i.e., expected to have an
810         IP address configuration.";
811     }
812   }
813
814   grouping sub-unnumbered-state {
815     description
816       "Operational state data unnumbered subinterfaces";
817   }
818
819   grouping sub-unnumbered-top {
820     description
821       "Top-level grouping unnumbered subinterfaces";
822
823     container unnumbered {
824       description
825         "Top-level container for setting unnumbered interfaces.
826         Includes reference the interface that provides the
827         address information";
828
829       container config {
830         description
831           "Configuration data for unnumbered interface";
832
833         uses sub-unnumbered-config;
834       }
835
836       container state {
837
838         config false;
839
840         description
841           "Operational state data for unnumbered interfaces";
842
843         uses sub-unnumbered-config;
844         uses sub-unnumbered-state;
845       }
846
847       uses oc-if:interface-ref;
848     }
849   }
850
851   grouping subinterfaces-config {
852     description
853       "Configuration data for subinterfaces";
854
855     leaf index {
856       type uint32;
857       default 0;
858       description
859         "The index of the subinterface, or logical interface number.
860         On systems with no support for subinterfaces, or not using
861         subinterfaces, this value should default to 0, i.e., the
862         default subinterface.";
863     }
864
865     uses interface-common-config;
866
867   }
868
869   grouping subinterfaces-state {
870     description
871       "Operational state data for subinterfaces";
872
873     leaf name {
874       type string;
875       description
876         "The system-assigned name for the sub-interface.  This MAY
877         be a combination of the base interface name and the
878         subinterface index, or some other convention used by the
879         system.";
880     }
881
882     uses interface-common-state;
883     uses interface-counters-state;
884   }
885
886   grouping subinterfaces-top {
887     description
888       "Subinterface data for logical interfaces associated with a
889       given interface";
890
891     container subinterfaces {
892       description
893         "Enclosing container for the list of subinterfaces associated
894         with a physical interface";
895
896       list subinterface {
897         key "index";
898
899         description
900           "The list of subinterfaces (logical interfaces) associated
901           with a physical interface";
902
903         leaf index {
904           type leafref {
905             path "../config/index";
906           }
907           description
908             "The index number of the subinterface -- used to address
909             the logical interface";
910         }
911
912         container config {
913           description
914             "Configurable items at the subinterface level";
915
916           uses subinterfaces-config;
917         }
918
919         container state {
920
921           config false;
922           description
923             "Operational state data for logical interfaces";
924
925           uses subinterfaces-config;
926           uses subinterfaces-state;
927         }
928       }
929     }
930   }
931
932   grouping interfaces-top {
933     description
934       "Top-level grouping for interface configuration and
935       operational state data";
936
937     container interfaces {
938       description
939         "Top level container for interfaces, including configuration
940         and state data.";
941
942
943       list interface {
944         key "name";
945
946         description
947           "The list of named interfaces on the device.";
948
949         leaf name {
950           type leafref {
951             path "../config/name";
952           }
953           description
954             "References the configured name of the interface";
955             //TODO: need to consider whether this should actually
956             //reference the name in the state subtree, which
957             //presumably would be the system-assigned name, or the
958             //configured name.  Points to the config/name now
959             //because of YANG 1.0 limitation that the list
960             //key must have the same "config" as the list, and
961             //also can't point to a non-config node.
962         }
963
964         container config {
965           description
966             "Configurable items at the global, physical interface
967             level";
968
969           uses interface-phys-config;
970         }
971
972         container state {
973
974           config false;
975           description
976             "Operational state data at the global interface level";
977
978           uses interface-phys-config;
979           uses interface-common-state;
980           uses interface-counters-state;
981         }
982
983         uses interface-phys-holdtime-top;
984         uses subinterfaces-top;
985       }
986     }
987   }
988
989   uses interfaces-top;
990
991
992 }