+2020.01.06 -- version 0.3.8
+
+* fix build for Boost 1.71
+
2018.06.08 -- version 0.3.7
* fix build for new versions of GCC and Boost
#!/bin/sh
set -e
-OPENSSL=openssl-1.0.2h
+OPENSSL=openssl-1.1.0h
BASE=`pwd`
wget http://openssl.org/source/$OPENSSL.tar.gz -O - | tar xz
cp anytun-$target/*.exe anytun-$VER-$target
cp $LIBGCC_DLL $LIBSTDCPP_DLL anytun-$VER-$target
cp boost-$target/lib/libboost_{date_time,serialization,system,thread_win32,chrono}.dll anytun-$VER-$target
- cp openssl-$target/bin/libeay32.dll anytun-$VER-$target
+ cp openssl-$target/bin/{libeay32.dll,libcrypto*.dll} anytun-$VER-$target
cp anytun-example.bat anytun-$VER-$target
cp ../{AUTHORS,ChangeLog,LICENSE,README,version} anytun-$VER-$target
cp -r tap?? anytun-$VER-$target
--- /dev/null
+diff -Nur openssl-1.1.0h.orig/config openssl-1.1.0h/config
+--- openssl-1.1.0h.orig/config 2018-06-09 01:39:38.845245228 +0200
++++ openssl-1.1.0h/config 2018-06-09 01:43:01.715723809 +0200
+@@ -843,11 +843,11 @@
+ options="$options $CONFIG_OPTIONS"
+ fi
+
+-if expr "$options" : '.*no\-asm' > /dev/null; then :; else
+- sh -c "$CROSS_COMPILE${CC:-gcc} -Wa,--help -c -o /tmp/null.$$.o -x assembler /dev/null && rm /tmp/null.$$.o" 2>&1 | \
+- grep \\--noexecstack >/dev/null && \
+- options="$options -Wa,--noexecstack"
+-fi
++#if expr "$options" : '.*no\-asm' > /dev/null; then :; else
++# sh -c "$CROSS_COMPILE${CC:-gcc} -Wa,--help -c -o /tmp/null.$$.o -x assembler /dev/null && rm /tmp/null.$$.o" 2>&1 | \
++# grep \\--noexecstack >/dev/null && \
++# options="$options -Wa,--noexecstack"
++#fi
+
+ # gcc < 2.8 does not support -march=ultrasparc
+ if [ "$OUT" = solaris-sparcv9-gcc -a $GCCVER -lt 28 ]
+diff -Nur openssl-1.1.0h.orig/Configure openssl-1.1.0h/Configure
+--- openssl-1.1.0h.orig/Configure 2018-06-09 01:39:38.845245228 +0200
++++ openssl-1.1.0h/Configure 2018-06-09 01:47:30.473859795 +0200
+@@ -741,7 +741,7 @@
+ }
+ else
+ {
+- die "target already defined - $target (offending arg: $_)\n" if ($target ne "");
++ # die "target already defined - $target (offending arg: $_)\n" if ($target ne "");
+ $target=$_;
+ }
+ unless ($_ eq $target || /^no-/ || /^disable-/)
.\" Title: anytun-config
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 06/09/2018
+.\" Date: 01/06/2020
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "ANYTUN\-CONFIG" "8" "06/09/2018" "\ \&" "\ \&"
+.TH "ANYTUN\-CONFIG" "8" "01/06/2020" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" Title: anytun-controld
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 06/09/2018
+.\" Date: 01/06/2020
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "ANYTUN\-CONTROLD" "8" "06/09/2018" "\ \&" "\ \&"
+.TH "ANYTUN\-CONTROLD" "8" "01/06/2020" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" Title: anytun-showtables
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 06/09/2018
+.\" Date: 01/06/2020
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "ANYTUN\-SHOWTABLES" "8" "06/09/2018" "\ \&" "\ \&"
+.TH "ANYTUN\-SHOWTABLES" "8" "01/06/2020" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" Title: anytun
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 06/09/2018
+.\" Date: 01/06/2020
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "ANYTUN" "8" "06/09/2018" "\ \&" "\ \&"
+.TH "ANYTUN" "8" "01/06/2020" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.PP
\fB\-i, \-\-interface \fR\fB\fI<ip address>\fR\fR
.RS 4
-This IP address is used as the sender address for outgoing packets\&. In case of anycast tunnel endpoints, the anycast IP has to be used\&. In case of unicast endpoints, the address is usually derived correctly from the routing table\&. The default is to not use a special inteface and just bind on all interfaces\&.
+This IP address is used as the sender address for outgoing packets\&. In case of anycast tunnel endpoints, the anycast IP has to be used\&. In case of unicast endpoints, the address is usually derived correctly from the routing table\&. The default is to not use a special interface and just bind on all interfaces\&.
.RE
.PP
\fB\-p, \-\-port \fR\fB\fI<port>\fR\fR
.RS 4
local unicast(sync) ip address to bind to
-This option is only needed for tunnel endpoints consisting of multiple anycast hosts\&. The unicast IP address of the anycast host can be used here\&. This is needed for communication with the other anycast hosts\&. The default is to not use a special inteface and just bind on all interfaces\&. However this is only the case if synchronisation is active see
+This option is only needed for tunnel endpoints consisting of multiple anycast hosts\&. The unicast IP address of the anycast host can be used here\&. This is needed for communication with the other anycast hosts\&. The default is to not use a special interface and just bind on all interfaces\&. However this is only the case if synchronisation is active see
\fB\-\-sync\-port\fR\&.
.RE
.PP
.PP
\fB\-s, \-\-sender\-id \fR\fB\fI<sender id>\fR\fR
.RS 4
-Each anycast tunnel endpoint needs a uniqe sender id (1, 2, 3, \&...)\&. It is needed to distinguish the senders in case of replay attacks\&. This option can be ignored on unicast endpoints\&. default: 0
+Each anycast tunnel endpoint needs a unique sender id (1, 2, 3, \&...)\&. It is needed to distinguish the senders in case of replay attacks\&. This option can be ignored on unicast endpoints\&. default: 0
.RE
.PP
\fB\-w, \-\-window\-size \fR\fB\fI<window size>\fR\fR
packets. In case of anycast tunnel endpoints, the anycast
IP has to be used. In case of unicast endpoints, the
address is usually derived correctly from the routing
- table. The default is to not use a special inteface and just
+ table. The default is to not use a special interface and just
bind on all interfaces.
*-p, --port '<port>'*::
of multiple anycast hosts. The unicast IP address of
the anycast host can be used here. This is needed for
communication with the other anycast hosts. The default is to
- not use a special inteface and just bind on all interfaces. However
+ not use a special interface and just bind on all interfaces. However
this is only the case if synchronisation is active see *--sync-port*.
*-S, --sync-port '<port>'*::
the multiplex id to use. default: 0
*-s, --sender-id '<sender id>'*::
- Each anycast tunnel endpoint needs a uniqe sender id
+ Each anycast tunnel endpoint needs a unique sender id
(1, 2, 3, ...). It is needed to distinguish the senders
in case of replay attacks. This option can be ignored on
unicast endpoints. default: 0
%.d: %.cpp
@set -e; rm -f $@; \
- $(CXX) -MM $(CXXFLAGS) $< > $@.$$$$; \
+ $(CXX) -MM $(CPPFLAGS) $< > $@.$$$$; \
sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
rm -f $@.$$$$; echo '(re)building $@'
$(LD) $(ANYTUNOBJS) anytun-nosync.o -o $@ $(LDFLAGS)
anytun-nosync.o: anytun.cpp
- $(CXX) $(CXXFLAGS) -DANYTUN_NOSYNC $< -c -o anytun-nosync.o
+ $(CXX) $(CPPFLAGS) $(CXXFLAGS) -DANYTUN_NOSYNC $< -c -o anytun-nosync.o
anytun-showtables$(EXE): $(ANYSHOWOBJS) $(SYNCOBJS) anytun-showtables.o
$(LD) $(ANYSHOWOBJS) $(SYNCOBJS) anytun-showtables.o -o $@ $(LDFLAGS)
options.o: options.cpp
- $(CXX) $(CXXFLAGS) -DANYTUN_OPTIONS $< -c -o $@
+ $(CXX) $(CPPFLAGS) $(CXXFLAGS) -DANYTUN_OPTIONS $< -c -o $@
anyCtrOptions.o: options.cpp
- $(CXX) $(CXXFLAGS) -DANYCTR_OPTIONS $< -c -o $@
+ $(CXX) $(CPPFLAGS) $(CXXFLAGS) -DANYCTR_OPTIONS $< -c -o $@
anyConfOptions.o: options.cpp
- $(CXX) $(CXXFLAGS) -DANYCONF_OPTIONS $< -c -o $@
+ $(CXX) $(CPPFLAGS) $(CXXFLAGS) -DANYCONF_OPTIONS $< -c -o $@
nullOptions.o: options.cpp
- $(CXX) $(CXXFLAGS) $< -c -o $@
+ $(CXX) $(CPPFLAGS) $(CXXFLAGS) $< -c -o $@
%.o: %.cpp
- $(CXX) $(CXXFLAGS) $< -c -o $@
+ $(CXX) $(CPPFLAGS) $(CXXFLAGS) $< -c -o $@
libAnysync.a: $(OBJS)
#define ANYTUN_anytunError_h_INCLUDED
#include <sstream>
+#define BOOST_SYSTEM_ENABLE_DEPRECATED
#include <boost/system/system_error.hpp>
#include "datatypes.h"
fi
if [ $USE_CLANG -eq 0 ]; then
- CXXFLAGS='-g -Wall -Werror -Wno-error=unused-variable -O2'
- LDFLAGS='-g -Wall -Werror -O2'
+ if [ -z "$CXXFLAGS" ]; then CXXFLAGS='-g -Wall -O2'; fi
+ if [ -z "$LDFLAGS" ]; then LDFLAGS='-g -Wall -O2'; fi
COMPILER='g++'
else
- CXXFLAGS='-g -O2'
- LDFLAGS='-g -O2'
+ if [ -z "$CXXFLAGS" ]; then CXXFLAGS='-g -O2'; fi
+ if [ -z "$LDFLAGS" ]; then LDFLAGS='-g -O2'; fi
COMPILER='clang++'
fi
ln -sf posix/posixDaemon.h daemonService.h
ln -sf posix/posixDaemon.cpp daemonService.cpp
echo "loading BSD specific TUN Device"
- CXXFLAGS=$CXXFLAGS' -I/usr/local/include'
- LDFLAGS=$LDFLAGS' -L/usr/local/lib -lboost_thread -lboost_serialization -lboost_system -lboost_date_time -lpthread'
+ CPPFLAGS=$CPPFLAGS' -I/usr/local/include'
+ LDFLAGS=$LDFLAGS' -L/usr/local/lib -lboost_thread -lboost_serialization -lboost_system -lboost_date_time -lpthread'
LOG_TARGETS='-DLOG_SYSLOG -DLOG_FILE -DLOG_STDOUT'
INSTALLSYSTEMD=0
;;
rm -f sysExec.hpp
rm -f daemonService.h daemonService.cpp
echo "loading Windows specific TUN Device"
- CXXFLAGS=$CXXFLAGS' -DMINGW -D_WIN32_WINNT=0x0501 -DWIN32_LEAN_AND_MEAN -DBOOST_WINDOWS -fno-strict-aliasing -DBOOST_THREAD_USE_LIB'
+ CPPFLAGS=$CPPFLAGS' -DMINGW -D_WIN32_WINNT=0x0501 -DWIN32_LEAN_AND_MEAN -DBOOST_WINDOWS -fno-strict-aliasing -DBOOST_THREAD_USE_LIB'
LDFLAGS=$LDFLAGS' -lboost_thread_win32 -lboost_serialization -lboost_system -lboost_date_time -lwsock32 -lws2_32'
LOG_TARGETS='-DWIN_EVENTLOG -DLOG_FILE -DLOG_STDOUT'
INSTALLSYSTEMD=0
;;
esac
-CXXFLAGS="$CXXFLAGS $LOG_TARGETS"
+CPPFLAGS="$CPPFLAGS $LOG_TARGETS"
if [ -n "$BOOST_PREFIX" ]; then
- CXXFLAGS="$CXXFLAGS -I\"$BOOST_PREFIX/include\""
+ CPPFLAGS="$CPPFLAGS -I\"$BOOST_PREFIX/include\""
LDFLAGS="$LDFLAGS -L\"$BOOST_PREFIX/lib\""
fi
CRYPTO_LIB_NAME=""
case $CRYPTO_LIB in
gcrypt)
- CXXFLAGS=$CXXFLAGS' -DUSE_GCRYPT'
+ CPPFLAGS=$CPPFLAGS' -DUSE_GCRYPT'
LDFLAGS=$LDFLAGS' -lgcrypt -lgpg-error'
if [ -n "$GCRYPT_PREFIX" ]; then
- CXXFLAGS="$CXXFLAGS -I\"$GCRYPT_PREFIX/include\""
+ CPPFLAGS="$CPPFLAGS -I\"$GCRYPT_PREFIX/include\""
LDFLAGS="$LDFLAGS -L\"$GCRYPT_PREFIX/lib\""
fi
CRYPTO_LIB_NAME="libgcrypt"
echo "using gcrypt library"
;;
nettle)
- CXXFLAGS=$CXXFLAGS' -DUSE_NETTLE'
+ CPPFLAGS=$CPPFLAGS' -DUSE_NETTLE'
LDFLAGS=$LDFLAGS' -lnettle'
if [ -n "$NETTLE_PREFIX" ]; then
- CXXFLAGS="$CXXFLAGS -I\"$NETTLE_PREFIX/include\""
+ CPPFLAGS="$CPPFLAGS -I\"$NETTLE_PREFIX/include\""
LDFLAGS="$LDFLAGS -L\"$NETTLE_PREFIX/lib\""
fi
CRYPTO_LIB_NAME="Nettle"
echo "using nettle library"
;;
ssl)
- CXXFLAGS=$CXXFLAGS' -DUSE_SSL_CRYPTO'
+ CPPFLAGS=$CPPFLAGS' -DUSE_SSL_CRYPTO'
LDFLAGS=$LDFLAGS' -lcrypto'
if [ -n "$OPENSSL_PREFIX" ]; then
- CXXFLAGS="$CXXFLAGS -I\"$OPENSSL_PREFIX/include\""
+ CPPFLAGS="$CPPFLAGS -I\"$OPENSSL_PREFIX/include\""
LDFLAGS="$LDFLAGS -L\"$OPENSSL_PREFIX/lib\""
fi
CRYPTO_LIB_NAME="OpenSSL"
echo "using openssl crypto library"
;;
none)
- CXXFLAGS=$CXXFLAGS' -DNO_CRYPT'
+ CPPFLAGS=$CPPFLAGS' -DNO_CRYPT'
CRYPTO_LIB_NAME="none"
echo "disabling crypto"
;;
esac
if [ $PASSPHRASE -eq 0 ]; then
- CXXFLAGS=$CXXFLAGS' -DNO_PASSPHRASE'
+ CPPFLAGS=$CPPFLAGS' -DNO_PASSPHRASE'
echo "disabling master key and salt passphrase"
fi
if [ $ROUTING -eq 0 ]; then
- CXXFLAGS=$CXXFLAGS' -DNO_ROUTING'
+ CPPFLAGS=$CPPFLAGS' -DNO_ROUTING'
echo "disabling built-in routing capability"
fi
# do not edit this file directly
# use ./configure instead
-TARGET = $TARGET
-CXX = ${CROSS_PREFIX}$COMPILER
-CXXFLAGS = $CXXFLAGS
-LD = ${CROSS_PREFIX}$COMPILER
-LDFLAGS = $LDFLAGS
-STRIP = ${CROSS_PREFIX}strip
-INSTALL = install
+TARGET := $TARGET
+CXX := ${CROSS_PREFIX}$COMPILER
+CPPFLAGS := $CPPFLAGS
+CXXFLAGS := $CXXFLAGS
+LD := ${CROSS_PREFIX}$COMPILER
+LDFLAGS := $LDFLAGS
+STRIP := ${CROSS_PREFIX}strip
+INSTALL := install
prefix := $PREFIX
BINDIR := $BINDIR
*/
#include <boost/bind.hpp>
+#define BOOST_SYSTEM_ENABLE_DEPRECATED
#include <boost/system/error_code.hpp>
#include "resolver.h"
std::list<AcceptorsElement>::iterator it = acceptors_.begin();
for(; it != acceptors_.end(); ++it) {
if(!it->started_) {
+#if BOOST_VERSION >= 107000
+ SyncTcpConnection::pointer new_connection = SyncTcpConnection::create(it->acceptor_->get_executor());
+#else
SyncTcpConnection::pointer new_connection = SyncTcpConnection::create(it->acceptor_->get_io_service());
+#endif
conns_.push_back(new_connection);
it->acceptor_->async_accept(new_connection->socket(),
boost::bind(&SyncServer::handle_accept, this, new_connection, boost::asio::placeholders::error, it));
boost::asio::placeholders::error,
boost::asio::placeholders::bytes_transferred));
}
+
+#if BOOST_VERSION >= 107000
+SyncTcpConnection::SyncTcpConnection(const boost::asio::executor& executor)
+ : socket_(executor)
+{
+}
+#else
SyncTcpConnection::SyncTcpConnection(boost::asio::io_service& io_service)
: socket_(io_service)
{
}
+#endif
void SyncTcpConnection::handle_write(const boost::system::error_code& /*error*/,
size_t /*bytes_transferred*/)
typedef boost::shared_ptr<SyncTcpConnection> pointer;
typedef boost::asio::ip::tcp proto;
+#if BOOST_VERSION >= 107000
+ static pointer create(const boost::asio::executor& executor) {
+ return pointer(new SyncTcpConnection(executor));
+ };
+#else
static pointer create(boost::asio::io_service& io_service) {
return pointer(new SyncTcpConnection(io_service));
};
+#endif
boost::function<void(SyncTcpConnection*)> onConnect;
proto::socket& socket();
void start();
void Send(std::string message);
private:
+#if BOOST_VERSION >= 107000
+ SyncTcpConnection(const boost::asio::executor& executor);
+#else
SyncTcpConnection(boost::asio::io_service& io_service);
+#endif
void handle_write(const boost::system::error_code & /*error*/,
size_t /*bytes_transferred*/);