1
2
3 """Address Resolution Protocol."""
4 from __future__ import absolute_import
5
6 from . import dpkt
7
8
9 ARP_HRD_ETH = 0x0001
10 ARP_HRD_IEEE802 = 0x0006
11
12
13 ARP_PRO_IP = 0x0800
14
15
16 ARP_OP_REQUEST = 1
17 ARP_OP_REPLY = 2
18 ARP_OP_REVREQUEST = 3
19 ARP_OP_REVREPLY = 4
20
21
22 -class ARP(dpkt.Packet):
23 """Address Resolution Protocol.
24
25 See more about the ARP on \
26 https://en.wikipedia.org/wiki/Address_Resolution_Protocol
27
28 Attributes:
29 __hdr__: Header fields of ARP.
30 """
31
32 __hdr__ = (
33 ('hrd', 'H', ARP_HRD_ETH),
34 ('pro', 'H', ARP_PRO_IP),
35 ('hln', 'B', 6),
36 ('pln', 'B', 4),
37 ('op', 'H', ARP_OP_REQUEST),
38 ('sha', '6s', ''),
39 ('spa', '4s', ''),
40 ('tha', '6s', ''),
41 ('tpa', '4s', '')
42 )
43