Class: DHCP::OptHost

Inherits:
OptData show all
Defined in:
lib/dhcp/options.rb

Overview

Class for DHCP options containing DNS host names

Instance Attribute Summary

Attributes inherited from OptData

#data

Attributes inherited from Opt

#name, #opt

Instance Method Summary collapse

Methods inherited from OptData

#bin_to_data, #get, #initialize, #opt_header, #set, #to_opt, #to_s

Methods inherited from Opt

#initialize, #opt_header, #to_opt, #to_s

Constructor Details

This class inherits a constructor from DHCP::OptData

Instance Method Details

#data_to_bin(data) ⇒ Object



542
543
544
545
# File 'lib/dhcp/options.rb', line 542

def data_to_bin(data)
  raise "Invalid host name" unless /^(?:[a-zA-Z0-9][a-zA-Z0-9-]{0,62}\.)*[a-zA-Z0-9][a-zA-Z0-9-]{0,62}$/.match(data)
  data
end