Commit | Line | Data |
---|---|---|
d66f7a18 MK |
1 | /* |
2 | * Copyright (c) 1986 Regents of the University of California. | |
5b519e94 | 3 | * All rights reserved. |
d66f7a18 | 4 | * |
1c15e888 C |
5 | * Redistribution is only permitted until one year after the first shipment |
6 | * of 4.4BSD by the Regents. Otherwise, redistribution and use in source and | |
7 | * binary forms are permitted provided that: (1) source distributions retain | |
8 | * this entire copyright notice and comment, and (2) distributions including | |
9 | * binaries display the following acknowledgement: This product includes | |
10 | * software developed by the University of California, Berkeley and its | |
11 | * contributors'' in the documentation or other materials provided with the | |
12 | * distribution and in all advertising materials mentioning features or use | |
13 | * of this software. Neither the name of the University nor the names of | |
14 | * its contributors may be used to endorse or promote products derived from | |
15 | * this software without specific prior written permission. | |
16 | * THIS SOFTWARE IS PROVIDED AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED | |
17 | * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF | |
18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | |
5b519e94 | 19 | * |
1c15e888 | 20 | * @(#)if_arp.h 7.4 (Berkeley) 6/28/90 |
d66f7a18 MK |
21 | */ |
22 | ||
23 | /* | |
24 | * Address Resolution Protocol. | |
25 | * | |
26 | * See RFC 826 for protocol description. ARP packets are variable | |
27 | * in size; the arphdr structure defines the fixed-length portion. | |
28 | * Protocol type values are the same as those for 10 Mb/s Ethernet. | |
29 | * It is followed by the variable-sized fields ar_sha, arp_spa, | |
30 | * arp_tha and arp_tpa in that order, according to the lengths | |
31 | * specified. Field names used correspond to RFC 826. | |
32 | */ | |
33 | struct arphdr { | |
34 | u_short ar_hrd; /* format of hardware address */ | |
35 | #define ARPHRD_ETHER 1 /* ethernet hardware address */ | |
36 | u_short ar_pro; /* format of protocol address */ | |
37 | u_char ar_hln; /* length of hardware address */ | |
38 | u_char ar_pln; /* length of protocol address */ | |
39 | u_short ar_op; /* one of: */ | |
40 | #define ARPOP_REQUEST 1 /* request to resolve address */ | |
41 | #define ARPOP_REPLY 2 /* response to previous request */ | |
42 | /* | |
43 | * The remaining fields are variable in size, | |
44 | * according to the sizes above. | |
45 | */ | |
46 | /* u_char ar_sha[]; /* sender hardware address */ | |
47 | /* u_char ar_spa[]; /* sender protocol address */ | |
48 | /* u_char ar_tha[]; /* target hardware address */ | |
49 | /* u_char ar_tpa[]; /* target protocol address */ | |
50 | }; | |
51 | ||
52 | /* | |
53 | * ARP ioctl request | |
54 | */ | |
55 | struct arpreq { | |
56 | struct sockaddr arp_pa; /* protocol address */ | |
57 | struct sockaddr arp_ha; /* hardware address */ | |
58 | int arp_flags; /* flags */ | |
59 | }; | |
60 | /* arp_flags and at_flags field values */ | |
61 | #define ATF_INUSE 0x01 /* entry in use */ | |
62 | #define ATF_COM 0x02 /* completed entry (enaddr valid) */ | |
63 | #define ATF_PERM 0x04 /* permanent entry */ | |
64 | #define ATF_PUBL 0x08 /* publish entry (respond for other host) */ | |
65 | #define ATF_USETRAILERS 0x10 /* has requested trailers */ |