xref: /openbsd/usr.sbin/trpt/trpt.8 (revision 09467b48)
1.\"	$OpenBSD: trpt.8,v 1.17 2016/09/25 23:31:50 deraadt Exp $
2.\"
3.\" Copyright (c) 1983, 1991, 1993
4.\"	The Regents of the University of California.  All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. Neither the name of the University nor the names of its contributors
15.\"    may be used to endorse or promote products derived from this software
16.\"    without specific prior written permission.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28.\" SUCH DAMAGE.
29.\"
30.\"     @(#)trpt.8	8.2 (Berkeley) 12/11/93
31.\"
32.Dd $Mdocdate: September 25 2016 $
33.Dt TRPT 8
34.Os
35.Sh NAME
36.Nm trpt
37.Nd transliterate protocol trace
38.Sh SYNOPSIS
39.Nm trpt
40.Op Fl afjst
41.Op Fl M Ar core
42.Op Fl N Ar system
43.Op Fl p Ar hex-address
44.Sh DESCRIPTION
45.Nm
46interrogates the buffer of
47.Tn TCP
48trace records created
49when a socket is marked for
50.Dq debugging
51(see
52.Xr setsockopt 2 ) ,
53and prints a readable description of these records.
54When no options are supplied,
55.Nm
56prints all the trace records found in the system
57grouped according to
58.Tn TCP
59connection protocol control
60block
61.Pq Tn PCB .
62.Pp
63The options are as follows:
64.Bl -tag -width Ds
65.It Fl a
66In addition to the normal output,
67print the values of the source and destination
68addresses for each packet recorded.
69.It Fl f
70Follow the trace as it occurs, waiting a short time for additional records
71each time the end of the log is reached.
72.It Fl j
73Just give a list of the protocol control block
74addresses for which there are trace records.
75.It Fl M Ar core
76Extract values associated with the name list from
77.Pa core
78instead of the running kernel.
79.It Fl N Ar system
80Extract the name list from
81.Pa system
82instead of the running kernel.
83.It Fl p Ar hex-address
84Show only trace records associated with the protocol
85control block at the given address
86.Ar hex-address .
87.It Fl s
88In addition to the normal output,
89print a detailed description of the packet
90sequencing information.
91.It Fl t
92In addition to the normal output,
93print the values for all timers at each
94point in the trace.
95.El
96.Pp
97The recommended use of
98.Nm
99is as follows.
100Isolate the problem and enable debugging on the
101socket(s) involved in the connection.
102Find the address of the protocol control blocks
103associated with the sockets using the
104.Fl A
105option to
106.Xr netstat 1 .
107Then run
108.Nm
109with the
110.Fl p
111option, supplying the associated
112protocol control block addresses.
113The
114.Fl f
115option can be used to follow the trace log once the trace is located.
116If there are
117many sockets using the debugging option, the
118.Fl j
119option may be useful in checking to see if
120any trace records are present for the socket in
121question.
122.Pp
123.Nm
124requires the ability to open
125.Pa /dev/kmem
126which may be restricted based upon the value of the
127.Ar kern.allowkmem
128.Xr sysctl 8 .
129.Sh DIAGNOSTICS
130.Bl -tag -width Ds
131.It Sy no namelist
132When the system image doesn't
133contain the proper symbols to find the trace buffer;
134others which should be self explanatory.
135.El
136.Sh SEE ALSO
137.Xr netstat 1 ,
138.Xr setsockopt 2
139.Sh HISTORY
140The
141.Nm
142command appeared in
143.Bx 4.2 .
144.Sh BUGS
145Should also print the data for each input or output,
146but this is not saved in the trace record.
147.Pp
148The output format is inscrutable and should be described
149here.
150