Commit Graph

527 Commits

Author SHA1 Message Date
frekky 07181e6a6a Fixed format string warnings when compiling for 32 bit systems 2016-01-10 22:00:52 +08:00
frekky 150bd5dedc Fix clang reinitialization warning 2016-01-09 22:37:41 +08:00
frekky ad4aa69be1 Make user.c independent of server for tests, add util.o to testobjs 2016-01-09 22:36:34 +08:00
frekky 122e42a5f7 Always print window sizes on startup 2016-01-09 22:13:13 +08:00
frekky 8232979a6e Added more presets - TODO: test to ensure they work as described 2016-01-09 22:12:00 +08:00
frekky 7068bcc08d Added command line option presets (--preset or -Y)
Fixed some refactoring issues and passing this.* as arguments
2016-01-09 19:29:17 +08:00
frekky f4d1d1634c Server now functions the same as before, using default preset 2016-01-09 15:26:25 +08:00
frekky 4c3e546b57 Remove unused date constants 2016-01-09 15:05:41 +08:00
frekky 4cdb3900d8 Modify debug macro to use appropriate global instance 2016-01-09 15:05:16 +08:00
frekky 147119afee Refactor client code to use client_instance 2016-01-09 15:04:39 +08:00
frekky 506c1de67e Refactor server code to use global server_instance 2016-01-09 15:03:58 +08:00
frekky eb6d2fae77 Update makefile to produce correct base64u files 2015-12-16 22:51:59 +08:00
frekky a17b990570 Reduced max label size to accomodate fussy DNS servers
At some point this may become a command line option
2015-12-16 22:44:51 +08:00
frekky 1ff16293dc Refactor to match client.c usage 2015-12-16 22:43:47 +08:00
frekky 68a53c4565 Fixed clang warnings + debug build 2015-11-21 19:27:28 +08:00
frekky e3531378b5 Fixed err.h error 2015-11-17 18:59:26 +08:00
frekky 03909ad59b Fixed err.h errors 2015-11-16 21:59:01 +08:00
frekky 4c8732f0ca Should now compile with mingw cross (still need zlib + err.h) 2015-11-15 20:57:45 +08:00
frekky 26b025a9b0 Fix unused variable warning on default build 2015-11-11 20:24:13 +08:00
frekky 4a565fd664 Improve data flow, better debugging, fixed ping CMC and frag timeout 2015-11-10 20:54:01 +08:00
frekky f96bd3735d Resend fragments ASAP to improve flow 2015-11-10 20:51:12 +08:00
frekky 8d25974867 Increased bad fragment tolerance to keep data flowing 2015-11-10 20:49:44 +08:00
frekky 9dec2de448 Updated command line arguments help 2015-11-10 20:42:31 +08:00
frekky 141d1f1e4e Removed unused tun_user::disabled flag 2015-11-10 20:04:14 +08:00
frekky fbf21caa6e Updated debug macros to include more info with DEBUG_BUILD 2015-11-10 20:03:27 +08:00
frekky a7dee7396c Making function of check_authenticated_user_and_ip a little more clear 2015-10-27 18:36:00 +08:00
frekky 3bcfe91769 Fixed raw UDP mode + improved debugging 2015-10-27 18:33:44 +08:00
frekky 08adc5da71 Added downstream window frag timeout and id=0 will now work. 2015-10-27 17:29:41 +08:00
frekky 50c9cb28ec Successfully fails if data buffer is too small 2015-10-27 17:28:20 +08:00
frekky 91c095e063 Minor adjustments and fixed some warnings 2015-10-27 17:27:11 +08:00
frekky 87edca99b4 Added downstream window fragment timeout option (-j) 2015-10-27 17:25:56 +08:00
frekky 8354ce28aa Updated fragment timeouts to use timeval for better precision 2015-10-17 22:30:46 +08:00
frekky 4983dadfdd Added client command line options + fixed version text 2015-10-17 22:29:55 +08:00
frekky 137d3029e5 Debug macro now always shows source location. 2015-10-17 22:28:45 +08:00
frekky 235d3be538 Improved timings + fixed immediate mode send interval.
Still switches to immediate mode too eagerly and reduces timeout very
quickly (especially with lots of SERVFAILs)
2015-10-17 22:28:10 +08:00
frekky c38e7d30a8 Merged QMEM and DNS cache; removed implied lazy switch.
Improved immediate mode handling, however does not add data queries to
QMEM in immediate mode (and does not work either).
2015-10-17 22:25:31 +08:00
frekky 49b3232874 Fixed ping userid validation 2015-10-05 10:33:16 +08:00
frekky f4f358f5e2 Ping responses use the same query and are immediate + set window params 2015-10-05 10:20:03 +08:00
frekky ceaac64814 Refactored client/server to use debug macro 2015-10-04 22:39:40 +08:00
frekky 2e0b7f8eae Added implied lazymode switch with server timeout of 0 2015-10-04 22:15:56 +08:00
frekky 7bc434536c Added global debug macro and some refactoring for window.c debug output 2015-10-04 22:15:12 +08:00
frekky 41ec2ae79c Added statistics printout and command line option 2015-10-04 22:13:47 +08:00
frekky 2be624c9a6 Fixed window_sending + made debug output nicer 2015-10-03 22:15:30 +08:00
frekky 4403e950a9 Added timeval <-> millisecond util functions 2015-10-03 22:14:30 +08:00
frekky 9ee23992c0 Added user ping flag, all_users_waiting_to_send now makes sense 2015-10-03 22:13:15 +08:00
frekky faf7d277a8 Server-side query-answer logic now handled by qmem_max_wait 2015-10-03 22:11:58 +08:00
frekky 51bf36c863 Adjusted new command line options for case consistency 2015-10-03 22:10:12 +08:00
frekky 1b85d23087 Fixed option handshake and query tracking (now works) 2015-10-03 22:09:34 +08:00
frekky e454a7edb5 Modified options packet to change more than 1 option at a time 2015-09-28 20:06:23 +08:00
frekky 4f16dd10e6 Merge remote-tracking branch 'h44z/iodine/master'
Conflicts:
	src/window.h
2015-09-28 16:39:08 +08:00
frekky ad48dc8e10 Updated qmem as lazy mode query buffer, other fixes/adjustments and
support for more client-controlled options
2015-09-28 13:09:49 +08:00
frekky 6eb2e4d251 Added fine tuning command-line options 2015-09-28 13:07:29 +08:00
frekky c7cff96055 More connection stats, timeout control + compression flags, client-side
query tracking; lazy mode is now possible with windowing protocol.
2015-09-28 13:07:00 +08:00
frekky c903203a24 Fixed issues with difftime and removed unused parts of query struct. 2015-09-28 13:02:34 +08:00
frekky 555a3cbfe2 Modified qmem for lazy mode handling; fixed some user management issues 2015-09-28 13:01:18 +08:00
frekky bd9966836e Added clear, reset and number of fragments to be sent; better debugging 2015-09-28 12:57:33 +08:00
frekky 33525e5086 Added windows gettimeofday function and timeval macros 2015-09-28 12:26:41 +08:00
frekky c48822dfbe Added debug / default build options (make debug) 2015-09-28 12:24:15 +08:00
Christoph Haas b7f0da1493 Fixed C99 Compiler warning 2015-09-11 17:33:04 +02:00
frekky 0449c465e7 Re-implemented working DNS tunnelling (with windows!) 2015-08-29 20:11:46 +08:00
frekky 9f6033c4b8 Added client debug output option 2015-08-29 20:10:53 +08:00
frekky c83a52c771 Now starts when no non-loopback interfaces configured 2015-08-29 20:10:25 +08:00
frekky 98da57ba74 More unsignedness and working DNS tunnelling 2015-08-29 20:08:46 +08:00
frekky 51a59bed24 Added more debug output and deprecated qmem 2015-08-29 20:07:44 +08:00
frekky b6162241e6 Fixed some windowing issues + made debug output optional (WINDOW_DEBUG) 2015-08-29 20:06:53 +08:00
frekky 02c2763c26 Unsigned types for encoding data 2015-08-29 13:03:08 +08:00
frekky 4c8ce94be7 Minor readability adjustments + more debug output 2015-08-23 22:15:51 +08:00
frekky 8e08c007c5 Window buffer max_fragsize adjusted according to MAX_HOSTNAME and
current upstream codec
2015-08-23 22:14:27 +08:00
frekky 391bf5224a Added window_buffer_resize function 2015-08-23 22:11:28 +08:00
frekky 5df91ed775 Added encoder length calculation functions 2015-08-23 22:10:50 +08:00
frekky 96f9270b7f Removed unhelpful coding errors. 2015-08-21 23:24:53 +08:00
frekky d8c08191cc Server-side sliding window implementation mostly finished. Requires
testing.
2015-08-21 23:23:24 +08:00
frekky 844abefcf8 A little bit of refactoring - separated iodined.c into separate files
Fixed up client side compile issues
Removed old packet handling code - TODO: use sliding window buffer
instead
2015-08-21 16:57:54 +08:00
frekky 83f70608fc Client side sliding window implementation (requires further testing) 2015-08-21 11:08:47 +08:00
frekky 0fcd8d337d Updated docs + protocol description (800) 2015-08-21 11:07:48 +08:00
frekky 92f3963790 Created sliding window buffer implementation and handling code 2015-08-21 11:05:50 +08:00
frekky 3e7cf55fe4 Added option for multiple nameservers, used in round-robin 2015-08-14 22:07:48 +08:00
Erik Ekman a8a5fbbf0d Second attempt at PIE binary for new android
Github PR #14
2015-08-05 20:04:03 +02:00
Erik Ekman c269a00344 Add support for Android L
Build position-indepent executables, required for Android L (5.0+)
They also work with kitkat.

Add new maketarget "cross-android-old" that builds without PIE
for older versions.

Include both new and old versions in latest-android.zip. Add arm64.

Hopefully solves github PR #14.
2015-08-05 19:36:28 +02:00
Erik Ekman f61ed01a3c Remove unused method users_waiting_on_reply() 2015-07-19 09:48:36 +02:00
Erik Ekman fc1611fc40 Only accept IPv6 in server IPv6 socket
Set IPV6_V6ONLY flag on server socket. Not all operating systems
support mixing v4/v6 in one socket, so separate them all the time.
2015-06-30 21:58:16 +02:00
Erik Ekman 4d03ee7786 Allow choosing only IPv4 or IPv6 in server
IPv6 might still allow IPv4 since V6_ONLY is not set by the server.
2015-06-30 21:32:21 +02:00
Erik Ekman e7d253b1c1 Fix compile on Darwin (hopefully) 2015-06-28 22:52:33 +02:00
Erik Ekman b4e9148df8 Support raw mode for both IPv4 and IPv6
Read destination address of IP request packet and return it.
Check length in client and use it as IPv4 or v6 depending on length.
2015-06-28 22:41:54 +02:00
Erik Ekman 7a51b22909 Simplify cleanup code 2015-06-28 21:05:23 +02:00
Erik Ekman ec0e3f2e51 Change sockaddr lengths back to signed
They are used to check negative return values.
2015-06-28 20:25:22 +02:00
Erik Ekman 7a117bd71e IPv6 support for DNS traffic in server
Server will by default listen on both IPv4 and IPv6.
No way to only listen on one protocol right now.

Use -L to only listen on a specific v6 address.

IP address to use for raw mode is still IPv4 only.
Use -n on server to make raw mode work from IPv6 clients,
then they will get an IPv4 address from the server for raw mode.

Tunnel data is still IPv4.
2015-06-28 20:01:48 +02:00
Erik Ekman 07c2fd4068 Prepare server code for IPv6 listening socket
Add a struct with multiple dns file descriptors (for IPv4 and IPv6)
and pass this to required areas. Choose which descriptor to use when
sending by looking at the destination address family.
2015-06-28 13:05:17 +02:00
Erik Ekman 582a818f2a Switch external IP service to api.ipify.org
externalip.net seems to have gone away
2015-06-27 12:11:43 +02:00
Erik Ekman 778d29825d Switch to IPv6-ready storage of user IP address 2015-06-27 11:57:39 +02:00
Erik Ekman 9e105d21d4 Add explanation for tun packet headers 2015-04-08 08:42:05 +02:00
Catalin Patulea b38b2ca7c5 Clarify that header is for both OPENBSD and DARWIN(utun). 2015-04-08 01:40:19 -04:00
Catalin Patulea 33abc0ca26 Support utun devices on Mac OS X.
As of 10.6, OS X has native tunnel devices. They are implemented as
sockets rather than character devices, but otherwise they appear to
behave the same as Free/OpenBSD tunnels.

'-d utunX' will tell iodine to use a utun device. For backward
compatibility, we'll continue to default to the old tuntap devices for
now.

This is a port of Peter Sagerson <psagers.github@ignorare.net>'s openvpn
commit 43e5016a.
2015-03-14 17:02:08 -04:00
gregor herrmann 1160649794 fix compilation error on kFreeBSD and Hurd 2015-01-23 09:50:41 +01:00
Ryan Welton 434a023afe Fix warning for comparing enum
CC user.c
user.c:202:15: warning: comparison of unsigned
      enum expression < 0 is always false
      [-Wtautological-compare]
        if (c < 0 || c >= CONN_MAX)
            ~ ^ ~
2014-10-25 10:27:01 +02:00
Erik Ekman 9a45c4aa66 Change license wording to follow ISC license exactly
"Permission to use, copy, modify, and distribute this software" is now
"Permission to use, copy, modify, and/or distribute this software".

Add license header to source files missing one.
2014-08-07 21:18:33 +02:00
Erik Ekman 7433423836 Remove redundant strerror() in warn() calls 2014-08-07 20:03:46 +02:00
Barak A. Pearlmutter 46532539c2 Rename VERSION define
prep for autotools: autoconf defines VERSION so s/VERSION/PROTOCOL_VERSION/
2014-08-07 12:55:59 +02:00
Jason A. Donenfeld cc4bc22447 osflags: use pkg-config for systemd support
Recent versions of systemd don't ship with libsystemd-daemon.so anymore,
but instead use libsystemd.so for everything. This is obviously
problematic for using the same LDFLAGS on old systemd and new systemd.
So, they also ship compatability pkgconfig files, which use the old
names but return the new library. So, the most portable way to support
both old and new systemd is to use pkgconfig. It's not a problem either,
since systems that use systemd are bound to also have pkgconfig
installed.
2014-07-25 02:02:48 +02:00
Erik Ekman eec0a868d9 Set correct sockaddr length when sending
Fix EINVAL error on NetBSD
2014-06-16 22:28:04 +02:00