Class: DHCP::Offer

Inherits:
Message show all
Defined in:
lib/net/dhcp/core.rb

Overview

Server to client in response to DHCPDISCOVER with offer of configuration parameters.

By default an ACK message will contain a Server Identifier (0.0.0.0) and a Domain Name (‘nomejortu.com’) option.

Instance Attribute Summary

Attributes inherited from Message

#chaddr, #ciaddr, #flags, #fname, #giaddr, #hlen, #hops, #htype, #op, #options, #secs, #siaddr, #sname, #xid, #yiaddr

Instance Method Summary collapse

Methods inherited from Message

#==, #eql?, from_udp_payload, #pack, #to_s

Constructor Details

#initialize(params = {}) ⇒ Offer

Returns a new instance of Offer.



291
292
293
294
295
296
297
298
299
# File 'lib/net/dhcp/core.rb', line 291

def initialize(params={})
  params[:op] = $DHCP_OP_REPLY
  params[:options] = params.fetch(:options, [
  MessageTypeOption.new({:payload=>[$DHCP_MSG_OFFER]}), 
  ServerIdentifierOption.new,
  DomainNameOption.new
  ])
  super(params)
end