Explicitly request literal mode after .Xr.
[netbsd-mini2440.git] / dist / tcpdump / tcp.h
blob1a659f650c9e405c80169293f6eceb5c82743187
1 /* $NetBSD$ */
3 /* @(#) Header: /tcpdump/master/tcpdump/tcp.h,v 1.11.2.1 2005/11/29 09:09:26 hannes Exp (LBL) */
4 /*
5 * Copyright (c) 1982, 1986, 1993
6 * The Regents of the University of California. All rights reserved.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. Neither the name of the University nor the names of its contributors
17 * may be used to endorse or promote products derived from this software
18 * without specific prior written permission.
20 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
32 * @(#)tcp.h 8.1 (Berkeley) 6/10/93
35 typedef u_int32_t tcp_seq;
37 * TCP header.
38 * Per RFC 793, September, 1981.
40 struct tcphdr {
41 u_int16_t th_sport; /* source port */
42 u_int16_t th_dport; /* destination port */
43 tcp_seq th_seq; /* sequence number */
44 tcp_seq th_ack; /* acknowledgement number */
45 u_int8_t th_offx2; /* data offset, rsvd */
46 #define TH_OFF(th) (((th)->th_offx2 & 0xf0) >> 4)
47 u_int8_t th_flags;
48 #define TH_FIN 0x01
49 #define TH_SYN 0x02
50 #define TH_RST 0x04
51 #define TH_PUSH 0x08
52 #define TH_ACK 0x10
53 #define TH_URG 0x20
54 #define TH_ECNECHO 0x40 /* ECN Echo */
55 #define TH_CWR 0x80 /* ECN Cwnd Reduced */
56 u_int16_t th_win; /* window */
57 u_int16_t th_sum; /* checksum */
58 u_int16_t th_urp; /* urgent pointer */
61 #define TCPOPT_EOL 0
62 #define TCPOPT_NOP 1
63 #define TCPOPT_MAXSEG 2
64 #define TCPOLEN_MAXSEG 4
65 #define TCPOPT_WSCALE 3 /* window scale factor (rfc1323) */
66 #define TCPOPT_SACKOK 4 /* selective ack ok (rfc2018) */
67 #define TCPOPT_SACK 5 /* selective ack (rfc2018) */
68 #define TCPOPT_ECHO 6 /* echo (rfc1072) */
69 #define TCPOPT_ECHOREPLY 7 /* echo (rfc1072) */
70 #define TCPOPT_TIMESTAMP 8 /* timestamp (rfc1323) */
71 #define TCPOLEN_TIMESTAMP 10
72 #define TCPOLEN_TSTAMP_APPA (TCPOLEN_TIMESTAMP+2) /* appendix A */
73 #define TCPOPT_CC 11 /* T/TCP CC options (rfc1644) */
74 #define TCPOPT_CCNEW 12 /* T/TCP CC options (rfc1644) */
75 #define TCPOPT_CCECHO 13 /* T/TCP CC options (rfc1644) */
76 #define TCPOPT_SIGNATURE 19 /* Keyed MD5 (rfc2385) */
77 #define TCPOLEN_SIGNATURE 18
78 #define TCP_SIGLEN 16 /* length of an option 19 digest */
79 #define TCPOPT_AUTH 20 /* Enhanced AUTH option */
81 #define TCPOPT_TSTAMP_HDR \
82 (TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP)