Class: DHCP::RequestedIPAddressOption
- Defined in:
- lib/net/dhcp/options.rb
Overview
This option is used in a client request (DHCPDISCOVER) to allow the client to request that a particular IP address be assigned.
The code for this option is 50, and its length is 4.
The default value for this option is 0.0.0.0
Instance Attribute Summary
Attributes inherited from Option
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ RequestedIPAddressOption
constructor
A new instance of RequestedIPAddressOption.
- #to_s ⇒ Object
Methods inherited from Option
Constructor Details
#initialize(params = {}) ⇒ RequestedIPAddressOption
Returns a new instance of RequestedIPAddressOption.
201 202 203 204 205 |
# File 'lib/net/dhcp/options.rb', line 201 def initialize(params={}) params[:type] = $DHCP_DISCOVERADDR params[:payload] = params.fetch(:payload, [0, 0, 0, 0]) super(params) end |
Instance Method Details
#to_s ⇒ Object
207 208 209 |
# File 'lib/net/dhcp/options.rb', line 207 def to_s "Requested IP address = #{self.payload.join('.')}" end |