1: /*
2: * Copyright (c) 1982, 1986 Regents of the University of California.
3: * All rights reserved. The Berkeley software License Agreement
4: * specifies the terms and conditions for redistribution.
5: *
6: * @(#)tcp.h 7.1 (Berkeley) 6/5/86
7: */
8:
9: typedef u_long tcp_seq;
10: /*
11: * TCP header.
12: * Per RFC 793, September, 1981.
13: */
14: struct tcphdr {
15: u_short th_sport; /* source port */
16: u_short th_dport; /* destination port */
17: tcp_seq th_seq; /* sequence number */
18: tcp_seq th_ack; /* acknowledgement number */
19: #ifdef vax
20: u_char th_x2:4, /* (unused) */
21: th_off:4; /* data offset */
22: #endif
23: u_char th_flags;
24: #define TH_FIN 0x01
25: #define TH_SYN 0x02
26: #define TH_RST 0x04
27: #define TH_PUSH 0x08
28: #define TH_ACK 0x10
29: #define TH_URG 0x20
30: u_short th_win; /* window */
31: u_short th_sum; /* checksum */
32: u_short th_urp; /* urgent pointer */
33: };
34:
35: #define TCPOPT_EOL 0
36: #define TCPOPT_NOP 1
37: #define TCPOPT_MAXSEG 2
38:
39: /*
40: * Default maximum segment size for TCP.
41: * With an IP MSS of 576, this is 536,
42: * but 512 is probably more convenient.
43: */
44: #ifdef lint
45: #define TCP_MSS 536
46: #else
47: #define TCP_MSS MIN(512, IP_MSS - sizeof (struct tcpiphdr))
48: #endif
49:
50: /*
51: * User-settable options (used with setsockopt).
52: */
53: #define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */
54: #define TCP_MAXSEG 0x02 /* set maximum segment size */
Defined struct's
tcphdr
defined in line
14; used 16 times
Defined macros
TH_FIN
defined in line
24; used 14 times
- in /usr/src/sys/netinet/tcp_input.c line
53,
143,
452,
485,
504,
526,
815,
832,
839
- in /usr/src/sys/netinet/tcp_output.c line
84,
98,
127,
233,
324
Usage of this include