1 /* 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 * Definitions for the protocol dispatcher. 7 * 8 * Version: @(#)protocol.h 1.0.2 05/07/93 9 * 10 * Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> 11 * 12 * This program is free software; you can redistribute it and/or 13 * modify it under the terms of the GNU General Public License 14 * as published by the Free Software Foundation; either version 15 * 2 of the License, or (at your option) any later version. 16 * 17 * Changes: 18 * Alan Cox : Added a name field and a frag handler 19 * field for later. 20 */ 21
22 #ifndef_PROTOCOL_H 23 #define_PROTOCOL_H 24
25
26 #defineMAX_INET_PROTOS 32 /* Must be a power of 2 */ 27
28
29 /* This is used to register protocols. */ 30 structinet_protocol{ 31 int (*handler)(structsk_buff *skb, structdevice *dev,
32 structoptions *opt, unsignedlongdaddr,
33 unsignedshortlen, unsignedlongsaddr,
34 intredo, structinet_protocol *protocol);
35 int (*frag_handler)(structsk_buff *skb, structdevice *dev,
36 structoptions *opt, unsignedlongdaddr,
37 unsignedshortlen, unsignedlongsaddr,
38 intredo, structinet_protocol *protocol);
39 void (*err_handler)(interr, unsignedchar *buff,
40 unsignedlongdaddr,
41 unsignedlongsaddr,
42 structinet_protocol *protocol);
43 structinet_protocol *next;
44 unsignedcharprotocol;
45 unsignedcharcopy:1;
46 void *data;
47 char *name;
48 };
49
50
51 externstructinet_protocol *inet_protocol_base;
52 externstructinet_protocol *inet_protos[MAX_INET_PROTOS];
53
54
55 externvoidinet_add_protocol(structinet_protocol *prot);
56 externintinet_del_protocol(structinet_protocol *prot);
57
58
59 #endif/* _PROTOCOL_H */