williamr@2
|
1 |
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
|
williamr@2
|
2 |
/* All Rights Reserved */
|
williamr@2
|
3 |
|
williamr@2
|
4 |
/** @file
|
williamr@2
|
5 |
@publishedAll
|
williamr@2
|
6 |
@released
|
williamr@2
|
7 |
*/
|
williamr@2
|
8 |
|
williamr@2
|
9 |
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */
|
williamr@2
|
10 |
/* The copyright notice above does not evidence any */
|
williamr@2
|
11 |
/* actual or intended publication of such source code. */
|
williamr@2
|
12 |
|
williamr@2
|
13 |
/*
|
williamr@2
|
14 |
* PROPRIETARY NOTICE (Combined)
|
williamr@2
|
15 |
*
|
williamr@2
|
16 |
* This source code is unpublished proprietary information
|
williamr@2
|
17 |
* constituting, or derived under license from AT&T's Unix(r) System V.
|
williamr@2
|
18 |
* In addition, portions of such source code were derived from Berkeley
|
williamr@2
|
19 |
* 4.3 BSD under license from the Regents of the University of
|
williamr@2
|
20 |
* California.
|
williamr@2
|
21 |
*
|
williamr@2
|
22 |
*
|
williamr@2
|
23 |
*
|
williamr@2
|
24 |
* Copyright Notice
|
williamr@2
|
25 |
*
|
williamr@2
|
26 |
* Notice of copyright on this source code product does not indicate
|
williamr@2
|
27 |
* publication.
|
williamr@2
|
28 |
*
|
williamr@2
|
29 |
* (c) 1986,1987,1988,1989 Sun Microsystems, Inc.
|
williamr@2
|
30 |
* (c) 1983,1984,1985,1986,1987,1988,1989 AT&T.
|
williamr@2
|
31 |
* All rights reserved.
|
williamr@2
|
32 |
*/
|
williamr@2
|
33 |
|
williamr@2
|
34 |
#ifndef _NETINET_ARP_H
|
williamr@2
|
35 |
#define _NETINET_ARP_H
|
williamr@2
|
36 |
|
williamr@2
|
37 |
#ifdef __cplusplus
|
williamr@2
|
38 |
extern "C" {
|
williamr@2
|
39 |
#endif
|
williamr@2
|
40 |
|
williamr@4
|
41 |
#include <sys/socket.h>
|
williamr@4
|
42 |
#include <sys/types.h>
|
williamr@4
|
43 |
#include <libc/netinet/net_types.h>
|
williamr@2
|
44 |
/**
|
williamr@2
|
45 |
Address Resolution Protocol.
|
williamr@2
|
46 |
|
williamr@2
|
47 |
See RFC 826 for protocol description. ARP packets are variable
|
williamr@2
|
48 |
in size; the arphdr structure defines the fixed-length portion.
|
williamr@2
|
49 |
Protocol type values are the same as those for 10 Mb/s Ethernet.
|
williamr@2
|
50 |
It is followed by the variable-sized fields ar_sha, arp_spa,
|
williamr@2
|
51 |
arp_tha and arp_tpa in that order, according to the lengths
|
williamr@2
|
52 |
specified. Field names used correspond to RFC 826.
|
williamr@2
|
53 |
*/
|
williamr@2
|
54 |
struct arphdr {
|
williamr@2
|
55 |
u_short ar_hrd; /* format of hardware address */
|
williamr@2
|
56 |
#define ARPHRD_ETHER 1 /* ethernet hardware address */
|
williamr@2
|
57 |
u_short ar_pro; /* format of protocol address */
|
williamr@2
|
58 |
u_char ar_hln; /* length of hardware address */
|
williamr@2
|
59 |
u_char ar_pln; /* length of protocol address */
|
williamr@2
|
60 |
u_short ar_op; /* one of: */
|
williamr@2
|
61 |
#define ARPOP_REQUEST 1 /* request to resolve address */
|
williamr@2
|
62 |
#define ARPOP_REPLY 2 /* response to previous request */
|
williamr@2
|
63 |
#define REVARP_REQUEST 3 /* Reverse ARP request */
|
williamr@2
|
64 |
#define REVARP_REPLY 4 /* Reverse ARP reply */
|
williamr@2
|
65 |
/*
|
williamr@2
|
66 |
* The remaining fields are variable in size,
|
williamr@2
|
67 |
* according to the sizes above, and are defined
|
williamr@2
|
68 |
* as appropriate for specific hardware/protocol
|
williamr@2
|
69 |
* combinations. (E.g., see <netinet/if_ether.h>.)
|
williamr@2
|
70 |
*/
|
williamr@2
|
71 |
#ifdef notdef
|
williamr@2
|
72 |
u_char ar_sha[]; /* sender hardware address */
|
williamr@2
|
73 |
u_char ar_spa[]; /* sender protocol address */
|
williamr@2
|
74 |
u_char ar_tha[]; /* target hardware address */
|
williamr@2
|
75 |
u_char ar_tpa[]; /* target protocol address */
|
williamr@2
|
76 |
#endif /* notdef */
|
williamr@2
|
77 |
};
|
williamr@2
|
78 |
|
williamr@2
|
79 |
/**
|
williamr@2
|
80 |
Ethernet Address Resolution Protocol.
|
williamr@2
|
81 |
|
williamr@2
|
82 |
See RFC 826 for protocol description. Structure below is adapted
|
williamr@2
|
83 |
to resolving internet addresses. Field names used correspond to
|
williamr@2
|
84 |
RFC 826.
|
williamr@2
|
85 |
*/
|
williamr@2
|
86 |
struct ether_arp {
|
williamr@2
|
87 |
struct arphdr ea_hdr; /* fixed-size header */
|
williamr@2
|
88 |
struct ether_addr arp_sha; /* sender hardware address */
|
williamr@2
|
89 |
u_char arp_spa[4]; /* sender protocol address */
|
williamr@2
|
90 |
struct ether_addr arp_tha; /* target hardware address */
|
williamr@2
|
91 |
u_char arp_tpa[4]; /* target protocol address */
|
williamr@2
|
92 |
};
|
williamr@2
|
93 |
|
williamr@2
|
94 |
/**
|
williamr@2
|
95 |
ARP ioctl request
|
williamr@2
|
96 |
*/
|
williamr@2
|
97 |
struct arpreq {
|
williamr@2
|
98 |
struct sockaddr arp_pa; /* protocol address */
|
williamr@2
|
99 |
struct sockaddr arp_ha; /* hardware address */
|
williamr@2
|
100 |
int arp_flags; /* flags */
|
williamr@2
|
101 |
};
|
williamr@4
|
102 |
|
williamr@2
|
103 |
|
williamr@2
|
104 |
#ifdef __cplusplus
|
williamr@2
|
105 |
}
|
williamr@2
|
106 |
#endif
|
williamr@2
|
107 |
|
williamr@2
|
108 |
#endif /* _NETINET_ARP_H */
|