Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of lwip by
SNMP output message processing (RFC1157). More...
Go to the source code of this file.
Functions | |
static u16_t | snmp_resp_header_sum (struct snmp_msg_pstat *m_stat, u16_t vb_len) |
Sums response header field lengths from tail to head and returns resp_header_lengths for second encoding pass. | |
static u16_t | snmp_trap_header_sum (struct snmp_msg_trap *m_trap, u16_t vb_len) |
Sums trap header field lengths from tail to head and returns trap_header_lengths for second encoding pass. | |
static u16_t | snmp_varbind_list_sum (struct snmp_varbind_root *root) |
Sums varbind lengths from tail to head and annotates lengths in varbind for second encoding pass. | |
static u16_t | snmp_resp_header_enc (struct snmp_msg_pstat *m_stat, struct pbuf *p) |
Encodes response header from head to tail. | |
static u16_t | snmp_trap_header_enc (struct snmp_msg_trap *m_trap, struct pbuf *p) |
Encodes trap header from head to tail. | |
static u16_t | snmp_varbind_list_enc (struct snmp_varbind_root *root, struct pbuf *p, u16_t ofs) |
Encodes varbind list from head to tail. | |
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. | |
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 | |
struct snmp_msg_trap | trap_msg |
TRAP message structure. |
Detailed Description
SNMP output message processing (RFC1157).
Output responses and traps are build in two passes:
Pass 0: iterate over the output message backwards to determine encoding lengths Pass 1: the actual forward encoding of internal form into ASN1
The single-pass encoding method described by Comer & Stevens requires extra buffer space and copying for reversal of the packet. The buffer requirement can be prohibitively large for big payloads (>= 484) therefore we use the two encoding passes.
Definition in file msg_out.c.
Function Documentation
static u16_t snmp_resp_header_enc | ( | struct snmp_msg_pstat * | m_stat, |
struct pbuf * | p | ||
) | [static] |
static u16_t snmp_resp_header_sum | ( | struct snmp_msg_pstat * | m_stat, |
u16_t | vb_len | ||
) | [static] |
err_t snmp_send_response | ( | struct snmp_msg_pstat * | m_stat ) |
Sends a 'getresponse' message to the request originator.
- Parameters:
-
m_stat points 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
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_trap is the trap code eoid points to enterprise object identifier specific_trap used 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
void snmp_trap_dst_enable | ( | u8_t | dst_idx, |
u8_t | enable | ||
) |
void snmp_trap_dst_ip_set | ( | u8_t | dst_idx, |
ip_addr_t * | dst | ||
) |
static u16_t snmp_trap_header_enc | ( | struct snmp_msg_trap * | m_trap, |
struct pbuf * | p | ||
) | [static] |
static u16_t snmp_trap_header_sum | ( | struct snmp_msg_trap * | m_trap, |
u16_t | vb_len | ||
) | [static] |
static u16_t snmp_varbind_list_enc | ( | struct snmp_varbind_root * | root, |
struct pbuf * | p, | ||
u16_t | ofs | ||
) | [static] |
static u16_t snmp_varbind_list_sum | ( | struct snmp_varbind_root * | root ) | [static] |
Variable Documentation
Generated on Tue Jul 12 2022 11:29:38 by
