Annotation of linux/net/tcp/sock.h, revision 1.1

1.1     ! root        1: /* sock.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 [email protected] or
        !            20:     C/O Department of Mathematics; Stanford University; Stanford, CA 94305
        !            21: */
        !            22: #ifndef _TCP_SOCK_H
        !            23: #define _TCP_SOCK_H
        !            24: 
        !            25: #define SOCK_ARRAY_SIZE 64
        !            26: 
        !            27: /* This structure really needs to be cleaned up.  Most of it is
        !            28:    for tcp, and not used by any of the other protocols. */
        !            29: 
        !            30: struct sock 
        !            31: {
        !            32:   struct options *opt;
        !            33:   unsigned long wmem_alloc;
        !            34:   unsigned long rmem_alloc;
        !            35:   unsigned long send_seq;
        !            36:   unsigned long acked_seq;
        !            37:   unsigned long copied_seq;
        !            38:   unsigned long rcv_ack_seq;
        !            39:   unsigned long window_seq;
        !            40:   unsigned long fin_seq;
        !            41:   unsigned long inuse:1, dead:1, urginline:1,
        !            42:                 intr:1, blog:1, done:1, reuse:1, keepopen:1, linger:1,
        !            43:                 delay_acks:1, timeout:3, destroy:1, ack_timed:1, no_check:1,
        !            44:                 exp_growth:1;
        !            45:   int proc;
        !            46:   volatile struct sock *next;
        !            47:   volatile struct sock *pair;
        !            48:   struct sk_buff *send_tail;
        !            49:   struct sk_buff *send_head;
        !            50:   struct sk_buff *back_log;
        !            51:   long retransmits;
        !            52:   struct sk_buff *wback, *wfront, *rqueue;
        !            53:   struct proto *prot;
        !            54:   struct wait_queue **sleep;
        !            55:   unsigned long daddr;
        !            56:   unsigned long saddr;
        !            57:   unsigned short max_unacked;
        !            58:   unsigned short window;
        !            59:   unsigned short bytes_rcv;
        !            60:   unsigned short mtu;
        !            61:   unsigned short num;
        !            62:   unsigned short cong_window;
        !            63:   unsigned short packets_out;
        !            64:   unsigned short urg;
        !            65:   unsigned short shutdown;
        !            66:   short rtt;
        !            67:   unsigned char protocol;
        !            68:   unsigned char state;
        !            69:   unsigned char ack_backlog;
        !            70:   unsigned char err;
        !            71:   unsigned char max_ack_backlog;
        !            72:   unsigned char priority;
        !            73:   struct tcp_header dummy_th; /* I may be able to get rid of this. */
        !            74:   struct timer time_wait;
        !            75: };
        !            76: 
        !            77: struct proto 
        !            78: {
        !            79:   void *(*wmalloc)(volatile struct sock *sk, unsigned long size, int force);
        !            80:   void *(*rmalloc)(volatile struct sock *sk, unsigned long size, int force);
        !            81:   void (*wfree)(volatile struct sock *sk, void *mem, unsigned long size);
        !            82:   void (*rfree)(volatile struct sock *sk, void *mem, unsigned long size);
        !            83:   unsigned long (*rspace)(volatile struct sock *sk);
        !            84:   unsigned long (*wspace)(volatile struct sock *sk);
        !            85:   void (*close)(volatile struct sock *sk, int timeout);
        !            86:   int (*read)(volatile struct sock *sk, unsigned char *to, int len,
        !            87:              int nonblock, unsigned flags);
        !            88:   int (*write)(volatile struct sock *sk, unsigned char *to, int len,
        !            89:               int nonblock, unsigned flags);
        !            90:   int (*sendto) (volatile struct sock *sk, unsigned char *from, int len,
        !            91:                 int noblock, unsigned flags, struct sockaddr_in *usin,
        !            92:                 int addr_len);
        !            93:   int (*recvfrom) (volatile struct sock *sk, unsigned char *from, int len,
        !            94:                   int noblock, unsigned flags, struct sockaddr_in *usin,
        !            95:                   int *addr_len);
        !            96:   int (*build_header) (struct sk_buff *skb, unsigned long saddr,
        !            97:                       unsigned long daddr, struct device **dev, int type,
        !            98:                       struct options *opt, int len);
        !            99:   int (*connect) (volatile struct sock *sk, struct sockaddr_in *usin,
        !           100:                  int addr_len);
        !           101:   volatile struct sock *(*accept) (volatile struct sock *sk, int flags);
        !           102:   void  (*queue_xmit) (volatile struct sock *sk, struct device *dev, 
        !           103:                       struct sk_buff *skb, int free);
        !           104:   void (*retransmit) (volatile struct sock *sk, int all);
        !           105:   void (*write_wakeup) (volatile struct sock *sk);
        !           106:   void (*read_wakeup) (volatile struct sock *sk);
        !           107:   int (*rcv)(struct sk_buff *buff, struct device *dev, struct options *opt,
        !           108:             unsigned long daddr, unsigned short len,
        !           109:             unsigned long saddr, int redo, struct ip_protocol *protocol);
        !           110:   int (*select)(volatile struct sock *sk, int which, select_table *wait);
        !           111:   int (*ioctl) (volatile struct sock *sk, int cmd, unsigned long arg);
        !           112:   int (*init) (volatile struct sock *sk);
        !           113:   unsigned short max_header;
        !           114:   unsigned long retransmits;
        !           115:   volatile struct sock *sock_array[SOCK_ARRAY_SIZE];
        !           116: };
        !           117: 
        !           118: #define TIME_WRITE 1
        !           119: #define TIME_CLOSE 2
        !           120: #define TIME_KEEPOPEN 3
        !           121: #define TIME_DESTROY 4
        !           122: #define TIME_DONE 5 /* used to absorb those last few packets. */
        !           123: #define SOCK_DESTROY_TIME 1000 /* about 10 seconds. */
        !           124: 
        !           125: /* used with free skb */
        !           126: #define FREE_READ 1
        !           127: #define FREE_WRITE 0
        !           128: 
        !           129: struct sk_buff
        !           130: {
        !           131:   struct sk_buff *next;
        !           132:   struct sk_buff *prev;
        !           133:   struct sk_buff *link3;
        !           134:   volatile struct sock *sk;
        !           135:   unsigned long when; /* used to compute rtt's. */
        !           136:   struct device *dev;
        !           137:   void *mem_addr;
        !           138:   union
        !           139:     {
        !           140:        struct tcp_header *th;
        !           141:        struct enet_header *eth;
        !           142:        struct ip_header *iph;
        !           143:        struct udp_header *uh;
        !           144:        struct arp *arp;
        !           145:        unsigned char *raw;
        !           146:        unsigned long seq;
        !           147:     } h;
        !           148:   unsigned long mem_len;
        !           149:   unsigned long len;
        !           150:   unsigned long saddr;
        !           151:   unsigned long daddr;
        !           152:   unsigned long acked:1,used:1,free:1,arp:1, urg_used:1, lock:1;
        !           153: };
        !           154: 
        !           155: #define PROT_SOCK 1024
        !           156: #define SK_WMEM_MAX 8192
        !           157: #define SK_RMEM_MAX 32767
        !           158: #define SHUTDOWN_MASK 3
        !           159: #define RCV_SHUTDOWN 1
        !           160: #define SEND_SHUTDOWN 2
        !           161: 
        !           162: void destroy_sock (volatile struct sock *sk);
        !           163: unsigned short get_new_socknum (struct proto *, unsigned short);
        !           164: void put_sock (unsigned short, volatile struct sock *); 
        !           165: void release_sock (volatile struct sock *sk);
        !           166: volatile struct sock *get_sock(struct proto *, unsigned short, unsigned long,
        !           167:                               unsigned short, unsigned long);
        !           168: void print_sk (volatile struct sock *);
        !           169: void print_skb (struct sk_buff *);
        !           170: void *sock_wmalloc(volatile struct sock *sk, unsigned long size, int force);
        !           171: void *sock_rmalloc(volatile struct sock *sk, unsigned long size, int force);
        !           172: void sock_wfree(volatile struct sock *sk, void *mem, unsigned long size);
        !           173: void sock_rfree(volatile struct sock *sk, void *mem, unsigned long size);
        !           174: unsigned long sock_rspace(volatile struct sock *sk);
        !           175: unsigned long sock_wspace(volatile struct sock *sk);
        !           176: void free_skb (struct sk_buff *skb, int rw);
        !           177: void lock_skb (struct sk_buff *skb);
        !           178: void unlock_skb (struct sk_buff *skb, int rw);
        !           179: 
        !           180: void dummy_routine(void *, ... );
        !           181: 
        !           182: #endif

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.