Go to the source code of this file.
Functions | |
int | SnmpAgentProcessRequest (SNMP_SESSION *sess, CONST uint8_t *in_data, size_t in_len, uint8_t *out_data, size_t *out_len) |
Parse incoming and create outgoing packet. | |
int | SnmpAgent (UDPSOCKET *sock) |
Run SNMP agent. |
int SnmpAgentProcessRequest | ( | SNMP_SESSION * | sess, | |
CONST uint8_t * | in_data, | |||
size_t | in_len, | |||
uint8_t * | out_data, | |||
size_t * | out_len | |||
) |
Parse incoming and create outgoing packet.
in_data | Pointer to the incoming packet. | |
in_len | Number of valid bytes in the incoming packet. | |
out_data | Pointer to a buffer for the outgoing packet. | |
out_len | Pointer to the variable that receives the number of bytes in the outgoing packet. | |
out_len | Pointer to a variable which contains the size of the output buffer on entry. On exit, it is returned as the number of valid bytes in the output buffer. |
Definition at line 302 of file snmp_agent.c.
References ASN_INTEGER, ASN_PRIMITIVE, ASN_UNIVERSAL, AsnHeaderParse(), AsnIntegerBuild(), AsnIntegerParse(), AsnSequenceBuild(), CONST, SNMP_SESSION::sess_id, SNMP_SESSION::sess_id_len, SNMP_SESSION::sess_read_view, SNMP_SESSION::sess_version, SNMP_SESSION::sess_write_view, SNMP_ACT_ACTION, SNMP_ACT_COMMIT, SNMP_ACT_FREE, SNMP_ACT_RESERVE1, SNMP_ACT_RESERVE2, SNMP_MSG_GET, SNMP_MSG_GETBULK, SNMP_MSG_GETNEXT, SNMP_MSG_RESPONSE, SNMP_MSG_SET, SNMP_STAT_INASNPARSEERRS, SNMP_STAT_INBADCOMMUNITYNAMES, SNMP_STAT_INBADVERSIONS, SNMP_STAT_INPKTS, SNMP_VERSION_1, SNMP_VERSION_2C, SnmpAuthBuild(), SnmpAuthParse(), SnmpCommunityFind(), and SnmpStatsInc().
Referenced by SnmpAgent().
int SnmpAgent | ( | UDPSOCKET * | sock | ) |
Run SNMP agent.
Normally runs in an endless loop, which is only left in case of an error.
sock | UDP socket to use. |
Definition at line 463 of file snmp_agent.c.
References free, malloc, memset(), NutUdpReceiveFrom(), NutUdpSendTo(), SNMP_MAX_LEN, SNMP_STAT_OUTPKTS, SnmpAgentProcessRequest(), and SnmpStatsInc().
Referenced by main().