root/net/inet/protocol.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   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 #ifndef _PROTOCOL_H
  18 #define _PROTOCOL_H
  19 
  20 
  21 #define MAX_INET_PROTOS 32              /* Must be a power of 2         */
  22 
  23 
  24 /* This is used to register protocols. */
  25 struct inet_protocol {
  26   int                   (*handler)(struct sk_buff *skb, struct device *dev,
  27                                    struct options *opt, unsigned long daddr,
  28                                    unsigned short len, unsigned long saddr,
  29                                    int redo, struct inet_protocol *protocol);
  30   void                  (*err_handler)(int err, unsigned char *buff,
  31                                        unsigned long daddr,
  32                                        unsigned long saddr,
  33                                        struct inet_protocol *protocol);
  34   struct inet_protocol *next;
  35   unsigned char         protocol;
  36   unsigned char         copy:1;
  37   void                  *data;
  38 };
  39 
  40 
  41 extern struct inet_protocol *inet_protocol_base;
  42 extern struct inet_protocol *inet_protos[MAX_INET_PROTOS];
  43 
  44 
  45 extern void             inet_add_protocol(struct inet_protocol *prot);
  46 extern int              inet_del_protocol(struct inet_protocol *prot);
  47 
  48 
  49 #endif  /* _PROTOCOL_H */

/* [previous][next][first][last][top][bottom][index][help] */