xref: /f-stack/freebsd/netinet/tcp_debug.h (revision a9643ea8)
1*a9643ea8Slogwang /*-
2*a9643ea8Slogwang  * Copyright (c) 1982, 1986, 1993
3*a9643ea8Slogwang  *	The Regents of the University of California.  All rights reserved.
4*a9643ea8Slogwang  *
5*a9643ea8Slogwang  * Redistribution and use in source and binary forms, with or without
6*a9643ea8Slogwang  * modification, are permitted provided that the following conditions
7*a9643ea8Slogwang  * are met:
8*a9643ea8Slogwang  * 1. Redistributions of source code must retain the above copyright
9*a9643ea8Slogwang  *    notice, this list of conditions and the following disclaimer.
10*a9643ea8Slogwang  * 2. Redistributions in binary form must reproduce the above copyright
11*a9643ea8Slogwang  *    notice, this list of conditions and the following disclaimer in the
12*a9643ea8Slogwang  *    documentation and/or other materials provided with the distribution.
13*a9643ea8Slogwang  * 4. Neither the name of the University nor the names of its contributors
14*a9643ea8Slogwang  *    may be used to endorse or promote products derived from this software
15*a9643ea8Slogwang  *    without specific prior written permission.
16*a9643ea8Slogwang  *
17*a9643ea8Slogwang  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18*a9643ea8Slogwang  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19*a9643ea8Slogwang  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20*a9643ea8Slogwang  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21*a9643ea8Slogwang  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22*a9643ea8Slogwang  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23*a9643ea8Slogwang  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24*a9643ea8Slogwang  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25*a9643ea8Slogwang  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26*a9643ea8Slogwang  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27*a9643ea8Slogwang  * SUCH DAMAGE.
28*a9643ea8Slogwang  *
29*a9643ea8Slogwang  *	@(#)tcp_debug.h	8.1 (Berkeley) 6/10/93
30*a9643ea8Slogwang  * $FreeBSD$
31*a9643ea8Slogwang  */
32*a9643ea8Slogwang 
33*a9643ea8Slogwang #ifndef _NETINET_TCP_DEBUG_H_
34*a9643ea8Slogwang #define	_NETINET_TCP_DEBUG_H_
35*a9643ea8Slogwang 
36*a9643ea8Slogwang struct	tcp_debug {
37*a9643ea8Slogwang 	uint32_t	td_time;	/* network format */
38*a9643ea8Slogwang 	short	td_act;
39*a9643ea8Slogwang 	short	td_ostate;
40*a9643ea8Slogwang 	caddr_t	td_tcb;
41*a9643ea8Slogwang 	int	td_family;
42*a9643ea8Slogwang 	/*
43*a9643ea8Slogwang 	 * Co-existense of td_ti and td_ti6 below is ugly, but it is necessary
44*a9643ea8Slogwang 	 * to achieve backword compatibility to some extent.
45*a9643ea8Slogwang 	 */
46*a9643ea8Slogwang 	struct	tcpiphdr td_ti;
47*a9643ea8Slogwang 	struct {
48*a9643ea8Slogwang #define	IP6_HDR_LEN	40	/* sizeof(struct ip6_hdr) */
49*a9643ea8Slogwang #if !defined(_KERNEL) && defined(INET6)
50*a9643ea8Slogwang 		struct	ip6_hdr ip6;
51*a9643ea8Slogwang #else
52*a9643ea8Slogwang 		u_char	ip6buf[IP6_HDR_LEN];
53*a9643ea8Slogwang #endif
54*a9643ea8Slogwang 		struct	tcphdr th;
55*a9643ea8Slogwang 	} td_ti6;
56*a9643ea8Slogwang #define	td_ip6buf	td_ti6.ip6buf
57*a9643ea8Slogwang 	short	td_req;
58*a9643ea8Slogwang 	struct	tcpcb td_cb;
59*a9643ea8Slogwang };
60*a9643ea8Slogwang 
61*a9643ea8Slogwang #define	TA_INPUT	0
62*a9643ea8Slogwang #define	TA_OUTPUT	1
63*a9643ea8Slogwang #define	TA_USER		2
64*a9643ea8Slogwang #define	TA_RESPOND	3
65*a9643ea8Slogwang #define	TA_DROP		4
66*a9643ea8Slogwang 
67*a9643ea8Slogwang #ifdef TANAMES
68*a9643ea8Slogwang static const char	*tanames[] =
69*a9643ea8Slogwang     { "input", "output", "user", "respond", "drop" };
70*a9643ea8Slogwang #endif
71*a9643ea8Slogwang 
72*a9643ea8Slogwang #define	TCP_NDEBUG 100
73*a9643ea8Slogwang 
74*a9643ea8Slogwang #ifndef _KERNEL
75*a9643ea8Slogwang /* XXX common variables for broken applications. */
76*a9643ea8Slogwang struct	tcp_debug tcp_debug[TCP_NDEBUG];
77*a9643ea8Slogwang int	tcp_debx;
78*a9643ea8Slogwang #endif
79*a9643ea8Slogwang 
80*a9643ea8Slogwang #endif /* !_NETINET_TCP_DEBUG_H_ */
81