4cea378749bf4364585d0f4e8d04e101dc29731d
[mdsal.git] / code-generator / binding-generator-impl / src / test / resources / enum-test-models / ietf-interfaces@2012-11-15.yang
1 module ietf-interfaces {
2
3   namespace "urn:ietf:params:xml:ns:yang:ietf-interfaces";
4   prefix if;
5
6   import iana-if-type {
7     prefix ianaift;
8   }
9
10
11   revision 2012-11-15 {
12   }
13
14   /* Typedefs */
15
16   typedef interface-ref {
17     type leafref {
18       path "/if:interfaces/if:interface/if:name";
19     }
20     description
21       "This type is used by data models that need to reference
22        interfaces.";
23   }
24
25   /* Features */
26
27   feature arbitrary-names {
28     description
29       "This feature indicates that the server allows interfaces to
30        be named arbitrarily.";
31   }
32
33   feature if-mib {
34     description
35       "This feature indicates that the server implements IF-MIB.";
36     reference
37       "RFC 2863: The Interfaces Group MIB";
38   }
39
40   /* Data nodes */
41
42   container interfaces {
43     description
44       "Interface parameters.";
45
46     list interface {
47       key "name";
48       unique "type location";
49
50       description
51         "The list of interfaces on the device.";
52
53       leaf name {
54         type string;
55       }
56
57       leaf description {
58         type string;
59       }
60
61       leaf type {
62         type ianaift:iana-if-type;
63         mandatory true;
64       }
65
66       leaf location {
67         type string;
68       }
69
70       leaf enabled {
71         type boolean;
72         default "true";
73       }
74
75       leaf oper-status {
76         type enumeration {
77           enum up {
78             value 1;
79             description
80               "Ready to pass packets.";
81           }
82           enum down {
83             value 2;
84             description
85               "The interface does not pass any packets.";
86           }
87           enum testing {
88             value 3;
89             description
90               "In some test mode.  No operational packets can
91                be passed.";
92           }
93           enum unknown {
94             value 4;
95             description
96               "Status cannot be determined for some reason.";
97           }
98           enum dormant {
99             value 5;
100             description
101               "Waiting for some external event.";
102           }
103           enum not-present {
104             value 6;
105             description
106               "Some component is missing.";
107           }
108           enum lower-layer-down {
109             value 7;
110             description
111               "Down due to state of lower-layer interface(s).";
112           }
113         }
114         config false;
115         description
116           "The current operational state of the interface.
117
118            If 'enabled' is 'false' then 'oper-status'
119            should be 'down'.  If 'enabled' is changed to 'true'
120            then 'oper-status' should change to 'up' if the interface
121            is ready to transmit and receive network traffic; it
122            should change to 'dormant' if the interface is waiting for
123            external actions (such as a serial line waiting for an
124            incoming connection); it should remain in the 'down' state
125            if and only if there is a fault that prevents it from
126            going to the 'up' state; it should remain in the
127            'not-present' state if the interface has missing
128            (typically, hardware) components.";
129         reference
130           "RFC 2863: The Interfaces Group MIB - ifOperStatus";
131       }
132
133       leaf last-change {
134         type string;
135         config false;
136       }
137
138       leaf if-index {
139         if-feature if-mib;
140         type int32 {
141           range "1..2147483647";
142         }
143         config false;
144       }
145
146       leaf link-up-down-trap-enable {
147         if-feature if-mib;
148         type enumeration {
149           enum enabled {
150             value 1;
151           }
152           enum disabled {
153             value 2;
154           }
155         }
156       }
157
158       leaf phys-address {
159         type string;
160         config false;
161       }
162
163       leaf-list higher-layer-if {
164         type interface-ref;
165         config false;
166       }
167
168       leaf-list lower-layer-if {
169         type interface-ref;
170         config false;
171       }
172
173       leaf speed {
174         type uint64;
175         units "bits / second";
176         config false;
177       }
178
179       container statistics {
180         config false;
181       }
182     }
183   }
184 }