blob: 0ca95710a4b0407bb0d4f154068b67c85c459b6f [file] [log] [blame]
Thomas Vachuska6655bee2017-08-24 16:12:59 -07001module openconfig-spanning-tree-types {
2
3 yang-version "1";
4
5 // namespace
6 namespace "http://openconfig.net/yang/spanning-tree/types";
7
8 prefix "oc-stp-types";
9
10 // import some basic types
11 import openconfig-extensions { prefix oc-ext; }
12
13
14 // meta
15 organization "OpenConfig working group";
16
17 contact
18 "OpenConfig working group
19 www.openconfig.net";
20
21 description
22 "This module defines types related to the
23 spanning-tree protocol model.";
24
25 oc-ext:openconfig-version "0.2.0";
26
27 revision "2017-07-14" {
28 description
29 "Migrated to OpenConfig types; fixed missing applied state
30 in rapid-pvst";
31 reference "0.2.0";
32 }
33
34 revision "2016-10-03" {
35 description
36 "Initial public revision";
37 reference "0.1.0";
38 }
39
40 // identity statements
41
42 identity STP_PROTOCOL {
43 description
44 "base identity for support spanning tree protocol";
45 }
46
47 identity RSTP {
48 base STP_PROTOCOL;
49 description
50 "Rapid Spanning Tree Protocol";
51 reference "IEEE 802.1D 17";
52 }
53
54 identity MSTP {
55 base STP_PROTOCOL;
56 description
57 "Multiple Spanning Tree Protocol";
58 reference "IEEE 802.1Q 13";
59 }
60
61 identity RAPID_PVST {
62 base STP_PROTOCOL;
63 description
64 "Rapid Per Vlan Spanning Tree Protocol";
65 }
66
67 identity STP_PORT_STATE {
68 description
69 "base identity for the different Spanning Tree Protocol port
70 states";
71 reference
72 "IEEE 802.1D 7.4 Port States and the active topology";
73 }
74
75 identity DISABLED {
76 base STP_PORT_STATE;
77 description
78 "A port that is manually isolated from the network";
79 }
80
81 identity LISTENING {
82 base STP_PORT_STATE;
83 description
84 "Processing BPDUs and building active toplogy";
85 }
86
87 identity LEARNING {
88 base STP_PORT_STATE;
89 description
90 "Building bridging tables; no forwarding of data";
91 }
92
93 identity BLOCKING {
94 base STP_PORT_STATE;
95 description
96 "A port that would cause a loop if it were sending data,
97 so it is only receiving BPDUs, untill a topology change
98 removes the possibliity of a loop";
99 }
100
101 identity FORWARDING {
102 base STP_PORT_STATE;
103 description
104 "Sending and receiving data, normal operation";
105 }
106
107 identity STP_EDGE_PORT {
108 description
109 "base identity for the different edge port modes";
110 reference
111 "IEEE 802.1D 17.13.1";
112 }
113
114 identity EDGE_ENABLE {
115 base STP_EDGE_PORT;
116 description
117 "Enable edge port for the bridge port";
118 }
119
120 identity EDGE_DISABLE {
121 base STP_EDGE_PORT;
122 description
123 "Disable edge port for the bridge port";
124 }
125
126 identity EDGE_AUTO {
127 base STP_EDGE_PORT;
128 description
129 "Enable edge port autodetction for the bridge port";
130 }
131
132 identity STP_PORT_ROLE {
133 description
134 "Base identity for the different Spanning Tree Protocol port
135 roles";
136 reference
137 "IEEE 802.1D 17.7 Port Role assignments";
138 }
139
140 identity ROOT {
141 base STP_PORT_ROLE;
142 description
143 "The port that receives the best BPDU on a bridge is the
144 root port";
145 }
146
147 identity DESIGNATED {
148 base STP_PORT_ROLE;
149 description
150 "A port is designated if it can send the best BPDU on the
151 segment to which it is connected.";
152 }
153
154 identity ALTERNATE {
155 base STP_PORT_ROLE;
156 description
157 "An alternate port receives more useful BPDUs from another
158 bridge and is a port blocked";
159 }
160
161 identity BACKUP {
162 base STP_PORT_ROLE;
163 description
164 "A backup port receives more useful BPDUs from the same
165 bridge it is on and is a port blocked";
166 }
167
168 // typedef statements
169
170 typedef stp-bridge-priority-type {
171 type uint32 {
172 range 1..611440;
173 }
174 description
175 "The manageable component of the Bridge Identifier";
176 reference "IEEE 802.1D 17.13.7 Bridge Identifier Priority";
177 }
178
179 typedef stp-port-priority-type {
180 type uint8 {
181 range 1..240;
182 }
183 description
184 "The manageable component of the Port Identifier,
185 also known as the Port Priority";
186 reference
187 "IEEE 802.1D 17.13.10 Port Identifier Priority";
188 }
189
190 typedef stp-guard-type {
191 type enumeration {
192 enum ROOT {
193 description
194 "Enable root guard";
195 }
196 enum LOOP {
197 description
198 "Enable loop guard";
199 }
200 enum NONE {
201 description
202 "disable guard";
203 }
204 }
205 description
206 "Type definition for the different STP guard for the switch port";
207 reference "IEEE 802.1D 17.2";
208 }
209
210 typedef stp-link-type {
211 type enumeration {
212 enum P2P {
213 description
214 "Point-to-Point link";
215 }
216 enum SHARED {
217 description
218 "Shared link";
219 }
220 }
221 description
222 "Type definition for the different link types";
223 reference "IEEE 802.1D 17.2";
224 }
225}