1 /* pack_type.c - implements raw packet sockets. */ 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 23 #include <linux/stddef.h> 24 #include "dev.h" 25 #include "eth.h" 26 27 extern int arp_rcv (struct sk_buff *skb, struct device *dev, 28 struct packet_type *pt); 29 30 static struct packet_type arp_packet_type= 31 { 32 NET16(ETHERTYPE_ARP), 33 0, /* copy */ 34 arp_rcv, 35 NULL, 36 NULL /* next */ 37 }; 38 39 extern int ip_rcv (struct sk_buff *skb, struct device *dev, 40 struct packet_type *pt); 41 42 static struct packet_type ip_packet_type= 43 { 44 NET16(ETHERTYPE_IP), 45 0, /* copy */ 46 ip_rcv, 47 NULL, 48 &arp_packet_type 49 }; 50 51 struct packet_type *ptype_base = &ip_packet_type; 52 53 54 55 56