1
1
module sonic-stp {
2
+
2
3
yang-version 1.1 ;
4
+
3
5
namespace "https://github.com/sonic-net/sonic-stp" ;
6
+
4
7
prefix stp;
5
8
6
9
import sonic-extension {
7
10
prefix sonic-ext;
8
11
}
9
-
10
- description
11
- "SONiC STP YANG model for PVST and MST configurations" ;
12
12
13
- revision 2024 -12 -30 {
14
- description
15
- "Version01 for combined PVST configurations." ;
16
- }
13
+ description
14
+ "This module contains the collection of YANG definitions for the PVST & MSTP" ;
17
15
18
- extension dependent-on {
19
- argument "dependency" ;
16
+ revision 2024 -12 -30 {
20
17
description
21
- "Indicates module dependencies " ;
18
+ "Version01 for combined PVST & MSTP configurations. " ;
22
19
}
23
20
24
21
grouping vlanModeAttr {
22
+ description
23
+ "Configuration parameters" ;
24
+
25
25
leaf forward_delay {
26
26
type uint8 {
27
27
range "4..30" {
@@ -74,6 +74,9 @@ module sonic-stp {
74
74
}
75
75
76
76
grouping interfaceAttr {
77
+ description
78
+ "Configuration parameters of interfaces." ;
79
+
77
80
leaf path_cost {
78
81
type uint64 {
79
82
range "1..200000000" {
@@ -99,42 +102,59 @@ module sonic-stp {
99
102
}
100
103
}
101
104
102
- container sonic-spanning-tree {
105
+ container spanning-tree {
106
+ description
107
+ "Top level container for SONiC Spanning Tree configurations" ;
108
+
109
+ container stp-config {
110
+ description
111
+ "Global configurations" ;
103
112
104
- container STP {
105
- list STP_LIST {
113
+ list stp-list {
114
+ description
115
+ "STP list containing global attributes" ;
106
116
max-elements 1 ;
107
117
key "keyleaf" ;
118
+
108
119
leaf keyleaf {
109
120
type enumeration {
110
- enum GLOBAL;
121
+ enum GLOBAL {
122
+ description
123
+ "Global configuration identifier" ;
124
+ }
111
125
}
112
126
description
113
127
"Key node identifier. It's value is always GLOBAL" ;
114
128
}
115
129
116
130
leaf mode {
117
131
type enumeration {
118
- enum pvst;
119
- enum mst;
132
+ enum pvst {
133
+ description
134
+ "Per VLAN Spanning Tree Mode" ;
135
+ }
136
+ enum mst {
137
+ description
138
+ "Multiple Spanning Tree Mode" ;
139
+ }
120
140
}
121
141
mandatory true ;
122
142
description
123
143
"Spanning tree mode" ;
124
144
}
125
145
126
146
leaf rootguard_timeout {
127
- must "../../../STP/STP_LIST[keyleaf='GLOBAL']/mode!='mst'" {
128
- error-message "Configuration not allowed in MST mode" ;
129
- error-app-tag stp-invalid;
130
- }
131
-
132
147
type uint16 {
133
148
range "5..600" {
134
149
error-message "Invalid Root-guard Timeout value." ;
135
150
}
136
151
}
137
152
units seconds;
153
+ must "../../../stp-config/stp-list[keyleaf='GLOBAL']/mode!='mst'" {
154
+ error-message "Root guard timeout not allowed in MST mode" ;
155
+ error-app-tag stp-invalid;
156
+ }
157
+
138
158
description
139
159
"Once superior BPDUs stop coming on the port, device
140
160
will wait for a period until root guard timeout before
@@ -145,9 +165,15 @@ module sonic-stp {
145
165
}
146
166
}
147
167
148
- container STP_VLAN {
149
- list STP_VLAN_LIST {
168
+ container stp-vlan {
169
+ description
170
+ "VLAN Specific STP Configurations" ;
171
+
172
+ list stp-vlan-list {
173
+ description
174
+ "List of VLAN STP configurations" ;
150
175
key "name" ;
176
+
151
177
leaf name {
152
178
type string ;
153
179
description
@@ -176,21 +202,26 @@ module sonic-stp {
176
202
}
177
203
}
178
204
179
- container STP_VLAN_PORT {
180
- list STP_VLAN_PORT_LIST {
205
+ container stp-vlan-port {
206
+ description
207
+ "Vlan port configurations" ;
208
+
209
+ list stp-vlan-port-list {
210
+ description
211
+ "List of VLAN port configurations" ;
181
212
key "vlan-name ifname" ;
182
213
183
214
leaf vlan-name {
184
215
type leafref {
185
- path "../../../STP_VLAN/STP_VLAN_LIST /name" ;
216
+ path "../../../stp-vlan/stp-vlan-list /name" ;
186
217
}
187
218
description
188
219
"Reference to Vlan" ;
189
220
}
190
221
191
222
leaf ifname {
192
223
type leafref {
193
- path "../../../STP_PORT/STP_PORT_LIST /ifname" ;
224
+ path "../../../stp-port/stp-port-list /ifname" ;
194
225
}
195
226
description
196
227
"Reference to Ethernet interface or PortChannel" ;
@@ -200,13 +231,17 @@ module sonic-stp {
200
231
}
201
232
}
202
233
203
- container STP_PORT {
204
- list STP_PORT_LIST {
234
+ container stp-port {
235
+ description
236
+ "Port Configurations." ;
237
+
238
+ list stp-port-list {
239
+ description
240
+ "List of STP port List attributes." ;
205
241
key "ifname" ;
206
- //sonic-ext:dependent-on "STP_LIST";
207
- must "/sonic-spanning-tree/STP/STP_LIST" {
208
- error-message "STP global configuration must exist" ;
209
- }
242
+
243
+ sonic-ext:dependent-on "stp-list" ;
244
+
210
245
leaf ifname {
211
246
type string ;
212
247
description
@@ -245,13 +280,13 @@ module sonic-stp {
245
280
}
246
281
247
282
leaf portfast {
248
- must "current()!='true' or ../../../STP/STP_LIST[keyleaf='GLOBAL']/mode='pvst'" {
283
+ type boolean ;
284
+ must "current()!='true' or ../../../stp-config/stp-list[keyleaf='GLOBAL']/mode='pvst'" {
249
285
error-message "Configuration not allowed in MST mode" ;
250
286
error-app-tag stp-invalid;
251
287
}
252
- type boolean ;
253
288
description
254
- "Enable/Disable portfast on port" ;
289
+ "Enable/Disable portfast on port in PVST only " ;
255
290
}
256
291
257
292
uses interfaceAttr;
@@ -265,9 +300,18 @@ module sonic-stp {
265
300
266
301
leaf link_type {
267
302
type enumeration {
268
- enum auto;
269
- enum shared;
270
- enum point-to-point;
303
+ enum auto {
304
+ description
305
+ "Specifies the interface's link type. Permissible values 'auto'" ;
306
+ }
307
+ enum shared {
308
+ description
309
+ "Specifies the interface's link type. Permissible values 'shared'" ;
310
+ }
311
+ enum point-to-point {
312
+ description
313
+ "Specifies the interface's link type. Permissible values 'point-to-point'" ;
314
+ }
271
315
}
272
316
description
273
317
"Specifies the interface's link type. Permissible values
@@ -276,97 +320,108 @@ module sonic-stp {
276
320
}
277
321
}
278
322
279
- container STP_MST {
280
- list STP_MST_LIST {
323
+ container stp-mst {
324
+ description
325
+ "MST specific configuration container" ;
326
+
327
+ list stp-mst-list {
328
+ description
329
+ "List of MST global configurations" ;
281
330
max-elements 1 ;
282
331
key "keyleaf" ;
283
- //sonic-ext:dependent-on "STP_LIST";
284
- must "/sonic-spanning-tree/STP/STP_LIST" {
285
- error-message "STP global configuration must exist" ;
286
- }
332
+
333
+ sonic-ext:dependent-on "stp-list" ;
287
334
288
335
leaf keyleaf {
289
336
type enumeration {
290
- enum GLOBAL;
337
+ enum GLOBAL {
338
+ description
339
+ "Global MST" ;
340
+ }
291
341
}
292
342
description
293
343
"Key node identifier. It's value is always GLOBAL" ;
294
344
}
295
345
296
346
leaf name {
297
- must "../../../STP/STP_LIST[keyleaf='GLOBAL']/mode='mst'" {
347
+ type string ;
348
+ must "../../../stp-config/stp-list[keyleaf='GLOBAL']/mode='mst'" {
298
349
error-message "Configuration allowed in MST mode" ;
299
350
error-app-tag stp-invalid;
300
351
}
301
- type string ;
302
352
description
303
353
"MST Region name" ;
304
354
}
305
355
306
356
leaf revision {
307
- must "../../../STP/STP_LIST[keyleaf='GLOBAL']/mode='mst'" {
357
+ type uint32 ;
358
+ must "../../../stp-config/stp-list[keyleaf='GLOBAL']/mode='mst'" {
308
359
error-message "Configuration allowed in MST mode" ;
309
360
error-app-tag stp-invalid;
310
361
}
311
- type uint32 ;
312
362
description
313
363
"MST Revision number" ;
314
364
}
315
365
316
366
leaf max_hops {
317
- must "../../../STP/STP_LIST[keyleaf='GLOBAL']/mode='mst'" {
367
+ type uint8 ;
368
+ must "../../../stp-config/stp-list[keyleaf='GLOBAL']/mode='mst'" {
318
369
error-message "Configuration allowed in MST mode" ;
319
370
error-app-tag stp-invalid;
320
371
}
321
- type uint8 ;
322
372
description
323
373
"MST Max hops" ;
324
374
}
325
375
326
376
leaf hello_time {
327
- must "../../../STP/STP_LIST[keyleaf='GLOBAL']/mode='mst'" {
377
+ type uint8 ;
378
+ must "../../../stp-config/stp-list[keyleaf='GLOBAL']/mode='mst'" {
328
379
error-message "Configuration allowed in MST mode" ;
329
380
error-app-tag stp-invalid;
330
381
}
331
- type uint8 ;
332
382
description
333
383
"MST hello time" ;
334
384
}
335
385
336
386
leaf max_age {
337
- must "../../../STP/STP_LIST[keyleaf='GLOBAL']/mode='mst'" {
387
+ type uint8 ;
388
+ must "../../../stp-config/stp-list[keyleaf='GLOBAL']/mode='mst'" {
338
389
error-message "Configuration allowed in MST mode" ;
339
390
error-app-tag stp-invalid;
340
391
}
341
- type uint8 ;
342
392
description
343
393
"MST max age" ;
344
394
}
345
395
346
396
leaf forward_delay {
347
- must "../../../STP/STP_LIST[keyleaf='GLOBAL']/mode='mst'" {
397
+ type uint8 ;
398
+ must "../../../stp-config/stp-list[keyleaf='GLOBAL']/mode='mst'" {
348
399
error-message "Configuration allowed in MST mode" ;
349
400
error-app-tag stp-invalid;
350
401
}
351
- type uint8 ;
352
402
description
353
403
"MST forward delay" ;
354
404
}
355
405
356
406
leaf hold_count {
357
- must "../../../STP/STP_LIST[keyleaf='GLOBAL']/mode='mst'" {
407
+ type uint8 ;
408
+ must "../../../stp-config/stp-list[keyleaf='GLOBAL']/mode='mst'" {
358
409
error-message "Configuration allowed in MST mode" ;
359
410
error-app-tag stp-invalid;
360
411
}
361
- type uint8 ;
362
412
description
363
413
"MST hold count" ;
364
414
}
365
415
}
366
416
}
367
417
368
- container STP_MST_INST {
369
- list STP_MST_INST_LIST {
418
+ container stp-mst-inst {
419
+ description
420
+ "STP MST Instance Configuration." ;
421
+
422
+ list stp-mst-inst-list {
423
+ description
424
+ "List of STP MST Instance attributes." ;
370
425
key "instance" ;
371
426
372
427
leaf instance {
@@ -393,23 +448,27 @@ module sonic-stp {
393
448
}
394
449
}
395
450
396
- container STP_MST_PORT {
397
- list STP_MST_PORT_LIST {
451
+ container stp-mst-port {
452
+ description
453
+ "STP MST Port configurations." ;
454
+
455
+ list stp-mst-port-list {
456
+ description
457
+ "STP MST Port List attributes" ;
398
458
key "inst_id ifname" ;
399
459
400
460
leaf inst_id {
401
461
type leafref {
402
- path "../../../STP_MST_INST/STP_MST_INST_LIST /instance" ;
462
+ path "../../../stp-mst-inst/stp-mst-inst-list /instance" ;
403
463
}
404
464
description
405
465
"Reference to MST Instance" ;
406
466
}
407
467
408
468
leaf ifname {
409
469
type leafref {
410
- path "../../../STP_PORT/STP_PORT_LIST /ifname" ;
470
+ path "../../../stp-port/stp-port-list /ifname" ;
411
471
}
412
-
413
472
description
414
473
"Reference to Ethernet interface or PortChannel" ;
415
474
}
0 commit comments