Class: DHCP::SubnetMaskOption
Overview
The subnet mask option specifies the client’s subnet mask as per RFC 950 [5].
If both the subnet mask and the router option are specified in a DHCP reply, the subnet mask option MUST be first.
The code for the subnet mask option is 1, and its length is 4 octets.
The default value for this option is 255.255.255.255
Instance Attribute Summary
Attributes inherited from Option
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ SubnetMaskOption
constructor
A new instance of SubnetMaskOption.
- #to_s ⇒ Object
Methods inherited from Option
Constructor Details
#initialize(params = {}) ⇒ SubnetMaskOption
Returns a new instance of SubnetMaskOption.
84 85 86 87 88 |
# File 'lib/net/dhcp/options.rb', line 84 def initialize(params={}) params[:type] = $DHCP_SUBNETMASK params[:payload] = params.fetch(:payload, [255, 255, 255, 255]) super(params) end |
Instance Method Details
#to_s ⇒ Object
90 91 92 |
# File 'lib/net/dhcp/options.rb', line 90 def to_s() "Subnet Mask = #{self.payload.join('.')}" end |