class Scriptroute::ICMPunreach

also handles time exceeded messages for now (same format, different code )

Attributes

contents[R]

@return [IPv4] The packet header embedded within the ICMP unreachable error message.

Public Class Methods

new(string) click to toggle source

Can create an unreachable only from string contents, never from filling in fields given a size. param string [String] the contents of the received packet.

Calls superclass method Scriptroute::ICMP::new
# File lib/scriptroute/packets.rb, line 834
def initialize(string) 
  # first four are code, type, checksum.
  # second four are undefined
  @contents = IPv4.creator(string[8..-1])
  super(string)
end

Public Instance Methods

marshal() click to toggle source

Cannot marshal an unreachable packet for transmission; raises an exception. @return [void]

# File lib/scriptroute/packets.rb, line 842
def marshal
  raise "not supported"
end
to_s() click to toggle source

@return [String] formats the packet and the embedded packet as a string.

Calls superclass method Scriptroute::ICMP#to_s
# File lib/scriptroute/packets.rb, line 846
def to_s
  super + " ( " + @contents.to_s + " )"
end