1 tcp.h |
1 /* TCP.H |
|
2 * |
|
3 * Portions copyright (c) 1997-1999 Symbian Ltd. All rights reserved. |
|
4 */ |
|
5 |
|
6 /** @file |
|
7 @publishedAll |
|
8 @released |
|
9 */ |
|
10 |
|
11 /* |
|
12 * Copyright (c) 1982, 1986 Regents of the University of California. |
|
13 * All rights reserved. The Berkeley software License Agreement |
|
14 * specifies the terms and conditions for redistribution. |
|
15 */ |
|
16 |
|
17 #ifndef _NETINET_TCP_H |
|
18 #define _NETINET_TCP_H |
|
19 |
|
20 #ifdef __cplusplus |
|
21 extern "C" { |
|
22 #endif |
|
23 |
|
24 typedef u_long tcp_seq; |
|
25 /** |
|
26 TCP header. |
|
27 Per RFC 793, September, 1981. |
|
28 @internalComponent |
|
29 */ |
|
30 struct tcphdr { |
|
31 u_short th_sport; /* source port */ |
|
32 u_short th_dport; /* destination port */ |
|
33 tcp_seq th_seq; /* sequence number */ |
|
34 tcp_seq th_ack; /* acknowledgement number */ |
|
35 #ifdef _BIT_FIELDS_LTOH |
|
36 u_int th_x2:4, /* (unused) */ |
|
37 th_off:4; /* data offset */ |
|
38 #else |
|
39 u_int th_off:4, /* data offset */ |
|
40 th_x2:4; /* (unused) */ |
|
41 #endif |
|
42 u_char th_flags; |
|
43 /** |
|
44 @internalComponent |
|
45 */ |
|
46 #define TH_FIN 0x01 |
|
47 /** |
|
48 @internalComponent |
|
49 */ |
|
50 #define TH_SYN 0x02 |
|
51 /** |
|
52 @internalComponent |
|
53 */ |
|
54 #define TH_RST 0x04 |
|
55 /** |
|
56 @internalComponent |
|
57 */ |
|
58 #define TH_PUSH 0x08 |
|
59 /** |
|
60 @internalComponent |
|
61 */ |
|
62 #define TH_ACK 0x10 |
|
63 /** |
|
64 @internalComponent |
|
65 */ |
|
66 #define TH_URG 0x20 |
|
67 u_short th_win; /* window */ |
|
68 u_short th_sum; /* checksum */ |
|
69 u_short th_urp; /* urgent pointer */ |
|
70 }; |
|
71 |
|
72 #define TCPOPT_EOL 0 |
|
73 #define TCPOPT_NOP 1 |
|
74 #define TCPOPT_MAXSEG 2 |
|
75 |
|
76 /** |
|
77 Default maximum segment size for TCP. |
|
78 With an IP MSS of 576, this is 536, |
|
79 but 512 is probably more convenient. |
|
80 */ |
|
81 #ifdef lint |
|
82 #define TCP_MSS 536 |
|
83 #else |
|
84 #define TCP_MSS MIN(512, IP_MSS - sizeof (struct tcpiphdr)) |
|
85 #endif |
|
86 |
|
87 /** |
|
88 User-settable options (used with setsockopt). |
|
89 */ |
|
90 #define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */ |
|
91 #define TCP_MAXSEG 0x02 /* set maximum segment size */ |
|
92 |
|
93 #define TCP_NOTIFY_THRESHOLD 0x10 |
|
94 #define TCP_ABORT_THRESHOLD 0x11 |
|
95 #define TCP_CONN_NOTIFY_THRESHOLD 0x12 |
|
96 #define TCP_CONN_ABORT_THRESHOLD 0x13 |
|
97 |
|
98 |
|
99 #ifdef __cplusplus |
|
100 } |
|
101 #endif |
|
102 |
|
103 #endif /* _NETINET_TCP_H */ |