Class: DHCP::VendorClassIDOption

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

Overview

This option is used by DHCP clients to optionally identify the vendor type and configuration of a DHCP client. The information is a string of n octets, interpreted by servers. Vendors may choose to define specific vendor class identifiers to convey particular configuration or other identification information about a client. For example, the identifier may encode the client’s hardware configuration. Servers not equipped to interpret the class-specific information sent by a client MUST ignore it (although it may be reported). Servers that

respond SHOULD only use option 43 to return the vendor-specific information to the client.

The code for this option is 60, and its minimum length is 1.

The default value is: ‘etdsoft’

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 = {}) ⇒ VendorClassIDOption

Returns a new instance of VendorClassIDOption.



335
336
337
338
339
# File 'lib/net/dhcp/options.rb', line 335

def initialize(params={})
  params[:type] = $DHCP_CLASSSID
  params[:payload] = params.fetch(:payload, 'etdsoft'.unpack('C*'))
  super(params)
end

Instance Method Details

#to_sObject



341
342
343
# File 'lib/net/dhcp/options.rb', line 341

def to_s()
  "Vendor class identifier = #{self.payload.pack('C*')}"
end