rstp_mib_impl.c
Go to the documentation of this file.
1 /**
2  * @file rstp_mib_impl.c
3  * @brief RSTP MIB module implementation
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 "rstp/rstp.h"
43 #include "rstp/rstp_mgmt.h"
44 #include "debug.h"
45 
46 //Check TCP/IP stack configuration
47 #if (RSTP_MIB_SUPPORT == ENABLED)
48 
49 
50 /**
51  * @brief RSTP MIB module initialization
52  * @return Error code
53  **/
54 
56 {
57  //Debug message
58  TRACE_INFO("Initializing RSTP MIB base...\r\n");
59 
60  //Clear RSTP MIB base
61  memset(&rstpMibBase, 0, sizeof(rstpMibBase));
62 
63  //Successful processing
64  return NO_ERROR;
65 }
66 
67 
68 /**
69  * @brief Attach RSTP bridge context
70  * @param[in] context Pointer to the RSTP bridge context
71  * @return Error code
72  **/
73 
75 {
76  //Save the RSTP bridge context
78 
79  //Successful processing
80  return NO_ERROR;
81 }
82 
83 
84 /**
85  * @brief Set dot1dStpVersion object value
86  * @param[in] object Pointer to the MIB object descriptor
87  * @param[in] oid Object identifier (object name and instance identifier)
88  * @param[in] oidLen Length of the OID, in bytes
89  * @param[in] value Object value
90  * @param[in] valueLen Length of the object value, in bytes
91  * @param[in] commit This flag tells whether the changes shall be committed
92  * to the MIB base
93  * @return Error code
94  **/
95 
96 error_t rstpMibSetDot1dStpVersion(const MibObject *object, const uint8_t *oid,
97  size_t oidLen, const MibVariant *value, size_t valueLen, bool_t commit)
98 {
99 #if (RSTP_MIB_SET_SUPPORT == ENABLED)
100  error_t error;
101 
102  //Ensure that the supplied value is valid
103  if(value->integer >= 0)
104  {
105  //This object specifies the version of Spanning Tree Protocol the bridge
106  //is currently running
108  commit);
109  }
110  else
111  {
112  //Report an error
113  error = ERROR_WRONG_VALUE;
114  }
115 
116  //Return status code
117  return error;
118 #else
119  //SET operation is not supported
120  return ERROR_WRITE_FAILED;
121 #endif
122 }
123 
124 
125 /**
126  * @brief Get dot1dStpVersion object value
127  * @param[in] object Pointer to the MIB object descriptor
128  * @param[in] oid Object identifier (object name and instance identifier)
129  * @param[in] oidLen Length of the OID, in bytes
130  * @param[out] value Object value
131  * @param[in,out] valueLen Length of the object value, in bytes
132  * @return Error code
133  **/
134 
135 error_t rstpMibGetDot1dStpVersion(const MibObject *object, const uint8_t *oid,
136  size_t oidLen, MibVariant *value, size_t *valueLen)
137 {
138  error_t error;
139  uint_t version;
140 
141  //This object specifies the version of Spanning Tree Protocol the bridge
142  //is currently running
144 
145  //Check status code
146  if(!error)
147  {
148  //Return the value of the object
149  value->integer = version;
150  }
151 
152  //Return status code
153  return error;
154 }
155 
156 
157 /**
158  * @brief Set dot1dStpTxHoldCount object value
159  * @param[in] object Pointer to the MIB object descriptor
160  * @param[in] oid Object identifier (object name and instance identifier)
161  * @param[in] oidLen Length of the OID, in bytes
162  * @param[in] value Object value
163  * @param[in] valueLen Length of the object value, in bytes
164  * @param[in] commit This flag tells whether the changes shall be committed
165  * to the MIB base
166  * @return Error code
167  **/
168 
169 error_t rstpMibSetDot1dStpTxHoldCount(const MibObject *object, const uint8_t *oid,
170  size_t oidLen, const MibVariant *value, size_t valueLen, bool_t commit)
171 {
172 #if (RSTP_MIB_SET_SUPPORT == ENABLED)
173  error_t error;
174 
175  //Ensure that the supplied value is valid
176  if(value->integer >= 0)
177  {
178  //This object specifies the value used by the Port Transmit state machine
179  //to limit the maximum transmission rate
181  value->integer, commit);
182  }
183  else
184  {
185  //Report an error
186  error = ERROR_WRONG_VALUE;
187  }
188 
189  //Return status code
190  return error;
191 #else
192  //SET operation is not supported
193  return ERROR_WRITE_FAILED;
194 #endif
195 }
196 
197 
198 /**
199  * @brief Get dot1dStpTxHoldCount object value
200  * @param[in] object Pointer to the MIB object descriptor
201  * @param[in] oid Object identifier (object name and instance identifier)
202  * @param[in] oidLen Length of the OID, in bytes
203  * @param[out] value Object value
204  * @param[in,out] valueLen Length of the object value, in bytes
205  * @return Error code
206  **/
207 
208 error_t rstpMibGetDot1dStpTxHoldCount(const MibObject *object, const uint8_t *oid,
209  size_t oidLen, MibVariant *value, size_t *valueLen)
210 {
211  error_t error;
212  uint_t txHoldCount;
213 
214  //This object specifies the value used by the Port Transmit state machine
215  //to limit the maximum transmission rate
217 
218  //Check status code
219  if(!error)
220  {
221  //Return the value of the object
222  value->integer = txHoldCount;
223  }
224 
225  //Return status code
226  return error;
227 }
228 
229 
230 /**
231  * @brief Set dot1dStpExtPortEntry object value
232  * @param[in] object Pointer to the MIB object descriptor
233  * @param[in] oid Object identifier (object name and instance identifier)
234  * @param[in] oidLen Length of the OID, in bytes
235  * @param[in] value Object value
236  * @param[in] valueLen Length of the object value, in bytes
237  * @param[in] commit This flag tells whether the changes shall be committed
238  * to the MIB base
239  * @return Error code
240  **/
241 
242 error_t rstpMibSetDot1dStpExtPortEntry(const MibObject *object, const uint8_t *oid,
243  size_t oidLen, const MibVariant *value, size_t valueLen, bool_t commit)
244 {
245 #if (RSTP_MIB_SET_SUPPORT == ENABLED)
246  error_t error;
247  size_t n;
248  uint16_t dot1dStpPort;
249 
250  //Point to the instance identifier
251  n = object->oidLen;
252 
253  //dot1dStpPort is used as instance identifier
254  error = mibDecodePort(oid, oidLen, &n, &dot1dStpPort);
255  //Invalid instance identifier?
256  if(error)
257  return error;
258 
259  //Sanity check
260  if(n != oidLen)
262 
263  //dot1dStpPortProtocolMigration object?
264  if(!strcmp(object->name, "dot1dStpPortProtocolMigration"))
265  {
266  //This object can be be set by management to force the Port Protocol
267  //Migration state machine to transmit RST BPDUs for a MigrateTime period
268  if(value->integer == MIB_TRUTH_VALUE_TRUE)
269  {
270  //When operating in RSTP mode, writing true to this object forces this
271  //port to transmit RSTP BPDUs
273  dot1dStpPort, TRUE, commit);
274  }
275  else if(value->integer == MIB_TRUTH_VALUE_FALSE)
276  {
277  //Any other operation on this object has no effect
279  dot1dStpPort, FALSE, commit);
280  }
281  else
282  {
283  //Report an error
284  error = ERROR_WRONG_VALUE;
285  }
286  }
287  //dot1dStpPortAdminEdgePort object?
288  else if(!strcmp(object->name, "dot1dStpPortAdminEdgePort"))
289  {
290  //Set the administrative value of the Edge Port parameter
291  if(value->integer == MIB_TRUTH_VALUE_TRUE)
292  {
293  //A value of true indicates that this port should be assumed as an
294  //edge port
296  dot1dStpPort, TRUE, commit);
297  }
298  else if(value->integer == MIB_TRUTH_VALUE_FALSE)
299  {
300  //A value of false indicates that this port should be assumed as a
301  //non-edge port
303  dot1dStpPort, FALSE, commit);
304  }
305  else
306  {
307  //Report an error
308  error = ERROR_WRONG_VALUE;
309  }
310  }
311  //dot1dStpPortAdminPointToPoint object?
312  else if(!strcmp(object->name, "dot1dStpPortAdminPointToPoint"))
313  {
314  //Set the administrative point-to-point status of the LAN segment
315  //attached to this port
317  {
318  //The administrator requires the MAC to be treated as if it is
319  //connected to a point-to-point LAN, regardless of any indications
320  //to the contrary that are generated by the MAC entity
322  dot1dStpPort, RSTP_ADMIN_P2P_MAC_FORCE_TRUE, commit);
323  }
324  else if(value->integer == RSTP_MIB_PORT_ADMIN_P2P_FORCE_FALSE)
325  {
326  //The administrator requires the MAC to be treated as connected to a
327  //non-point-to-point LAN, regardless of any indications to the contrary
328  //that are generated by the MAC entity
330  dot1dStpPort, RSTP_ADMIN_P2P_MAC_FORCE_FALSE, commit);
331  }
332  else if(value->integer == RSTP_MIB_PORT_ADMIN_P2P_AUTO)
333  {
334  //The administrator requires the point-to-point status of the MAC to
335  //be determined in accordance with the specific MAC procedure
337  dot1dStpPort, RSTP_ADMIN_P2P_MAC_AUTO, commit);
338  }
339  else
340  {
341  //Report an error
342  error = ERROR_WRONG_VALUE;
343  }
344  }
345  //dot1dStpPortAdminPathCost object?
346  else if(!strcmp(object->name, "dot1dStpPortAdminPathCost"))
347  {
348  //Ensure that the supplied value is valid
349  if(value->integer >= 0)
350  {
351  //This object specifies the administratively assigned value for the
352  //contribution of this port to the path cost of paths toward the
353  //spanning tree root
355  dot1dStpPort, value->integer, commit);
356  }
357  else
358  {
359  //Report an error
360  error = ERROR_WRONG_VALUE;
361  }
362  }
363  //Unknown object?
364  else
365  {
366  //The specified object does not exist
367  error = ERROR_OBJECT_NOT_FOUND;
368  }
369 
370  //Return status code
371  return error;
372 #else
373  //SET operation is not supported
374  return ERROR_WRITE_FAILED;
375 #endif
376 }
377 
378 
379 /**
380  * @brief Get dot1dStpExtPortEntry object value
381  * @param[in] object Pointer to the MIB object descriptor
382  * @param[in] oid Object identifier (object name and instance identifier)
383  * @param[in] oidLen Length of the OID, in bytes
384  * @param[out] value Object value
385  * @param[in,out] valueLen Length of the object value, in bytes
386  * @return Error code
387  **/
388 
389 error_t rstpMibGetDot1dStpExtPortEntry(const MibObject *object, const uint8_t *oid,
390  size_t oidLen, MibVariant *value, size_t *valueLen)
391 {
392  error_t error;
393  size_t n;
394  uint16_t dot1dStpPort;
395 
396  //Point to the instance identifier
397  n = object->oidLen;
398 
399  //dot1dStpPort is used as instance identifier
400  error = mibDecodePort(oid, oidLen, &n, &dot1dStpPort);
401  //Invalid instance identifier?
402  if(error)
403  return error;
404 
405  //Sanity check
406  if(n != oidLen)
408 
409  //dot1dStpPortProtocolMigration object?
410  if(!strcmp(object->name, "dot1dStpPortProtocolMigration"))
411  {
412  //This object always returns false when read
413  value->integer = MIB_TRUTH_VALUE_FALSE;
414  }
415  //dot1dStpPortAdminEdgePort object?
416  else if(!strcmp(object->name, "dot1dStpPortAdminEdgePort"))
417  {
418  bool_t adminEdgePort;
419 
420  //This object specifies the administrative value of the Edge Port
421  //parameter
423  dot1dStpPort, &adminEdgePort);
424 
425  //Check status code
426  if(!error)
427  {
428  //Return the value of the object
429  if(adminEdgePort)
430  {
431  value->integer = MIB_TRUTH_VALUE_TRUE;
432  }
433  else
434  {
435  value->integer = MIB_TRUTH_VALUE_FALSE;
436  }
437  }
438  }
439  //dot1dStpPortOperEdgePort object?
440  else if(!strcmp(object->name, "dot1dStpPortOperEdgePort"))
441  {
442  bool_t operEdgePort;
443 
444  //This object specifies the operational value of the Edge Port parameter
446  dot1dStpPort, &operEdgePort);
447 
448  //Check status code
449  if(!error)
450  {
451  //Return the value of the object
452  if(operEdgePort)
453  {
454  value->integer = MIB_TRUTH_VALUE_TRUE;
455  }
456  else
457  {
458  value->integer = MIB_TRUTH_VALUE_FALSE;
459  }
460  }
461  }
462  //dot1dStpPortAdminPointToPoint object?
463  else if(!strcmp(object->name, "dot1dStpPortAdminPointToPoint"))
464  {
465  RstpAdminPointToPointMac adminPointToPointMac;
466 
467  //This object specifies the administrative point-to-point status of the
468  //LAN segment attached to this port
470  dot1dStpPort, &adminPointToPointMac);
471 
472  //Check status code
473  if(!error)
474  {
475  //Return the value of the object
476  if(adminPointToPointMac == RSTP_ADMIN_P2P_MAC_FORCE_TRUE)
477  {
478  //The administrator requires the MAC to be treated as if it is
479  //connected to a point-to-point LAN, regardless of any indications
480  //to the contrary that are generated by the MAC entity
482  }
483  else if(adminPointToPointMac == RSTP_ADMIN_P2P_MAC_FORCE_FALSE)
484  {
485  //The administrator requires the MAC to be treated as connected to
486  //a non-point-to-point LAN, regardless of any indications to the
487  //contrary that are generated by the MAC entity
489  }
490  else
491  {
492  //The administrator requires the point-to-point status of the MAC
493  //to be determined in accordance with the specific MAC procedure
495  }
496  }
497  }
498  //dot1dStpPortOperPointToPoint object?
499  else if(!strcmp(object->name, "dot1dStpPortOperPointToPoint"))
500  {
501  bool_t operPointToPointMac;
502 
503  //This object specifies the operational point-to-point status of the LAN
504  //segment attached to this port
506  dot1dStpPort, &operPointToPointMac);
507 
508  //Check status code
509  if(!error)
510  {
511  //Return the value of the object
512  if(operPointToPointMac)
513  {
514  value->integer = MIB_TRUTH_VALUE_TRUE;
515  }
516  else
517  {
518  value->integer = MIB_TRUTH_VALUE_FALSE;
519  }
520  }
521  }
522  //dot1dStpPortAdminPathCost object?
523  else if(!strcmp(object->name, "dot1dStpPortAdminPathCost"))
524  {
525  uint32_t adminPathCost;
526 
527  //This object specifies the administratively assigned value for the
528  //contribution of this port to the path cost of paths toward the spanning
529  //tree root. If the default Path Cost is being used, this object returns
530  //0 when read
532  dot1dStpPort, &adminPathCost);
533 
534  //Check status code
535  if(!error)
536  {
537  //Return the value of the object
538  value->integer = adminPathCost;
539  }
540  }
541  //Unknown object?
542  else
543  {
544  //The specified object does not exist
545  error = ERROR_OBJECT_NOT_FOUND;
546  }
547 
548  //Return status code
549  return error;
550 }
551 
552 
553 /**
554  * @brief Get next dot1dStpExtPortEntry object
555  * @param[in] object Pointer to the MIB object descriptor
556  * @param[in] oid Object identifier
557  * @param[in] oidLen Length of the OID, in bytes
558  * @param[out] nextOid OID of the next object in the MIB
559  * @param[out] nextOidLen Length of the next object identifier, in bytes
560  * @return Error code
561  **/
562 
564  size_t oidLen, uint8_t *nextOid, size_t *nextOidLen)
565 {
566  error_t error;
567  uint_t i;
568  size_t n;
569  uint16_t portNum;
570  uint16_t curPortNum;
571  RstpBridgeContext *context;
572 
573  //Initialize variable
574  portNum = 0;
575 
576  //Point to the RSTP bridge context
577  context = rstpMibBase.rstpBridgeContext;
578 
579  //Make sure the buffer is large enough to hold the OID prefix
580  if(*nextOidLen < object->oidLen)
581  return ERROR_BUFFER_OVERFLOW;
582 
583  //Copy OID prefix
584  osMemcpy(nextOid, object->oid, object->oidLen);
585 
586  //Loop through the ports of the bridge
587  for(i = 0; i < context->numPorts; i++)
588  {
589  //Retrieve the port number associated with the current port
590  curPortNum = context->ports[i].portId & RSTP_PORT_NUM_MASK;
591 
592  //Append the instance identifier to the OID prefix
593  n = object->oidLen;
594 
595  //dot1dStpPort is used as instance identifier
596  error = mibEncodeIndex(nextOid, *nextOidLen, &n, curPortNum);
597  //Any error to report?
598  if(error)
599  return error;
600 
601  //Check whether the resulting object identifier lexicographically
602  //follows the specified OID
603  if(oidComp(nextOid, n, oid, oidLen) > 0)
604  {
605  //Save the closest object identifier that follows the specified
606  //OID in lexicographic order
607  if(portNum == 0 || curPortNum < portNum)
608  {
609  portNum = curPortNum;
610  }
611  }
612  }
613 
614  //The specified OID does not lexicographically precede the name
615  //of some object?
616  if(portNum == 0)
617  return ERROR_OBJECT_NOT_FOUND;
618 
619  //Append the instance identifier to the OID prefix
620  n = object->oidLen;
621 
622  //dot1dStpPort is used as instance identifier
623  error = mibEncodeIndex(nextOid, *nextOidLen, &n, portNum);
624  //Any error to report?
625  if(error)
626  return error;
627 
628  //Save the length of the resulting object identifier
629  *nextOidLen = n;
630  //Next object found
631  return NO_ERROR;
632 }
633 
634 #endif
ASN.1 (Abstract Syntax Notation One)
uint8_t version
Definition: coap_common.h:177
unsigned int uint_t
Definition: compiler_port.h:50
int bool_t
Definition: compiler_port.h:53
General definitions for cryptographic algorithms.
Debugging facilities.
#define TRACE_INFO(...)
Definition: debug.h:95
uint8_t n
error_t
Error codes.
Definition: error.h:43
@ ERROR_WRITE_FAILED
Definition: error.h:221
@ ERROR_OBJECT_NOT_FOUND
Definition: error.h:255
@ ERROR_INSTANCE_NOT_FOUND
Definition: error.h:256
@ ERROR_WRONG_VALUE
Definition: error.h:123
@ NO_ERROR
Success.
Definition: error.h:44
@ ERROR_BUFFER_OVERFLOW
Definition: error.h:142
uint8_t oid[]
Definition: lldp_tlv.h:300
uint8_t oidLen
Definition: lldp_tlv.h:299
error_t mibDecodePort(const uint8_t *oid, size_t oidLen, size_t *pos, uint16_t *port)
Decode instance identifier (port number)
Definition: mib_common.c:495
error_t mibEncodeIndex(uint8_t *oid, size_t maxOidLen, size_t *pos, uint_t index)
Encode instance identifier (index)
Definition: mib_common.c:47
Common definitions for MIB modules.
#define MibObject
Definition: mib_common.h:46
@ MIB_TRUTH_VALUE_TRUE
Definition: mib_common.h:91
@ MIB_TRUTH_VALUE_FALSE
Definition: mib_common.h:92
MibVariant
Definition: mib_common.h:196
TCP/IP stack core.
int_t oidComp(const uint8_t *oid1, size_t oidLen1, const uint8_t *oid2, size_t oidLen2)
Compare object identifiers.
Definition: oid.c:103
OID (Object Identifier)
#define osMemcpy(dest, src, length)
Definition: os_port.h:141
#define TRUE
Definition: os_port.h:50
#define FALSE
Definition: os_port.h:46
RSTP (Rapid Spanning Tree Protocol)
RstpAdminPointToPointMac
Administrative state of the point-to-point status.
Definition: rstp.h:255
@ RSTP_ADMIN_P2P_MAC_FORCE_FALSE
Definition: rstp.h:256
@ RSTP_ADMIN_P2P_MAC_AUTO
Definition: rstp.h:258
@ RSTP_ADMIN_P2P_MAC_FORCE_TRUE
Definition: rstp.h:257
#define RstpBridgeContext
Definition: rstp.h:36
#define RSTP_PORT_NUM_MASK
Definition: rstp_bpdu.h:44
error_t rstpMgmtSetProtocolMigration(RstpBridgeContext *context, uint_t portIndex, bool_t value, bool_t commit)
Force protocol migration.
Definition: rstp_mgmt.c:1127
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 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 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 rstpMgmtGetVersion(RstpBridgeContext *context, uint_t *value)
Get assigned protocol version.
Definition: rstp_mgmt.c:456
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 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 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 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
Management of the RSTP bridge.
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 rstpMibSetRstpBridgeContext(RstpBridgeContext *context)
Attach RSTP bridge context.
Definition: rstp_mib_impl.c:74
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.
RstpMibBase rstpMibBase
RSTP MIB base.
RSTP MIB module.
@ RSTP_MIB_PORT_ADMIN_P2P_FORCE_FALSE
@ RSTP_MIB_PORT_ADMIN_P2P_FORCE_TRUE
@ RSTP_MIB_PORT_ADMIN_P2P_AUTO
RstpBridgeContext * rstpBridgeContext
uint8_t value[]
Definition: tcp.h:369