stp.h
Go to the documentation of this file.
1 /**
2  * @file stp.h
3  * @brief STP (Spanning Tree Protocol)
4  *
5  * @section License
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  *
9  * Copyright (C) 2019-2024 Oryx Embedded SARL. All rights reserved.
10  *
11  * This file is part of CycloneSTP Open.
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software Foundation,
25  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26  *
27  * @author Oryx Embedded SARL (www.oryx-embedded.com)
28  * @version 2.4.4
29  **/
30 
31 #ifndef _STP_H
32 #define _STP_H
33 
34 //Forward declaration of StpBridgeContext structure
35 struct _StpBridgeContext;
36 #define StpBridgeContext struct _StpBridgeContext
37 
38 //Forward declaration of StpBridgePort structure
39 struct _StpBridgePort;
40 #define StpBridgePort struct _StpBridgePort
41 
42 //Dependencies
43 #include "stp/stp_common.h"
44 #include "stp/stp_bpdu.h"
45 
46 //STP bridge support
47 #ifndef STP_SUPPORT
48  #define STP_SUPPORT DISABLED
49 #elif (STP_SUPPORT != ENABLED && STP_SUPPORT != DISABLED)
50  #error STP_SUPPORT parameter is not valid
51 #endif
52 
53 //STP tick interval (in milliseconds)
54 #ifndef STP_TICK_INTERVAL
55  #define STP_TICK_INTERVAL 1000
56 #elif (STP_TICK_INTERVAL < 10)
57  #error STP_TICK_INTERVAL parameter is not valid
58 #endif
59 
60 //Default Bridge Priority Value
61 #ifndef STP_DEFAULT_BRIDGE_PRIORITY
62  #define STP_DEFAULT_BRIDGE_PRIORITY 32768
63 #elif (STP_DEFAULT_BRIDGE_PRIORITY < 0 || STP_DEFAULT_BRIDGE_PRIORITY > 61440)
64  #error STP_DEFAULT_BRIDGE_PRIORITY parameter is not valid
65 #endif
66 
67 //Default Port Priority Value
68 #ifndef STP_DEFAULT_PORT_PRIORITY
69  #define STP_DEFAULT_PORT_PRIORITY 128
70 #elif (STP_DEFAULT_PORT_PRIORITY < 0 || STP_DEFAULT_PORT_PRIORITY > 240)
71  #error STP_DEFAULT_PORT_PRIORITY parameter is not valid
72 #endif
73 
74 //Message Age increment
75 #ifndef STP_MESSAGE_AGE_INCREMENT
76  #define STP_MESSAGE_AGE_INCREMENT 1
77 #elif (STP_MESSAGE_AGE_INCREMENT < 1 || STP_MESSAGE_AGE_INCREMENT > 4)
78  #error STP_MESSAGE_AGE_INCREMENT parameter is not valid
79 #endif
80 
81 //Minimum Bridge Max Age value
82 #ifndef STP_MIN_BRIDGE_MAX_AGE
83  #define STP_MIN_BRIDGE_MAX_AGE 6
84 #elif (STP_MIN_BRIDGE_MAX_AGE < 0)
85  #error STP_MIN_BRIDGE_MAX_AGE parameter is not valid
86 #endif
87 
88 //Default Bridge Max Age value
89 #ifndef STP_DEFAULT_BRIDGE_MAX_AGE
90  #define STP_DEFAULT_BRIDGE_MAX_AGE 20
91 #elif (STP_DEFAULT_BRIDGE_MAX_AGE < STP_MIN_BRIDGE_MAX_AGE)
92  #error STP_DEFAULT_BRIDGE_MAX_AGE parameter is not valid
93 #endif
94 
95 //Maximum Bridge Max Age value
96 #ifndef STP_MAX_BRIDGE_MAX_AGE
97  #define STP_MAX_BRIDGE_MAX_AGE 40
98 #elif (STP_MAX_BRIDGE_MAX_AGE < STP_DEFAULT_BRIDGE_MAX_AGE)
99  #error STP_MAX_BRIDGE_MAX_AGE parameter is not valid
100 #endif
101 
102 //Minimum Bridge Hello Time value
103 #ifndef STP_MIN_BRIDGE_HELLO_TIME
104  #define STP_MIN_BRIDGE_HELLO_TIME 1
105 #elif (STP_MIN_BRIDGE_HELLO_TIME < 0)
106  #error STP_MIN_BRIDGE_HELLO_TIME parameter is not valid
107 #endif
108 
109 //Default Bridge Hello Time value
110 #ifndef STP_DEFAULT_BRIDGE_HELLO_TIME
111  #define STP_DEFAULT_BRIDGE_HELLO_TIME 2
112 #elif (STP_DEFAULT_BRIDGE_HELLO_TIME < STP_MIN_BRIDGE_HELLO_TIME)
113  #error STP_DEFAULT_BRIDGE_HELLO_TIME parameter is not valid
114 #endif
115 
116 //Maximum Bridge Hello Time value
117 #ifndef STP_MAX_BRIDGE_HELLO_TIME
118  #define STP_MAX_BRIDGE_HELLO_TIME 10
119 #elif (STP_MAX_BRIDGE_HELLO_TIME < STP_DEFAULT_BRIDGE_HELLO_TIME)
120  #error STP_MAX_BRIDGE_HELLO_TIME parameter is not valid
121 #endif
122 
123 //Minimum Bridge Forward Delay value
124 #ifndef STP_MIN_BRIDGE_FORWARD_DELAY
125  #define STP_MIN_BRIDGE_FORWARD_DELAY 4
126 #elif (STP_MIN_BRIDGE_FORWARD_DELAY < 0)
127  #error STP_MIN_BRIDGE_FORWARD_DELAY parameter is not valid
128 #endif
129 
130 //Default Bridge Forward Delay value
131 #ifndef STP_DEFAULT_BRIDGE_FORWARD_DELAY
132  #define STP_DEFAULT_BRIDGE_FORWARD_DELAY 15
133 #elif (STP_DEFAULT_BRIDGE_FORWARD_DELAY < STP_MIN_BRIDGE_FORWARD_DELAY)
134  #error STP_DEFAULT_BRIDGE_FORWARD_DELAY parameter is not valid
135 #endif
136 
137 //Maximum Bridge Forward Delay value
138 #ifndef STP_MAX_BRIDGE_FORWARD_DELAY
139  #define STP_MAX_BRIDGE_FORWARD_DELAY 30
140 #elif (STP_MAX_BRIDGE_FORWARD_DELAY < STP_DEFAULT_BRIDGE_FORWARD_DELAY)
141  #error STP_MAX_BRIDGE_FORWARD_DELAY parameter is not valid
142 #endif
143 
144 //Default Hold Time value
145 #ifndef STP_DEFAULT_HOLD_TIME
146  #define STP_DEFAULT_HOLD_TIME 1
147 #elif STP_DEFAULT_HOLD_TIME < 0
148  #error STP_DEFAULT_HOLD_TIME parameter is not valid
149 #endif
150 
151 //Minimum Ageing Time value
152 #ifndef STP_MIN_AGEING_TIME
153  #define STP_MIN_AGEING_TIME 10
154 #elif (STP_MIN_AGEING_TIME < 0)
155  #error STP_MIN_AGEING_TIME parameter is not valid
156 #endif
157 
158 //Default Ageing Time value
159 #ifndef STP_DEFAULT_AGEING_TIME
160  #define STP_DEFAULT_AGEING_TIME 300
161 #elif (STP_DEFAULT_AGEING_TIME < STP_MIN_AGEING_TIME)
162  #error STP_DEFAULT_AGEING_TIME parameter is not valid
163 #endif
164 
165 //Maximum Ageing Time value
166 #ifndef STP_MAX_AGEING_TIME
167  #define STP_MAX_AGEING_TIME 1000000
168 #elif (STP_MAX_AGEING_TIME < STP_DEFAULT_AGEING_TIME)
169  #error STP_MAX_AGEING_TIME parameter is not valid
170 #endif
171 
172 //Minimum Port Path Cost value
173 #ifndef STP_MIN_PORT_PATH_COST
174  #define STP_MIN_PORT_PATH_COST 1
175 #elif (STP_MIN_PORT_PATH_COST < 0)
176  #error STP_MIN_PORT_PATH_COST parameter is not valid
177 #endif
178 
179 //Default Port Path Cost value
180 #ifndef STP_DEFAULT_PORT_PATH_COST
181  #define STP_DEFAULT_PORT_PATH_COST 200000
182 #elif (STP_DEFAULT_PORT_PATH_COST < STP_MIN_PORT_PATH_COST)
183  #error STP_DEFAULT_PORT_PATH_COST parameter is not valid
184 #endif
185 
186 //Maximum Port Path Cost value
187 #ifndef STP_MAX_PORT_PATH_COST
188  #define STP_MAX_PORT_PATH_COST 200000000
189 #elif (STP_MAX_PORT_PATH_COST < STP_DEFAULT_PORT_PATH_COST)
190  #error STP_MAX_PORT_PATH_COST parameter is not valid
191 #endif
192 
193 //C++ guard
194 #ifdef __cplusplus
195 extern "C" {
196 #endif
197 
198 
199 /**
200  * @brief STP timer
201  **/
202 
203 typedef struct
204 {
207 } StpTimer;
208 
209 
210 /**
211  * @brief Bridge port
212  **/
213 
215 {
216  StpBridgeContext *context; ///<STP bridge context
217 
218  uint8_t portIndex; ///<Port index
219  MacAddr macAddr; ///<MAC address of the port
220 
221  bool_t macOperState; ///<The MAC entity is in a functioning state
222  uint_t forwardTransitions; ///<Number of times the port has transitioned to Forwarding state
223 
224  uint16_t portId; ///<Port identifier (8.5.5.1)
225  StpPortState state; ///<Current state of the port (8.5.5.2)
226  uint32_t pathCost; ///<Contribution of the path through this port (8.5.5.3)
227  StpBridgeId designatedRoot; ///<Unique identifier of the bridge recorded as the Root (8.5.5.4)
228  uint32_t designatedCost; ///<Designated cost (8.5.5.5)
229  StpBridgeId designatedBridge; ///<Designated bridge (8.5.5.6)
230  uint16_t designatedPort; ///<Designated port (8.5.5.7)
231  bool_t topologyChangeAck; ///<Topology Change Acknowledgment flag (8.5.5.8)
232  bool_t configPending; ///<A Configuration BPDU should be transmitted on expiry of the Hold Timer (8.5.5.9)
233  bool_t changeDetectionEnabled; ///<Detection of topology changes is enabled for the associated port(8.5.5.10)
234 
235  StpTimer messageAgeTimer; ///<Message age timer (8.5.6.1)
236  StpTimer forwardDelayTimer; ///<Forward delay timer (8.5.6.2)
237  StpTimer holdTimer; ///<Hold timer (8.5.6.3)
238 };
239 
240 
241 /**
242  * @brief STP bridge settings
243  **/
244 
245 typedef struct
246 {
247  NetInterface *interface; ///<Underlying network interface
248  uint_t numPorts; ///<Number of ports
249  StpBridgePort *ports; ///<Bridge's ports
251 
252 
253 /**
254  * @brief STP bridge context
255  **/
256 
258 {
259  NetInterface *interface; ///<Underlying network interface
260  uint_t numPorts; ///<Number of ports
261  StpBridgePort *ports; ///<Bridge's ports
262  bool_t running; ///<STP bridge operation state
263 
264  StpBridgeId designatedRoot; ///<Unique identifier of the bridge assumed to be the Root (8.5.3.1)
265  uint32_t rootPathCost; ///<Cost of the path to the Root from this bridge (8.5.3.2)
266  uint16_t rootPort; ///<Port identifier of the port that offers the lowest cost path to the Root (8.5.3.3)
267  uint_t maxAge; ///<Maximum age of received protocol information before it is discarded (8.5.3.4)
268  uint_t helloTime; ///<Time interval between the transmission of Configuration BPDUs (8.5.3.5)
269  uint_t forwardDelay; ///<Time spent in the Listening/Learning state before moving to the Learning/Forwarding state (8.5.3.6)
270  StpBridgeId bridgeId; ///<Unique identifier assigned to the bridge (8.5.3.7)
271  uint_t bridgeMaxAge; ///<Value of the Max Age parameter when the bridge is the Root (8.5.3.8)
272  uint_t bridgeHelloTime; ///<Value of the Hello Time parameter when the bridge is the Root (8.5.3.9)
273  uint_t bridgeForwardDelay; ///<Value of the Forward Delay parameter when the bridge is the Root (8.5.3.10)
274  bool_t topologyChangeDetected; ///<A topology change has been detected by or notified to the bridge (8.5.3.11)
275  bool_t topologyChange; ///<Boolean (8.5.3.12)
276  uint_t topologyChangeTime; ///<Time period for which Configuration messages indicate topology change (8.5.3.13)
277  uint_t holdTime; ///<Minimum time period between transmission of Configuration BPDUs (8.5.3.14)
278 
279  StpTimer helloTimer; ///<Hello timer (8.5.4.1)
280  StpTimer tcnTimer; ///<Topology change notification timer (8.5.4.2)
281  StpTimer topologyChangeTimer; ///<Topology change timer (8.5.4.3)
282 
283  uint_t ageingTime; ///<Ageing time for filtering database entries (7.9.2)
284  StpTimer rapidAgeingTimer; ///<Rapid ageing timer
285 
286  uint_t timeSinceTopologyChange; ///<Time since the last topology change
287  uint_t topologyChangeCount; ///<Number of topology changes
288 };
289 
290 
291 //STP related functions
294 
297 
303 
313 error_t stpGetRootPathCost(StpBridgeContext *context, uint32_t *value);
314 error_t stpGetRootPort(StpBridgeContext *context, uint16_t *value);
319 
321  uint_t *value);
322 
323 error_t stpSetPortNum(StpBridgeContext *context, uint_t portIndex,
324  uint16_t value);
325 
326 error_t stpSetPortAddr(StpBridgeContext *context, uint_t portIndex,
327  const MacAddr *value);
328 
330  uint8_t value);
331 
333  bool_t value);
334 
336  uint32_t value);
337 
338 error_t stpGetPortNum(StpBridgeContext *context, uint_t portIndex,
339  uint16_t *value);
340 
341 error_t stpGetPortAddr(StpBridgeContext *context, uint_t portIndex,
342  MacAddr *value);
343 
345  uint8_t *value);
346 
348  bool_t *value);
349 
351  bool_t *value);
352 
354  uint32_t *value);
355 
356 error_t stpGetPortState(StpBridgeContext *context, uint_t portIndex,
358 
359 error_t stpGetPortRole(StpBridgeContext *context, uint_t portIndex,
360  StpPortRole *value);
361 
363  StpBridgeId *value);
364 
366  uint32_t *value);
367 
369  uint_t portIndex, StpBridgeId *value);
370 
372  uint16_t *value);
373 
375  uint_t *value);
376 
377 void stpDeinit(StpBridgeContext *context);
378 
379 //C++ guard
380 #ifdef __cplusplus
381 }
382 #endif
383 
384 #endif
StpTimer messageAgeTimer
Message age timer (8.5.6.1)
Definition: stp.h:235
NetInterface * interface
Underlying network interface.
Definition: stp.h:247
uint_t topologyChangeCount
Number of topology changes.
Definition: stp.h:287
int bool_t
Definition: compiler_port.h:53
error_t stpGetPortNum(StpBridgeContext *context, uint_t portIndex, uint16_t *value)
Get the port number assigned to the port.
Definition: stp.c:1193
error_t stpStart(StpBridgeContext *context)
Start STP bridge operation.
Definition: stp.c:157
error_t stpGetRootPathCost(StpBridgeContext *context, uint32_t *value)
Get the current cost of the path to the root.
Definition: stp.c:753
uint_t numPorts
Number of ports.
Definition: stp.h:248
error_t stpGetPortDesignatedCost(StpBridgeContext *context, uint_t portIndex, uint32_t *value)
Get the designated cost of the port.
Definition: stp.c:1513
error_t stpGetRootPort(StpBridgeContext *context, uint16_t *value)
Get the current root port.
Definition: stp.c:785
error_t stpGetBridgeForwardDelay(StpBridgeContext *context, uint_t *value)
Get the assigned value of the Bridge Forward Delay parameter.
Definition: stp.c:625
error_t stpSetBridgeMaxAge(StpBridgeContext *context, uint_t value)
Set Bridge Max Age parameter.
Definition: stp.c:337
uint16_t designatedPort
Designated port (8.5.5.7)
Definition: stp.h:230
MacAddr macAddr
MAC address of the port.
Definition: stp.h:219
error_t stpGetBridgePriority(StpBridgeContext *context, uint16_t *value)
Get the assigned bridge priority.
Definition: stp.c:529
bool_t topologyChangeAck
Topology Change Acknowledgment flag (8.5.5.8)
Definition: stp.h:231
bool_t topologyChangeDetected
A topology change has been detected by or notified to the bridge (8.5.3.11)
Definition: stp.h:274
StpTimer rapidAgeingTimer
Rapid ageing timer.
Definition: stp.h:284
error_t stpGetAgeingTime(StpBridgeContext *context, uint_t *value)
Get the assigned value of the Ageing Time parameter.
Definition: stp.c:689
STP timer.
Definition: stp.h:204
error_t stpGetBridgeHelloTime(StpBridgeContext *context, uint_t *value)
Get the assigned value of the Bridge Hello Time parameter.
Definition: stp.c:593
StpBridgeId designatedRoot
Unique identifier of the bridge recorded as the Root (8.5.5.4)
Definition: stp.h:227
error_t stpGetPortAddr(StpBridgeContext *context, uint_t portIndex, MacAddr *value)
Get the MAC address assigned to the port.
Definition: stp.c:1241
bool_t macOperState
The MAC entity is in a functioning state.
Definition: stp.h:221
#define StpBridgePort
Definition: stp.h:40
STP bridge context.
Definition: stp.h:258
error_t stpGetTimeSinceTopologyChange(StpBridgeContext *context, uint_t *value)
Get the time since a topology change was last detected.
Definition: stp.c:945
STP common definitions.
StpBridgePort * ports
Bridge's ports.
Definition: stp.h:249
error_t stpGetMaxAge(StpBridgeContext *context, uint_t *value)
Get the current Max Age value.
Definition: stp.c:817
#define StpBridgeContext
Definition: stp.h:36
error_t stpSetPortPathCost(StpBridgeContext *context, uint_t portIndex, uint32_t value)
Set administrative port path cost.
Definition: stp.c:1159
error_t stpSetBridgeForwardDelay(StpBridgeContext *context, uint_t value)
Set Bridge Forward Delay parameter.
Definition: stp.c:401
uint_t value
Definition: stp.h:206
uint16_t rootPort
Port identifier of the port that offers the lowest cost path to the Root (8.5.3.3)
Definition: stp.h:266
uint_t maxAge
Maximum age of received protocol information before it is discarded (8.5.3.4)
Definition: stp.h:267
error_t stpGetPortDesignatedPort(StpBridgeContext *context, uint_t portIndex, uint16_t *value)
Get the port identifier of the designated bridge.
Definition: stp.c:1581
error_t stpInit(StpBridgeContext *context, StpBridgeSettings *settings)
Initialize STP bridge context.
Definition: stp.c:70
error_t stpSetAdminPortState(StpBridgeContext *context, uint_t portIndex, bool_t value)
Set administrative bridge port state.
Definition: stp.c:1125
error_t
Error codes.
Definition: error.h:43
StpPortRole
Port role values.
Definition: stp_common.h:123
NetInterface * interface
Underlying network interface.
Definition: stp.h:259
StpTimer topologyChangeTimer
Topology change timer (8.5.4.3)
Definition: stp.h:281
uint8_t portIndex
Port index.
Definition: stp.h:218
uint_t forwardTransitions
Number of times the port has transitioned to Forwarding state.
Definition: stp.h:222
bool_t running
STP bridge operation state.
Definition: stp.h:262
uint_t timeSinceTopologyChange
Time since the last topology change.
Definition: stp.h:286
#define NetInterface
Definition: net.h:36
bool_t active
Definition: stp.h:205
uint_t bridgeHelloTime
Value of the Hello Time parameter when the bridge is the Root (8.5.3.9)
Definition: stp.h:272
StpTimer forwardDelayTimer
Forward delay timer (8.5.6.2)
Definition: stp.h:236
error_t stpGetDesignatedRoot(StpBridgeContext *context, StpBridgeId *value)
Get the bridge identifier of the root of the spanning tree.
Definition: stp.c:721
error_t stpGetAdminPortState(StpBridgeContext *context, uint_t portIndex, bool_t *value)
Get the administrative port state.
Definition: stp.c:1309
error_t stpGetForwardDelay(StpBridgeContext *context, uint_t *value)
Get the current Forward Delay value.
Definition: stp.c:881
error_t stpGetForwardTransitions(StpBridgeContext *context, uint_t portIndex, uint_t *value)
Get the number of times the port has transitioned to Forwarding state.
Definition: stp.c:1615
Bridge port.
Definition: stp.h:215
StpBridgeId designatedBridge
Designated bridge (8.5.5.6)
Definition: stp.h:229
error_t stpGetHoldTime(StpBridgeContext *context, uint_t *value)
Get the assigned value of the Hold Time parameter.
Definition: stp.c:657
void stpGetDefaultSettings(StpBridgeSettings *settings)
Initialize settings with default values.
Definition: stp.c:51
MacAddr
Definition: ethernet.h:195
StpTimer holdTimer
Hold timer (8.5.6.3)
Definition: stp.h:237
StpBridgeId designatedRoot
Unique identifier of the bridge assumed to be the Root (8.5.3.1)
Definition: stp.h:264
void stpDeinit(StpBridgeContext *context)
Release STP bridge context.
Definition: stp.c:1646
BPDU processing.
error_t stpSetBridgeHelloTime(StpBridgeContext *context, uint_t value)
Set Bridge Hello Time parameter.
Definition: stp.c:369
STP bridge settings.
Definition: stp.h:246
StpBridgePort * ports
Bridge's ports.
Definition: stp.h:261
error_t stpGetPortPathCost(StpBridgeContext *context, uint_t portIndex, uint32_t *value)
Get the current value of the port path cost.
Definition: stp.c:1377
uint_t numPorts
Number of ports.
Definition: stp.h:260
bool_t changeDetectionEnabled
Detection of topology changes is enabled for the associated port(8.5.5.10)
Definition: stp.h:233
error_t stpSetPortPriority(StpBridgeContext *context, uint_t portIndex, uint8_t value)
Set port priority.
Definition: stp.c:1091
error_t stpGetNumPorts(StpBridgeContext *context, uint_t *value)
Get the number of ports.
Definition: stp.c:465
uint16_t portId
Port identifier (8.5.5.1)
Definition: stp.h:224
error_t stpGetBridgeAddr(StpBridgeContext *context, MacAddr *value)
Get the MAC address assigned to the bridge.
Definition: stp.c:497
StpPortState state
Current state of the port (8.5.5.2)
Definition: stp.h:225
StpBridgeId
Definition: stp_common.h:148
error_t stpGetPortDesignatedBridge(StpBridgeContext *context, uint_t portIndex, StpBridgeId *value)
Get the bridge identifier of the designated bridge.
Definition: stp.c:1547
error_t stpSetPortAddr(StpBridgeContext *context, uint_t portIndex, const MacAddr *value)
Set port address.
Definition: stp.c:1040
uint8_t value[]
Definition: tcp.h:369
uint_t helloTime
Time interval between the transmission of Configuration BPDUs (8.5.3.5)
Definition: stp.h:268
error_t stpStop(StpBridgeContext *context)
Stop STP bridge operation.
Definition: stp.c:245
error_t stpGetPortState(StpBridgeContext *context, uint_t portIndex, StpPortState *value)
Get the current state of the port.
Definition: stp.c:1411
error_t stpGetTopologyChanges(StpBridgeContext *context, uint_t *value)
Get the number of topology changes.
Definition: stp.c:913
StpTimer tcnTimer
Topology change notification timer (8.5.4.2)
Definition: stp.h:280
StpPortState
Port states.
Definition: stp_common.h:108
uint_t topologyChangeTime
Time period for which Configuration messages indicate topology change (8.5.3.13)
Definition: stp.h:276
uint_t bridgeForwardDelay
Value of the Forward Delay parameter when the bridge is the Root (8.5.3.10)
Definition: stp.h:273
error_t stpGetPortDesignatedRoot(StpBridgeContext *context, uint_t portIndex, StpBridgeId *value)
Get the bridge identifier of the designated root bridge.
Definition: stp.c:1479
uint32_t rootPathCost
Cost of the path to the Root from this bridge (8.5.3.2)
Definition: stp.h:265
error_t stpSetBridgePriority(StpBridgeContext *context, uint16_t value)
Set bridge priority.
Definition: stp.c:305
bool_t configPending
A Configuration BPDU should be transmitted on expiry of the Hold Timer (8.5.5.9)
Definition: stp.h:232
uint32_t pathCost
Contribution of the path through this port (8.5.5.3)
Definition: stp.h:226
error_t stpGetHelloTime(StpBridgeContext *context, uint_t *value)
Get the current Hello Time value.
Definition: stp.c:849
error_t stpSetAgeingTime(StpBridgeContext *context, uint_t value)
Set Ageing Time parameter.
Definition: stp.c:433
unsigned int uint_t
Definition: compiler_port.h:50
error_t stpGetBridgeMaxAge(StpBridgeContext *context, uint_t *value)
Get the assigned value of the Bridge Max Age parameter.
Definition: stp.c:561
StpBridgeId bridgeId
Unique identifier assigned to the bridge (8.5.3.7)
Definition: stp.h:270
error_t stpGetPortPriority(StpBridgeContext *context, uint_t portIndex, uint8_t *value)
Get the priority assigned to the port.
Definition: stp.c:1275
error_t stpGetMacOperState(StpBridgeContext *context, uint_t portIndex, bool_t *value)
Get the current MAC operational state.
Definition: stp.c:1343
uint32_t designatedCost
Designated cost (8.5.5.5)
Definition: stp.h:228
uint_t bridgeMaxAge
Value of the Max Age parameter when the bridge is the Root (8.5.3.8)
Definition: stp.h:271
uint_t forwardDelay
Time spent in the Listening/Learning state before moving to the Learning/Forwarding state (8....
Definition: stp.h:269
StpTimer helloTimer
Hello timer (8.5.4.1)
Definition: stp.h:279
bool_t topologyChange
Boolean (8.5.3.12)
Definition: stp.h:275
uint_t ageingTime
Ageing time for filtering database entries (7.9.2)
Definition: stp.h:283
StpBridgeContext * context
STP bridge context.
Definition: stp.h:216
uint_t holdTime
Minimum time period between transmission of Configuration BPDUs (8.5.3.14)
Definition: stp.h:277
error_t stpSetPortNum(StpBridgeContext *context, uint_t portIndex, uint16_t value)
Set port number.
Definition: stp.c:979
error_t stpGetPortRole(StpBridgeContext *context, uint_t portIndex, StpPortRole *value)
Get the assigned role of the port.
Definition: stp.c:1445