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
21 #defineHEADER_SIZE 64 /* maximum header size */ 22
23
24 structtcphdr{ 25 unsignedshortsource;
26 unsignedshortdest;
27 unsignedlongseq;
28 unsignedlongack_seq;
29 #ifdefined(__i386__)
30 unsignedshortres1:4,
31 doff:4,
32 fin:1,
33 syn:1,
34 rst:1,
35 psh:1,
36 ack:1,
37 urg:1,
38 res2:2;
39 #else 40 #ifdefined(__mc680x0__)
41 unsignedshortres2:2,
42 urg:1,
43 ack:1,
44 psh:1,
45 rst:1,
46 syn:1,
47 fin:1,
48 doff:4,
49 res1:4;
50 #else 51 #error "Adjust this structure for your cpu alignment rules"
52 #endif 53 #endif 54 unsignedshortwindow;
55 unsignedshortcheck;
56 unsignedshorturg_ptr;
57 };
58
59
60 enum{ 61 TCP_ESTABLISHED = 1,
62 TCP_SYN_SENT,
63 TCP_SYN_RECV,
64 TCP_FIN_WAIT1,
65 TCP_FIN_WAIT2,
66 TCP_TIME_WAIT,
67 TCP_CLOSE,
68 TCP_CLOSE_WAIT,
69 TCP_LAST_ACK,
70 TCP_LISTEN,
71 TCP_CLOSING/* now a valid state */ 72 };
73
74 #endif/* _LINUX_TCP_H */