Commit | Line | Data |
---|---|---|
b2db9217 | 1 | /* tcp.h 1.21 82/01/18 */ |
6e8b2eca | 2 | |
8a13b737 | 3 | typedef u_long tcp_seq; |
6e8b2eca | 4 | /* |
eb44bfb2 | 5 | * TCP header. |
2b4b57cd | 6 | * Per RFC 793, September, 1981. |
6e8b2eca | 7 | */ |
eb44bfb2 BJ |
8 | struct tcphdr { |
9 | u_short th_sport; /* source port */ | |
10 | u_short th_dport; /* destination port */ | |
8a13b737 BJ |
11 | tcp_seq th_seq; /* sequence number */ |
12 | tcp_seq th_ack; /* acknowledgement number */ | |
6e8b2eca | 13 | u_char |
eb44bfb2 BJ |
14 | th_x2:4, /* (unused) */ |
15 | th_off:4; /* data offset */ | |
a3d78bbd | 16 | u_char th_flags; |
2ff61f9d BJ |
17 | #define TH_FIN 0x01 |
18 | #define TH_SYN 0x02 | |
19 | #define TH_RST 0x04 | |
20 | #define TH_PUSH 0x08 | |
21 | #define TH_ACK 0x10 | |
22 | #define TH_URG 0x20 | |
eb44bfb2 BJ |
23 | u_short th_win; /* window */ |
24 | u_short th_sum; /* checksum */ | |
25 | u_short th_urp; /* urgent pointer */ | |
121f5f3a | 26 | }; |
8b5a83bb BJ |
27 | |
28 | #define TCPOPT_EOL 0 | |
29 | #define TCPOPT_NOP 1 | |
30 | #define TCPOPT_MAXSEG 2 | |
31 | ||
32 | #ifdef TCPTRUEOOB | |
33 | /* | |
34 | * True out-of-band as value added option. | |
35 | * Advertise willingness with TCPOPT_WILOOB in | |
36 | * initial segment. If peer is willing, will receive | |
37 | * such also. Then can send TCPOPT_OOBDATA whenever oob data | |
38 | * exists; peer should ack with TCPOPT_OOBACK in segment. | |
39 | */ | |
40 | #define TCPOPT_WILLOOB 64 /* bytes: 64, 2 */ | |
b2db9217 | 41 | #define TCPOPT_OOBDATA 65 /* bytes: 65, 8, seq#, data, markseq */ |
8b5a83bb BJ |
42 | #define TCPOPT_OOBACK 66 /* bytes: 66, 3, ack# */ |
43 | #endif |