class

SNMP::V3::Message

Inherits SNMP::Message / Reference / Object

Constants

MAX_MESSAGE_SIZE = 65507

Largest UDP payload (65535 - 20-byte IP - 8-byte UDP header) — advertised as msgMaxSize, the biggest response this engine will accept.

MSG_MAX_SIZE = ASN1::BER.new.set_integer(MAX_MESSAGE_SIZE)
MSG_VERSION = ASN1::BER.new.set_integer(Version::V3.to_i)
PRIVNONE = ASN1::BER.new.set_string("", tag: UniversalTags::OctetString)

Constructors

new(snmp : Array(ASN1::BER), security = nil)
Source
new(scoped_pdu : ScopedPDU, security_params : SecurityParams, security : Security | Nil = nil, security_model : SNMP::V3::SecurityModel = SecurityModel::USM, id : Int32 = rand(REQUEST_ID_RANGE))
Source
new(snmp : ASN1::BER, security : Security | Nil = nil)
Source

Instance methods

community=(id)

Mirrors engine_id= — see the note above; kept for SNMP::Message compatibility.

Source
engine_id

In SNMPv3 the authoritative engine id plays the role the community string plays in v1/v2c. engine_id is the meaningful accessor here; the inherited community field is kept in sync only so code shared with SNMP::Message (which reads #community) keeps working — prefer engine_id in v3 code.

Source
engine_id=(id)
Source
flags
Source
flags=(flags : MessageFlags)
Source
id=(id : Int32)
Source
max_size
Source
max_size=(max_size : Int32)
Source
new_request_id
Source
pdu=(pdu)
Source
report?

True if this is a Report PDU (RFC 3412 6.2.6) — the agent's error report.

Source
request=(type : Request)
Source
scoped_pdu
Source
scoped_pdu=(scoped_pdu : ScopedPDU)
Source
security_model
Source
security_model=(security_model : SecurityModel)
Source
security_params
Source
security_params=(security_params : SecurityParams)
Source
sign(security, scoped_pdu = @scoped_pdu.to_ber)
Source
to_ber(scoped_pdu = @scoped_pdu.to_ber)

The scoped PDU can be passed in as a BER for passing in encrypted values

Source
usm_stat

The usmStats counter this Report names, or nil if it is not a usmStats Report.

Source
verify(security, scoped_pdu = @scoped_pdu.to_ber)
Source