Commit graph

158 commits

Author SHA1 Message Date
Guus Sliepen
ddc6a81a85 Remove global variable "now". 2007-05-18 09:34:06 +00:00
Guus Sliepen
aaf1851315 Redo SIGALRM handling. 2007-05-17 23:04:02 +00:00
Guus Sliepen
a67ab277c9 Use libevent for retrying outgoing connections. 2007-05-17 22:09:55 +00:00
Guus Sliepen
ee7844905f Configure events after obtaining a socket. 2007-05-17 21:47:27 +00:00
Guus Sliepen
0f6f54ff8a Use a separate event structure to handle meta data writes.
Make meta socket events persistent.
2007-05-17 20:20:10 +00:00
Guus Sliepen
6ea1dfc995 Port fixes from release 1.0.8. 2007-05-17 19:15:48 +00:00
Guus Sliepen
480dd127c8 Make sure connection->name is never NULL. 2007-05-16 14:42:08 +00:00
Guus Sliepen
f0cf4991e2 Apply patch from "dnk" making sockets non-blocking under Windows. 2007-05-14 09:21:09 +00:00
Scott Lamb
38c25d62c2 Convert to libevent.
This is a quick initial conversion that doesn't yet show much advantage:
- We roll our own timeouts.
- We roll our own signal handling.
- We build up the meta connection fd events on each loop rather than
  on state changes.
2007-02-27 01:57:01 +00:00
Scott Lamb
6362b12df7 Rename "event_t" to "tevent_t", along with associated functions.
This relieves some confusion and problems during the libevent transition.
In particular, "event_add" was defined by both.
(The 't' stands for 'timeout', 'tinc', 'temporary', or some such.)
2007-02-27 01:26:11 +00:00
Guus Sliepen
64e0519cb5 Remove unused variable. 2006-08-08 13:50:58 +00:00
Guus Sliepen
c620df3c15 Remove unused variables. 2006-08-08 13:44:19 +00:00
Guus Sliepen
de78d79db8 Update copyright notices, remove Ivo's email address. 2006-04-26 13:52:58 +00:00
Guus Sliepen
af95368c0f Fix signedness compiler warnings. 2006-03-19 13:06:21 +00:00
Guus Sliepen
228e7a5c8f Apply patch from Scott Lamb adding an output buffer for the TCP sockets.
This helps coalescing multiple send_meta() commands into one TCP packet.
Also limit the size of the output buffer before dropping PACKETs.
2006-01-19 17:13:18 +00:00
Guus Sliepen
a5a4d2b865 Apply patch from Scott Lamb unifying configuration of TCP socket options. 2006-01-13 11:21:59 +00:00
Guus Sliepen
df3220a154 Update copyright notices. 2005-05-04 18:09:30 +00:00
Guus Sliepen
dc09f6fe89 Be on the safe side with initialisation of c->name. 2005-05-04 15:51:45 +00:00
Guus Sliepen
4fe7aff4d1 Add BlockingTCP option, useful when using TCPOnly on slow or congested links. 2004-11-10 21:56:31 +00:00
Guus Sliepen
7926a156e5 Update copyrights, links, email addresses and let Subversion update $Id$ keywords. 2004-03-21 14:21:22 +00:00
Guus Sliepen
35399784b6 Improvements for PMTU discovery and IPv4 packet fragmentation. 2003-12-22 11:04:17 +00:00
Guus Sliepen
9bab08e972 More sensible name, and try to set PMTU discovery on IPv6 sockets as well. 2003-12-20 21:09:33 +00:00
Guus Sliepen
6b12bea62f Let tinc figure out the exact MTU of the link. 2003-12-20 19:47:53 +00:00
Guus Sliepen
5a1406adef Code beautification, start of multicast support. 2003-12-12 19:52:25 +00:00
Guus Sliepen
6350334aa4 Don't confuse users with "Address family not supported" warnings. 2003-10-06 14:41:45 +00:00
Guus Sliepen
721e4caee0 Native Windows support. 2003-07-29 22:59:01 +00:00
Guus Sliepen
0e94541331 More checks for missing functions. 2003-07-28 22:06:09 +00:00
Guus Sliepen
83263b7446 Sprinkle around a lot of const and some C99 initialisers. 2003-07-24 12:08:16 +00:00
Guus Sliepen
eefa28059a Use bools and enums where appropriate. 2003-07-22 20:55:21 +00:00
Guus Sliepen
123bb765d1 Use iface instead of interface because it might already be declared in
system header files.
2003-07-18 13:45:06 +00:00
Guus Sliepen
00ddbf5723 Update all device.c files. 2003-07-18 13:41:37 +00:00
Guus Sliepen
e449d94cae Big header file cleanup: everything that has to do with standard system
libraries is moved to system.h.
2003-07-17 15:06:27 +00:00
Guus Sliepen
5db596c684 Simplify logging, update copyrights and some minor cleanups. 2003-07-12 17:41:48 +00:00
Guus Sliepen
0b9175e998 Define logger(), cleans up source code and allows us to write log entries
to a separate file.
2003-07-06 22:11:37 +00:00
Guus Sliepen
31f17d4334 AddressFamily is "any" by default. 2003-06-11 19:27:35 +00:00
Guus Sliepen
c08858baa9 - Fix indentation in some places.
- Optimise select loop.
- Remove unused function setup_outgoing_socket().
- Clear EVP_CIPHER_CTX structures before using them.
2003-01-17 00:37:20 +00:00
Guus Sliepen
5eca9520d9 Small fixes so tinc compiles out of the box on SunOS 5.8 2002-09-15 14:55:54 +00:00
Guus Sliepen
6f9f6779e6 Remove redundant spaces. 2002-09-09 22:33:31 +00:00
Guus Sliepen
f75dcef72a Switch to K&R style indentation. 2002-09-09 21:25:28 +00:00
Guus Sliepen
5fc1ed17f4 Cleanups:
- Convert cp to cp(); so that automatic indenters work.
 - Convert constructions like if(x == NULL) to if(!x).
 - Move all assignments out of conditions.
2002-09-09 19:40:12 +00:00
Guus Sliepen
82ebfc923d Revert to edge and graph stuff. This time, use a directed graph. 2002-09-04 13:48:52 +00:00
Guus Sliepen
d134c4542d Drop graph and edge stuff. Use new node stuff instead. 2002-09-03 20:43:26 +00:00
Guus Sliepen
627f7c22b4 s/sliepen.warande.net/sliepen.eu.org/g
s/itimmermans@bigfoot.com/ivo@o2w.nl/g
2002-06-21 10:11:37 +00:00
Guus Sliepen
940fcb6701 Reset listen_sockets after SIGHUP. 2002-06-13 16:12:40 +00:00
Guus Sliepen
78e8852184 - netinet/* include files depend on netinet/in_systm.h.
- Squash bashism in configure.in.
2002-06-08 14:08:57 +00:00
Guus Sliepen
116ba3b3da Cleanup:
- Remove checks for specific OS's, instead check for #defines/#includes.
 - Use uint??_t where appropriate.
 - Mask handling functions use void pointers to get rid of silly casts.
2002-06-08 12:57:10 +00:00
Ivo Timmermans
97d492d9e2 Put #ifndef checks for HAVE_RAND_PSEUDO_BYTES in the correct places. 2002-04-18 20:09:05 +00:00
Guus Sliepen
0e7136027c Merge do_prune() with build_fdset(). Probably fixes the invalid filedescriptor error. 2002-03-27 14:02:36 +00:00
Guus Sliepen
305505f5ec Remember sockaddrs of listening sockets, use appropriate one when sending
UDP packets.
2002-03-18 22:47:20 +00:00
Guus Sliepen
8b84c44175 Unmap v4mapped sockaddrs. 2002-03-17 15:59:29 +00:00
Guus Sliepen
0c16add71c Check if BindToDevice and PriorityInheritance are supported. 2002-03-01 15:14:29 +00:00
Guus Sliepen
14979f835d - Global time_t now, so that we don't have to call time() too often.
- MAC addresses expire after a time configurable by MACExpire (default 600
  seconds)
2002-03-01 14:09:31 +00:00
Guus Sliepen
f93b1334e0 Create/bind TCP and UDP listening sockets in pairs. 2002-03-01 13:18:54 +00:00
Guus Sliepen
7f58ed7685 Make BindToInterface work. 2002-03-01 11:18:34 +00:00
Guus Sliepen
50403909b6 Allow multiple listening sockets. 2002-02-26 23:26:41 +00:00
Guus Sliepen
23fda5688e - Change SA_LEN to SALEN, former one is already defined on some platforms.
- Use SALEN everywhere appropriate.
2002-02-20 22:37:38 +00:00
Guus Sliepen
c6d0158831 Protocol now also exchanges cipher/digest/maclength/compression for the
meta connection.
2002-02-20 19:25:09 +00:00
Guus Sliepen
c2b9c06062 - Non-blocking connect()s.
- Socket handling revamped to use sockaddr_t.
- tinc can now tunnel over IPv6.
- Handle all addresses and subnets in network byte order.
  Only convert them when they need to be printed.
- IPv6 subnets bigger than /128 now work.
- Use %s and strerror(errno) instead of %m.
2002-02-18 16:25:19 +00:00