Commit | Line | Data |
---|---|---|
d66f7a18 MK |
1 | /* |
2 | * Copyright (c) 1986 Regents of the University of California. | |
5b519e94 | 3 | * All rights reserved. |
d66f7a18 | 4 | * |
dbf0c423 | 5 | * %sccs.include.redist.c% |
5b519e94 | 6 | * |
29cc8eca | 7 | * @(#)if_arp.h 7.6 (Berkeley) %G% |
d66f7a18 MK |
8 | */ |
9 | ||
10 | /* | |
11 | * Address Resolution Protocol. | |
12 | * | |
13 | * See RFC 826 for protocol description. ARP packets are variable | |
14 | * in size; the arphdr structure defines the fixed-length portion. | |
15 | * Protocol type values are the same as those for 10 Mb/s Ethernet. | |
16 | * It is followed by the variable-sized fields ar_sha, arp_spa, | |
17 | * arp_tha and arp_tpa in that order, according to the lengths | |
18 | * specified. Field names used correspond to RFC 826. | |
19 | */ | |
20 | struct arphdr { | |
21 | u_short ar_hrd; /* format of hardware address */ | |
29cc8eca KS |
22 | #define ARPHRD_ETHER 1 /* ethernet hardware format */ |
23 | #define ARPHRD_FRELAY 15 /* frame relay hardware format */ | |
d66f7a18 MK |
24 | u_short ar_pro; /* format of protocol address */ |
25 | u_char ar_hln; /* length of hardware address */ | |
26 | u_char ar_pln; /* length of protocol address */ | |
27 | u_short ar_op; /* one of: */ | |
28 | #define ARPOP_REQUEST 1 /* request to resolve address */ | |
29 | #define ARPOP_REPLY 2 /* response to previous request */ | |
29cc8eca KS |
30 | #define ARPOP_REVREQUEST 3 /* request protocol address given hardware */ |
31 | #define ARPOP_REVREPLY 4 /* response giving protocol address */ | |
32 | #define ARPOP_INVREQUEST 8 /* request to identify peer */ | |
33 | #define ARPOP_INVREPLY 9 /* response identifying peer */ | |
d66f7a18 MK |
34 | /* |
35 | * The remaining fields are variable in size, | |
36 | * according to the sizes above. | |
37 | */ | |
1405b342 KB |
38 | #ifdef COMMENT_ONLY |
39 | u_char ar_sha[]; /* sender hardware address */ | |
40 | u_char ar_spa[]; /* sender protocol address */ | |
41 | u_char ar_tha[]; /* target hardware address */ | |
42 | u_char ar_tpa[]; /* target protocol address */ | |
43 | #endif | |
d66f7a18 MK |
44 | }; |
45 | ||
46 | /* | |
47 | * ARP ioctl request | |
48 | */ | |
49 | struct arpreq { | |
50 | struct sockaddr arp_pa; /* protocol address */ | |
51 | struct sockaddr arp_ha; /* hardware address */ | |
52 | int arp_flags; /* flags */ | |
53 | }; | |
54 | /* arp_flags and at_flags field values */ | |
55 | #define ATF_INUSE 0x01 /* entry in use */ | |
56 | #define ATF_COM 0x02 /* completed entry (enaddr valid) */ | |
57 | #define ATF_PERM 0x04 /* permanent entry */ | |
58 | #define ATF_PUBL 0x08 /* publish entry (respond for other host) */ | |
59 | #define ATF_USETRAILERS 0x10 /* has requested trailers */ |