mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-10-05 22:29:49 +00:00
msg_in.c, msg_in.c: add snmp_get_community() and snmp_set_community() accessors
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
This commit is contained in:
parent
2c9ceea3cf
commit
4ebeeaf1e0
@ -102,6 +102,30 @@ snmp_init(void)
|
|||||||
snmp_coldstart_trap();
|
snmp_coldstart_trap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns current SNMP community string.
|
||||||
|
* @return current SNMP community string
|
||||||
|
*/
|
||||||
|
const char *
|
||||||
|
snmp_get_community(void)
|
||||||
|
{
|
||||||
|
return snmp_community;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets SNMP community string.
|
||||||
|
* The string itself (its storage) must be valid throughout the whole life of
|
||||||
|
* program (or until it is changed to sth else).
|
||||||
|
*
|
||||||
|
* @param community is a pointer to new community string
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
snmp_set_community(const char * const community)
|
||||||
|
{
|
||||||
|
LWIP_ASSERT("community string is too long!", strlen(community) <= SNMP_COMMUNITY_STR_LEN);
|
||||||
|
snmp_community = community;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
snmp_error_response(struct snmp_msg_pstat *msg_ps, u8_t error)
|
snmp_error_response(struct snmp_msg_pstat *msg_ps, u8_t error)
|
||||||
{
|
{
|
||||||
|
@ -97,6 +97,9 @@ struct snmp_obj_id
|
|||||||
s32_t id[LWIP_SNMP_OBJ_ID_LEN];
|
s32_t id[LWIP_SNMP_OBJ_ID_LEN];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const char * snmp_get_community(void);
|
||||||
|
void snmp_set_community(const char *community);
|
||||||
|
|
||||||
/* system */
|
/* system */
|
||||||
void snmp_set_sysdescr(const u8_t* str, const u8_t* len);
|
void snmp_set_sysdescr(const u8_t* str, const u8_t* len);
|
||||||
void snmp_set_sysobjid(const struct snmp_obj_id *oid);
|
void snmp_set_sysobjid(const struct snmp_obj_id *oid);
|
||||||
|
Loading…
Reference in New Issue
Block a user