Class: DHCP::SubnetSelectionOption
- Defined in:
- lib/net/dhcp/options.rb
Overview
The subnet selection option is a DHCP option. The option contains a single IPv4 address that is the address of a subnet. The value for the subnet address is determined by taking any IPv4 address on the subnet and ANDing that address with the subnet mask (i.e.: the network and subnet bits are left alone and the remaining (address) bits are set to zero). When the DHCP server is configured to respond to this option, is allocating an address, and this option is present then the DHCP server MUST allocate the address on either:
- the subnet specified in the subnet selection option, or;
- a subnet on the same network segment as the subnet specified in the
subnet selection option.
The code for this option is 118, and its length is 4.
Instance Attribute Summary
Attributes inherited from Option
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ SubnetSelectionOption
constructor
A new instance of SubnetSelectionOption.
- #to_s ⇒ Object
Methods inherited from Option
Constructor Details
#initialize(params = {}) ⇒ SubnetSelectionOption
574 575 576 577 578 |
# File 'lib/net/dhcp/options.rb', line 574 def initialize(params={}) params[:type] = $DHCP_SUBNET_SELECTION params[:payload] = params.fetch(:payload) super(params) end |
Instance Method Details
#to_s ⇒ Object
580 581 582 |
# File 'lib/net/dhcp/options.rb', line 580 def to_s() "Subnet Selection = #{self.payload.join('.')}" end |