Class: DHCP::RouterOption

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

Overview

The router option specifies a list of IP addresses for routers on the client’s subnet. Routers SHOULD be listed in order of preference.

The code for the router option is 3. The minimum length for the router option is 4 octets, and the length MUST always be a multiple of 4.

The default value for this option is 0.0.0.0

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 = {}) ⇒ RouterOption

Returns a new instance of RouterOption.



105
106
107
108
109
# File 'lib/net/dhcp/options.rb', line 105

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

Instance Method Details

#to_sObject



111
112
113
# File 'lib/net/dhcp/options.rb', line 111

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