aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/yang/openconfig/openconfig-spanning-tree-types.yang
blob: 0ca95710a4b0407bb0d4f154068b67c85c459b6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
module openconfig-spanning-tree-types {

  yang-version "1";

  // namespace
  namespace "http://openconfig.net/yang/spanning-tree/types";

  prefix "oc-stp-types";

  // import some basic types
  import openconfig-extensions { prefix oc-ext; }


  // meta
  organization "OpenConfig working group";

  contact
    "OpenConfig working group
    www.openconfig.net";

  description
    "This module defines types related to the
    spanning-tree protocol model.";

  oc-ext:openconfig-version "0.2.0";

  revision "2017-07-14" {
    description
      "Migrated to OpenConfig types; fixed missing applied state
      in rapid-pvst";
    reference "0.2.0";
  }

  revision "2016-10-03" {
    description
      "Initial public revision";
    reference "0.1.0";
  }

  // identity statements

  identity STP_PROTOCOL {
    description
      "base identity for support spanning tree protocol";
  }

  identity RSTP {
    base STP_PROTOCOL;
    description
      "Rapid Spanning Tree Protocol";
    reference "IEEE 802.1D 17";
  }

  identity MSTP {
    base STP_PROTOCOL;
    description
      "Multiple Spanning Tree Protocol";
    reference "IEEE 802.1Q 13";
  }

  identity RAPID_PVST {
    base STP_PROTOCOL;
    description
      "Rapid Per Vlan Spanning Tree Protocol";
  }

  identity STP_PORT_STATE {
    description
      "base identity for the different Spanning Tree Protocol port
      states";
    reference
      "IEEE 802.1D 7.4 Port States and the active topology";
  }

  identity DISABLED {
    base STP_PORT_STATE;
    description
      "A port that is manually isolated from the network";
  }

  identity LISTENING {
    base STP_PORT_STATE;
    description
      "Processing BPDUs and building active toplogy";
  }

  identity LEARNING {
    base STP_PORT_STATE;
    description
      "Building bridging tables; no forwarding of data";
  }

  identity BLOCKING {
    base STP_PORT_STATE;
    description
      "A port that would cause a loop if it were sending data,
      so it is only receiving BPDUs, untill a topology change
      removes the possibliity of a loop";
  }

  identity FORWARDING {
    base STP_PORT_STATE;
    description
      "Sending and receiving data, normal operation";
  }

  identity STP_EDGE_PORT {
    description
      "base identity for the different edge port modes";
    reference
      "IEEE 802.1D 17.13.1";
  }

  identity EDGE_ENABLE {
    base STP_EDGE_PORT;
    description
      "Enable edge port for the bridge port";
  }

  identity EDGE_DISABLE {
    base STP_EDGE_PORT;
    description
      "Disable edge port for the bridge port";
  }

  identity EDGE_AUTO {
    base STP_EDGE_PORT;
    description
      "Enable edge port autodetction for the bridge port";
  }

  identity STP_PORT_ROLE {
    description
      "Base identity for the different Spanning Tree Protocol port
      roles";
    reference
      "IEEE 802.1D 17.7 Port Role assignments";
  }

  identity ROOT {
    base STP_PORT_ROLE;
    description
      "The port that receives the best BPDU on a bridge is the
      root port";
  }

  identity DESIGNATED {
    base STP_PORT_ROLE;
    description
      "A port is designated if it can send the best BPDU on the
      segment to which it is connected.";
  }

  identity ALTERNATE {
    base STP_PORT_ROLE;
    description
      "An alternate port receives more useful BPDUs from another
      bridge and is a port blocked";
  }

  identity BACKUP {
    base STP_PORT_ROLE;
    description
      "A backup port receives more useful BPDUs from the same
      bridge it is on and is a port blocked";
  }

  // typedef statements

  typedef stp-bridge-priority-type {
    type uint32 {
      range 1..611440;
    }
    description
      "The manageable component of the Bridge Identifier";
    reference "IEEE 802.1D 17.13.7 Bridge Identifier Priority";
  }

  typedef stp-port-priority-type {
    type uint8 {
      range 1..240;
    }
    description
      "The manageable component of the Port Identifier,
      also known as the Port Priority";
    reference
      "IEEE 802.1D 17.13.10 Port Identifier Priority";
  }

  typedef stp-guard-type {
    type enumeration {
      enum ROOT {
      	description
      	  "Enable root guard";
      }
      enum LOOP {
      	description
      	  "Enable loop guard";
      }
      enum NONE {
      	description
      	  "disable guard";
      }
    }
    description
      "Type definition for the different STP guard for the switch port";
    reference "IEEE 802.1D 17.2";
  }

  typedef stp-link-type {
    type enumeration {
      enum P2P {
      	description
      	  "Point-to-Point link";
      }
      enum SHARED {
      	description
      	  "Shared link";
      }
    }
    description
      "Type definition for the different link types";
    reference "IEEE 802.1D 17.2";
  }
}