Commit Graph

36 Commits

Author SHA1 Message Date
rofl0r 37960ab9dd client: warn when handshake fails due to BADIP
other parts of the code show the meaningful error message too, but
not at the spot where it happened for me.
2019-08-04 13:53:21 +02:00
Sergey Alirzaev b406009c6d
client.c: don't produce an useless strncat usage warning 2018-10-01 04:04:15 +03:00
Ralf Ramsauer 6b438e7517 encoder: further simplifications
Get rid of unique header files for each encoder, consolidate them to
where they are actually needed: encoding.h.

This also simplifies the generation of the base64u decoder, as its
header file does not need to be generated any longer.

Signed-off-by: Ralf Ramsauer <ralf@ramses-pyramidenbau.de>
2017-03-11 21:30:49 -08:00
Ralf Ramsauer b517121f1c base encoder: simplify structures
We don't need complex getters. Just expose basic operations as they are.

Signed-off-by: Ralf Ramsauer <ralf@ramses-pyramidenbau.de>
2017-03-11 21:30:49 -08:00
Ralf Ramsauer 52c4940523 Warn, warn warn.
iodine does not seem to follow any styling guidelines (mixture of
different function prototypes, ...).  So let's introduce some.  This
will improve overall code quality and readability.

Additionally, warnings will improve code quality as well. Let's turn on
very pedantic warnings, and fix everything where the compiler barks
back.

Introduce the following function definition scheme:
  type function_name(type name, type1 name1 ...)
  {
  }
This allows us to copy and paste the definition to the declaration by
selecting one single line.

Furthermore, limit line length to 80 characters.

Signed-off-by: Ralf Ramsauer <ralf@ramses-pyramidenbau.de>
2017-03-11 21:30:01 -08:00
Ralf Ramsauer c83d2ae03c client: constify test patterns
There is no reason, why those patterns should not be const.

Signed-off-by: Ralf Ramsauer <ralf@ramses-pyramidenbau.de>
2017-03-11 02:17:27 -08: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 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 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
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
Erik Ekman eec0a868d9 Set correct sockaddr length when sending
Fix EINVAL error on NetBSD
2014-06-16 22:28:04 +02:00
Erik Ekman 3ebcd29b13 Add support for using an unspecified RR type
Add PRIVATE query type with id 65399 (private use range).
According to RFC3597 the reply data in a query with unspecified RR type must be handled
as unstructured binary data, which means it can contain raw packet data just like the NULL type.
Since the reply format is optimal it is ordered just after NULL in the priority order.
2014-06-09 20:06:36 +02:00
Erik Ekman 1f4b9250cf Check that supplied query type is valid 2014-06-09 18:56:32 +02:00
Erik Ekman 4d7678dc5b Prefix exported functions from client.c 2014-06-09 18:11:16 +02:00
Erik Ekman a23899513d Remove trailing whitespace 2014-06-01 08:46:54 +02:00
Erik Ekman 388afe3845 Update copyright 2014-06-01 08:46:54 +02:00
Erik Ekman d6c3426b84 Set C standard to C99
Also include strings.h where strcasecmp() is used
2014-05-29 18:38:43 +02:00
Erik Ekman a1d88c4f0a IPv6 support for client (#107)
The iodine client now supports both IPv4 and IPv6 nameservers for
sending DNS queries to an IPv4 iodined. The nameserver will
transparently handle translation between IP protocols.

Windows port needs Vista or later to support IPv6.
2014-02-05 22:36:53 +01:00
Erik Ekman 97b5e688ef Fix warning, unused variable 'accepted_fragsize' 2014-01-29 19:33:54 +01:00
Erik Ekman 45a5d80c49 Adjust indentation 2012-02-06 20:28:42 +01:00
Marcel Bokhorst a569030bb7 Android support (#105) patch from Marcel Bokhorst 2012-02-04 20:34:05 +01:00
Erik Ekman b22e3da5a0 #89, use remote ip as second ip in ifconfig on FreeBSD 2012-02-04 20:34:05 +01:00
J. A. Bezemer b177901d38 Applied patch from #88, thanks a lot! 2012-02-04 20:34:04 +01:00
Erik Ekman 1a26a91db3 #82, switch to gethostbyname() for win32 support 2012-02-04 20:34:04 +01:00
Erik Ekman c5bdf07070 #82 update docs 2012-02-04 20:34:04 +01:00
Erik Ekman 365aab1d29 #82, fix resolving given nameserver on everything but win32 2012-02-04 20:34:04 +01:00
Erik Ekman 269499ba43 Print DNS errors only when requested packet has an error 2012-02-04 20:34:04 +01:00
Erik Ekman 326da432c9 Fix buggy set lazy mode function 2012-02-04 20:34:04 +01:00
J. A. Bezemer 3c48602747 merge client code #76 2012-02-04 20:34:04 +01:00
Erik Ekman 92b160a416 Fix mtu fragment size probing 2012-02-04 20:34:04 +01:00
J. A. Bezemer 2c2dd6f06e update client code #75 2012-02-04 20:34:03 +01:00
Erik Ekman f9c2257ba9 Prune includes 2012-02-04 20:34:03 +01:00
Erik Ekman a1a2e3cefe Refactored to make it easier to add unit tests 2012-02-04 20:34:03 +01:00
Guillaume Rischard 3879f96a80 Fix build error on OSX 10.6 by Guillaume Rischard, #79 2012-02-04 20:34:03 +01:00
Erik Ekman 0cdd537819 #78, print server tunnel ip 2012-02-04 20:34:03 +01:00
Erik Ekman 27fdc23433 Split the client code out from the file with the main() func 2012-02-04 20:34:03 +01:00