Class: DHCP::BroadcastAddressOption

Inherits:
Option
  • Object
show all
Defined in:
lib/net/dhcp/options.rb

Overview

This option specifies the broadcast address in use on the client’s subnet. Legal values for broadcast addresses are specified in section 3.2.1.3 of [4].

The code for this option is 28, and its length is 4.

The default value for this option is 255.255.255.255

Instance Attribute Summary

Attributes inherited from Option

#len, #payload, #type

Instance Method Summary collapse

Methods inherited from Option

#eql?, #pack, #to_a

Constructor Details

#initialize(params = {}) ⇒ BroadcastAddressOption

Returns a new instance of BroadcastAddressOption.



183
184
185
186
187
# File 'lib/net/dhcp/options.rb', line 183

def initialize(params={})
  params[:type] = $DHCP_BROADCASTADDR
  params[:payload] = params.fetch(:payload, [255, 255, 255, 255])
  super(params)
end

Instance Method Details

#to_sObject



189
190
191
# File 'lib/net/dhcp/options.rb', line 189

def to_s()
  "Broadcast Adress = #{self.payload.join('.')}"
end