30#ifndef DETERMINISTICESPASYNCWEBSERVER_SNMP_AGENT_H
31#define DETERMINISTICESPASYNCWEBSERVER_SNMP_AGENT_H
41enum class SnmpVersion : uint8_t
49enum class SnmpErr : uint8_t
51 SNMP_ERR_NO_ERROR = 0,
53 SNMP_ERR_NO_SUCH_NAME = 2,
54 SNMP_ERR_BAD_VALUE = 3,
55 SNMP_ERR_READ_ONLY = 4,
57 SNMP_ERR_NO_ACCESS = 6,
58 SNMP_ERR_WRONG_TYPE = 7,
59 SNMP_ERR_NOT_WRITABLE = 17,
83typedef bool (*SnmpGetFn)(SnmpValue *out);
85typedef bool (*SnmpSetFn)(
const SnmpValue *in);
97void snmp_agent_init(
const char *ro_community =
"public");
100void snmp_agent_set_rw_community(
const char *rw_community);
110void snmp_agent_set_system(
const char *descr,
const char *contact,
const char *name,
const char *location,
114bool snmp_agent_add_string(
const uint32_t *oid,
size_t oid_len,
const char *value, SnmpSetFn setter =
nullptr);
116bool snmp_agent_add_integer(
const uint32_t *oid,
size_t oid_len,
long value, SnmpSetFn setter =
nullptr);
118bool snmp_agent_add_dynamic(
const uint32_t *oid,
size_t oid_len, uint8_t type, SnmpGetFn getter);
137size_t snmp_agent_process(
const uint8_t *req,
size_t req_len, uint8_t *resp,
size_t resp_cap);
154size_t snmp_dispatch_pdu(
const uint8_t *pdu,
size_t pdu_len,
bool allow_write,
bool v2c, uint8_t *out,
size_t out_cap);
166void snmp_agent_begin_udp(uint16_t port = 161);
User-facing configuration for DeterministicESPAsyncWebServer.
Zero-heap ASN.1 BER encoder/decoder for the SNMP agent (DETWS_ENABLE_SNMP).