1 /* arp.h */ 2 /* 3 Copyright (C) 1992 Ross Biro 4 5 This program is free software; you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation; either version 2, or (at your option) 8 any later version. 9 10 This program is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 GNU General Public License for more details. 14 15 You should have received a copy of the GNU General Public License 16 along with this program; if not, write to the Free Software 17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 19 The Author may be reached as bir7@leland.stanford.edu or 20 C/O Department of Mathematics; Stanford University; Stanford, CA 94305 21 */ 22 /* $Id: arp.h,v 0.8.4.4 1993/01/23 18:00:11 bir7 Exp $ */ 23 /* $Log: arp.h,v $ 24 * Revision 0.8.4.4 1993/01/23 18:00:11 bir7 25 * Added ioctls as supplied by R.P. Bellis <rpb@psy.ox.ac.uk> 26 * 27 * Revision 0.8.4.3 1992/12/03 19:54:12 bir7 28 * Added paranoid queue checking. 29 * 30 * Revision 0.8.4.2 1992/11/15 14:55:30 bir7 31 * make arp_q global so sock.c can mess with it. 32 * 33 * Revision 0.8.4.1 1992/11/10 00:17:18 bir7 34 * version change only. 35 * 36 * Revision 0.8.3.2 1992/11/10 00:14:47 bir7 37 * Changed malloc to kmalloc and added $iId$ and $Log: arp.h,v $ 38 * Revision 0.8.4.4 1993/01/23 18:00:11 bir7 39 * Added ioctls as supplied by R.P. Bellis <rpb@psy.ox.ac.uk> 40 * 41 * Revision 0.8.4.3 1992/12/03 19:54:12 bir7 42 * Added paranoid queue checking. 43 * 44 * Revision 0.8.4.2 1992/11/15 14:55:30 bir7 45 * make arp_q global so sock.c can mess with it. 46 * 47 * Revision 0.8.4.1 1992/11/10 00:17:18 bir7 48 * version change only. 49 *. 50 * */ 51 52 #ifndef _TCP_ARP_H 53 #define _TCP_ARP_H 54 55 struct arp 56 { 57 unsigned short hrd; 58 unsigned short pro; 59 unsigned char hlen; 60 unsigned char plen; 61 unsigned short op; 62 }; 63 64 65 struct arp_table 66 { 67 volatile struct arp_table *next; 68 volatile unsigned long last_used; 69 unsigned long ip; 70 unsigned char hlen; 71 unsigned char hard[MAX_ADDR_LEN]; 72 }; 73 74 volatile struct sk_buff *arp_q; 75 76 int arp_rcv(struct sk_buff *, struct device *, struct packet_type *); 77 void arp_snd (unsigned long, struct device *, unsigned long); 78 int arp_find (unsigned char *, unsigned long, struct device *dev, 79 unsigned long); 80 void arp_add_broad (unsigned long, struct device *dev); 81 void arp_destroy (unsigned long); 82 void arp_add (unsigned long addr, unsigned char *haddr, struct device *dev); 83 void arp_queue (struct sk_buff *skb); 84 85 int arp_ioctl_set(struct arpreq *req); 86 int arp_ioctl_get(struct arpreq *req); 87 int arp_ioctl_del(struct arpreq *req); 88 89 #define ARP_TABLE_SIZE 16 90 #define ARP_IP_PROT ETHERTYPE_IP 91 #define ARP_REQUEST 1 92 #define ARP_REPLY 2 93 #define ARP_TIMEOUT 8640000 /* about 8 hours. */ 94 #define ARP_RES_TIME 250 /* 2.5 seconds. */ 95 96 #define ARP_QUEUE_MAGIC 0x0432447A 97 98 #endif