Class: DHCP::ServerIdentifierOption
- Defined in:
- lib/net/dhcp/options.rb
Overview
This option is used in DHCPOFFER and DHCPREQUEST messages, and may optionally be included in the DHCPACK and DHCPNAK messages. DHCP servers include this option in the DHCPOFFER in order to allow the client to distinguish between lease offers. DHCP clients use the contents of the ‘server identifier’ field as the destination address for any DHCP messages unicast to the DHCP server. DHCP clients also indicate which of several lease offers is being accepted by including this option in a DHCPREQUEST message.
The identifier is the IP address of the selected server.
The code for this option is 54, and its length is 4.
The default value is 0.0.0.0
Instance Attribute Summary
Attributes inherited from Option
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ ServerIdentifierOption
constructor
A new instance of ServerIdentifierOption.
- #to_s ⇒ Object
Methods inherited from Option
Constructor Details
#initialize(params = {}) ⇒ ServerIdentifierOption
Returns a new instance of ServerIdentifierOption.
283 284 285 286 287 |
# File 'lib/net/dhcp/options.rb', line 283 def initialize(params={}) params[:type] = $DHCP_SERVIDENT params[:payload] = params.fetch(:payload, [0, 0, 0, 0]) super(params) end |
Instance Method Details
#to_s ⇒ Object
289 290 291 |
# File 'lib/net/dhcp/options.rb', line 289 def to_s "Server Identifier = #{self.payload.join('.')}" end |