class SNMP::Message

Direct Known Subclasses

Defined in:

snmp/message.cr

Constructors

Class Method Summary

Instance Method Summary

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) #

[View source]
def self.new(snmp : Array(ASN1::BER)) #

[View source]

Class Method Detail

def self.from_io(io : IO, format : IO::ByteFormat = IO::ByteFormat::SystemEndian) #

IO serialisation support


[View source]

Instance Method Detail

def build_reply #

Builds a response object based on the current request


[View source]
def community : String #

[View source]
def community=(community : String) #

[View source]
def error_index #

[View source]
def error_index=(value) #

[View source]
def error_status #

[View source]
def error_status=(value) #

[View source]
def expects_response? #

Returns true if the current SNMP packet is expecting a response


[View source]
def new_request_id #

[View source]
def oid #

shortcut for .varbinds[0].oid


[View source]
def pdu : PDU | Trap | V1Trap #

[View source]
def request : Request #

[View source]
def request=(request : Request) #

[View source]
def request_id #

[View source]
def request_id=(value) #

[View source]
def to_ber(pdu = @pdu.to_ber(@request.to_u8)) #

[View source]
def to_io(io : IO, format : IO::ByteFormat = IO::ByteFormat::SystemEndian) #

[View source]
def trap? #

Returns true if the current packet is a trap / inform


[View source]
def value #

shortcut for .varbinds[0].value


[View source]
def varbinds #

[View source]
def varbinds=(value) #

[View source]
def version : Version #

[View source]
def version=(version : Version) #

[View source]