root/net/inet/sockinet.h

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

INCLUDED FROM


   1 /*
   2  *              Definitions for the socket handler
   3  *
   4  * Version:     @(#)sock.h      1.28    26/12/93
   5  *
   6  * Authors:     Ross Biro, <bir7@leland.Stanford.Edu>
   7  *              Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
   8  *              Corey Minyard <wf-rch!minyard@relay.EU.net>
   9  *              Florian La Roche <flla@stud.uni-sb.de>
  10  *
  11  * Fixes:
  12  *              Alan Cox        :       Volatiles in skbuff pointers. See
  13  *                                      skbuff comments. May be overdone,
  14  *                                      better to prove they can be removed
  15  *                                      than the reverse.
  16  *              Alan Cox        :       Added a zapped field for tcp to note
  17  *                                      a socket is reset and must stay shut up
  18  *              Alan Cox        :       New fields for options
  19  *      Pauline Middelink       :       identd support
  20  *              Alan Cox        :       Split into sock.h and sockinet.h
  21  *
  22  *              This program is free software; you can redistribute it and/or
  23  *              modify it under the terms of the GNU General Public License
  24  *              as published by the Free Software Foundation; either version
  25  *              2 of the License, or (at your option) any later version.
  26  */
  27 
  28 #ifndef _SOCKINET_H
  29 #define _SOCKINET_H
  30 
  31 #ifndef _SOCK_H
  32 #include "socket/sock.h"
  33 #endif
  34 
  35 #ifndef _PROTOCOL_H_
  36 #include "protocol.h"
  37 #endif
  38 
  39 struct proto {
  40   void                  *(*wmalloc)(struct sock *sk,
  41                                     unsigned long size, int force,
  42                                     int priority);
  43   void                  *(*rmalloc)(struct sock *sk,
  44                                     unsigned long size, int force,
  45                                     int priority);
  46   void                  (*wfree)(struct sock *sk, void *mem,
  47                                  unsigned long size);
  48   void                  (*rfree)(struct sock *sk, void *mem,
  49                                  unsigned long size);
  50   unsigned long         (*rspace)(struct sock *sk);
  51   unsigned long         (*wspace)(struct sock *sk);
  52   void                  (*close)(struct sock *sk, int timeout);
  53   int                   (*read)(struct sock *sk, unsigned char *to,
  54                                 int len, int nonblock, unsigned flags);
  55   int                   (*write)(struct sock *sk, unsigned char *to,
  56                                  int len, int nonblock, unsigned flags);
  57   int                   (*sendto)(struct sock *sk,
  58                                   unsigned char *from, int len, int noblock,
  59                                   unsigned flags, struct sockaddr_in *usin,
  60                                   int addr_len);
  61   int                   (*recvfrom)(struct sock *sk,
  62                                     unsigned char *from, int len, int noblock,
  63                                     unsigned flags, struct sockaddr_in *usin,
  64                                     int *addr_len);
  65   int                   (*build_header)(struct sk_buff *skb,
  66                                         unsigned long saddr,
  67                                         unsigned long daddr,
  68                                         struct device **dev, int type,
  69                                         struct options *opt, int len,
  70                                         int ttl, int tos);
  71   int                   (*connect)(struct sock *sk,
  72                                   struct sockaddr_in *usin, int addr_len);
  73   struct sock           *(*accept) (struct sock *sk, int flags);
  74   void                  (*queue_xmit)(struct sock *sk,
  75                                       struct device *dev, struct sk_buff *skb,
  76                                       int free);
  77   void                  (*retransmit)(struct sock *sk, int all);
  78   void                  (*write_wakeup)(struct sock *sk);
  79   void                  (*read_wakeup)(struct sock *sk);
  80   int                   (*rcv)(struct sk_buff *buff, struct device *dev,
  81                                struct options *opt, unsigned long daddr,
  82                                unsigned short len, unsigned long saddr,
  83                                int redo, struct inet_protocol *protocol);
  84   int                   (*select)(struct sock *sk, int which,
  85                                   select_table *wait);
  86   int                   (*ioctl)(struct sock *sk, int cmd,
  87                                  unsigned long arg);
  88   int                   (*init)(struct sock *sk);
  89   void                  (*shutdown)(struct sock *sk, int how);
  90   int                   (*setsockopt)(struct sock *sk, int level, int optname,
  91                                  char *optval, int optlen);
  92   int                   (*getsockopt)(struct sock *sk, int level, int optname,
  93                                 char *optval, int *option);      
  94   unsigned short        max_header;
  95   unsigned long         retransmits;
  96   struct sock           *sock_array[SOCK_ARRAY_SIZE];
  97   char                  name[80];
  98 };
  99 
 100 extern void                     destroy_sock(struct sock *sk);
 101 extern unsigned short           get_new_socknum(struct proto *, unsigned short);
 102 extern void                     put_sock(unsigned short, struct sock *); 
 103 extern void                     release_sock(struct sock *sk);
 104 extern struct sock              *get_sock(struct proto *, unsigned short,
 105                                           unsigned long, unsigned short,
 106                                           unsigned long);
 107 
 108 
 109 /* declarations from timer.c */
 110 extern struct sock *timer_base;
 111 
 112 void delete_timer (struct sock *);
 113 void reset_timer (struct sock *, int, unsigned long);
 114 void net_timer (unsigned long);
 115 
 116 
 117 
 118 #endif

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