Renamed the private mib node from 'private' to 'mib_private' to *not* use reserved C/C++ keywords, added comments, added init-define for private MIB

This commit is contained in:
goldsimon 2010-01-24 17:16:37 +00:00
parent 9dd6c28523
commit ef31aa12e2
5 changed files with 18 additions and 1 deletions

View File

@ -731,8 +731,10 @@ const struct mib_array_node mgmt = {
/* internet .1.3.6.1 */
#if SNMP_PRIVATE_MIB
/* When using a private MIB, you have to create a file 'private_mib.h' that contains
* a 'struct mib_array_node mib_private' which contains your MIB. */
s32_t internet_ids[2] = { 2, 4 };
struct mib_node* const internet_nodes[2] = { (struct mib_node* const)&mgmt, (struct mib_node* const)&private };
struct mib_node* const internet_nodes[2] = { (struct mib_node* const)&mgmt, (struct mib_node* const)&mib_private };
const struct mib_array_node internet = {
&noleafs_get_object_def,
&noleafs_get_value,

View File

@ -88,6 +88,15 @@ snmp_init(void)
msg_ps++;
}
trap_msg.pcb = snmp1_pcb;
#ifdef SNMP_PRIVATE_MIB_INIT
/* If defined, rhis must be a function-like define to initialize the
* private MIB after the stack has been initialized.
* The private MIB can also be initialized in tcpip_callback (or after
* the stack is initialized), this define is only for convenience. */
SNMP_PRIVATE_MIB_INIT();
#endif /* SNMP_PRIVATE_MIB_INIT */
/* The coldstart trap will only be output
if our outgoing interface is up & configured */
snmp_coldstart_trap();

View File

@ -627,6 +627,8 @@
/**
* SNMP_PRIVATE_MIB:
* When using a private MIB, you have to create a file 'private_mib.h' that contains
* a 'struct mib_array_node mib_private' which contains your MIB.
*/
#ifndef SNMP_PRIVATE_MIB
#define SNMP_PRIVATE_MIB 0

View File

@ -44,6 +44,8 @@
#if LWIP_SNMP
#if SNMP_PRIVATE_MIB
/* When using a private MIB, you have to create a file 'private_mib.h' that contains
* a 'struct mib_array_node mib_private' which contains your MIB. */
#include "private_mib.h"
#endif

View File

@ -44,6 +44,8 @@
#include "lwip/snmp.h"
#if SNMP_PRIVATE_MIB
/* When using a private MIB, you have to create a file 'private_mib.h' that contains
* a 'struct mib_array_node mib_private' which contains your MIB. */
#include "private_mib.h"
#endif