Traceroute.Protocols.ICMP (traceroute v0.2.4)
View SourceImplements the encoding and decoding of ICMP and ICMPv6 packets.
See: https://en.wikipedia.org/wiki/Internet_Control_Message_Protocol See: https://en.wikipedia.org/wiki/ICMPv6
Summary
Functions
Decodes an IPv4 or IPv6 ICMP datagram and its reply packet.
Encodes an ICMP datagram which consists of a header and data section.
Types
@type t() :: %Traceroute.Protocols.ICMP{ checksum: binary(), code: non_neg_integer(), reply: reply(), type: non_neg_integer() }
Functions
Decodes an IPv4 or IPv6 ICMP datagram and its reply packet.
@spec encode_datagram( type :: non_neg_integer(), code :: non_neg_integer(), id :: non_neg_integer(), sequence :: non_neg_integer(), payload :: binary() ) :: binary()
Encodes an ICMP datagram which consists of a header and data section.
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type | Code | Checksum | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Rest of Header - Varies based on ICMP type and code | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Data | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+