1.\" $NetBSD: trpt.8,v 1.16 2007/08/30 18:53:54 jnemeth 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 August 30, 2007 33.Dt TRPT 8 34.Os 35.Sh NAME 36.Nm trpt 37.Nd transliterate protocol trace 38.Sh SYNOPSIS 39.Nm 40.Op Fl a 41.Op Fl f 42.Op Fl j 43.Op Fl p Ar hex-address 44.Op Fl s 45.Op Fl t 46.Op Fl N Ar system 47.Op Fl M Ar core 48.Sh DESCRIPTION 49.Nm 50interrogates the buffer of 51.Tn TCP 52trace records created 53when a socket is marked for 54.Dq debugging 55(see 56.Xr setsockopt 2 ) , 57and prints a readable description of these records. 58When no options are supplied, 59.Nm 60prints all the trace records found in the system 61grouped according to 62.Tn TCP 63connection protocol control 64block 65.Pq Tn PCB . 66The following options may be used to 67alter this behavior. 68.Bl -tag -width Ds 69.It Fl a 70In addition to the normal output, 71print the values of the source and destination 72addresses for each packet recorded. 73.It Fl f 74Follow the trace as it occurs, waiting a short time for additional records 75each time the end of the log is reached. 76.It Fl j 77Just give a list of the protocol control block 78addresses for which there are trace records. 79.It Fl p 80Show only trace records associated with the protocol 81control block at the given address 82.Ar hex-address . 83.It Fl s 84In addition to the normal output, 85print a detailed description of the packet 86sequencing information. 87.It Fl t 88in addition to the normal output, 89print the values for all timers at each 90point in the trace. 91.It Fl M Ar core 92Extract values associated with the name list from 93.Pa core . 94.It Fl N Ar system 95Extract the name list from 96.Pa system . 97.El 98.Pp 99The recommended use of 100.Nm 101is as follows. 102Isolate the problem and enable debugging on the 103socket(s) involved in the connection. 104Find the address of the protocol control blocks 105associated with the sockets using the 106.Fl A 107option to 108.Xr netstat 1 . 109Then run 110.Nm 111with the 112.Fl p 113option, supplying the associated 114protocol control block addresses. 115The 116.Fl f 117option can be used to follow the trace log once the trace is located. 118If there are 119many sockets using the debugging option, the 120.Fl j 121option may be useful in checking to see if 122any trace records are present for the socket in 123question. 124.Sh SYSCTLS 125The following sysctls are used by 126.Nm . 127The 128.Dv TCP_DEBUG 129kernel option must be enabled. 130.Pp 131.Bl -tag -width "XnetXinetXtcpXdebugXX" 132.It Li net.inet.tcp.debug 133Structure containing TCP sockets information used by 134.Nm . 135.It Li net.inet.tcp.debx 136Number of TCP debug messages. 137.El 138.Sh DIAGNOSTICS 139.Bl -tag -width Ds 140.It Sy no namelist 141When the image doesn't 142contain the proper symbols to find the trace buffer; 143others which should be self explanatory. 144.El 145.Sh SEE ALSO 146.Xr netstat 1 , 147.Xr setsockopt 2 , 148.Sh HISTORY 149The 150.Nm 151command appeared in 152.Bx 4.2 . 153.Sh BUGS 154Should also print the data for each input or output, 155but this is not saved in the trace record. 156.Pp 157The output format is inscrutable and should be described 158here. 159