rstp_mgmt.h
Go to the documentation of this file.
1 /**
2  * @file rstp_mgmt.h
3  * @brief Management of the RSTP bridge
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.0
29  **/
30 
31 #ifndef _RSTP_MGMT_H
32 #define _RSTP_MGMT_H
33 
34 //Dependencies
35 #include "rstp/rstp.h"
36 
37 //C++ guard
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
42 //RSTP related functions
44  bool_t commit);
45 
47  bool_t commit);
48 
50  bool_t commit);
51 
53  bool_t commit);
54 
56  bool_t commit);
57 
59  bool_t commit);
60 
62  bool_t commit);
63 
80 
82  uint_t *value);
83 
85  uint8_t value, bool_t commit);
86 
88  bool_t value, bool_t commit);
89 
91  uint32_t value, bool_t commit);
92 
94  uint_t portIndex, RstpAdminPointToPointMac value, bool_t commit);
95 
97  bool_t value, bool_t commit);
98 
100  bool_t value, bool_t commit);
101 
103  bool_t value, bool_t commit);
104 
106  MacAddr *value);
107 
109  uint8_t *value);
110 
112  bool_t *value);
113 
115  bool_t *value);
116 
118  uint_t portIndex, uint32_t *value);
119 
121  uint32_t *value);
122 
125 
127  uint_t portIndex, bool_t *value);
128 
130  bool_t *value);
131 
133  bool_t *value);
134 
136  bool_t *value);
137 
140 
142  StpPortRole *value);
143 
145  uint_t portIndex, StpBridgeId *value);
146 
148  uint_t portIndex, uint32_t *value);
149 
151  uint_t portIndex, StpBridgeId *value);
152 
154  uint_t portIndex, uint16_t *value);
155 
157  uint_t portIndex, uint_t *value);
158 
159 //C++ guard
160 #ifdef __cplusplus
161 }
162 #endif
163 
164 #endif
unsigned int uint_t
Definition: compiler_port.h:50
int bool_t
Definition: compiler_port.h:53
error_t
Error codes.
Definition: error.h:43
MacAddr
Definition: ethernet.h:195
RSTP (Rapid Spanning Tree Protocol)
RstpAdminPointToPointMac
Administrative state of the point-to-point status.
Definition: rstp.h:255
#define RstpBridgeContext
Definition: rstp.h:36
error_t rstpMgmtSetProtocolMigration(RstpBridgeContext *context, uint_t portIndex, bool_t value, bool_t commit)
Force protocol migration.
Definition: rstp_mgmt.c:1127
error_t rstpMgmtGetMaxAge(RstpBridgeContext *context, uint_t *value)
Get the current Max Age value.
Definition: rstp_mgmt.c:690
error_t rstpMgmtGetRootPort(RstpBridgeContext *context, uint16_t *value)
Get the current root port.
Definition: rstp_mgmt.c:668
error_t rstpMgmtSetBridgeForwardDelay(RstpBridgeContext *context, uint_t value, bool_t commit)
Set Bridge Forward Delay parameter.
Definition: rstp_mgmt.c:276
error_t rstpMgmtGetNumPorts(RstpBridgeContext *context, uint_t *value)
Get the number of ports.
Definition: rstp_mgmt.c:435
error_t rstpMgmtGetAgeingTime(RstpBridgeContext *context, uint_t *value)
Get the assigned value of the Ageing Time parameter.
Definition: rstp_mgmt.c:604
error_t rstpMgmtSetAgeingTime(RstpBridgeContext *context, uint_t value, bool_t commit)
Set Ageing Time parameter.
Definition: rstp_mgmt.c:391
error_t rstpMgmtGetBridgeMaxAge(RstpBridgeContext *context, uint_t *value)
Get the assigned value of the Bridge Max Age parameter.
Definition: rstp_mgmt.c:520
error_t rstpMgmtGetAdminPointToPointMac(RstpBridgeContext *context, uint_t portIndex, RstpAdminPointToPointMac *value)
Get the administrative point-to-point status of the LAN segment.
Definition: rstp_mgmt.c:1374
error_t rstpMgmtSetAdminEdgePort(RstpBridgeContext *context, uint_t portIndex, bool_t value, bool_t commit)
Set administrative value of the Edge Port parameter.
Definition: rstp_mgmt.c:1029
error_t rstpMgmtGetPortPriority(RstpBridgeContext *context, uint_t portIndex, uint8_t *value)
Get the priority assigned to the port.
Definition: rstp_mgmt.c:1212
error_t rstpMgmtGetBridgeHelloTime(RstpBridgeContext *context, uint_t *value)
Get the assigned value of the Bridge Hello Time parameter.
Definition: rstp_mgmt.c:541
error_t rstpMgmtSetAdminPortState(RstpBridgeContext *context, uint_t portIndex, bool_t value, bool_t commit)
Set administrative bridge port state.
Definition: rstp_mgmt.c:860
error_t rstpMgmtSetAdminPortPathCost(RstpBridgeContext *context, uint_t portIndex, uint32_t value, bool_t commit)
Set administrative port path cost.
Definition: rstp_mgmt.c:910
error_t rstpMgmtGetAdminEdgePort(RstpBridgeContext *context, uint_t portIndex, bool_t *value)
Get the administrative value of the Edge Port parameter.
Definition: rstp_mgmt.c:1440
error_t rstpMgmtSetPortPriority(RstpBridgeContext *context, uint_t portIndex, uint8_t value, bool_t commit)
Set port priority.
Definition: rstp_mgmt.c:804
error_t rstpMgmtGetPortDesignatedCost(RstpBridgeContext *context, uint_t portIndex, uint32_t *value)
Get the designated cost of the port.
Definition: rstp_mgmt.c:1690
error_t rstpMgmtGetMacOperState(RstpBridgeContext *context, uint_t portIndex, bool_t *value)
Get the current MAC operational state.
Definition: rstp_mgmt.c:1276
error_t rstpMgmtSetAdminPointToPointMac(RstpBridgeContext *context, uint_t portIndex, RstpAdminPointToPointMac value, bool_t commit)
Set administrative point-to-point status of the LAN segment.
Definition: rstp_mgmt.c:971
error_t rstpMgmtGetBridgeForwardDelay(RstpBridgeContext *context, uint_t *value)
Get the assigned value of the Bridge Forward Delay parameter.
Definition: rstp_mgmt.c:562
error_t rstpMgmtGetBridgeAddr(RstpBridgeContext *context, MacAddr *value)
Get the MAC address assigned to the bridge.
Definition: rstp_mgmt.c:478
error_t rstpMgmtGetPortPathCost(RstpBridgeContext *context, uint_t portIndex, uint32_t *value)
Get the current value of the port path cost.
Definition: rstp_mgmt.c:1340
error_t rstpMgmtSetBridgeMaxAge(RstpBridgeContext *context, uint_t value, bool_t commit)
Set Bridge Max Age parameter.
Definition: rstp_mgmt.c:156
error_t rstpMgmtGetVersion(RstpBridgeContext *context, uint_t *value)
Get assigned protocol version.
Definition: rstp_mgmt.c:456
error_t rstpMgmtGetTimeSinceTopologyChange(RstpBridgeContext *context, uint_t *value)
Get the time since a topology change was last detected.
Definition: rstp_mgmt.c:778
error_t rstpMgmtGetAdminPortState(RstpBridgeContext *context, uint_t portIndex, bool_t *value)
Get the administrative port state.
Definition: rstp_mgmt.c:1244
error_t rstpMgmtGetPortState(RstpBridgeContext *context, uint_t portIndex, StpPortState *value)
Get the current state of the port.
Definition: rstp_mgmt.c:1536
error_t rstpMgmtGetBridgePriority(RstpBridgeContext *context, uint16_t *value)
Get the assigned bridge priority.
Definition: rstp_mgmt.c:499
error_t rstpMgmtGetTxHoldCount(RstpBridgeContext *context, uint_t *value)
Get the assigned value of the Transmit Hold Count parameter.
Definition: rstp_mgmt.c:583
error_t rstpMgmtSetVersion(RstpBridgeContext *context, uint_t value, bool_t commit)
Set protocol version.
Definition: rstp_mgmt.c:55
error_t rstpMgmtGetPortRole(RstpBridgeContext *context, uint_t portIndex, StpPortRole *value)
Get the assigned role of the port.
Definition: rstp_mgmt.c:1624
error_t rstpMgmtGetHelloTime(RstpBridgeContext *context, uint_t *value)
Get the current Hello Time value.
Definition: rstp_mgmt.c:712
error_t rstpMgmtGetOperEdgePort(RstpBridgeContext *context, uint_t portIndex, bool_t *value)
Get the operational value of the Edge Port parameter.
Definition: rstp_mgmt.c:1504
error_t rstpMgmtGetForwardDelay(RstpBridgeContext *context, uint_t *value)
Get the current Forward Delay value.
Definition: rstp_mgmt.c:735
error_t rstpMgmtGetPortDesignatedRoot(RstpBridgeContext *context, uint_t portIndex, StpBridgeId *value)
Get the bridge identifier of the designated root bridge.
Definition: rstp_mgmt.c:1656
error_t rstpMgmtGetForwardTransitions(RstpBridgeContext *context, uint_t portIndex, uint_t *value)
Get the number of times the port has transitioned to Forwarding state.
Definition: rstp_mgmt.c:1789
error_t rstpMgmtSetAutoEdgePort(RstpBridgeContext *context, uint_t portIndex, bool_t value, bool_t commit)
Set AutoEdgePort parameter.
Definition: rstp_mgmt.c:1079
error_t rstpMgmtGetPortAddr(RstpBridgeContext *context, uint_t portIndex, MacAddr *value)
Get the MAC address assigned to the port.
Definition: rstp_mgmt.c:1180
error_t rstpMgmtGetPortDesignatedPort(RstpBridgeContext *context, uint_t portIndex, uint16_t *value)
Get the port identifier of the designated bridge.
Definition: rstp_mgmt.c:1756
error_t rstpMgmtGetPortDesignatedBridge(RstpBridgeContext *context, uint_t portIndex, StpBridgeId *value)
Get the bridge identifier of the designated bridge.
Definition: rstp_mgmt.c:1723
error_t rstpMgmtSetBridgeHelloTime(RstpBridgeContext *context, uint_t value, bool_t commit)
Set Bridge Hello Time parameter.
Definition: rstp_mgmt.c:216
error_t rstpMgmtSetBridgePriority(RstpBridgeContext *context, uint16_t value, bool_t commit)
Set bridge priority.
Definition: rstp_mgmt.c:96
error_t rstpMgmtGetDesignatedRoot(RstpBridgeContext *context, StpBridgeId *value)
Get the bridge identifier of the root of the spanning tree.
Definition: rstp_mgmt.c:625
error_t rstpMgmtGetAutoEdgePort(RstpBridgeContext *context, uint_t portIndex, bool_t *value)
Get the value of the AutoEdgePort parameter.
Definition: rstp_mgmt.c:1472
error_t rstpMgmtGetAdminPortPathCost(RstpBridgeContext *context, uint_t portIndex, uint32_t *value)
Get the administrative port path cost.
Definition: rstp_mgmt.c:1308
error_t rstpMgmtSetTxHoldCount(RstpBridgeContext *context, uint_t value, bool_t commit)
Set Transmit Hold Count parameter.
Definition: rstp_mgmt.c:339
error_t rstpMgmtGetRootPathCost(RstpBridgeContext *context, uint32_t *value)
Get the current cost of the path to the root.
Definition: rstp_mgmt.c:647
error_t rstpMgmtGetTopologyChanges(RstpBridgeContext *context, uint_t *value)
Get the number of topology changes.
Definition: rstp_mgmt.c:757
error_t rstpMgmtGetOperPointToPointMac(RstpBridgeContext *context, uint_t portIndex, bool_t *value)
Get the operational point-to-point status of the LAN segment.
Definition: rstp_mgmt.c:1408
StpBridgeId
Definition: stp_common.h:148
StpPortRole
Port role values.
Definition: stp_common.h:123
StpPortState
Port states.
Definition: stp_common.h:108
uint8_t value[]
Definition: tcp.h:369