source: branches/libc-0.6/src/emx/include/net/if_arp.h@ 2992

Last change on this file since 2992 was 183, checked in by bird, 23 years ago

#434: Initial tcpip header merges.

  • Property cvs2svn:cvs-rev set to 1.2
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 4.9 KB
Line 
1/* Modified for emx by hv 1994,1996
2 * Modified for gcc/os2 by bird 2003
3 *
4 * Copyright (c) 1986 Regents of the University of California.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. All advertising materials mentioning features or use of this software
16 * must display the following acknowledgement:
17 * This product includes software developed by the University of
18 * California, Berkeley and its contributors.
19 * 4. Neither the name of the University nor the names of its contributors
20 * may be used to endorse or promote products derived from this software
21 * without specific prior written permission.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE.
34 *
35 * from: @(#)if_arp.h 7.4 (Berkeley) 6/28/90
36 * $Id: if_arp.h,v 1.5 1993/09/05 00:46:54 cassidy Exp $
37 */
38
39#ifndef _NET_IF_ARP_H_
40#define _NET_IF_ARP_H_
41
42/*
43 * Address Resolution Protocol.
44 *
45 * See RFC 826 for protocol description. ARP packets are variable
46 * in size; the arphdr structure defines the fixed-length portion.
47 * Protocol type values are the same as those for 10 Mb/s Ethernet.
48 * It is followed by the variable-sized fields ar_sha, arp_spa,
49 * arp_tha and arp_tpa in that order, according to the lengths
50 * specified. Field names used correspond to RFC 826.
51 */
52#ifndef TCPV40HDR
53#pragma pack(1)
54#endif
55struct arphdr {
56 u_short ar_hrd; /* format of hardware address */
57#define ARPHRD_ETHER 1 /* ethernet hardware address */
58#define ARPHRD_802 6 /* 802 net hardware address */
59#ifndef TCPV40HDRS
60#define ARPHRD_FRELAY 15 /* frame relay hardware format */
61#endif
62 u_short ar_pro; /* format of protocol address */
63 u_char ar_hln; /* length of hardware address */
64 u_char ar_pln; /* length of protocol address */
65 u_short ar_op; /* one of: */
66#define ARPOP_REQUEST 1 /* request to resolve address */
67#define ARPOP_REPLY 2 /* response to previous request */
68#ifndef TCPV40HDRS
69#define ARPOP_REVREQUEST 3 /* request protocol address given hardware */
70#define ARPOP_REVREPLY 4 /* response giving protocol address */
71#define ARPOP_INVREQUEST 8 /* request to identify peer */
72#define ARPOP_INVREPLY 9 /* response identifying peer */
73#endif
74#if 0 /* not OS/2 */
75#define REVARP_REQUEST 3 /* reverse ARP request (not IBM) */
76#define REVARP_REPLY 4 /* reverse ARP reply (not IBM) */
77#endif
78/*
79 * The remaining fields are variable in size,
80 * according to the sizes above.
81 */
82/* u_char ar_sha[]; * sender hardware address */
83/* u_char ar_spa[]; * sender protocol address */
84/* u_char ar_tha[]; * target hardware address */
85/* u_char ar_tpa[]; * target protocol address */
86};
87#ifndef TCPV40HDRS
88#pragma pack()
89#endif
90
91/*
92 * ARP ioctl request
93 */
94#ifndef TCPV40HDRS
95#pragma pack(4)
96#endif
97struct arpreq {
98 struct sockaddr arp_pa; /* protocol address */
99 struct sockaddr arp_ha; /* hardware address */
100 int arp_flags; /* flags */
101};
102#ifndef TCPV40HDRS
103#pragma pack()
104#endif
105
106#ifndef TCPV40HDRS
107/*
108 * Token ring ARP ioctl request
109 */
110#pragma pack(4)
111struct arpreq_tr {
112 struct sockaddr arp_pa; /* protocol address */
113 struct sockaddr arp_ha; /* hardware address */
114 long arp_flags; /* flags */
115 u_short arp_rcf; /* token ring routing control field */
116 u_short arp_rseg[8]; /* token ring routing segments */
117};
118#endif /*!TCPV40HDRS*/
119
120
121/* arp_flags and at_flags field values */
122#define ATF_INUSE 0x01 /* entry in use */
123#define ATF_COM 0x02 /* completed entry (enaddr valid) */
124#define ATF_PERM 0x04 /* permanent entry */
125#define ATF_PUBL 0x08 /* publish entry (respond for other host) */
126#define ATF_USETRAILERS 0x10 /* has requested trailers */
127#ifndef TCPV40HDRS
128#define ATF_802_3 0x20 /* sender's ether if set to 802.3 */
129#endif
130
131#endif /* !_NET_IF_ARP_H_ */
Note: See TracBrowser for help on using the repository browser.