rstp_mib_module.c
Go to the documentation of this file.
1 /**
2  * @file rstp_mib_module.c
3  * @brief RSTP 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.0
29  **/
30 
31 //Switch to the appropriate trace level
32 #define TRACE_LEVEL SNMP_TRACE_LEVEL
33 
34 //Dependencies
35 #include "core/net.h"
36 #include "mibs/mib_common.h"
37 #include "mibs/rstp_mib_module.h"
38 #include "mibs/rstp_mib_impl.h"
39 #include "core/crypto.h"
40 #include "encoding/asn1.h"
41 #include "encoding/oid.h"
42 #include "debug.h"
43 
44 //Check TCP/IP stack configuration
45 #if (RSTP_MIB_SUPPORT == ENABLED)
46 
47 
48 /**
49  * @brief RSTP MIB base
50  **/
51 
53 
54 
55 /**
56  * @brief RSTP MIB objects
57  **/
58 
60 {
61  //dot1dStpVersion object (1.3.6.1.2.1.17.2.16)
62  {
63  "dot1dStpVersion",
64  {43, 6, 1, 2, 1, 17, 2, 16},
65  8,
69  NULL,
70  NULL,
71  sizeof(int32_t),
74  NULL
75  },
76  //dot1dStpTxHoldCount object (1.3.6.1.2.1.17.2.17)
77  {
78  "dot1dStpTxHoldCount",
79  {43, 6, 1, 2, 1, 17, 2, 17},
80  8,
84  NULL,
85  NULL,
86  sizeof(int32_t),
89  NULL
90  },
91  //dot1dStpPortProtocolMigration object (1.3.6.1.2.1.17.2.19.1.1)
92  {
93  "dot1dStpPortProtocolMigration",
94  {43, 6, 1, 2, 1, 17, 2, 19, 1, 1},
95  10,
99  NULL,
100  NULL,
101  sizeof(int32_t),
105  },
106  //dot1dStpPortAdminEdgePort object (1.3.6.1.2.1.17.2.19.1.2)
107  {
108  "dot1dStpPortAdminEdgePort",
109  {43, 6, 1, 2, 1, 17, 2, 19, 1, 2},
110  10,
114  NULL,
115  NULL,
116  sizeof(int32_t),
120  },
121  //dot1dStpPortOperEdgePort object (1.3.6.1.2.1.17.2.19.1.3)
122  {
123  "dot1dStpPortOperEdgePort",
124  {43, 6, 1, 2, 1, 17, 2, 19, 1, 3},
125  10,
129  NULL,
130  NULL,
131  sizeof(int32_t),
132  NULL,
135  },
136  //dot1dStpPortAdminPointToPoint object (1.3.6.1.2.1.17.2.19.1.4)
137  {
138  "dot1dStpPortAdminPointToPoint",
139  {43, 6, 1, 2, 1, 17, 2, 19, 1, 4},
140  10,
144  NULL,
145  NULL,
146  sizeof(int32_t),
150  },
151  //dot1dStpPortOperPointToPoint object (1.3.6.1.2.1.17.2.19.1.5)
152  {
153  "dot1dStpPortOperPointToPoint",
154  {43, 6, 1, 2, 1, 17, 2, 19, 1, 5},
155  10,
159  NULL,
160  NULL,
161  sizeof(int32_t),
162  NULL,
165  },
166  //dot1dStpPortAdminPathCost object (1.3.6.1.2.1.17.2.19.1.6)
167  {
168  "dot1dStpPortAdminPathCost",
169  {43, 6, 1, 2, 1, 17, 2, 19, 1, 6},
170  10,
174  NULL,
175  NULL,
176  sizeof(int32_t),
180  }
181 };
182 
183 
184 /**
185  * @brief RSTP MIB module
186  **/
187 
189 {
190  "RSTP-MIB",
191  {43, 6, 1, 2, 1, 129, 6},
192  7,
195  rstpMibInit,
196  NULL,
197  NULL,
198  NULL,
199  NULL
200 };
201 
202 #endif
ASN.1 (Abstract Syntax Notation One)
@ ASN1_TYPE_INTEGER
Definition: asn1.h:70
#define ASN1_CLASS_UNIVERSAL
Definition: asn1.h:52
General definitions for cryptographic algorithms.
Debugging facilities.
Common definitions for MIB modules.
#define MibObject
Definition: mib_common.h:46
@ MIB_ACCESS_READ_ONLY
Definition: mib_common.h:79
@ MIB_ACCESS_READ_WRITE
Definition: mib_common.h:80
TCP/IP stack core.
OID (Object Identifier)
#define arraysize(a)
Definition: os_port.h:71
error_t rstpMibSetDot1dStpExtPortEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, const MibVariant *value, size_t valueLen, bool_t commit)
Set dot1dStpExtPortEntry object value.
error_t rstpMibGetDot1dStpVersion(const MibObject *object, const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen)
Get dot1dStpVersion object value.
error_t rstpMibGetDot1dStpExtPortEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen)
Get dot1dStpExtPortEntry object value.
error_t rstpMibSetDot1dStpTxHoldCount(const MibObject *object, const uint8_t *oid, size_t oidLen, const MibVariant *value, size_t valueLen, bool_t commit)
Set dot1dStpTxHoldCount object value.
error_t rstpMibSetDot1dStpVersion(const MibObject *object, const uint8_t *oid, size_t oidLen, const MibVariant *value, size_t valueLen, bool_t commit)
Set dot1dStpVersion object value.
Definition: rstp_mib_impl.c:96
error_t rstpMibInit(void)
RSTP MIB module initialization.
Definition: rstp_mib_impl.c:55
error_t rstpMibGetDot1dStpTxHoldCount(const MibObject *object, const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen)
Get dot1dStpTxHoldCount object value.
error_t rstpMibGetNextDot1dStpExtPortEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, uint8_t *nextOid, size_t *nextOidLen)
Get next dot1dStpExtPortEntry object.
RSTP MIB module implementation.
const MibObject rstpMibObjects[]
RSTP MIB objects.
const MibModule rstpMibModule
RSTP MIB module.
RstpMibBase rstpMibBase
RSTP MIB base.
RSTP MIB module.
MIB module.
Definition: mib_common.h:292
RSTP MIB base.