class PacketGen::Header::IP::Options

Class to handle IP options @author Sylvain Daubert

Constants

HUMAN_SEPARATOR

Public Instance Methods

to_s() click to toggle source

Get binary string @return [String]

Calls superclass method
# File lib/packetgen/header/ip/options.rb, line 20
def to_s
  str = super
  str += ([0] * (4 - (str.length % 4))).pack('C*') if str.length % 4 != 0
  str
end

Private Instance Methods

real_type(opt) click to toggle source
# File lib/packetgen/header/ip/options.rb, line 32
def real_type(opt)
  types = Option.types
  types.value?(opt.type) ? IP.const_get(types.key(opt.type)) : opt.class
end
record_from_hash(hsh) click to toggle source
# File lib/packetgen/header/ip/options.rb, line 28
def record_from_hash(hsh)
  Option.build(hsh)
end