Commit graph

95 commits

Author SHA1 Message Date
Guus Sliepen
cad86108f3 Don't complain about garbage if we skipped importing a host file. 2013-01-14 12:59:17 +01:00
Guus Sliepen
a717b9bcfb Add option to dump only a list of reachable nodes. 2012-12-03 13:08:03 +01:00
Guus Sliepen
6bc5d626a8 Drop libevent and use our own event handling again.
There are several reasons for this:

- MacOS/X doesn't support polling the tap device using kqueue, requiring a
  workaround to fall back to select().
- On Windows only sockets are properly handled, therefore tinc uses a second
  thread that does a blocking ReadFile() on the TAP-Win32/64 device. However,
  this does not mix well with libevent.
- Libevent, event just the core, is quite large, and although it is easy to get
  and install on many platforms, it can be a burden.
- Libev is more lightweight and seems technically superior, but it doesn't
  abstract away all the platform differences (for example, async events are not
  supported on Windows).
2012-11-29 12:28:23 +01:00
Guus Sliepen
b355476e91 Fix potential buffer overflow reading the PID file.
Found by cppcheck.
2012-11-10 23:09:31 +01:00
Guus Sliepen
717ea66d7b Add the AutoConnect option.
When set to a non-zero value, tinc will try to maintain exactly that number of
meta connections to other nodes.  If there are not enough connections, it will
periodically try to set up an outgoing connection to a random node.  If there
are too many connections, it will periodically try to remove an outgoing
connection.
2012-10-21 17:35:13 +02:00
Guus Sliepen
368727c3da tincctl: add node colors and edge weight to graph dump. 2012-10-14 16:12:17 +02:00
Guus Sliepen
d917c8cb6b Fix whitespace. 2012-10-10 17:17:49 +02:00
Guus Sliepen
d93a37928b Fix warnings from cppcheck. 2012-10-07 17:53:23 +02:00
Guus Sliepen
ef9358c0d6 Improve starting/stopping tincd using tincctl.
When starting tincd, tincctl now strips non-options from the command line, and
sets argv[0] to the name of the tincd command instead of copying its own
command name.

When stopping a running tincd, tincctl now waits for it to terminate.
2012-10-06 17:45:03 +02:00
Guus Sliepen
e971130b60 Make tincctl robust against dropped control connections. 2012-09-28 17:36:25 +02:00
Guus Sliepen
f70cbc9d3e Comment out old public/private keys when generating new ones. 2012-09-27 15:45:02 +02:00
Guus Sliepen
1f312137d5 Allow dumping either directed or undirected graphs.
Internally, tinc maintains a directed graph of the meta connections between
nodes. However, this causes graphviz to draw two lines between nodes, which is
not always desirable. The "dump graph" command now defaults to dumping an
undirected graph, the "dump digraph" command will dump a directed graph.
2012-09-26 23:52:36 +02:00
Guus Sliepen
d6388d782e Let tincctl parse and format dumps.
At the moment it just reproduces the old format.
2012-09-26 23:18:32 +02:00
Guus Sliepen
d74b81b61e Fix node name check for "connect" and "disconnect" commands. 2012-08-30 14:00:34 +02:00
Guus Sliepen
5567c0d410 Quit when "exit" or "quit" commands are used in tincctl's shell. 2012-08-05 17:25:31 +02:00
Guus Sliepen
d18519ae21 Fix segfault when using tincctl's shell without readline. 2012-08-05 17:03:57 +02:00
Guus Sliepen
a57db1dfe0 Fork when using the "start" command in tincctl.
This allows the command to be given in its shell without immediatly exiting tincctl.
2012-08-03 14:15:50 +02:00
Guus Sliepen
36c6afede3 Add readline completion for tincctl config and tincctl info. 2012-08-03 13:23:07 +02:00
Guus Sliepen
73348be58e Have tincctl act as a shell when no command is given.
By default it uses readline to read commands. If the input and output are not a
tty, no prompt is shown.
2012-08-02 17:24:42 +02:00
Guus Sliepen
6396f42d74 Stricter checks for netname and node names.
- Node names should not be empty.
- Net names should not contain slashes or start with a dot, because they are
  used in pathnames.
2012-08-01 16:51:59 +02:00
Guus Sliepen
61006ced88 Add missing configuration variables. 2012-08-01 16:13:23 +02:00
Guus Sliepen
b0f3a76e9b Add the ability to query configuration variables to tincctl. 2012-08-01 15:53:20 +02:00
Guus Sliepen
a9caa2a6ea tincctl restart should work even if no tincd is running. 2012-08-01 15:15:37 +02:00
Guus Sliepen
07980b056c Try sending SIGTERM if we cannot connect to a tincd but we know its PID. 2012-08-01 15:14:48 +02:00
Guus Sliepen
2b97a7d7cf tincctl init now also creates a template tinc-up script. 2012-07-22 12:52:31 +02:00
Guus Sliepen
e5e96882c3 Windows doesn't like quotes around "edit" when calling it through system().
Even though that works fine on the command line.
2012-07-21 16:33:09 +02:00
Guus Sliepen
18237e1f2d Use backslashes on Windows.
Although Windows itself supports the forward slash, some programs may not.
2012-07-21 16:26:55 +02:00
Guus Sliepen
09a8ff649c Don't try to mkdir(CONFDIR) on Windows when there is a registry key for tinc. 2012-07-21 15:58:16 +02:00
Guus Sliepen
ed8ce60845 Fix crash when no netname is specified. 2012-07-21 15:51:15 +02:00
Guus Sliepen
7303b512b0 Fix some compiler warnings. 2012-07-21 15:50:50 +02:00
Guus Sliepen
33521eabd4 Have tincd and tincctl use the same method of determining netname. 2012-07-21 15:15:04 +02:00
Guus Sliepen
1d322d2eda Add a newline to a configuration file if it is missing. 2012-07-21 15:02:44 +02:00
Guus Sliepen
dea722c4ac Add some checks when changing configuration. 2012-07-21 15:02:17 +02:00
Guus Sliepen
4e0fc52197 Fix various compiler warnings. 2012-07-21 13:53:22 +02:00
Guus Sliepen
5eeed38b8e Make sure tinc compiles on Windows. 2012-07-21 12:51:53 +02:00
Guus Sliepen
68de7b481e When exporting configuration files, don't copy Name variables.
These interfere with tincctl import. Besides, host configuration files should
not contain Name at all.
2012-07-16 18:49:39 +02:00
Guus Sliepen
c52c46f871 Add an easy way to export and import host configuration files. 2012-07-16 16:48:24 +02:00
Guus Sliepen
53735a9d96 "tincctl info" gives more human readable information about nodes or subnets. 2012-07-16 01:05:25 +02:00
Guus Sliepen
e72e6febfe Fix tincctl dump. 2012-07-15 22:53:03 +02:00
Guus Sliepen
9be8980a2b Let tincctl ignore tincd options, so they will be passed on. 2012-07-15 21:17:10 +02:00
Guus Sliepen
36dee4c539 Fix tincctl start. 2012-07-15 21:15:35 +02:00
Guus Sliepen
439069bda6 Have tincctl notify a running tincd of configuration file changes. 2012-07-15 20:59:17 +02:00
Guus Sliepen
eb01fd9625 Add an easy way to edit a configuration file. 2012-07-15 20:37:38 +02:00
Guus Sliepen
cedfeccb24 Stricter checks for node names. 2012-07-15 20:22:21 +02:00
Guus Sliepen
03f72c6173 Allow configuration variables to be added/removed using tincctl. 2012-07-15 18:16:35 +02:00
Guus Sliepen
dd102efd24 Put every command in its own function. 2012-07-15 15:46:16 +02:00
Guus Sliepen
a444ec3964 "tincctl init" creates initial directory structure, tinc.conf and keypairs. 2012-07-15 14:49:36 +02:00
Guus Sliepen
8ac096b5bf Allow log messages to be captured by tincctl.
This allows tincctl to receive log messages from a running tincd,
independent of what is logged to syslog or to file. Tincctl can receive
debug messages with an arbitrary level.
2012-02-26 18:37:36 +01:00
Guus Sliepen
344d6b9ac3 Let tincctl use the NETNAME environment variable if no -n option is given.
This allows administrators who frequently want to work with one tinc
network to omit the -n option. Since the NETNAME variable is set by
tincd when executing scripts, this makes it slightly easier to use
tincctl from within scripts.
2012-02-26 13:08:34 +01:00
Guus Sliepen
b50d6a7f2a Fix compiler warnings. 2011-12-26 23:04:40 +01:00