lwIP 2.1.2 Lightweight IP stack

Functions
Traps
Applications » SNMPv2c/v3 agent

## 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)
err_t | snmp_send_trap (const struct snmp_obj_id *eoid, 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)

## 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

## ◆ 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_send_trap()

err_t snmp_send_trap | ( | const struct snmp_obj_id * | eoid,
|  | s32_t | generic_trap,
|  | s32_t | specific_trap,
|  | struct snmp_varbind * | varbinds
| ) |  |

Sends a generic or enterprise specific trap message.

Parameters

  eoid | points to enterprise object identifier
  generic_trap | is the trap code
  specific_trap | used for enterprise traps when generic_trap == 6
  varbinds | linked 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.

send to the TRAP destination

## ◆ snmp_send_trap_generic()

err_t snmp_send_trap_generic | ( | s32_t | generic_trap | ) |

Send generic SNMP trap

## ◆ 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

## ◆ snmp_set_auth_traps_enabled()

void snmp_set_auth_traps_enabled | ( | u8_t | enable | ) |

Enable/disable authentication 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

  community | is a pointer to new trap community string

## ◆ 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_idx | index in 0 .. SNMP_TRAP_DESTINATIONS-1
  enable | switch 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_idx | index in 0 .. SNMP_TRAP_DESTINATIONS-1
  dst | IPv4 address in host order.