1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 #ifndef _LINUX_TCP_H
18 #define _LINUX_TCP_H
19
20 #include <linux/types.h>
21 #include <asm/byteorder.h>
22
23 struct tcphdr {
24 __u16 source;
25 __u16 dest;
26 __u32 seq;
27 __u32 ack_seq;
28 #if defined(__LITTLE_ENDIAN_BITFIELD)
29 __u16 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 #elif defined(__BIG_ENDIAN_BITFIELD)
39 __u16 doff:4,
40 res1:4,
41 res2:2,
42 urg:1,
43 ack:1,
44 psh:1,
45 rst:1,
46 syn:1,
47 fin:1;
48 #else
49 #error "Adjust your <asm/byteorder.h> defines"
50 #endif
51 __u16 window;
52 __u16 check;
53 __u16 urg_ptr;
54 };
55
56
57 enum {
58 TCP_ESTABLISHED = 1,
59 TCP_SYN_SENT,
60 TCP_SYN_RECV,
61 TCP_FIN_WAIT1,
62 TCP_FIN_WAIT2,
63 TCP_TIME_WAIT,
64 TCP_CLOSE,
65 TCP_CLOSE_WAIT,
66 TCP_LAST_ACK,
67 TCP_LISTEN,
68 TCP_CLOSING
69 };
70
71 #endif