Guus Sliepen
2f42896789
Remove debugging message that was accidentily left in.
2011-06-02 21:29:11 +02:00
Guus Sliepen
c6b0e102ad
Don't treat packets coming in via TCP as having zero length.
2011-06-02 21:16:57 +02:00
Guus Sliepen
80ca91769d
Fix nodes joining the VPN after tincctl top started.
2011-06-02 21:14:50 +02:00
Guus Sliepen
311f60f4f0
Make traffic statistics more readable with configurable scaling.
2011-06-02 20:48:18 +02:00
Guus Sliepen
a8f0d21330
More stable sorting in tincctl top.
...
Although we use qsort(), which is not guaranteed to be stable, resorting the
previously sorted array is more stable than recreating and resorting the array
each time.
2011-06-02 20:27:16 +02:00
Guus Sliepen
2bda2aa885
Fix some compiler and cppcheck warnings.
2011-06-02 18:22:26 +02:00
Guus Sliepen
809dfd2f5b
Remove support for the Ethertap device.
2011-06-02 18:07:50 +02:00
Guus Sliepen
af2e0c9a32
Remove unused functions and variables.
2011-06-02 17:57:53 +02:00
Guus Sliepen
9eca49329d
Don't #include <alloca.h> anymore.
2011-06-02 17:55:29 +02:00
Guus Sliepen
b7754e5aaa
Drop the GNU memcmp.c implementation.
2011-06-02 17:53:35 +02:00
Guus Sliepen
25b467638a
Drop the GNU malloc.c, realloc.c, and xmalloc.c.
...
We live in the 21st century, and we require C99 semantics, so we do not need to
work around buggy libcs. The xmalloc() and related functions are now static
inline functions.
2011-06-02 17:45:06 +02:00
Guus Sliepen
e452a933f9
Simplify signal handling.
...
We don't override any signal handlers anymore except those for SIGPIPE and
SIGCHLD. Fatal signals (SIGSEGV, SIGBUS etc.) will terminate tincd and
optionally dump core. The previous behaviour was to terminate gracefully and
try to restart, but that usually failed and made any core dump useless.
2011-06-02 17:14:30 +02:00
Guus Sliepen
4d440336c3
Remove outgoing event in free_connection().
2011-05-29 22:34:19 +02:00
Guus Sliepen
d29bfc9a45
Initialise priority field to zero for packets read from the VPN interface.
2011-05-29 22:14:35 +02:00
Guus Sliepen
4c403840ff
Cosmetic fix when pressing 's' in tincctl top.
2011-05-29 22:12:37 +02:00
Guus Sliepen
b3aeaf0f91
Show hostname and port in error message when connecting to a running tincd.
2011-05-29 22:10:54 +02:00
Sven-Haegar Koch
04de15984f
do_outgoing_connection() may delete a failed connection, and the structure
...
must not be accessed afterwards.
2011-05-29 22:05:14 +02:00
Sven-Haegar Koch
82109868b5
src/net_socket.c bind_to_address(): Use after free in error path.
2011-05-29 22:05:04 +02:00
Guus Sliepen
5bc957074a
Allow tincctl to connect to something besides localhost.
...
This would allow tincctl to connect to a remote tincd, or to a local tincd that
isn't listening on localhost, for example if it is using the BindToInterface or
BindToAddress options.
2011-05-29 14:41:05 +02:00
Guus Sliepen
64771f73eb
Remove a few unnecessary #includes.
...
Some spotted by Michael Tokarev.
2011-05-28 23:46:56 +02:00
Guus Sliepen
5cff8c47c1
Remove newlines from log messages.
2011-05-28 23:42:18 +02:00
Guus Sliepen
6d08eb1614
Fix sparse warnings and add an extra sprinkling of const.
...
This is more or less the equivalent of Sven-Haegar Koch's fixes in the 1.1
branch.
2011-05-28 23:36:52 +02:00
Sven-Haegar Koch
e6b21e1a51
fgets() returns NULL on error, not < 0
2011-05-28 15:24:39 +02:00
Sven-Haegar Koch
434e57ae5e
sparse fixup: warning: Using plain integer as NULL pointer
2011-05-28 15:24:39 +02:00
Sven-Haegar Koch
f4010694b3
sparse fixup: warning: non-ANSI function declaration of function '...'
2011-05-28 15:24:39 +02:00
Sven-Haegar Koch
d772289f6d
sparse fixup: warning: symbol '...' was not declared. Should it be static?
2011-05-28 15:24:39 +02:00
Sven-Haegar Koch
02e32cf61e
sparse fixup: error: too many arguments for function send_key_changed
2011-05-28 15:24:39 +02:00
Sven-Haegar Koch
b995243ac3
sparse fixup: error: dubious one-bit signed bitfield
2011-05-28 15:24:39 +02:00
Sven-Haegar Koch
bbd0025ae3
Use same definition for xalloc_fail_func as is really used.
2011-05-28 15:24:39 +02:00
Sven-Haegar Koch
3fca2cad48
Removed two newlines from the end of log messages which created empty lines.
2011-05-28 15:24:39 +02:00
Sven-Haegar Koch
9cce44dfe3
Fixed error logging on "Input buffer full" condition.
2011-05-28 15:24:38 +02:00
Guus Sliepen
07ffb1a198
Make return value of SetPriorityClass() behave the same as setpriority().
2011-05-22 15:56:04 +02:00
Guus Sliepen
453c44e7b2
Add the ability to dump all traffic going through route() over a control connection.
...
One can get the packet stream in pcap format, which can be decoded using
tcpdump, for example:
tincctl -n <netname> pcap | tcpdump -r -
2011-05-22 14:17:30 +02:00
Guus Sliepen
54c900e961
Reset tcplen after use.
2011-05-22 14:02:27 +02:00
Guus Sliepen
8ddcad5fa1
Check if an event is initialized before calling event_del().
...
Libevent prints a warning to stderr if we do that.
2011-05-22 13:24:01 +02:00
Guus Sliepen
931e30f91a
Always compact the buffer if it has reached MAXBUFSIZE.
2011-05-22 13:24:01 +02:00
Guus Sliepen
90c7fafe59
Compact input buffer before trying to read instead of after.
...
Also log an error when the input buffer contains more than MAXBUFSIZE bytes
already, instead of silently claiming the other side closed the connection.
2011-05-22 13:20:44 +02:00
Guus Sliepen
8de8f1d9e2
Fix some compiler warnings.
2011-05-17 10:58:22 +02:00
Guus Sliepen
a80c18dd20
Use GetItemCount() on ListCtrls instead of directly accessing ItemCount.
2011-05-17 10:57:30 +02:00
Guus Sliepen
f536504a7d
Add top.h.
2011-05-16 09:48:19 +02:00
Guus Sliepen
e272fab858
Add tincctl.h.
2011-05-16 09:46:54 +02:00
Guus Sliepen
6d97cb1e22
Nicer top command.
...
- Configurable refresh interval.
- Switch between cumulative count or current rate.
- Configurable sorting.
2011-05-15 16:30:13 +02:00
Guus Sliepen
4574b04f79
Allow inserting items in the middle of a list.
2011-05-15 16:29:54 +02:00
Guus Sliepen
97355690b9
Add a very primitive "top" command to tincctl.
2011-05-15 13:16:48 +02:00
Guus Sliepen
ec495b2f15
Add an autoconf check for the curses library.
2011-05-15 12:06:21 +02:00
Guus Sliepen
362d8a6358
Dump traffic statistics over control sockets.
2011-05-15 11:59:13 +02:00
Guus Sliepen
f5843e7d64
Add per-node traffic counters.
2011-05-15 00:42:29 +02:00
Guus Sliepen
ffa3a443b9
Several fixes for the buffer code.
2011-05-14 22:30:23 +02:00
Guus Sliepen
cdb793f687
Remove use of bufferevent and eventbuffers, use our own buffering instead.
2011-05-14 19:20:56 +02:00
Guus Sliepen
f431fcb35f
Add simple buffer management code.
...
Libevent 2.0's buffer code is not completely backward compatible with 1.4's.
In order to not (mis)use it anymore, we implement it ourselves. The buffers
are automatically expanding when necessary. When consuming data from the
buffer, no memmove()s are performed. Only when adding to the buffer would
write past the end do we shift everything back to the start.
2011-05-14 19:15:04 +02:00