Class: DHCP::MaximumMsgSizeOption

Inherits:
Option
  • Object
show all
Defined in:
lib/net/dhcp/options.rb

Overview

from rfc2132: This option specifies the maximum length DHCP message that it is willing to accept. The length is specified as an unsigned 16-bit integer. A client may use the maximum DHCP message size option in DHCPDISCOVER or DHCPREQUEST messages, but should not use the option in DHCPDECLINE messages.

Instance Attribute Summary

Attributes inherited from Option

#len, #payload, #type

Instance Method Summary collapse

Methods inherited from Option

#eql?, #pack, #to_a

Constructor Details

#initialize(params = {}) ⇒ MaximumMsgSizeOption

Returns a new instance of MaximumMsgSizeOption.



493
494
495
496
497
# File 'lib/net/dhcp/options.rb', line 493

def initialize(params={})
  params[:type] = $DHCP_MAXMSGSIZE
  params[:payload] = params.fetch(:payload, [1024].pack('n').unpack('C*'))
  super(params)
end

Instance Method Details

#to_sObject



499
500
501
# File 'lib/net/dhcp/options.rb', line 499

def to_s
  "Maximum Message Size = #{self.payload}"
end