mikroSDK Reference Manual
snmp_agent_inform.h
Go to the documentation of this file.
1
31#ifndef _SNMP_AGENT_INFORM_H
32#define _SNMP_AGENT_INFORM_H
33
34//Dependencies
35#include "core/net.h"
36#include "snmp/snmp_agent.h"
37
38//Inform notification support
39#ifndef SNMP_AGENT_INFORM_SUPPORT
40 #define SNMP_AGENT_INFORM_SUPPORT DISABLED
41#elif (SNMP_AGENT_INFORM_SUPPORT != ENABLED && SNMP_AGENT_INFORM_SUPPORT != DISABLED)
42 #error SNMP_AGENT_INFORM_SUPPORT parameter is not valid
43#endif
44
45//Maximum number of retransmissions of inform requests
46#ifndef SNMP_AGENT_INFORM_MAX_RETRIES
47 #define SNMP_AGENT_INFORM_MAX_RETRIES 5
48#elif (SNMP_AGENT_INFORM_MAX_RETRIES < 1)
49 #error SNMP_AGENT_INFORM_MAX_RETRIES parameter is not valid
50#endif
51
52//Inform request retransmission timeout
53#ifndef SNMP_AGENT_INFORM_TIMEOUT
54 #define SNMP_AGENT_INFORM_TIMEOUT 2000
55#elif (SNMP_AGENT_INFORM_TIMEOUT < 1000)
56 #error SNMP_AGENT_INFORM_TIMEOUT parameter is not valid
57#endif
58
59//C++ guard
60#ifdef __cplusplus
61extern "C" {
62#endif
63
64
69typedef enum
70{
71 SNMP_AGENT_STATE_IDLE = 0,
72 SNMP_AGENT_STATE_SENDING_GET_REQ = 1,
73 SNMP_AGENT_STATE_WAITING_REPORT = 2,
74 SNMP_AGENT_STATE_SENDING_INFORM_REQ = 3,
75 SNMP_AGENT_STATE_WAITING_GET_RESP = 4
77
78
79//SNMP inform related functions
80error_t snmpFormatInformRequestMessage(SnmpAgentContext *context,
81 SnmpVersion version, const char_t *userName, uint_t genericTrapType,
82 uint_t specificTrapCode, const SnmpTrapObject *objectList,
83 uint_t objectListSize);
84
85error_t snmpFormatInformRequestPdu(SnmpAgentContext *context,
86 SnmpVersion version, const char_t *userName, uint_t genericTrapType,
87 uint_t specificTrapCode, const SnmpTrapObject *objectList,
88 uint_t objectListSize);
89
90error_t snmpFormatGetRequestMessage(SnmpAgentContext *context,
91 SnmpVersion version);
92
93error_t snmpFormatGetRequestPdu(SnmpAgentContext *context, SnmpVersion version);
94
95error_t snmpProcessGetResponsePdu(SnmpAgentContext *context);
96error_t snmpProcessReportPdu(SnmpAgentContext *context);
97
98//C++ guard
99#ifdef __cplusplus
100}
101#endif
102
103#endif
error_t
Error codes.
Definition error.h:43
TCP/IP stack core.
SNMP agent (Simple Network Management Protocol)
SnmpAgentState
State of the inform sending process.
Definition snmp_agent_inform.h:70
SnmpVersion
SNMP version identifiers.
Definition snmp_common.h:137
Object descriptor for trap notifications.
Definition snmp_agent_trap.h:56