SnmpKit.SnmpLib.Security.EngineCache (snmpkit v2.0.1)
Remembers what the manager has learned about remote SNMPv3 engines: the
authoritative engine id of each {host, port} and its boots/time, so a
request does not need a discovery round trip and a time synchronisation
every time.
Entries are refreshed whenever an agent answers with a
usmStatsNotInTimeWindows or usmStatsUnknownEngineIDs report.
Summary
Functions
Returns a specification to start this module under a supervisor.
Forgets one engine or, with no argument, every engine.
The agent's engine time as of now, from a cached entry.
The cached entry for {host, port}, or nil.
Stores the engine id and current boots/time of {host, port}.
Types
@type entry() :: %{ engine_id: binary(), engine_boots: non_neg_integer(), time_offset: integer(), learned_at: integer() }
@type key() :: {:inet.ip_address() | String.t(), :inet.port_number()}
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec clear(key() | nil) :: :ok
Forgets one engine or, with no argument, every engine.
@spec current_time(entry()) :: non_neg_integer()
The agent's engine time as of now, from a cached entry.
The cached entry for {host, port}, or nil.
@spec store(key(), binary(), non_neg_integer(), non_neg_integer()) :: :ok
Stores the engine id and current boots/time of {host, port}.