class Lib::DHCP::Option122::SubOption::Option5

Attributes

max_retries[RW]
max_timeout[RW]
nom_timeout[RW]

Public Class Methods

new(nom_timeout, max_timeout, max_retries) click to toggle source
# File lib/lib/dhcp/options/option122.rb, line 214
def initialize(nom_timeout, max_timeout, max_retries)
  @oid = 5
  @nom_timeout = nom_timeout
  @max_timeout = max_timeout
  @max_retries = max_retries
end
unpack(oid, len, payload) click to toggle source
# File lib/lib/dhcp/options/option122.rb, line 241
def self.unpack(oid, len, payload)
  raise ArgumentError, "OID mismatch for TSP's AP-REQ/AP-REP Backoff and Retry, require 5, #{oid} given" unless oid == 5
  raise ArgumentError, "Wrong  length for TSP's AP-REQ/AP-REP Backoff and Retry = #{len}" unless len == 12
  nom_timeout, max_timeout, max_retries = payload.unpack('N3')
  self.new nom_timeout, max_timeout, max_retries
end

Public Instance Methods

name() click to toggle source
# File lib/lib/dhcp/options/option122.rb, line 221
def name
  "TSP's AP-REQ/AP-REP Backoff and Retry"
end
pack() click to toggle source
# File lib/lib/dhcp/options/option122.rb, line 237
def pack
  [5, 12, @nom_timeout.to_i, @max_timeout.to_i, @max_retries.to_i].pack('C2N3')
end
payload() click to toggle source
# File lib/lib/dhcp/options/option122.rb, line 225
def payload
  [@nom_timeout, @max_timeout, @max_retries]
end
to_i() click to toggle source
# File lib/lib/dhcp/options/option122.rb, line 233
def to_i
  nil
end
to_s() click to toggle source
# File lib/lib/dhcp/options/option122.rb, line 229
def to_s
  "#{@nom_timeout}, #{@max_timeout}, #{@max_retries}"
end