1 |
199 |
simons |
/*
|
2 |
|
|
* INET An implementation of the TCP/IP protocol suite for the LINUX
|
3 |
|
|
* operating system. INET is implemented using the BSD Socket
|
4 |
|
|
* interface as the means of communication with the user level.
|
5 |
|
|
*
|
6 |
|
|
* Global definitions for the ARP (RFC 826) protocol.
|
7 |
|
|
*
|
8 |
|
|
* Version: @(#)if_arp.h 1.0.2 08/12/96
|
9 |
|
|
*
|
10 |
|
|
* Authors: Original taken from Berkeley UNIX 4.3, (c) UCB 1986-1988
|
11 |
|
|
* Portions taken from the KA9Q/NOS (v2.00m PA0GRI) source.
|
12 |
|
|
* Ross Biro, <bir7@leland.Stanford.Edu>
|
13 |
|
|
* Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
|
14 |
|
|
* Florian La Roche,
|
15 |
|
|
* Jonathan Layes, <layes@loran.com>
|
16 |
|
|
* Lawrence V. Stefani, <stefani@lkg.dec.com>
|
17 |
|
|
*
|
18 |
|
|
* This program is free software; you can redistribute it and/or
|
19 |
|
|
* modify it under the terms of the GNU General Public License
|
20 |
|
|
* as published by the Free Software Foundation; either version
|
21 |
|
|
* 2 of the License, or (at your option) any later version.
|
22 |
|
|
*/
|
23 |
|
|
#ifndef _LINUX_IF_ARP_H
|
24 |
|
|
#define _LINUX_IF_ARP_H
|
25 |
|
|
|
26 |
|
|
#include <linux/netdevice.h>
|
27 |
|
|
|
28 |
|
|
/* ARP protocol HARDWARE identifiers. */
|
29 |
|
|
#define ARPHRD_NETROM 0 /* from KA9Q: NET/ROM pseudo */
|
30 |
|
|
#define ARPHRD_ETHER 1 /* Ethernet 10Mbps */
|
31 |
|
|
#define ARPHRD_EETHER 2 /* Experimental Ethernet */
|
32 |
|
|
#define ARPHRD_AX25 3 /* AX.25 Level 2 */
|
33 |
|
|
#define ARPHRD_PRONET 4 /* PROnet token ring */
|
34 |
|
|
#define ARPHRD_CHAOS 5 /* Chaosnet */
|
35 |
|
|
#define ARPHRD_IEEE802 6 /* IEEE 802.2 Ethernet/TR/TB */
|
36 |
|
|
#define ARPHRD_ARCNET 7 /* ARCnet */
|
37 |
|
|
#define ARPHRD_APPLETLK 8 /* APPLEtalk */
|
38 |
|
|
#define ARPHRD_DLCI 15 /* Frame Relay DLCI */
|
39 |
|
|
#define ARPHRD_METRICOM 23 /* Metricom STRIP (new IANA id) */
|
40 |
|
|
|
41 |
|
|
/* Dummy types for non ARP hardware */
|
42 |
|
|
#define ARPHRD_SLIP 256
|
43 |
|
|
#define ARPHRD_CSLIP 257
|
44 |
|
|
#define ARPHRD_SLIP6 258
|
45 |
|
|
#define ARPHRD_CSLIP6 259
|
46 |
|
|
#define ARPHRD_RSRVD 260 /* Notional KISS type */
|
47 |
|
|
#define ARPHRD_ADAPT 264
|
48 |
|
|
#define ARPHRD_ROSE 270
|
49 |
|
|
#define ARPHRD_PPP 512
|
50 |
|
|
|
51 |
|
|
#define ARPHRD_TUNNEL 768 /* IPIP tunnel */
|
52 |
|
|
#define ARPHRD_TUNNEL6 769 /* IPIP6 tunnel */
|
53 |
|
|
#define ARPHRD_FRAD 770 /* Frame Relay Access Device */
|
54 |
|
|
#define ARPHRD_SKIP 771 /* SKIP vif */
|
55 |
|
|
#define ARPHRD_LOOPBACK 772 /* Loopback device */
|
56 |
|
|
#define ARPHRD_LOCALTLK 773 /* Localtalk device */
|
57 |
|
|
#define ARPHRD_FDDI 774 /* Fiber Distributed Data Interface */
|
58 |
|
|
|
59 |
|
|
/* ARP protocol opcodes. */
|
60 |
|
|
#define ARPOP_REQUEST 1 /* ARP request */
|
61 |
|
|
#define ARPOP_REPLY 2 /* ARP reply */
|
62 |
|
|
#define ARPOP_RREQUEST 3 /* RARP request */
|
63 |
|
|
#define ARPOP_RREPLY 4 /* RARP reply */
|
64 |
|
|
|
65 |
|
|
|
66 |
|
|
/* ARP ioctl request. */
|
67 |
|
|
struct arpreq {
|
68 |
|
|
struct sockaddr arp_pa; /* protocol address */
|
69 |
|
|
struct sockaddr arp_ha; /* hardware address */
|
70 |
|
|
int arp_flags; /* flags */
|
71 |
|
|
struct sockaddr arp_netmask; /* netmask (only for proxy arps) */
|
72 |
|
|
char arp_dev[16];
|
73 |
|
|
};
|
74 |
|
|
|
75 |
|
|
struct arpreq_old {
|
76 |
|
|
struct sockaddr arp_pa; /* protocol address */
|
77 |
|
|
struct sockaddr arp_ha; /* hardware address */
|
78 |
|
|
int arp_flags; /* flags */
|
79 |
|
|
struct sockaddr arp_netmask; /* netmask (only for proxy arps) */
|
80 |
|
|
};
|
81 |
|
|
|
82 |
|
|
/* ARP Flag values. */
|
83 |
|
|
#define ATF_COM 0x02 /* completed entry (ha valid) */
|
84 |
|
|
#define ATF_PERM 0x04 /* permanent entry */
|
85 |
|
|
#define ATF_PUBL 0x08 /* publish entry */
|
86 |
|
|
#define ATF_USETRAILERS 0x10 /* has requested trailers */
|
87 |
|
|
#define ATF_NETMASK 0x20 /* want to use a netmask (only
|
88 |
|
|
for proxy entries) */
|
89 |
|
|
|
90 |
|
|
/*
|
91 |
|
|
* This structure defines an ethernet arp header.
|
92 |
|
|
*/
|
93 |
|
|
|
94 |
|
|
struct arphdr
|
95 |
|
|
{
|
96 |
|
|
unsigned short ar_hrd; /* format of hardware address */
|
97 |
|
|
unsigned short ar_pro; /* format of protocol address */
|
98 |
|
|
unsigned char ar_hln; /* length of hardware address */
|
99 |
|
|
unsigned char ar_pln; /* length of protocol address */
|
100 |
|
|
unsigned short ar_op; /* ARP opcode (command) */
|
101 |
|
|
|
102 |
|
|
#if 0
|
103 |
|
|
/*
|
104 |
|
|
* Ethernet looks like this : This bit is variable sized however...
|
105 |
|
|
*/
|
106 |
|
|
unsigned char ar_sha[ETH_ALEN]; /* sender hardware address */
|
107 |
|
|
unsigned char ar_sip[4]; /* sender IP address */
|
108 |
|
|
unsigned char ar_tha[ETH_ALEN]; /* target hardware address */
|
109 |
|
|
unsigned char ar_tip[4]; /* target IP address */
|
110 |
|
|
#endif
|
111 |
|
|
|
112 |
|
|
};
|
113 |
|
|
|
114 |
|
|
/* Support for the user space arp daemon, arpd */
|
115 |
|
|
|
116 |
|
|
#define ARPD_UPDATE 0x01
|
117 |
|
|
#define ARPD_LOOKUP 0x02
|
118 |
|
|
#define ARPD_FLUSH 0x03
|
119 |
|
|
|
120 |
|
|
struct arpd_request
|
121 |
|
|
{
|
122 |
|
|
unsigned short req; /* request type */
|
123 |
|
|
__u32 ip; /* ip address of entry */
|
124 |
|
|
unsigned long dev; /* Device entry is tied to */
|
125 |
|
|
unsigned long stamp;
|
126 |
|
|
unsigned long updated;
|
127 |
|
|
unsigned char ha[MAX_ADDR_LEN]; /* Hardware address */
|
128 |
|
|
};
|
129 |
|
|
|
130 |
|
|
#endif /* _LINUX_IF_ARP_H */
|