SnmpKit.Agent.Request (snmpkit v2.0.1)
Answers one request PDU against an agent's registered subtrees: GET,
GETNEXT, GETBULK and SET with SNMPv1 and SNMPv2c/v3 semantics (RFC 1157,
RFC 3416, and the v1/v2 error mapping of RFC 3584). Used by
SnmpKit.Agent; it has no state of its own.
Summary
Functions
Handles pdu (as delivered by SnmpKit.SnmpSim.Core.Server) and returns
the response PDU. subtrees must be sorted by prefix, longest first;
level is the requester's access: :read, :write, or :none for a
principal the agent does not know, whose request is not answered at all
(:drop), whatever its type. The server drops unknown communities and
USM rejects unknown v3 users before a PDU gets here, so :none is a
second line of defence, not the normal path.
The value at oid, as the agent would answer a GET for it.
The object after oid, as the agent would answer a GETNEXT.
Types
@type subtree() :: %{prefix: [non_neg_integer()], module: module(), ctx: term()}
Functions
Handles pdu (as delivered by SnmpKit.SnmpSim.Core.Server) and returns
the response PDU. subtrees must be sorted by prefix, longest first;
level is the requester's access: :read, :write, or :none for a
principal the agent does not know, whose request is not answered at all
(:drop), whatever its type. The server drops unknown communities and
USM rejects unknown v3 users before a PDU gets here, so :none is a
second line of defence, not the normal path.
@spec lookup([non_neg_integer()], [subtree()]) :: {:ok, {atom(), term()}} | {:error, :no_such_object | :no_such_instance}
The value at oid, as the agent would answer a GET for it.
@spec next([non_neg_integer()], [subtree()]) :: {:ok, {[non_neg_integer()], atom(), term()}} | :end_of_mib_view
The object after oid, as the agent would answer a GETNEXT.