class

SNMP::V3::Session

Inherits Reference / Object

Constants

MAX_ENGINE_BOOTS = 2147483647

The largest snmpEngineBoots value; reaching it forces a re-keying (RFC 3414 3.2.7).

TIME_WINDOW = 150

RFC 3414 3.2.7 tolerated clock skew for inbound authenticated messages. Distinct from TIMELINESS_THRESHOLD above, which drives local re-probing.

TIMELINESS_THRESHOLD = 140_i64

Timeliness is part of SNMP V3 Security The topic is described very nice here https://www.snmpsharpnet.com/?page_id=28 https://www.ietf.org/rfc/rfc2574.txt 1.4.1 Timeliness The probe is outdated after 150 seconds which results in a PDU Error, therefore it should expire before that and be renewed The 150 Seconds is specified in https://www.ietf.org/rfc/rfc2574.txt 2.2.3

Constructors

new(security : V3::Security)
Source
new(username, auth_password = "", priv_password = "", engine_id : String = "", auth_protocol = Security::AuthProtocol::MD5, priv_protocol = Security::PrivacyProtocol::DES)
Source

Instance methods

check_timeliness(message : V3::Message) : Nil

Enforce the RFC 3414 3.2.7 time window on an inbound authenticated message and advance the local notion of the remote engine's (boots, time).

Only authenticated messages carry a meaningful timeliness, and a baseline must already have been established (via discovery/validate); otherwise the call is a no-op. Raises Security::NotInTimeWindowError on a replayed or out-of-window message.

Source
engine_boots
Source
engine_id
Source
engine_time
Source
engine_validation_probe
Source
get(oids : Enumerable(String), request_id = rand(REQUEST_ID_RANGE), message_id = rand(REQUEST_ID_RANGE), security_model = @security.security_model)

Multi-varbind Get: one GetRequest carrying every OID (RFC 3416), answered by a single Response with N varbinds.

Source
get(oid, request_id = rand(REQUEST_ID_RANGE), message_id = rand(REQUEST_ID_RANGE), security_model = @security.security_model)
Source
get_bulk(oids : Enumerable(String), non_repeaters = 0, max_repetitions = 10, request_id = rand(REQUEST_ID_RANGE), message_id = rand(REQUEST_ID_RANGE), security_model = @security.security_model)

GetBulk (RFC 3416): up to max_repetitions successors per repeating varbind in one round-trip; the first non_repeaters OIDs act as plain GetNext.

Source
get_next(oids : Enumerable(String), request_id = rand(REQUEST_ID_RANGE), message_id = rand(REQUEST_ID_RANGE), security_model = @security.security_model)
Source
get_next(oid, request_id = rand(REQUEST_ID_RANGE), message_id = rand(REQUEST_ID_RANGE), security_model = @security.security_model)
Source
must_revalidate?
Source
parse(message : ASN1::BER, security = @security) : V3::Message

Decode a v3 message, rejecting any other version. security defaults to this session's so the HMAC is verified and the message timeliness checked; pass nil to decode without verification (e.g. an engine-discovery probe).

Source
prepare(message : V3::Message) : ASN1::BER
Source
reboot

Note:: only used when being queried

Source
resync_from(message : V3::Message)

Re-sync the local engine identity / clock from an authoritative message (typically a usmStats Report), so a retried request carries fresh values. The engine id is only overwritten when the message actually carries one.

Source
security
Source
session_created
Source
set(values : Hash(String, _), request_id = rand(REQUEST_ID_RANGE), message_id = rand(REQUEST_ID_RANGE), security_model = @security.security_model)

Multi-varbind Set: one SetRequest assigning every OID => value pair (Hash keeps insertion order).

Source
set(oid, value, request_id = rand(REQUEST_ID_RANGE), message_id = rand(REQUEST_ID_RANGE), security_model = @security.security_model)
Source
timeliness

Monotonic instant of the last engine sync / session start (nil = never synced).

Source
update_time
Source
validate(message : ASN1::BER)
Source
validate(message : V3::Message)
Source