31#ifndef _SNMP_AGENT_MESSAGE_H
32#define _SNMP_AGENT_MESSAGE_H
39#define SNMP_V1_MSG_HEADER_OVERHEAD 48
41#define SNMP_V2C_MSG_HEADER_OVERHEAD 37
43#define SNMP_V3_MSG_HEADER_OVERHEAD 105
57 uint8_t buffer[SNMP_MAX_MSG_SIZE];
62#if (SNMP_V1_SUPPORT == ENABLED || SNMP_V2C_SUPPORT == ENABLED)
66#if (SNMP_V3_SUPPORT == ENABLED)
90#if (SNMP_V1_SUPPORT == ENABLED)
98#if (SNMP_V2C_SUPPORT == ENABLED || SNMP_V3_SUPPORT == ENABLED)
119 const uint8_t *value;
126error_t snmpInitResponse(SnmpAgentContext *context);
148error_t snmpEncodeInt32(int32_t value, uint8_t *dest,
size_t *length);
149error_t snmpEncodeUnsignedInt32(uint32_t value, uint8_t *dest,
size_t *length);
150error_t snmpEncodeUnsignedInt64(uint64_t value, uint8_t *dest,
size_t *length);
152error_t snmpDecodeInt32(
const uint8_t *src,
size_t length, int32_t *value);
153error_t snmpDecodeUnsignedInt32(
const uint8_t *src,
size_t length, uint32_t *value);
154error_t snmpDecodeUnsignedInt64(
const uint8_t *src,
size_t length, uint64_t *value);
error_t
Error codes.
Definition error.h:43
uint32_t Ipv4Addr
IPv4 network address.
Definition ipv4.h:267
SNMP agent (Simple Network Management Protocol)
SnmpPduType
SNMP PDU types.
Definition snmp_common.h:149
SNMP message.
Definition snmp_agent_message.h:56
size_t bufferLen
Original length of the message.
Definition snmp_agent_message.h:58
const uint8_t * msgPrivParameters
Privacy parameters.
Definition snmp_agent_message.h:79
const uint8_t * msgAuthEngineId
Authoritative engine identifier.
Definition snmp_agent_message.h:71
int32_t msgMaxSize
Maximum message size supported by the sender.
Definition snmp_agent_message.h:68
uint8_t * pos
Current position.
Definition snmp_agent_message.h:59
int32_t version
SNMP version identifier.
Definition snmp_agent_message.h:61
Ipv4Addr agentAddr
Address of object generating trap.
Definition snmp_agent_message.h:93
int32_t msgAuthEngineTime
Number of seconds since last reboot.
Definition snmp_agent_message.h:74
SnmpPduType pduType
PDU type.
Definition snmp_agent_message.h:86
int32_t requestId
Request identifier.
Definition snmp_agent_message.h:87
int32_t nonRepeaters
GetBulkRequest-PDU specific parameter.
Definition snmp_agent_message.h:99
size_t contextNameLen
Length of the context name.
Definition snmp_agent_message.h:84
int32_t errorIndex
Error index.
Definition snmp_agent_message.h:89
size_t enterpriseOidLen
Length of the enterprise OID.
Definition snmp_agent_message.h:92
const uint8_t * contextEngineId
Context engine identifier.
Definition snmp_agent_message.h:81
size_t msgAuthParametersLen
Length of the authentication parameters.
Definition snmp_agent_message.h:78
uint8_t msgFlags
Bit fields which control processing of the message.
Definition snmp_agent_message.h:69
const uint8_t * enterpriseOid
Type of object generating trap.
Definition snmp_agent_message.h:91
size_t communityLen
Length of the community name.
Definition snmp_agent_message.h:64
const char_t * msgUserName
User name.
Definition snmp_agent_message.h:75
int32_t msgSecurityModel
Security model used by the sender.
Definition snmp_agent_message.h:70
size_t varBindListLen
Length of the list in bytes.
Definition snmp_agent_message.h:103
uint8_t * varBindList
List of variable bindings.
Definition snmp_agent_message.h:102
size_t oidLen
Length of the object identifier.
Definition snmp_agent_message.h:105
size_t varBindListMaxLen
Maximum length of the list in bytes.
Definition snmp_agent_message.h:104
size_t length
Length of the message.
Definition snmp_agent_message.h:60
int32_t msgId
Message identifier.
Definition snmp_agent_message.h:67
const char_t * contextName
Context name.
Definition snmp_agent_message.h:83
size_t msgAuthEngineIdLen
Length of the authoritative engine identifier.
Definition snmp_agent_message.h:72
int32_t genericTrapType
Generic trap type.
Definition snmp_agent_message.h:94
int32_t msgAuthEngineBoots
Number of times the SNMP engine has rebooted.
Definition snmp_agent_message.h:73
uint8_t * msgAuthParameters
Authentication parameters.
Definition snmp_agent_message.h:77
const char_t * community
Community name.
Definition snmp_agent_message.h:63
size_t msgUserNameLen
Length of the user name.
Definition snmp_agent_message.h:76
int32_t specificTrapCode
Specific trap code.
Definition snmp_agent_message.h:95
size_t contextEngineIdLen
Length of the context engine identifier.
Definition snmp_agent_message.h:82
int32_t maxRepetitions
GetBulkRequest-PDU specific parameter.
Definition snmp_agent_message.h:100
int32_t errorStatus
Error status.
Definition snmp_agent_message.h:88
uint32_t timestamp
Timestamp.
Definition snmp_agent_message.h:96
size_t msgPrivParametersLen
Length of the privacy parameters.
Definition snmp_agent_message.h:80
Variable binding.
Definition snmp_agent_message.h:114