class Scriptroute::RecordRoute_option

Attributes

routers[R]

Public Class Methods

new(*rest) click to toggle source
Calls superclass method Scriptroute::IPv4option::new
# File lib/scriptroute/packets.rb, line 520
def initialize(*rest)
  if(rest.length == 0) 
    super(IPOPT_RR, 39, 4) 
    @routers = Array.new((@ipt_len - 3 + 1)/4, 0)
  else
    super(rest[0]) 
    @routers = rest[0][3..@ipt_len].unpack("N*").map { |addr| IPaddress.new(addr) }
  end
end

Public Instance Methods

marshal() click to toggle source

@return [String] the option in string form

Calls superclass method Scriptroute::IPv4option#marshal
# File lib/scriptroute/packets.rb, line 530
def marshal
  super + @routers.pack("N*")  + "\0"
end
to_s() click to toggle source

@return [String]

Calls superclass method Scriptroute::IPv4option#to_s
# File lib/scriptroute/packets.rb, line 534
def to_s
  super + ': RR: {' + @routers.join(", ") + '}'
end