rstp_prt.h
Go to the documentation of this file.
1 /**
2  * @file rstp_prt.h
3  * @brief Port Role Transition state machine (PRT)
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 _RSTP_PRT_H
32 #define _RSTP_PRT_H
33 
34 //Dependencies
35 #include "rstp/rstp.h"
36 
37 //C++ guard
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
42 
43 /**
44  * @brief Port Role Transition machine states
45  **/
46 
47 typedef enum
48 {
72 
73 
74 //RSTP related functions
77 
80 
83 
86 
89 
90 //C++ guard
91 #ifdef __cplusplus
92 }
93 #endif
94 
95 #endif
void rstpPrtDisabledPortFsm(RstpBridgePort *port)
PRT state machine implementation (Disabled port role)
Definition: rstp_prt.c:166
@ RSTP_PRT_STATE_DESIGNATED_PORT
Definition: rstp_prt.h:65
@ RSTP_PRT_STATE_DESIGNATED_LEARN
Definition: rstp_prt.h:63
void rstpPrtDesignatedPortFsm(RstpBridgePort *port)
PRT state machine implementation (Designated port role)
Definition: rstp_prt.c:461
@ RSTP_PRT_STATE_DISABLE_PORT
Definition: rstp_prt.h:50
void rstpPrtFsm(RstpBridgePort *port)
PRT state machine implementation.
Definition: rstp_prt.c:91
@ RSTP_PRT_STATE_ALTERNATE_PORT
Definition: rstp_prt.h:70
@ RSTP_PRT_STATE_ROOT_FORWARD
Definition: rstp_prt.h:55
void rstpPrtDesignatedPortChangeState(RstpBridgePort *port, RstpPrtState newState)
Update PRT state machine state (Designated port role)
Definition: rstp_prt.c:551
@ RSTP_PRT_STATE_DESIGNATED_FORWARD
Definition: rstp_prt.h:62
@ RSTP_PRT_STATE_DESIGNATED_PROPOSE
Definition: rstp_prt.h:59
void rstpPrtAlternatePortChangeState(RstpBridgePort *port, RstpPrtState newState)
Update PRT state machine state (Alternate or Backup port role)
Definition: rstp_prt.c:718
RSTP (Rapid Spanning Tree Protocol)
@ RSTP_PRT_STATE_REROOT
Definition: rstp_prt.h:54
@ RSTP_PRT_STATE_DESIGNATED_RETIRED
Definition: rstp_prt.h:61
@ RSTP_PRT_STATE_DESIGNATED_SYNCED
Definition: rstp_prt.h:60
uint16_t port
Definition: dns_common.h:267
void rstpPrtRootPortChangeState(RstpBridgePort *port, RstpPrtState newState)
Update PRT state machine state (Root port role)
Definition: rstp_prt.c:379
@ RSTP_PRT_STATE_ROOT_PORT
Definition: rstp_prt.h:58
@ RSTP_PRT_STATE_ROOT_LEARN
Definition: rstp_prt.h:56
@ RSTP_PRT_STATE_ROOT_PROPOSED
Definition: rstp_prt.h:52
@ RSTP_PRT_STATE_BACKUP_PORT
Definition: rstp_prt.h:69
void rstpPrtRootPortFsm(RstpBridgePort *port)
PRT state machine implementation (Root port role)
Definition: rstp_prt.c:287
RstpPrtState
Port Role Transition machine states.
Definition: rstp_prt.h:48
@ RSTP_PRT_STATE_INIT_PORT
Definition: rstp_prt.h:49
@ RSTP_PRT_STATE_REROOTED
Definition: rstp_prt.h:57
@ RSTP_PRT_STATE_ALTERNATE_PROPOSED
Definition: rstp_prt.h:66
@ RSTP_PRT_STATE_ROOT_AGREED
Definition: rstp_prt.h:53
void rstpPrtInit(RstpBridgePort *port)
PRT state machine initialization.
Definition: rstp_prt.c:79
void rstpPrtDisabledPortChangeState(RstpBridgePort *port, RstpPrtState newState)
Update PRT state machine state (Disabled port role)
Definition: rstp_prt.c:224
@ RSTP_PRT_STATE_BLOCK_PORT
Definition: rstp_prt.h:68
void rstpPrtAlternatePortFsm(RstpBridgePort *port)
PRT state machine implementation (Alternate or Backup port role)
Definition: rstp_prt.c:637
@ RSTP_PRT_STATE_DESIGNATED_DISCARD
Definition: rstp_prt.h:64
@ RSTP_PRT_STATE_ALTERNATE_AGREED
Definition: rstp_prt.h:67
#define RstpBridgePort
Definition: rstp.h:40
@ RSTP_PRT_STATE_DISABLED_PORT
Definition: rstp_prt.h:51