Class: PacketGen::Header::SNMP::VariableBindings

Inherits:
RASN1::Model
  • Object
show all
Defined in:
lib/packetgen/header/snmp.rb

Overview

Class to handle SNMP VariableBindingsList

VarBindList ::= SEQUENCE (SIZE (0..max-bindings)) OF VarBind

This is a sequence of VarBind.

Examples:

bindings = PacketGen::Header::SNMP::VariableBindings.new
bindings << { name: "1.2.3.4", value: RASN1::Types::OctetString.new(value: "abc") }

Author:

  • Sylvain Daubert

  • LemonTree55

Since:

  • 2.0.0

Instance Method Summary collapse

Instance Method Details

#[](idx) ⇒ VarBind?

Get ‘idx’th element from the list

Returns:

Since:

  • 2.0.0

[View source]

136
137
138
# File 'lib/packetgen/header/snmp.rb', line 136

def [](idx)
  value[idx]
end

#sizeInteger

Get element counts in list

Returns:

  • (Integer)

Since:

  • 2.0.0

[View source]

142
143
144
# File 'lib/packetgen/header/snmp.rb', line 142

def size
  value.size
end