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 TCP protocol. 7 * 8 * Version: @(#)tcp.h 1.0.2 04/28/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_LINUX_TCP_H 18 #define_LINUX_TCP_H 19
20 structtcphdr{ 21 __u16source;
22 __u16dest;
23 __u32seq;
24 __u32ack_seq;
25 #ifdefined(__LITTLE_ENDIAN_BITFIELD)
26 __u16res1:4,
27 doff:4,
28 fin:1,
29 syn:1,
30 rst:1,
31 psh:1,
32 ack:1,
33 urg:1,
34 res2:2;
35 #elifdefined(__BIG_ENDIAN_BITFIELD)
36 __u16doff:4,
37 res1:4,
38 res2:2,
39 urg:1,
40 ack:1,
41 psh:1,
42 rst:1,
43 syn:1,
44 fin:1;
45 #else 46 #error "Adjust your <asm/byteorder.h> defines"
47 #endif 48 __u16window;
49 __u16check;
50 __u16urg_ptr;
51 };
52
53
54 enum{ 55 TCP_ESTABLISHED = 1,
56 TCP_SYN_SENT,
57 TCP_SYN_RECV,
58 TCP_FIN_WAIT1,
59 TCP_FIN_WAIT2,
60 TCP_TIME_WAIT,
61 TCP_CLOSE,
62 TCP_CLOSE_WAIT,
63 TCP_LAST_ACK,
64 TCP_LISTEN,
65 TCP_CLOSING/* now a valid state */ 66 };
67
68 #endif/* _LINUX_TCP_H */