Class: DHCP::ClientIdentifierOption

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

Overview

This option is used by DHCP clients to specify their unique identifier. DHCP servers use this value to index their database of address bindings. This value is expected to be unique for all clients in an administrative domain.

Identifiers SHOULD be treated as opaque objects by DHCP servers.

The client identifier MAY consist of type-value pairs similar to the ‘htype’/‘chaddr’ fields defined in [3]. For instance, it MAY consist of a hardware type and hardware address. In this case the type field SHOULD be one of the ARP hardware types defined in STD2 [22]. A hardware type of 0 (zero) should be used when the value field contains an identifier other than a hardware address (e.g. a fully qualified domain name).

For correct identification of clients, each client’s client- identifier MUST be unique among the client-identifiers used on the subnet to which the client is attached. Vendors and system administrators are responsible for choosing client-identifiers that meet this requirement for uniqueness.

The code for this option is 61, and its minimum length is 2.

The default value is: 0x6969

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

Returns a new instance of ClientIdentifierOption.



372
373
374
375
376
# File 'lib/net/dhcp/options.rb', line 372

def initialize(params={})
  params[:type] =  $DHCP_CLIENTID
  params[:payload] = params.fetch(:payload, [0x69, 0x69])
  super(params)
end

Instance Method Details

#to_sObject



378
379
380
# File 'lib/net/dhcp/options.rb', line 378

def to_s
  "Client Identifier = #{self.payload}"
end