Class: DHCP::Request

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

Overview

Client message to servers either (a) requesting offered parameters from one server and implicitly declining offers from all others, (b) confirming correctness of previously allocated address after, e.g., system reboot, or © extending the lease on a particular network address.

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

Returns a new instance of Request.



307
308
309
310
311
# File 'lib/net/dhcp/core.rb', line 307

def initialize(params={})
  params[:op] = $DHCP_OP_REQUEST
  params[:options] = params.fetch(:options, [MessageTypeOption.new({:payload=>[$DHCP_MSG_REQUEST]}), ParameterRequestListOption.new])
  super(params)
end