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.3 1992/12/03 19:54:12 bir7 Exp $ */ 23 /* $Log: arp.h,v $ 24 * Revision 0.8.4.3 1992/12/03 19:54:12 bir7 25 * Added paranoid queue checking. 26 * 27 * Revision 0.8.4.2 1992/11/15 14:55:30 bir7 28 * make arp_q global so sock.c can mess with it. 29 * 30 * Revision 0.8.4.1 1992/11/10 00:17:18 bir7 31 * version change only. 32 * 33 * Revision 0.8.3.2 1992/11/10 00:14:47 bir7 34 * Changed malloc to kmalloc and added $iId$ and $Log: arp.h,v $ 35 * Revision 0.8.4.3 1992/12/03 19:54:12 bir7 36 * Added paranoid queue checking. 37 * 38 * Revision 0.8.4.2 1992/11/15 14:55:30 bir7 39 * make arp_q global so sock.c can mess with it. 40 * 41 * Revision 0.8.4.1 1992/11/10 00:17:18 bir7 42 * version change only. 43 *. 44 * */ 45 46 #ifndef _TCP_ARP_H 47 #define _TCP_ARP_H 48 49 struct arp 50 { 51 unsigned short hrd; 52 unsigned short pro; 53 unsigned char hlen; 54 unsigned char plen; 55 unsigned short op; 56 }; 57 58 59 struct arp_table 60 { 61 struct arp_table *next; 62 unsigned long last_used; 63 unsigned long ip; 64 unsigned char hlen; 65 unsigned char hard[MAX_ADDR_LEN]; 66 }; 67 68 struct sk_buff *arp_q; 69 70 int arp_rcv(struct sk_buff *, struct device *, struct packet_type *); 71 void arp_snd (unsigned long, struct device *, unsigned long); 72 int arp_find (unsigned char *, unsigned long, struct device *dev, 73 unsigned long); 74 void arp_add_broad (unsigned long, struct device *dev); 75 void arp_destroy (unsigned long); 76 void arp_add (unsigned long addr, unsigned char *haddr, struct device *dev); 77 void arp_queue (struct sk_buff *skb); 78 79 #define ARP_TABLE_SIZE 16 80 #define ARP_IP_PROT ETHERTYPE_IP 81 #define ARP_REQUEST 1 82 #define ARP_REPLY 2 83 #define ARP_TIMEOUT 8640000 /* about 8 hours. */ 84 #define ARP_RES_TIME 250 /* 2.5 seconds. */ 85 86 #define ARP_QUEUE_MAGIC 0x0432447A 87 88 #endif