Class: DHCP::DomainNameOption

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

Overview

This option specifies the domain name that client should use when resolving hostnames via the Domain Name System.

The code for this option is 15. Its minimum length is 1.

The default value for this option is “nomejortu.com”

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

Returns a new instance of DomainNameOption.



164
165
166
167
168
# File 'lib/net/dhcp/options.rb', line 164

def initialize(params={})
  params[:type] = $DHCP_DOMAINNAME
  params[:payload] = params.fetch(:payload, 'nomejortu.com'.unpack('C*'))
  super(params)
end

Instance Method Details

#to_sObject



170
171
172
# File 'lib/net/dhcp/options.rb', line 170

def to_s()
  "Domain Name = #{self.payload.pack('C*')}"
end