lwIP 2.2.0
Lightweight IP stack
Loading...
Searching...
No Matches

Functions

const char * snmp_get_community_trap (void)
 
void snmp_set_community_trap (const char *const community)
 
void snmp_trap_dst_enable (u8_t dst_idx, u8_t enable)
 
void snmp_trap_dst_ip_set (u8_t dst_idx, const ip_addr_t *dst)
 
void snmp_set_auth_traps_enabled (u8_t enable)
 
u8_t snmp_get_auth_traps_enabled (void)
 
void snmp_set_default_trap_version (u8_t snmp_version)
 
u8_t snmp_get_default_trap_version (void)
 
err_t snmp_send_trap (const struct snmp_obj_id *oid, s32_t generic_trap, s32_t specific_trap, struct snmp_varbind *varbinds)
 
err_t snmp_send_trap_generic (s32_t generic_trap)
 
err_t snmp_send_trap_specific (s32_t specific_trap, struct snmp_varbind *varbinds)
 
void snmp_coldstart_trap (void)
 
void snmp_authfail_trap (void)
 
err_t snmp_send_inform_specific (s32_t specific_trap, struct snmp_varbind *varbinds, s32_t *ptr_request_id)
 
err_t snmp_send_inform_generic (s32_t generic_trap, struct snmp_varbind *varbinds, s32_t *ptr_request_id)
 
err_t snmp_send_inform (const struct snmp_obj_id *oid, s32_t generic_trap, s32_t specific_trap, struct snmp_varbind *varbinds, s32_t *ptr_request_id)
 

Detailed Description

Function Documentation

◆ snmp_authfail_trap()

void snmp_authfail_trap ( void  )

Send authentication failure trap (used internally by agent)

◆ snmp_coldstart_trap()

void snmp_coldstart_trap ( void  )

Send coldstart trap

◆ snmp_get_auth_traps_enabled()

u8_t snmp_get_auth_traps_enabled ( void  )

Get authentication traps enabled state

Returns
TRUE if traps are enabled, FALSE if they aren't

◆ snmp_get_community_trap()

const char * snmp_get_community_trap ( void  )

Returns current SNMP community string used for sending traps.

Returns
current SNMP community string used for sending traps

◆ snmp_get_default_trap_version()

u8_t snmp_get_default_trap_version ( void  )

Get default SNMP version for sending traps

Returns
selected default version: 0 - SNMP_VERSION_1 1 - SNMP_VERSION_2c 3 - SNMP_VERSION_3

◆ snmp_send_inform()

err_t snmp_send_inform ( const struct snmp_obj_id oid,
s32_t  generic_trap,
s32_t  specific_trap,
struct snmp_varbind varbinds,
s32_t *  ptr_request_id 
)

Generic function for sending informs

Parameters
oidpoints to object identifier
generic_trapis the trap code
specific_trapused for enterprise traps when generic_trap == 6
varbindslinked list of varbinds (at the beginning of this list function will insert 2 special purpose varbinds [see RFC 3584])
ptr_request_id[out] variable in which to store request_id needed to verify acknowledgement
Returns
ERR_OK if successful

◆ snmp_send_inform_generic()

err_t snmp_send_inform_generic ( s32_t  generic_trap,
struct snmp_varbind varbinds,
s32_t *  ptr_request_id 
)

Wrapper function for sending informs

Parameters
generic_trapis the trap code
varbindslinked list of varbinds (at the beginning of this list function will insert 2 special purpose varbinds [see RFC 3584])
ptr_request_id[out] variable in which to store request_id needed to verify acknowledgement
Returns
ERR_OK if successful

◆ snmp_send_inform_specific()

err_t snmp_send_inform_specific ( s32_t  specific_trap,
struct snmp_varbind varbinds,
s32_t *  ptr_request_id 
)

Wrapper function for sending informs

Parameters
specific_trapwill be appended to enterprise oid [see RFC 3584]
varbindslinked list of varbinds (at the beginning of this list function will insert 2 special purpose varbinds [see RFC 3584])
ptr_request_id[out] variable in which to store request_id needed to verify acknowledgement
Returns
ERR_OK if successful

◆ snmp_send_trap()

err_t snmp_send_trap ( const struct snmp_obj_id oid,
s32_t  generic_trap,
s32_t  specific_trap,
struct snmp_varbind varbinds 
)

This function is a wrapper function for preparing and sending generic or specific traps.

Parameters
oidpoints to enterprise object identifier
generic_trapis the trap code
specific_trapused for enterprise traps when generic_trap == 6
varbindslinked list of varbinds to be sent
Returns
ERR_OK when success, ERR_MEM if we're out of memory
Note
the use of the enterprise identifier field is per RFC1215. Use .iso.org.dod.internet.mgmt.mib-2.snmp for generic traps and .iso.org.dod.internet.private.enterprises.yourenterprise (sysObjectID) for specific traps.

◆ snmp_send_trap_generic()

err_t snmp_send_trap_generic ( s32_t  generic_trap)

Send generic SNMP trap

Parameters
generic_trapis the trap code return ERR_OK when success

◆ snmp_send_trap_specific()

err_t snmp_send_trap_specific ( s32_t  specific_trap,
struct snmp_varbind varbinds 
)

Send specific SNMP trap with variable bindings

Parameters
specific_trapused for enterprise traps (generic_trap = 6)
varbindslinked list of varbinds to be sent
Returns
ERR_OK when success

◆ snmp_set_auth_traps_enabled()

void snmp_set_auth_traps_enabled ( u8_t  enable)

Enable/disable authentication traps

Parameters
enableenable SNMP traps

◆ snmp_set_community_trap()

void snmp_set_community_trap ( const char *const  community)

Sets SNMP community string used for sending traps. The string itself (its storage) must be valid throughout the whole life of program (or until it is changed to sth else).

Parameters
communityis a pointer to new trap community string

◆ snmp_set_default_trap_version()

void snmp_set_default_trap_version ( u8_t  snmp_version)

Choose default SNMP version for sending traps (if not specified, default version is SNMP_VERSION_1) SNMP_VERSION_1 0 SNMP_VERSION_2c 1 SNMP_VERSION_3 3

Parameters
snmp_versionversion that will be used for sending traps

◆ snmp_trap_dst_enable()

void snmp_trap_dst_enable ( u8_t  dst_idx,
u8_t  enable 
)

Sets enable switch for this trap destination.

Parameters
dst_idxindex in 0 .. SNMP_TRAP_DESTINATIONS-1
enableswitch if 0 destination is disabled >0 enabled.

◆ snmp_trap_dst_ip_set()

void snmp_trap_dst_ip_set ( u8_t  dst_idx,
const ip_addr_t dst 
)

Sets IPv4 address for this trap destination.

Parameters
dst_idxindex in 0 .. SNMP_TRAP_DESTINATIONS-1
dstIPv4 address in host order.