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:, **options) ⇒ ScopedPDU
constructor
A new instance of ScopedPDU.
Methods inherited from PDU
#add_varbind, build, decode, #to_asn, #to_der
Constructor Details
#initialize(type:, headers:, **options) ⇒ ScopedPDU
Returns a new instance of ScopedPDU.
7 8 9 10 |
# File 'lib/netsnmp/scoped_pdu.rb', line 7 def initialize(type:, headers:, **) @engine_id, @context = headers super(type: type, headers: [3, nil], **) end |
Instance Attribute Details
#engine_id ⇒ Object (readonly)
Returns the value of attribute engine_id.
5 6 7 |
# File 'lib/netsnmp/scoped_pdu.rb', line 5 def engine_id @engine_id end |
Instance Method Details
#encode_headers_asn ⇒ Object
12 13 14 15 |
# File 'lib/netsnmp/scoped_pdu.rb', line 12 def encode_headers_asn [OpenSSL::ASN1::OctetString.new(@engine_id || ""), OpenSSL::ASN1::OctetString.new(@context || "")] end |