fdsf

Dependents:   sisk_proj_stat MQTT Hello_FXOS8700Q WireFSHandControl ... more

Embed: (wiki syntax)

« Back to documentation index

snmp_msg.h File Reference

snmp_msg.h File Reference

SNMP Agent message handling structures. More...

Go to the source code of this file.

Data Structures

struct  snmp_resp_header_lengths
 output response message header length fields More...
struct  snmp_trap_header_lengths
 output response message header length fields More...

Functions

void snmp_init (void)
 Agent setup, start listening to port 161.
void snmp_trap_dst_enable (u8_t dst_idx, u8_t enable)
 Sets enable switch for this trap destination.
void snmp_trap_dst_ip_set (u8_t dst_idx, ip_addr_t *dst)
 Sets IPv4 address for this trap destination.
struct snmp_varbind * snmp_varbind_alloc (struct snmp_obj_id *oid, u8_t type, u8_t len)
 Varbind-list functions.
void snmp_msg_event (u8_t request_id)
 Handle an internal (recv) or external (private response) event.
err_t snmp_send_response (struct snmp_msg_pstat *m_stat)
 Sends a 'getresponse' message to the request originator.
err_t snmp_send_trap (s8_t generic_trap, struct snmp_obj_id *eoid, s32_t specific_trap)
 Sends an generic or enterprise specific trap message.

Variables

const s32_t snmp_version
 Agent Version constant, 0 = v1 oddity.
const char snmp_publiccommunity [7]
 Agent default "public" community string.
struct snmp_msg_trap trap_msg
 TRAP message structure.

Detailed Description

SNMP Agent message handling structures.

Definition in file snmp_msg.h.


Function Documentation

void snmp_init ( void   )

Agent setup, start listening to port 161.

Agent setup, start listening to port 161.

Allocates UDP pcb and binds it to IP_ADDR_ANY port 161.

Definition at line 71 of file msg_in.c.

void snmp_msg_event ( u8_t  request_id )

Handle an internal (recv) or external (private response) event.

Handle an internal (recv) or external (private response) event.

Called for one async event. (recv external/private answer)

Parameters:
request_ididentifies requests from 0 to (SNMP_CONCURRENT_REQUESTS-1)

Definition at line 784 of file msg_in.c.

err_t snmp_send_response ( struct snmp_msg_pstat *  m_stat )

Sends a 'getresponse' message to the request originator.

Parameters:
m_statpoints to the current message request state source
Returns:
ERR_OK when success, ERR_MEM if we're out of memory
Note:
the caller is responsible for filling in outvb in the m_stat and provide error-status and index (except for tooBig errors) ...

connect to the originating source

disassociate remote address and port with this pcb

Definition at line 113 of file msg_out.c.

err_t snmp_send_trap ( s8_t  generic_trap,
struct snmp_obj_id eoid,
s32_t  specific_trap 
)

Sends an generic or enterprise specific trap message.

Parameters:
generic_trapis the trap code
eoidpoints to enterprise object identifier
specific_trapused for enterprise traps when generic_trap == 6
Returns:
ERR_OK when success, ERR_MEM if we're out of memory
Note:
the caller is responsible for filling in outvb in the trap_msg
the use of the enterpise 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

Definition at line 220 of file msg_out.c.

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.

Definition at line 81 of file msg_out.c.

void snmp_trap_dst_ip_set ( u8_t  dst_idx,
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.

Definition at line 95 of file msg_out.c.

struct snmp_varbind* snmp_varbind_alloc ( struct snmp_obj_id oid,
u8_t  type,
u8_t  len 
) [read]

Varbind-list functions.

Definition at line 1303 of file msg_in.c.


Variable Documentation

const char snmp_publiccommunity[7]

Agent default "public" community string.

Definition at line 54 of file msg_in.c.

const s32_t snmp_version

Agent Version constant, 0 = v1 oddity.

Definition at line 52 of file msg_in.c.

struct snmp_msg_trap trap_msg

TRAP message structure.

Definition at line 65 of file msg_out.c.