- Changed the names of some variables in SNMP module to avoid them shadowing each other (which produces a lot of warnings and makes the code hard to maintain)

- Added missing defines for 3 snmp-functions if LWIP_SNMP==0
This commit is contained in:
goldsimon 2007-04-02 20:39:24 +00:00
parent 2f53df93e8
commit 34fcccc50b
3 changed files with 15 additions and 11 deletions

View File

@ -486,7 +486,7 @@ struct mib_node* const ip_nodes[23] = {
(struct mib_node* const)&iprtetable, (struct mib_node* const)&ipntomtable, (struct mib_node* const)&iprtetable, (struct mib_node* const)&ipntomtable,
(struct mib_node* const)&ip_scalar (struct mib_node* const)&ip_scalar
}; };
const struct mib_array_node ip = { const struct mib_array_node g_ip = {
&noleafs_get_object_def, &noleafs_get_object_def,
&noleafs_get_value, &noleafs_get_value,
&noleafs_set_test, &noleafs_set_test,
@ -541,7 +541,7 @@ const struct mib_array_node attable = {
/* at .1.3.6.1.2.1.3 */ /* at .1.3.6.1.2.1.3 */
s32_t at_id = 1; s32_t at_id = 1;
struct mib_node* at_node = (struct mib_node* const)&attable; struct mib_node* g_at_node = (struct mib_node* const)&attable;
struct mib_ram_array_node at = { struct mib_ram_array_node at = {
&noleafs_get_object_def, &noleafs_get_object_def,
&noleafs_get_value, &noleafs_get_value,
@ -550,7 +550,7 @@ struct mib_ram_array_node at = {
MIB_NODE_RA, MIB_NODE_RA,
0, 0,
&at_id, &at_id,
&at_node &g_at_node
}; };
/** index root node for ifTable */ /** index root node for ifTable */
@ -680,7 +680,7 @@ struct mib_node* const mib2_nodes[MIB2_GROUPS] = {
(struct mib_node* const)&sys_tem, (struct mib_node* const)&sys_tem,
(struct mib_node* const)&interfaces, (struct mib_node* const)&interfaces,
(struct mib_node* const)&at, (struct mib_node* const)&at,
(struct mib_node* const)&ip, (struct mib_node* const)&g_ip,
(struct mib_node* const)&icmp, (struct mib_node* const)&icmp,
#if LWIP_TCP #if LWIP_TCP
(struct mib_node* const)&tcp, (struct mib_node* const)&tcp,
@ -914,12 +914,12 @@ void objectidncpy(s32_t *dst, s32_t *src, u8_t n)
* @param str if non-NULL then copy str pointer * @param str if non-NULL then copy str pointer
* @param strlen points to string length, excluding zero terminator * @param strlen points to string length, excluding zero terminator
*/ */
void snmp_set_sysdesr(u8_t *str, u8_t *strlen) void snmp_set_sysdesr(u8_t *str, u8_t *len)
{ {
if (str != NULL) if (str != NULL)
{ {
sysdescr_ptr = str; sysdescr_ptr = str;
sysdescr_len_ptr = strlen; sysdescr_len_ptr = len;
} }
} }

View File

@ -369,12 +369,12 @@ snmp_mib_node_find(struct mib_list_rootnode *rn, s32_t objid, struct mib_list_no
} }
else else
{ {
struct mib_list_rootnode *rn; struct mib_list_rootnode *r;
if (n->nptr->node_type == MIB_NODE_LR) if (n->nptr->node_type == MIB_NODE_LR)
{ {
rn = (struct mib_list_rootnode *)n->nptr; r = (struct mib_list_rootnode *)n->nptr;
if (rn->count > 1) if (r->count > 1)
{ {
/* can't delete node */ /* can't delete node */
fc = 2; fc = 2;

View File

@ -50,7 +50,7 @@ struct snmp_obj_id
}; };
/* system */ /* system */
void snmp_set_sysdesr(u8_t* str, u8_t* strlen); void snmp_set_sysdesr(u8_t* str, u8_t* len);
void snmp_set_sysobjid(struct snmp_obj_id *oid); void snmp_set_sysobjid(struct snmp_obj_id *oid);
void snmp_get_sysobjid_ptr(struct snmp_obj_id **oid); void snmp_get_sysobjid_ptr(struct snmp_obj_id **oid);
void snmp_inc_sysuptime(void); void snmp_inc_sysuptime(void);
@ -182,10 +182,14 @@ void snmp_get_snmpenableauthentraps(u8_t *value);
#else #else
/* system */ /* system */
#define snmp_set_sysdesr(str, strlen) #define snmp_set_sysdesr(str, len)
#define snmp_set_sysobjid(oid);
#define snmp_get_sysobjid_ptr(oid) #define snmp_get_sysobjid_ptr(oid)
#define snmp_inc_sysuptime() #define snmp_inc_sysuptime()
#define snmp_get_sysuptime(value) #define snmp_get_sysuptime(value)
#define snmp_set_syscontact(ocstr, ocstrlen);
#define snmp_set_sysname(ocstr, ocstrlen);
#define snmp_set_syslocation(ocstr, ocstrlen);
/* network interface */ /* network interface */
#define snmp_add_ifinoctets(ni,value) #define snmp_add_ifinoctets(ni,value)