before overlay
[unix-history] / usr / src / sys / netinet / tcp.h
CommitLineData
53a5409e 1/* tcp.h 1.15 81/11/14 */
6e8b2eca
BJ
2
3/*
dad64fdf
BJ
4 * Tcp header. Fits over the ip header after option removed.
5 *
6 * SHOULD MAKE A CLEAN HEADER FOR USE BY USERS.
6e8b2eca 7 */
53a5409e
BJ
8struct tcpiphdr {
9 struct tcpiphdr *t_next; /* -> next tcp on rcv chain */
10 struct tcpiphdr *t_prev; /* -> prev tcp on rcv chain */
6e8b2eca
BJ
11 u_char t_x1; /* (unused) */
12 u_char t_pr; /* protocol */
94b52709
BJ
13/* by rights, t_len should be a u_short, but this makes operations */
14/* on it very dangerous as comparisons become unsigned and comparing */
15/* against negative numbers then fails... we don't expect any > 32767 */
16/* byte segments, so pragmatically delcare it to be a short */
17 short t_len; /* seg length */
d52566dd
BJ
18 struct ip_addr t_s; /* source internet address */
19 struct ip_addr t_d; /* destination internet address */
6e8b2eca
BJ
20 u_short t_src; /* source port */
21 u_short t_dst; /* destination port */
22 seq_t t_seq; /* sequence number */
23 seq_t t_ackno; /* acknowledgement number */
24#define t_end(x) (x->t_seq + x->t_len - 1)
25 u_char
26 t_x2:4, /* (unused) */
27 t_off:4; /* data offset */
a3d78bbd
BJ
28 u_char th_flags;
29#define TH_FIN 001
30#define TH_SYN 002
31#define TH_RST 004
32#define TH_EOL 010
33#define TH_ACK 020
34#define TH_URG 040
6e8b2eca
BJ
35 u_short t_win; /* window */
36 u_short t_sum; /* checksum */
37 u_short t_urp; /* urgent pointer */
121f5f3a 38};