class Scriptroute::IPv4option
base class for IPv4
options.
Constants
- IPOPT_EOL
- IPOPT_EOOL
- IPOPT_NOOP
- IPOPT_RR
- IPOPT_TIMESTAMP
- IPOPT_TS
- IPOPT_TS_PRESPEC
- IPOPT_TS_TSANDADDR
- IPOPT_TS_TSONLY
Attributes
ipt_code[R]
@return [Fixnum]
ipt_len[R]
@return [Fixnum]
ipt_ptr[RW]
@return [Fixnum]
Public Class Methods
creator(str)
click to toggle source
# File lib/scriptroute/packets.rb, line 412 def IPv4option.creator(str) ipt_code, ipt_len, ipt_ptr = str.unpack("CCC") if(@@creators[ipt_code]) then pkt = (@@creators[ipt_code]).call(str) else raise "unknown ip option code %d" % ipt_code end end
new(*rest)
click to toggle source
# File lib/scriptroute/packets.rb, line 420 def initialize(*rest) if(rest.length == 3) then @ipt_code = rest[0] @ipt_len = rest[1] @ipt_ptr = rest[2] else @ipt_code, @ipt_len, @ipt_ptr = rest[0].unpack("CCC") end end
Public Instance Methods
to_s()
click to toggle source
@return [String]
# File lib/scriptroute/packets.rb, line 435 def to_s ": opt: code %d len %d ptr %d" % [ @ipt_code, @ipt_len, @ipt_ptr ] end
Private Instance Methods
marshal()
click to toggle source
@return [String] The packet in string form
# File lib/scriptroute/packets.rb, line 430 def marshal # doesn't end on a word. [ @ipt_code, @ipt_len, @ipt_ptr ].pack("CCC") end