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 #define HEADER_SIZE 64 /* maximum header size */ 22 23 24 struct tcphdr { 25 unsigned short source; 26 unsigned short dest; 27 unsigned long seq; 28 unsigned long ack_seq; 29 unsigned short res1:4, 30 doff:4, 31 fin:1, 32 syn:1, 33 rst:1, 34 psh:1, 35 ack:1, 36 urg:1, 37 res2:2; 38 unsigned short window; 39 unsigned short check; 40 unsigned short urg_ptr; 41 }; 42 43 44 enum { 45 TCP_ESTABLISHED = 1, 46 TCP_SYN_SENT, 47 TCP_SYN_RECV, 48 #if 0 49 TCP_CLOSING, /* not a valid state, just a seperator so we can use 50 < tcp_closing or > tcp_closing for checks. */ 51 #endif 52 TCP_FIN_WAIT1, 53 TCP_FIN_WAIT2, 54 TCP_TIME_WAIT, 55 TCP_CLOSE, 56 TCP_CLOSE_WAIT, 57 TCP_LAST_ACK, 58 TCP_LISTEN 59 }; 60 61 #endif /* _LINUX_TCP_H */