Class: Scriptroute::EndOfOptions_option

Inherits:
IPv4option
  • Object
show all
Defined in:
lib/scriptroute/packets.rb

Overview

The IPv4 EOOL option, which has a purpose.

Direct Known Subclasses

NOOP_option

Constant Summary

Constants inherited from IPv4option

IPv4option::IPOPT_EOL, IPv4option::IPOPT_EOOL, IPv4option::IPOPT_NOOP, IPv4option::IPOPT_RR, IPv4option::IPOPT_TIMESTAMP, IPv4option::IPOPT_TS, IPv4option::IPOPT_TS_PRESPEC, IPv4option::IPOPT_TS_TSANDADDR, IPv4option::IPOPT_TS_TSONLY

Instance Attribute Summary

Attributes inherited from IPv4option

#ipt_code, #ipt_len, #ipt_ptr

Instance Method Summary collapse

Methods inherited from IPv4option

creator

Constructor Details

#initialize(flag_or_str) ⇒ EndOfOptions_option

Returns a new instance of EndOfOptions_option.



447
448
449
450
451
452
453
454
# File 'lib/scriptroute/packets.rb', line 447

def initialize(flag_or_str)
     if(flag_or_str.is_a?(Fixnum)) then
       super(IPOPT_EOOL, 0, 1,nil) # maximum length is 40, but tcpdump whines.
     else
       @ipt_code = flag_or_str.unpack("c")
       @ipt_len=1
     end
end

Instance Method Details

#marshalString

Returns the option in string form.

Returns:

  • (String)

    the option in string form



460
461
462
# File 'lib/scriptroute/packets.rb', line 460

def marshal
     @ipt_code.pack("c")  # oflw will be init'd to zero
end

#to_sString

Returns:

  • (String)


456
457
458
# File 'lib/scriptroute/packets.rb', line 456

def to_s
     ":ip_option_code=#{@ipt_code}"
end