]> the.earth.li Git - sersniff.git/blob - README
a9821bedad31019587d1a81b849c7183c8c91da6
[sersniff.git] / README
1 sersniff 0.0.3 - 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 | -l PORT] [-o DEVICE | -c HOST:PORT] [-b BAUD] [-s]
32
33 -h
34         Displays some command line option help.
35
36 -i IN_DEV
37         Set the device to use for Port1, if you're using serial ports.
38         Default of /dev/ttyS0
39
40 -l PORT
41         Set the port to listen on, if you want Port1 to be a TCP socket.
42
43 -o OUT_DEV
44         Set the device to use for Port2, if you're using serial ports.
45         Default of /dev/ttyS1
46
47 -c HOST:PORT
48         Specify the host and port to connect to if Port2 is to be a TCP
49         socket.
50
51 -b BAUD
52         Specify baud rate for serial connections. Defaults to 19200.
53
54 -s
55         Make sersniff not copy data between the two ports - useful if a
56         Y cable is being used for serial port sniffing for example.
57
58
59 TCP/serial things:
60
61 This program was originally written to cope with serial port data. I
62 have added simple support for a TCP connection both to aid with
63 development (it's a /lot/ easier for me to generate TCP streams than
64 serial streams) and also because I think a lot of the things that are
65 useful for monitoring a serial port data stream can also be applied to
66 TCP. Taking this further leads to thinking about UDP/raw ethernet - I'll
67 think about it once I get some filtering stuff in.
68
69 The TCP stuff does a simple listen on a port and then connects to the
70 host/port specified. I see no reason why it couldn't be used to allow
71 telneting to a serial port or connecting from a serial port to a TCP
72 port, but I haven't tested this.
73
74
75 Filtering:
76
77 This is a definite to do. For example, let's assume a regex based
78 scheme. We could implement the current filter as something like:
79
80 /\x0A/          <LF>
81 /\x0D/          <CR>
82 /\x1B/          <ESC>
83 /./             .
84
85 (Yeah, ok, I need to think about syntax. This doesn't cover the < 32 or
86 > 127 range)
87
88 But then say we learn a bit about our protocol? Let's assume VT100 for a
89 moment, then we might want:
90
91 /\x0A/          <LF>
92 /\x0D/          <CR>
93 /\x1B/          <ESC>
94 /\x1B[2J/       <Screen Clear>
95 /\x1B[0m/       <Attribute Reset>
96 /\0x7/          <BEL>
97 /./             .
98
99 Now that's more useful, isn't it? And if it came with filters for common
100 serial protocols, that might be useful too? Say a VT100 one, a PPP one,
101 a UUCP one, well, you get the idea hopefully.
102
103 Anyway, this is a major to do. Just needs me to get a round tuit and
104 think about syntax.
105
106
107 Development system:
108
109 sersniff was originally written under Linux on a 486dx2-66. It is
110 currently being worked on under FreeBSD on a Cyrix P233+.
111
112
113 Contacting the author:
114
115 I can be reached as noodles@earth.li or on Fidonet as Jonathan McDowell
116 @ 2:443/21
117
118 All constructive criticism about sersniff is welcome.
119
120
121 License:
122
123 sersniff is distributed under the GNU Public License, a copy of which
124 should have been provided with this archive as LICENSE.