30#ifndef PROTOCORE_SNMP_AGENT_H
31#define PROTOCORE_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 pc_snmp_agent_init(
const char *ro_community =
"public");
100void pc_snmp_agent_set_rw_community(
const char *rw_community);
110void pc_snmp_agent_set_system(
const char *descr,
const char *contact,
const char *name,
const char *location,
114bool pc_snmp_agent_add_string(
const uint32_t *oid,
size_t oid_len,
const char *value, SnmpSetFn setter =
nullptr);
116bool pc_snmp_agent_add_integer(
const uint32_t *oid,
size_t oid_len,
long value, SnmpSetFn setter =
nullptr);
118bool pc_snmp_agent_add_dynamic(
const uint32_t *oid,
size_t oid_len, uint8_t type, SnmpGetFn getter);
137size_t pc_snmp_agent_process(
const uint8_t *req,
size_t req_len, uint8_t *resp,
size_t pc_resp_cap);
154size_t pc_snmp_dispatch_pdu(
const uint8_t *pdu,
size_t pdu_len,
bool allow_write,
bool v2c, uint8_t *out,
167void pc_snmp_agent_begin_udp(uint16_t port = 161);
User-facing configuration for ProtoCore.