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

Inherits:
BinStruct::Array
  • Object
show all
Defined in:
lib/packetgen/header/dhcp/options.rb

Overview

Container class for DHCP Options. Accepted options are listed on DHCP_OPTIONS.

Examples:

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