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
//! Address Resolution Protocol (ARP, RFC 826 / RFC 5227) AST definitions.
//!
//! Defines the wire-level configuration parameters for IPv4-to-Ethernet address resolution
//! over EtherType `0x0806`. The 28-byte ARP payload consists of Hardware Type (`HTYPE = 0x0001`
//! for Ethernet), Protocol Type (`PTYPE = 0x0800` for IPv4), Hardware Address Length (`HLEN = 6`),
//! Protocol Address Length (`PLEN = 4`), 16-bit Operation Code (`OPER = 1` Request, `2` Reply),
//! 48-bit Sender Hardware Address (`SHA`), 32-bit Sender Protocol Address (`SPA`), 48-bit Target
//! Hardware Address (`THA`), and 32-bit Target Protocol Address (`TPA`).
//!
//! Canonical `.fasm` syntax:
//! `a -> b ARP [REQUEST | REPLY] [GRATUITOUS] [SENDERMAC <mac>] [SENDERIP <ip>] [TARGETMAC <mac>] [TARGETIP <ip>]`
use PhantomData;
use IpAddr;
/// ARP 16-bit operation code (`OPER` field at byte offset 6..8 of the ARP header per RFC 826).
/// Address Resolution Protocol (RFC 826 / RFC 5227) frame specification.
///
/// Syntax mapping: `ARP [REQUEST | REPLY] [GRATUITOUS] [SENDERMAC <mac>] [SENDERIP <ip>] [TARGETMAC <mac>] [TARGETIP <ip>]`