mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-05-15 20:56:51 +08: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:
@@ -102,6 +102,30 @@ snmp_init(void)
|
||||
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
|
||||
snmp_error_response(struct snmp_msg_pstat *msg_ps, u8_t error)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user