DeterministicESPAsyncWebServer v6.27.1
Zero-allocation, bounded-execution async HTTP server for ESP32
Loading...
Searching...
No Matches
snmp_agent.h File Reference

Zero-heap SNMP v1/v2c agent: PDU processing + a fixed MIB table. More...

#include "ServerConfig.h"
#include "services/snmp/snmp_ber.h"
#include <stddef.h>
#include <stdint.h>

Go to the source code of this file.

Detailed Description

Zero-heap SNMP v1/v2c agent: PDU processing + a fixed MIB table.

The agent is split into a pure, host-testable core and an ESP32-only UDP transport (mirroring how the provisioning service splits its form parser from its lwIP DNS responder):

  • snmp_agent_process() takes a complete request datagram and produces a complete response datagram in a caller buffer - no sockets, no heap. It is unit-tested on the host (env:native_snmp).
  • snmp_agent_begin_udp() binds the agent on :161 via the det_udp_* transport API (Arduino only) and feeds received datagrams through snmp_agent_process().

The MIB is a fixed BSS table of SNMP_MAX_MIB_ENTRIES objects. Register objects with snmp_agent_add_*; values are either static (stored in the entry) or fetched through a getter callback (e.g. sysUpTime). All string/OID values are referenced by pointer and must outlive the agent (point them at flash/static data, exactly like the rest of the library's strings).

Get / GetNext / GetBulk / Set are supported. GetBulk and per-varbind exceptions (noSuchObject / noSuchInstance / endOfMibView) apply to v2c; v1 uses the classic error-status / error-index reporting. SNMPv3 (USM) is a separate, gated layer.

Definition in file snmp_agent.h.