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