http://www.azstarnet.com/~ymg/files/slsnif-0.4.0.tar.gz
[slsnif.git] / slsnif.1
1 .\" hey, Emacs:   -*- nroff -*-
2 .\" slsnif is free software; you can redistribute it and/or modify
3 .\" it under the terms of the GNU General Public License as published by
4 .\" the Free Software Foundation; either version 2 of the License, or
5 .\" (at your option) any later version.
6 .\" 
7 .\" This program is distributed in the hope that it will be useful,
8 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
9 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10 .\" GNU General Public License for more details.
11 .\" 
12 .\" You should have received a copy of the GNU General Public License
13 .\" along with this program; see the file COPYING.  If not, write to
14 .\" the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
15 .\" 
16 .\" Please update the above date whenever this man page is modified.
17 .\" 
18 .\" Some roff macros, for reference:
19 .\" .nh        disable hyphenation
20 .\" .hy        enable hyphenation
21 .\" .ad l      left justify
22 .\" .ad b      justify to both left and right margins (default)
23 .\" .nf        disable filling
24 .\" .fi        enable filling
25 .\" .br        insert line break
26 .\" .sp <n>    insert n+1 empty lines
27 .\" for manpage-specific macros, see man(7)
28 .TH "SLSNIF" "1" "0.4.0" "Warrior" "Debug"
29 .SH "NAME"
30 slsnif \- Serial line sniffer
31 .SH "SYNOPSIS"
32 .B slsnif
33 [\-b] [\-l logfile] [\-s speed] [\-t] [\-p port2]
34 [\-\-color color] [\-\-timecolor color] [\-\-bytescolor color]
35 [\-n] port1
36  
37 .SH "DESCRIPTION"
38 \fBslsnif\fR is a serial line sniffer software. It listens to the specified serial port and writes all data coming through it into either stdout (default) or a log file (if specified \-\- see option \fI\-l\fR).
39 .PP 
40 \fBslsnif\fR operates either by creating a pseudo tty (pty) and linking it to the serial port, or by linking two serial ports together. In order to set up a debug session one has either to start \fBslsnif\fR on a given port first, note the \fIpty\fR it had opened, then configure the controlling software for the device being debugged to use this pty instead of the actual port, or, in case of two ports being used, simply start \fBslsnif\fR on two ports (see option \fI\-p\fR) and watch the show :) 
41 .PP 
42 \fBNote 1 :\fR \fBSlsnif\fR will try to match port settings on pty and port (or on 1st and 2nd ports) as soon as it detects first chunk of data coming from the "host side" (which is either pty or 2nd port). If it fails (in case of a braindead   controlling   software that doesn't set  the  baudrate  correctly), one has an ability to set baudrate by hand via option \fI\-s\fR. Controlling software and \fBslsnif\fR should be set up to use the same baudrate, which in turn should match the baudrate used by the device connected to the port.
43 .PP 
44 \fBNote 2 :\fR If controlling software is running under vmware (www.vmware.com) and pty is used, port in question should be disconnected from vmware \fIbefore\fR invoking \fBslsnif\fR, and connected to the opened pty \fIafter\fR slsnif has been started.
45 .SH "PARAMETERS"
46 \fBslsnif\fP accepts the following parameters:
47 .TP 
48 .B <port1> (required)
49 First (and only one in case of pty being used) serial port to listen to. (/dev/ttyS0, /dev/ttyS1, etc.)
50 .\"
51 .SH "OPTIONS"
52 .TP 
53 .B [\-l <logfile>] ([\-\-log <logfile>])
54 File to direct output to. Output is sent to \fIstdout\fR by default.
55 .TP 
56 .B [\-s <speed>] ([\-\-speed <speed>])
57 Baudrate to use. Valid options are:
58 .br 
59 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, 9600,
60 19200, 38400, 57600, 115200.
61 .br 
62 Defaults to 9600 baud.
63 .TP 
64 .B [\-b] ([\-\-bytes])
65 Print number of bytes transmitted on every read.
66 .TP 
67 .B [\-p <port2>] ([\-\-port2 <port2>])
68 Use real serial port instead of pty. Useful when one needs to log data going between two ports.
69 .TP 
70 .B [\-n] ([\-\-nolock])
71 Disable locking of the port.
72 Normally not a good idea, but can be very useful if one doesn't have
73 permissions to write to lock directory
74 (usually /var/lock/)
75 .TP 
76 .B [\-t] ([\-\-timestamp])
77 Print timestamp for every transmission.
78 .TP 
79 .B [\-\-color <color>]
80 Color to use for normal output.
81 .TP 
82 .B [\-\-timecolor <color>]
83 Color to use for timestamp.
84 .TP 
85 .B [\-\-bytescolor <color>]
86 Color to use for number of bytes transmitted.
87 .br 
88 Valid <color> values are:
89 .br 
90 black, red, green, yellow, blue, magenta,
91 .br 
92 cyan, white, brightblack, brightred,
93 .br 
94 brightgreen, brightyellow, brightblue,
95 .br 
96 brightmagenta, brightcyan, and brightwhite.
97 .TP 
98 .B [\-h] ([\-\-help])
99 Display help.
100 .br 
101 .br 
102 .br 
103 .br 
104 .br 
105 .br 
106 .\"
107 .SH "RC FILE"
108 .PP 
109 The following options can be specified via rc\-file '.slsnifrc', which should be located in the user's home directory:
110 .TP 
111 .B TOTALBYTES ON/OFF
112 \-\- corresponds to \-b (\-\-bytes).
113 .TP 
114 .B TIMESTAMP  ON/OFF
115 \-\- corresponds to \-t (\-\-timestamp).
116 .TP 
117 .B NOLOCK     ON/OFF
118 \-\- corresponds to \-n (\-\-nolock).
119 .TP 
120 .B COLOR      <color>
121 \-\- corresponds to \-\-color <color>.
122 .TP 
123 .B TIMECOLOR  <color> 
124 \-\- corresponds to \-\-timecolor <color>.
125 .TP 
126 .B BYTESCOLOR <color>
127 \-\- corresponds to \-\-bytescolor <color>.
128 .PP 
129 Options specified via command line \fIalways override\fR the ones specified via rc\-file.
130 .PP 
131 .\"
132 .SH "EXAMPLE"
133 .PP 
134 \fBslsnif \-l log.txt \-s 2400 /dev/ttyS1\fR
135 .br 
136 \fI
137        Opened pty: /dev/ttyp0
138        Opened port: /dev/ttyS1
139 \fR
140 .br 
141 Note: pty \fBslsnif\fR has opened is \fI/dev/ttyp0\fR.
142 .SH "SEE ALSO"
143 .BR setserial (8), 
144 .BR stty (1).
145 .\"
146 .SH "AUTHOR"
147 Yan "Warrior" Gurtovoy <ymg@azstarnet.com>.