1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//! Internet Control Message Protocol (ICMPv4 RFC 792 / ICMPv6 RFC 4443) AST definitions.
//!
//! Defines network-layer diagnostic, reachability, and error-reporting control messages carried
//! over IP protocol `1` (ICMPv4, RFC 792) and IPv6 Next Header `58` (ICMPv6, RFC 4443). The 8-byte
//! base header consists of an 8-bit `Type` (`TYPE` or symbolic keyword `ECHO_REQUEST`, `ECHO_REPLY`,
//! `DEST_UNREACH`, `TIME_EXCEEDED`, `REDIRECT`), an 8-bit `Code` (`CODE`), a 16-bit ones'-complement
//! `Checksum` (computed over the ICMPv6 pseudo-header when running over IPv6), and a 32-bit header
//! rest field containing `Identifier` (`ID`) and `Sequence Number` (`SEQ`) for Echo messages or a
//! 32-bit `Gateway Internet Address` (`GATEWAY`) for IPv4 Redirect messages.
//!
//! Canonical `.fasm` syntax:
//! `a -> b ICMP [ECHO_REQUEST | ECHO_REPLY | DEST_UNREACH | TIME_EXCEEDED | REDIRECT] [TYPE <u8>] [CODE <u8>] [ID <u16>] [SEQ <u16>] [GATEWAY <ipv4>]`
use PhantomData;
use IpAddr;
/// Symbolic ICMPv4 (RFC 792) and ICMPv6 (RFC 4443) message type classification.
/// Internet Control Message Protocol (RFC 792 / RFC 4443) specification over IP protocol `1` / `58`.
///
/// Syntax mapping: `ICMP [ECHO_REQUEST | ECHO_REPLY | DEST_UNREACH | TIME_EXCEEDED | REDIRECT] [TYPE <u8>] [CODE <u8>] [ID <u16>] [SEQ <u16>] [GATEWAY <ipv4>]`