Class: Scriptroute::EndOfOptions_option
- Inherits:
-
IPv4option
- Object
- IPv4option
- Scriptroute::EndOfOptions_option
- Defined in:
- lib/scriptroute/packets.rb
Overview
The IPv4 EOOL option, which has a purpose.
Direct Known Subclasses
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
Instance Method Summary collapse
-
#initialize(flag_or_str) ⇒ EndOfOptions_option
constructor
A new instance of EndOfOptions_option.
-
#marshal ⇒ String
The option in string form.
- #to_s ⇒ String
Methods inherited from IPv4option
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
#marshal ⇒ String
Returns 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_s ⇒ String
456 457 458 |
# File 'lib/scriptroute/packets.rb', line 456 def to_s ":ip_option_code=#{@ipt_code}" end |