STP (Spanning Tree Protocol) More...
Go to the source code of this file.
Data Structures | |
| struct | StpTimer |
| STP timer. More... | |
| struct | _StpBridgePort |
| Bridge port. More... | |
| struct | StpBridgeSettings |
| STP bridge settings. More... | |
| struct | _StpBridgeContext |
| STP bridge context. More... | |
Macros | |
| #define | StpBridgeContext struct _StpBridgeContext |
| #define | StpBridgePort struct _StpBridgePort |
| #define | STP_SUPPORT DISABLED |
| #define | STP_TICK_INTERVAL 1000 |
| #define | STP_DEFAULT_BRIDGE_PRIORITY 32768 |
| #define | STP_DEFAULT_PORT_PRIORITY 128 |
| #define | STP_MESSAGE_AGE_INCREMENT 1 |
| #define | STP_MIN_BRIDGE_MAX_AGE 6 |
| #define | STP_DEFAULT_BRIDGE_MAX_AGE 20 |
| #define | STP_MAX_BRIDGE_MAX_AGE 40 |
| #define | STP_MIN_BRIDGE_HELLO_TIME 1 |
| #define | STP_DEFAULT_BRIDGE_HELLO_TIME 2 |
| #define | STP_MAX_BRIDGE_HELLO_TIME 10 |
| #define | STP_MIN_BRIDGE_FORWARD_DELAY 4 |
| #define | STP_DEFAULT_BRIDGE_FORWARD_DELAY 15 |
| #define | STP_MAX_BRIDGE_FORWARD_DELAY 30 |
| #define | STP_DEFAULT_HOLD_TIME 1 |
| #define | STP_MIN_AGEING_TIME 10 |
| #define | STP_DEFAULT_AGEING_TIME 300 |
| #define | STP_MAX_AGEING_TIME 1000000 |
| #define | STP_MIN_PORT_PATH_COST 1 |
| #define | STP_DEFAULT_PORT_PATH_COST 200000 |
| #define | STP_MAX_PORT_PATH_COST 200000000 |
Functions | |
| void | stpGetDefaultSettings (StpBridgeSettings *settings) |
| Initialize settings with default values. More... | |
| error_t | stpInit (StpBridgeContext *context, StpBridgeSettings *settings) |
| Initialize STP bridge context. More... | |
| error_t | stpStart (StpBridgeContext *context) |
| Start STP bridge operation. More... | |
| error_t | stpStop (StpBridgeContext *context) |
| Stop STP bridge operation. More... | |
| error_t | stpSetBridgePriority (StpBridgeContext *context, uint16_t value) |
| Set bridge priority. More... | |
| error_t | stpSetBridgeMaxAge (StpBridgeContext *context, uint_t value) |
| Set Bridge Max Age parameter. More... | |
| error_t | stpSetBridgeHelloTime (StpBridgeContext *context, uint_t value) |
| Set Bridge Hello Time parameter. More... | |
| error_t | stpSetBridgeForwardDelay (StpBridgeContext *context, uint_t value) |
| Set Bridge Forward Delay parameter. More... | |
| error_t | stpSetAgeingTime (StpBridgeContext *context, uint_t value) |
| Set Ageing Time parameter. More... | |
| error_t | stpGetNumPorts (StpBridgeContext *context, uint_t *value) |
| Get the number of ports. More... | |
| error_t | stpGetBridgeAddr (StpBridgeContext *context, MacAddr *value) |
| Get the MAC address assigned to the bridge. More... | |
| error_t | stpGetBridgePriority (StpBridgeContext *context, uint16_t *value) |
| Get the assigned bridge priority. More... | |
| error_t | stpGetBridgeMaxAge (StpBridgeContext *context, uint_t *value) |
| Get the assigned value of the Bridge Max Age parameter. More... | |
| error_t | stpGetBridgeHelloTime (StpBridgeContext *context, uint_t *value) |
| Get the assigned value of the Bridge Hello Time parameter. More... | |
| error_t | stpGetBridgeForwardDelay (StpBridgeContext *context, uint_t *value) |
| Get the assigned value of the Bridge Forward Delay parameter. More... | |
| error_t | stpGetHoldTime (StpBridgeContext *context, uint_t *value) |
| Get the assigned value of the Hold Time parameter. More... | |
| error_t | stpGetAgeingTime (StpBridgeContext *context, uint_t *value) |
| Get the assigned value of the Ageing Time parameter. More... | |
| error_t | stpGetDesignatedRoot (StpBridgeContext *context, StpBridgeId *value) |
| Get the bridge identifier of the root of the spanning tree. More... | |
| error_t | stpGetRootPathCost (StpBridgeContext *context, uint32_t *value) |
| Get the current cost of the path to the root. More... | |
| error_t | stpGetRootPort (StpBridgeContext *context, uint16_t *value) |
| Get the current root port. More... | |
| error_t | stpGetMaxAge (StpBridgeContext *context, uint_t *value) |
| Get the current Max Age value. More... | |
| error_t | stpGetHelloTime (StpBridgeContext *context, uint_t *value) |
| Get the current Hello Time value. More... | |
| error_t | stpGetForwardDelay (StpBridgeContext *context, uint_t *value) |
| Get the current Forward Delay value. More... | |
| error_t | stpGetTopologyChanges (StpBridgeContext *context, uint_t *value) |
| Get the number of topology changes. More... | |
| error_t | stpGetTimeSinceTopologyChange (StpBridgeContext *context, uint_t *value) |
| Get the time since a topology change was last detected. More... | |
| error_t | stpSetPortNum (StpBridgeContext *context, uint_t portIndex, uint16_t value) |
| Set port number. More... | |
| error_t | stpSetPortAddr (StpBridgeContext *context, uint_t portIndex, const MacAddr *value) |
| Set port address. More... | |
| error_t | stpSetPortPriority (StpBridgeContext *context, uint_t portIndex, uint8_t value) |
| Set port priority. More... | |
| error_t | stpSetAdminPortState (StpBridgeContext *context, uint_t portIndex, bool_t value) |
| Set administrative bridge port state. More... | |
| error_t | stpSetPortPathCost (StpBridgeContext *context, uint_t portIndex, uint32_t value) |
| Set administrative port path cost. More... | |
| error_t | stpGetPortNum (StpBridgeContext *context, uint_t portIndex, uint16_t *value) |
| Get the port number assigned to the port. More... | |
| error_t | stpGetPortAddr (StpBridgeContext *context, uint_t portIndex, MacAddr *value) |
| Get the MAC address assigned to the port. More... | |
| error_t | stpGetPortPriority (StpBridgeContext *context, uint_t portIndex, uint8_t *value) |
| Get the priority assigned to the port. More... | |
| error_t | stpGetAdminPortState (StpBridgeContext *context, uint_t portIndex, bool_t *value) |
| Get the administrative port state. More... | |
| error_t | stpGetMacOperState (StpBridgeContext *context, uint_t portIndex, bool_t *value) |
| Get the current MAC operational state. More... | |
| error_t | stpGetPortPathCost (StpBridgeContext *context, uint_t portIndex, uint32_t *value) |
| Get the current value of the port path cost. More... | |
| error_t | stpGetPortState (StpBridgeContext *context, uint_t portIndex, StpPortState *value) |
| Get the current state of the port. More... | |
| error_t | stpGetPortRole (StpBridgeContext *context, uint_t portIndex, StpPortRole *value) |
| Get the assigned role of the port. More... | |
| error_t | stpGetPortDesignatedRoot (StpBridgeContext *context, uint_t portIndex, StpBridgeId *value) |
| Get the bridge identifier of the designated root bridge. More... | |
| error_t | stpGetPortDesignatedCost (StpBridgeContext *context, uint_t portIndex, uint32_t *value) |
| Get the designated cost of the port. More... | |
| error_t | stpGetPortDesignatedBridge (StpBridgeContext *context, uint_t portIndex, StpBridgeId *value) |
| Get the bridge identifier of the designated bridge. More... | |
| error_t | stpGetPortDesignatedPort (StpBridgeContext *context, uint_t portIndex, uint16_t *value) |
| Get the port identifier of the designated bridge. More... | |
| error_t | stpGetForwardTransitions (StpBridgeContext *context, uint_t portIndex, uint_t *value) |
| Get the number of times the port has transitioned to Forwarding state. More... | |
| void | stpDeinit (StpBridgeContext *context) |
| Release STP bridge context. More... | |
Detailed Description
STP (Spanning Tree Protocol)
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2019-2025 Oryx Embedded SARL. All rights reserved.
This file is part of CycloneSTP Open.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- Version
- 2.5.4
Definition in file stp.h.
Macro Definition Documentation
◆ STP_DEFAULT_AGEING_TIME
◆ STP_DEFAULT_BRIDGE_FORWARD_DELAY
◆ STP_DEFAULT_BRIDGE_HELLO_TIME
◆ STP_DEFAULT_BRIDGE_MAX_AGE
◆ STP_DEFAULT_BRIDGE_PRIORITY
◆ STP_DEFAULT_HOLD_TIME
◆ STP_DEFAULT_PORT_PATH_COST
◆ STP_DEFAULT_PORT_PRIORITY
◆ STP_MAX_AGEING_TIME
◆ STP_MAX_BRIDGE_FORWARD_DELAY
◆ STP_MAX_BRIDGE_HELLO_TIME
◆ STP_MAX_BRIDGE_MAX_AGE
◆ STP_MAX_PORT_PATH_COST
◆ STP_MESSAGE_AGE_INCREMENT
◆ STP_MIN_AGEING_TIME
◆ STP_MIN_BRIDGE_FORWARD_DELAY
◆ STP_MIN_BRIDGE_HELLO_TIME
◆ STP_MIN_BRIDGE_MAX_AGE
◆ STP_MIN_PORT_PATH_COST
◆ STP_SUPPORT
◆ STP_TICK_INTERVAL
◆ StpBridgeContext
| #define StpBridgeContext struct _StpBridgeContext |
◆ StpBridgePort
| #define StpBridgePort struct _StpBridgePort |
Function Documentation
◆ stpDeinit()
| void stpDeinit | ( | StpBridgeContext * | context | ) |
◆ stpGetAdminPortState()
| error_t stpGetAdminPortState | ( | StpBridgeContext * | context, |
| uint_t | portIndex, | ||
| bool_t * | value | ||
| ) |
◆ stpGetAgeingTime()
| error_t stpGetAgeingTime | ( | StpBridgeContext * | context, |
| uint_t * | value | ||
| ) |
◆ stpGetBridgeAddr()
| error_t stpGetBridgeAddr | ( | StpBridgeContext * | context, |
| MacAddr * | value | ||
| ) |
◆ stpGetBridgeForwardDelay()
| error_t stpGetBridgeForwardDelay | ( | StpBridgeContext * | context, |
| uint_t * | value | ||
| ) |
◆ stpGetBridgeHelloTime()
| error_t stpGetBridgeHelloTime | ( | StpBridgeContext * | context, |
| uint_t * | value | ||
| ) |
◆ stpGetBridgeMaxAge()
| error_t stpGetBridgeMaxAge | ( | StpBridgeContext * | context, |
| uint_t * | value | ||
| ) |
◆ stpGetBridgePriority()
| error_t stpGetBridgePriority | ( | StpBridgeContext * | context, |
| uint16_t * | value | ||
| ) |
◆ stpGetDefaultSettings()
| void stpGetDefaultSettings | ( | StpBridgeSettings * | settings | ) |
◆ stpGetDesignatedRoot()
| error_t stpGetDesignatedRoot | ( | StpBridgeContext * | context, |
| StpBridgeId * | value | ||
| ) |
◆ stpGetForwardDelay()
| error_t stpGetForwardDelay | ( | StpBridgeContext * | context, |
| uint_t * | value | ||
| ) |
◆ stpGetForwardTransitions()
| error_t stpGetForwardTransitions | ( | StpBridgeContext * | context, |
| uint_t | portIndex, | ||
| uint_t * | value | ||
| ) |
◆ stpGetHelloTime()
| error_t stpGetHelloTime | ( | StpBridgeContext * | context, |
| uint_t * | value | ||
| ) |
◆ stpGetHoldTime()
| error_t stpGetHoldTime | ( | StpBridgeContext * | context, |
| uint_t * | value | ||
| ) |
◆ stpGetMacOperState()
| error_t stpGetMacOperState | ( | StpBridgeContext * | context, |
| uint_t | portIndex, | ||
| bool_t * | value | ||
| ) |
◆ stpGetMaxAge()
| error_t stpGetMaxAge | ( | StpBridgeContext * | context, |
| uint_t * | value | ||
| ) |
◆ stpGetNumPorts()
| error_t stpGetNumPorts | ( | StpBridgeContext * | context, |
| uint_t * | value | ||
| ) |
◆ stpGetPortAddr()
| error_t stpGetPortAddr | ( | StpBridgeContext * | context, |
| uint_t | portIndex, | ||
| MacAddr * | value | ||
| ) |
◆ stpGetPortDesignatedBridge()
| error_t stpGetPortDesignatedBridge | ( | StpBridgeContext * | context, |
| uint_t | portIndex, | ||
| StpBridgeId * | value | ||
| ) |
◆ stpGetPortDesignatedCost()
| error_t stpGetPortDesignatedCost | ( | StpBridgeContext * | context, |
| uint_t | portIndex, | ||
| uint32_t * | value | ||
| ) |
◆ stpGetPortDesignatedPort()
| error_t stpGetPortDesignatedPort | ( | StpBridgeContext * | context, |
| uint_t | portIndex, | ||
| uint16_t * | value | ||
| ) |
◆ stpGetPortDesignatedRoot()
| error_t stpGetPortDesignatedRoot | ( | StpBridgeContext * | context, |
| uint_t | portIndex, | ||
| StpBridgeId * | value | ||
| ) |
◆ stpGetPortNum()
| error_t stpGetPortNum | ( | StpBridgeContext * | context, |
| uint_t | portIndex, | ||
| uint16_t * | value | ||
| ) |
◆ stpGetPortPathCost()
| error_t stpGetPortPathCost | ( | StpBridgeContext * | context, |
| uint_t | portIndex, | ||
| uint32_t * | value | ||
| ) |
◆ stpGetPortPriority()
| error_t stpGetPortPriority | ( | StpBridgeContext * | context, |
| uint_t | portIndex, | ||
| uint8_t * | value | ||
| ) |
◆ stpGetPortRole()
| error_t stpGetPortRole | ( | StpBridgeContext * | context, |
| uint_t | portIndex, | ||
| StpPortRole * | value | ||
| ) |
◆ stpGetPortState()
| error_t stpGetPortState | ( | StpBridgeContext * | context, |
| uint_t | portIndex, | ||
| StpPortState * | value | ||
| ) |
◆ stpGetRootPathCost()
| error_t stpGetRootPathCost | ( | StpBridgeContext * | context, |
| uint32_t * | value | ||
| ) |
◆ stpGetRootPort()
| error_t stpGetRootPort | ( | StpBridgeContext * | context, |
| uint16_t * | value | ||
| ) |
◆ stpGetTimeSinceTopologyChange()
| error_t stpGetTimeSinceTopologyChange | ( | StpBridgeContext * | context, |
| uint_t * | value | ||
| ) |
◆ stpGetTopologyChanges()
| error_t stpGetTopologyChanges | ( | StpBridgeContext * | context, |
| uint_t * | value | ||
| ) |
◆ stpInit()
| error_t stpInit | ( | StpBridgeContext * | context, |
| StpBridgeSettings * | settings | ||
| ) |
◆ stpSetAdminPortState()
| error_t stpSetAdminPortState | ( | StpBridgeContext * | context, |
| uint_t | portIndex, | ||
| bool_t | value | ||
| ) |
◆ stpSetAgeingTime()
| error_t stpSetAgeingTime | ( | StpBridgeContext * | context, |
| uint_t | value | ||
| ) |
◆ stpSetBridgeForwardDelay()
| error_t stpSetBridgeForwardDelay | ( | StpBridgeContext * | context, |
| uint_t | value | ||
| ) |
◆ stpSetBridgeHelloTime()
| error_t stpSetBridgeHelloTime | ( | StpBridgeContext * | context, |
| uint_t | value | ||
| ) |
◆ stpSetBridgeMaxAge()
| error_t stpSetBridgeMaxAge | ( | StpBridgeContext * | context, |
| uint_t | value | ||
| ) |
◆ stpSetBridgePriority()
| error_t stpSetBridgePriority | ( | StpBridgeContext * | context, |
| uint16_t | value | ||
| ) |
◆ stpSetPortAddr()
| error_t stpSetPortAddr | ( | StpBridgeContext * | context, |
| uint_t | portIndex, | ||
| const MacAddr * | value | ||
| ) |
◆ stpSetPortNum()
| error_t stpSetPortNum | ( | StpBridgeContext * | context, |
| uint_t | portIndex, | ||
| uint16_t | value | ||
| ) |
◆ stpSetPortPathCost()
| error_t stpSetPortPathCost | ( | StpBridgeContext * | context, |
| uint_t | portIndex, | ||
| uint32_t | value | ||
| ) |
◆ stpSetPortPriority()
| error_t stpSetPortPriority | ( | StpBridgeContext * | context, |
| uint_t | portIndex, | ||
| uint8_t | value | ||
| ) |
◆ stpStart()
| error_t stpStart | ( | StpBridgeContext * | context | ) |
◆ stpStop()
| error_t stpStop | ( | StpBridgeContext * | context | ) |
