Class: NETSNMP::ScopedPDU
Constant Summary
Constants inherited from PDU
Instance Attribute Summary collapse
-
#engine_id ⇒ Object
readonly
Returns the value of attribute engine_id.
Attributes inherited from PDU
#community, #request_id, #type, #varbinds, #version
Instance Method Summary collapse
- #encode_headers_asn ⇒ Object
-
#initialize(type:, headers:, request_id: nil, error_status: 0, error_index: 0, varbinds: []) ⇒ ScopedPDU
constructor
A new instance of ScopedPDU.
Methods inherited from PDU
#add_varbind, build, decode, #to_asn, #to_der
Constructor Details
#initialize(type:, headers:, request_id: nil, error_status: 0, error_index: 0, varbinds: []) ⇒ ScopedPDU
Returns a new instance of ScopedPDU.
8 9 10 11 12 13 14 15 |
# File 'lib/netsnmp/scoped_pdu.rb', line 8 def initialize(type: , headers:, request_id: nil, error_status: 0, error_index: 0, varbinds: []) @engine_id, @context = headers super(type: type, headers: [3, nil], request_id: request_id, varbinds: varbinds) end |
Instance Attribute Details
#engine_id ⇒ Object (readonly)
Returns the value of attribute engine_id.
6 7 8 |
# File 'lib/netsnmp/scoped_pdu.rb', line 6 def engine_id @engine_id end |
Instance Method Details
#encode_headers_asn ⇒ Object
17 18 19 20 |
# File 'lib/netsnmp/scoped_pdu.rb', line 17 def encode_headers_asn [ OpenSSL::ASN1::OctetString.new(@engine_id || ""), OpenSSL::ASN1::OctetString.new(@context || "") ] end |