]> the.earth.li Git - sersniff.git/blob - README
Import sersniff 0.0.4
[sersniff.git] / README
1 sersniff 0.0.4 - A program to tunnel between 2 serial ports and show
2 what's happening.
3 Copyright 1999 Jonathan McDowell for Project Purple.
4 http://www.earth.li/projectpurple/progs/sersniff.html
5
6
7 Introduction:
8
9 This program was written to aid me with the decoding of the protocol
10 used by the Nokia 9000i Communicator to talk to the NServer software
11 Nokia provides, which only runs under Windows. Having hastily thrown
12 together the code to do what I needed it occured to me that others may
13 have a use for something similiar and that having a skeleton available
14 may help.
15
16 (Aside: Of course, in the usual tradition of Open Source, someone got
17 there before. Checkout nserver from
18 http://users.globalnet.co.uk/~syrinx/ if your interested in the Nokia
19 stuff.)
20
21 I feel that the concept could be taken a lot further, with various
22 filters and so on being constructed (given a framework in which to
23 construct them) similiar to that available with ethernet sniffers. This
24 could aid with the disassembly of unknown protocols over serial lines or
25 even for debugging serial connections. Maybe I'll write this code
26 someday, maybe not. Maybe someone else will and will send me a patch. :)
27
28
29 Command line options:
30
31 sersniff [-h] [-i DEVICE ] [-o DEVICE] [-b BAUD] [-s] [-n] [-w USECS]
32
33 -h
34         Displays some command line option help.
35
36 -i IN_DEV
37         Set the device to use for Port1. Default of /dev/ttyS0. If you want
38         to listen on a TCP port then use the format :port. If there's a / in
39         the string then it will always be treated as a device rather than a
40         port to listen on.
41
42 -o OUT_DEV
43         Set the device to use for Port2. Default of /dev/ttyS1. If you want
44         to connect to a TCP port then use the format host:port. Again if
45         there's a / in the string then it will always be treated as a device.
46
47 -b BAUD
48         Specify baud rate for serial connections. Defaults to 19200.
49
50 -s
51         Make sersniff not copy data between the two ports - useful if a
52         Y cable is being used for serial port sniffing for example.
53
54 -n
55         Don't do any port configuration.
56
57 -w USECS
58         How many microsecs to wait before reporting a delay.
59
60 -x
61         Show hex characters instead of normal ASCII characters.
62
63 -f
64         Specify the format string that should be used to print hex characters.
65
66
67 TCP/serial things:
68
69 This program was originally written to cope with serial port data. I
70 have added simple support for a TCP connection both to aid with
71 development (it's a /lot/ easier for me to generate TCP streams than
72 serial streams) and also because I think a lot of the things that are
73 useful for monitoring a serial port data stream can also be applied to
74 TCP. Taking this further leads to thinking about UDP/raw ethernet - I'll
75 think about it once I get some filtering stuff in.
76
77 The TCP stuff does a simple listen on a port and then connects to the
78 host/port specified. I see no reason why it couldn't be used to allow
79 telneting to a serial port or connecting from a serial port to a TCP
80 port, but I haven't tested this.
81
82
83 Filtering:
84
85 This is a definite to do. For example, let's assume a regex based
86 scheme. We could implement the current filter as something like:
87
88 /\x0A/          <LF>
89 /\x0D/          <CR>
90 /\x1B/          <ESC>
91 /./             .
92
93 (Yeah, ok, I need to think about syntax. This doesn't cover the < 32 or
94 > 127 range)
95
96 But then say we learn a bit about our protocol? Let's assume VT100 for a
97 moment, then we might want:
98
99 /\x0A/          <LF>
100 /\x0D/          <CR>
101 /\x1B/          <ESC>
102 /\x1B[2J/       <Screen Clear>
103 /\x1B[0m/       <Attribute Reset>
104 /\0x7/          <BEL>
105 /./             .
106
107 Now that's more useful, isn't it? And if it came with filters for common
108 serial protocols, that might be useful too? Say a VT100 one, a PPP one,
109 a UUCP one, well, you get the idea hopefully.
110
111 Anyway, this is a major to do. Just needs me to get a round tuit and
112 think about syntax.
113
114
115 Development system:
116
117 sersniff was originally written under Linux on a 486dx2-66. It is
118 currently being worked on under FreeBSD on a Cyrix P233+.
119
120
121 Contacting the author:
122
123 I can be reached as noodles@earth.li or on Fidonet as Jonathan McDowell
124 @ 2:443/21
125
126 All constructive criticism about sersniff is welcome.
127
128
129 License:
130
131 sersniff is distributed under the GNU Public License, a copy of which
132 should have been provided with this archive as LICENSE.