class SNMP::Message
- SNMP::Message
- Reference
- Object
Direct Known Subclasses
Defined in:
snmp/message.crConstructors
- .new(community : String, request : SNMP::Request, varbind : VarBind | Nil | Array(VarBind) = nil, request_id = rand(2147483647), error_status = ErrorStatus::NoError, error_index = ErrorIndex::NoError, version : SNMP::Version = Version::V2C)
- .new(snmp : Array(ASN1::BER))
Class Method Summary
-
.from_io(io : IO, format : IO::ByteFormat = IO::ByteFormat::SystemEndian)
IO serialisation support
Instance Method Summary
-
#build_reply
Builds a response object based on the current request
- #community : String
- #community=(community : String)
- #error_index
- #error_index=(value)
- #error_status
- #error_status=(value)
-
#expects_response?
Returns true if the current SNMP packet is expecting a response
- #new_request_id
-
#oid
shortcut for
.varbinds[0].oid
- #pdu : PDU | Trap | V1Trap
- #request : Request
- #request=(request : Request)
- #request_id
- #request_id=(value)
- #to_ber(pdu = @pdu.to_ber(@request.to_u8))
- #to_io(io : IO, format : IO::ByteFormat = IO::ByteFormat::SystemEndian)
-
#trap?
Returns true if the current packet is a trap / inform
-
#value
shortcut for
.varbinds[0].value
- #varbinds
- #varbinds=(value)
- #version : Version
- #version=(version : Version)
Constructor Detail
def self.new(community : String, request : SNMP::Request, varbind : VarBind | Nil | Array(VarBind) = nil, request_id = rand(2147483647), error_status = ErrorStatus::NoError, error_index = ErrorIndex::NoError, version : SNMP::Version = Version::V2C)
#
Class Method Detail
IO serialisation support