Class: PacketGen::Header::SNMP::Bulk

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

Overview

Class to handle Bulk PDU

GetBulkRequest-PDU ::= [5] IMPLICIT BulkPDU

BulkPDU ::=                         -- must be identical in
      SEQUENCE {                    -- structure to PDU
          request-id      INTEGER (-214783648..214783647),
          non-repeaters   INTEGER (0..max-bindings),
          max-repetitions INTEGER (0..max-bindings),
          variable-bindings           -- values are ignored
              VarBindList
      }

This class defines 4 values accessibles through #[]:

  • :id for request-id (type RASN1::Types::Integer),

  • :non_repeaters (type RASN1::Types::Integer),

  • :max_repetitions (type RASN1::Types::Integer),

  • varbindlist for variable-bindings (type VariableBindings).

Examples:

bulk = PacketGen::Header::SNMP::Bulk.new(id: 1, non_repeaters: 2, max_repetitions: 2)
bulk[:varbindlist] << { name: '1.2.3.4', value: RASN1::Types::OctetString.new(value: "abcd") }
bulk[:id].inspect  # => "id INTEGER: 1"
bulk[:id].value    # => 1
bulk[:varbindlist][0][:name].value  # => "1.2.3.4"

Author:

  • Sylvain Daubert

  • LemonTree55

Since:

  • 2.0.0