Class: PacketGen::Header::DHCP::Options

Inherits:
Types::Array show all
Defined in:
lib/packetgen/header/dhcp/options.rb

Overview

Container class for DHCP Options.

Add DHCP options to an Options instance

options = PacketGen::Header::DHCP::Options.new
# Add a lease_time option
options << { type: 'lease_time', value: 3600 }
# Add a domain option. Here, use integer type
options << { type: 15, value: 'example.net'}
# Add an end option
options << { type: 'end' }
# And finish with padding
options << { type: 'pad' }

Author:

  • Sylvain Daubert

Since:

  • 2.2.0

Constant Summary

Constants inherited from Types::Array

Types::Array::HUMAN_SEPARATOR

Constants included from Types::LengthFrom

Types::LengthFrom::MAX_SZ_TO_READ

Method Summary

Methods inherited from Types::Array

#<<, #==, #[], #clear, #clear!, #delete, #delete_at, #each, #empty?, #first, #initialize, #initialize_copy, #last, #push, #read, set_of, set_of_klass, #size, #sz, #to_a, #to_human, #to_s

Methods included from Types::LengthFrom

#initialize_length_from, #read_with_length_from, #sz_to_read

Methods included from Types::Fieldable

#format_inspect, #read, #sz, #to_human, #to_s, #type_name

Constructor Details

This class inherits a constructor from PacketGen::Types::Array