bridge_mib_module.h
Go to the documentation of this file.
1 /**
2  * @file bridge_mib_module.h
3  * @brief Bridge MIB module
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 _BRIDGE_MIB_MODULE_H
32 #define _BRIDGE_MIB_MODULE_H
33 
34 //Dependencies
35 #include "mibs/mib_common.h"
36 #include "stp/stp.h"
37 #include "rstp/rstp.h"
38 
39 //Bridge MIB module support
40 #ifndef BRIDGE_MIB_SUPPORT
41  #define BRIDGE_MIB_SUPPORT DISABLED
42 #elif (BRIDGE_MIB_SUPPORT != ENABLED && BRIDGE_MIB_SUPPORT != DISABLED)
43  #error BRIDGE_MIB_SUPPORT parameter is not valid
44 #endif
45 
46 //Support for SET operations
47 #ifndef BRIDGE_MIB_SET_SUPPORT
48  #define BRIDGE_MIB_SET_SUPPORT DISABLED
49 #elif (BRIDGE_MIB_SET_SUPPORT != ENABLED && BRIDGE_MIB_SET_SUPPORT != DISABLED)
50  #error BRIDGE_MIB_SET_SUPPORT parameter is not valid
51 #endif
52 
53 //C++ guard
54 #ifdef __cplusplus
55 extern "C" {
56 #endif
57 
58 
59 /**
60  * @brief Types of bridging
61  **/
62 
63 typedef enum
64 {
70 
71 
72 /**
73  * @brief STP protocol specification
74  **/
75 
76 typedef enum
77 {
82 
83 
84 /**
85  * @brief Port state
86  **/
87 
88 typedef enum
89 {
98 
99 
100 /**
101  * @brief Status of the port
102  **/
103 
104 typedef enum
105 {
109 
110 
111 /**
112  * @brief Status of forwarding database entry
113  **/
114 
115 typedef enum
116 {
123 
124 
125 /**
126  * @brief Status of static database entry
127  **/
128 
129 typedef enum
130 {
137 
138 
139 /**
140  * @brief Bridge MIB base
141  **/
142 
143 typedef struct
144 {
146 #if (STP_SUPPORT == ENABLED)
148 #endif
149 #if (RSTP_SUPPORT == ENABLED)
151 #endif
152  int32_t dot1dBaseType;
157 } BridgeMibBase;
158 
159 
160 //Bridge MIB related constants
162 extern const MibObject bridgeMibObjects[];
163 extern const MibModule bridgeMibModule;
164 
165 //C++ guard
166 #ifdef __cplusplus
167 }
168 #endif
169 
170 #endif
MacAddr dot1dStaticAddress
@ BRIDGE_MIB_BASE_TYPE_SOURCE_ROUTE_ONLY
uint16_t dot1dStaticReceivePort
const MibModule bridgeMibModule
Bridge MIB module.
@ BRIDGE_MIB_PORT_STATE_FORWARDING
@ BRIDGE_MIB_PROTOCOL_SPEC_DEC_LB100
@ BRIDGE_MIB_FDB_STATUS_INVALID
@ BRIDGE_MIB_BASE_TYPE_TRANSPARENT_ONLY
@ BRIDGE_MIB_FDB_STATUS_MGMT
STP (Spanning Tree Protocol)
#define RstpBridgeContext
Definition: rstp.h:36
#define StpBridgeContext
Definition: stp.h:36
BridgeMibFdbStatus
Status of forwarding database entry.
uint32_t dot1dStaticAllowedToGoTo
@ BRIDGE_MIB_STATIC_STATUS_PERMANENT
@ BRIDGE_MIB_PORT_STATUS_ENABLED
@ BRIDGE_MIB_STATIC_STATUS_INVALID
int32_t dot1dStpProtocolSpecification
RSTP (Rapid Spanning Tree Protocol)
@ BRIDGE_MIB_STATIC_STATUS_DELETE_ON_RESET
@ BRIDGE_MIB_BASE_TYPE_SRT
#define NetInterface
Definition: net.h:36
BridgeMibPortState
Port state.
@ BRIDGE_MIB_PROTOCOL_SPEC_UNKNOWN
BridgeMibProtocolSpec
STP protocol specification.
const MibObject bridgeMibObjects[]
Bridge MIB objects.
BridgeMibBaseType
Types of bridging.
@ BRIDGE_MIB_FDB_STATUS_OTHER
BridgeMibPortStatus
Status of the port.
@ BRIDGE_MIB_PORT_STATE_DISABLED
MIB module.
Definition: mib_common.h:292
RstpBridgeContext * rstpBridgeContext
MacAddr
Definition: ethernet.h:195
Bridge MIB base.
@ BRIDGE_MIB_PORT_STATE_BROKEN
@ BRIDGE_MIB_PORT_STATUS_DISABLED
Common definitions for MIB modules.
BridgeMibBase bridgeMibBase
Bridge MIB base.
@ BRIDGE_MIB_BASE_TYPE_UNKNOWN
#define MibObject
Definition: mib_common.h:46
@ BRIDGE_MIB_PORT_STATE_UNKNOWN
@ BRIDGE_MIB_PORT_STATE_BLOCKING
@ BRIDGE_MIB_STATIC_STATUS_OTHER
NetInterface * interface
@ BRIDGE_MIB_STATIC_STATUS_DELETE_ON_TIMEOUT
@ BRIDGE_MIB_PROTOCOL_SPEC_IEEE802_1D
@ BRIDGE_MIB_PORT_STATE_LEARNING
BridgeMibStaticStatus
Status of static database entry.
@ BRIDGE_MIB_FDB_STATUS_SELF
@ BRIDGE_MIB_PORT_STATE_LISTENING
@ BRIDGE_MIB_FDB_STATUS_LEARNED
StpBridgeContext * stpBridgeContext