Class: Scriptroute::ICMP6unreach
- Defined in:
- lib/scriptroute/packets.rb
Constant Summary
Constants inherited from ICMP6
Scriptroute::ICMP6::ICMP6_DST_UNREACH, Scriptroute::ICMP6::ICMP6_ECHO, Scriptroute::ICMP6::ICMP6_ECHOREPLY, Scriptroute::ICMP6::ICMP6_PACKET_TOO_BIG, Scriptroute::ICMP6::ICMP6_PARAM_PROB, Scriptroute::ICMP6::ICMP6_TIME_EXCEEDED
Constants inherited from IPv6
Scriptroute::IPv6::IPPROTO_ICMP6
Constants inherited from IP
Scriptroute::IP::IPPROTO_TCP, Scriptroute::IP::IPPROTO_UDP
Instance Attribute Summary collapse
-
#contents ⇒ IPv4
readonly
The packet header embedded within the ICMP unreachable error message.
Attributes inherited from ICMP6
#icmp_cksum, #icmp_code, #icmp_type, #ip_payload_len
Attributes inherited from IPv6
#ip6_dst, #ip6_flow, #ip6_hlim, #ip6_src
Instance Method Summary collapse
-
#initialize(string) ⇒ ICMP6unreach
constructor
Can create an unreachable only from string contents, never from filling in fields given a size.
-
#marshal ⇒ void
Cannot marshal an unreachable packet for transmission; raises an exception.
-
#to_s ⇒ String
Formats the packet and the embedded packet as a string.
Methods inherited from IPv6
creator, #ip_ttl=, #ipv6_unmarshal
Methods inherited from IP
Constructor Details
#initialize(string) ⇒ ICMP6unreach
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.
860 861 862 863 864 865 |
# File 'lib/scriptroute/packets.rb', line 860 def initialize(string) # first four are code, type, checksum. # second four are undefined @contents = IPv6.creator(string[8..-1]) super(string) end |
Instance Attribute Details
#contents ⇒ IPv4 (readonly)
Returns The packet header embedded within the ICMP unreachable error message.
853 854 855 |
# File 'lib/scriptroute/packets.rb', line 853 def contents @contents end |
Instance Method Details
#marshal ⇒ void
This method returns an undefined value.
Cannot marshal an unreachable packet for transmission; raises an exception.
868 869 870 |
# File 'lib/scriptroute/packets.rb', line 868 def marshal raise "not supported" end |
#to_s ⇒ String
Returns formats the packet and the embedded packet as a string.
872 873 874 |
# File 'lib/scriptroute/packets.rb', line 872 def to_s super + " ( " + @contents.to_s + " )" end |