summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/anytun.cpp7
-rw-r--r--src/anytun.vcproj34
-rw-r--r--src/bsd/tunDevice.cpp2
-rw-r--r--src/linux/tunDevice.cpp2
-rw-r--r--src/options.cpp4
-rw-r--r--src/sysExec.h3
6 files changed, 20 insertions, 32 deletions
diff --git a/src/anytun.cpp b/src/anytun.cpp
index e70087d..384b7c3 100644
--- a/src/anytun.cpp
+++ b/src/anytun.cpp
@@ -399,14 +399,14 @@ int main(int argc, char* argv[])
TunDevice dev(gOpt.getDevName(), gOpt.getDevType(), net.net_addr, net.prefix_length);
cLog.msg(Log::PRIO_NOTICE) << "dev opened - name '" << dev.getActualName() << "', node '" << dev.getActualNode() << "'";
cLog.msg(Log::PRIO_NOTICE) << "dev type is '" << dev.getTypeString() << "'";
-#ifndef NO_EXEC
+
SysExec * postup_script = NULL;
if(gOpt.getPostUpScript() != "") {
cLog.msg(Log::PRIO_NOTICE) << "executing post-up script '" << gOpt.getPostUpScript() << "'";
StringVector args = boost::assign::list_of(dev.getActualName())(dev.getActualNode());
postup_script = new SysExec(gOpt.getPostUpScript(), args);
}
-#endif
+
#ifndef NO_DAEMON
if(gOpt.getChrootDir() != "") {
try {
@@ -423,11 +423,10 @@ int main(int argc, char* argv[])
// this has to be called before the first thread is started
gSignalController.init(service);
gResolver.init();
-#ifndef NO_EXEC
boost::thread(boost::bind(&TunDevice::waitUntilReady,&dev));
if (postup_script)
boost::thread(boost::bind(&SysExec::waitAndDestroy,postup_script));
-#endif
+
initCrypto();
PacketSource* src = new UDPPacketSource(gOpt.getLocalAddr(), gOpt.getLocalPort());
diff --git a/src/anytun.vcproj b/src/anytun.vcproj
index 337c9f7..fea7ffa 100644
--- a/src/anytun.vcproj
+++ b/src/anytun.vcproj
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0" encoding="UTF-8"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9,00"
@@ -46,7 +46,7 @@
Name="VCCLCompilerTool"
AdditionalOptions="/I &quot;C:\Program Files\boost\boost_1_35_0\&quot;"
Optimization="0"
- PreprocessorDefinitions="LOG_FILE;LOG_STDOUT;LOG_WINEVENTLOG;USE_SSL_CRYPTO;NO_DAEMON;NO_EXEC;WIN32_LEAN_AND_MEAN;BOOST_ALL_DYN_LINK"
+ PreprocessorDefinitions="LOG_FILE;LOG_STDOUT;LOG_WINEVENTLOG;USE_SSL_CRYPTO;NO_DAEMON;WIN32_LEAN_AND_MEAN;NOMINMAX;BOOST_ALL_DYN_LINK"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@@ -120,7 +120,7 @@
/>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="LOG_FILE;LOG_STDOUT;LOG_WINEVENTLOG;USE_SSL_CRYPTO;NO_DAEMON;NO_EXEC;WIN32_LEAN_AND_MEAN;BOOST_ALL_DYN_LINK"
+ PreprocessorDefinitions="LOG_FILE;LOG_STDOUT;LOG_WINEVENTLOG;USE_SSL_CRYPTO;NO_DAEMON;WIN32_LEAN_AND_MEAN;NOMINMAX;BOOST_ALL_DYN_LINK"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
@@ -195,7 +195,7 @@
Name="VCCLCompilerTool"
AdditionalOptions="/I &quot;C:\Program Files\boost\boost_1_35_0\&quot;"
Optimization="0"
- PreprocessorDefinitions="LOG_FILE;LOG_STDOUT;LOG_WINEVENTLOG;WIN_SERVICE;USE_SSL_CRYPTO;NO_DAEMON;NO_EXEC;WIN32_LEAN_AND_MEAN;BOOST_ALL_DYN_LINK"
+ PreprocessorDefinitions="LOG_FILE;LOG_STDOUT;LOG_WINEVENTLOG;WIN_SERVICE;USE_SSL_CRYPTO;NO_DAEMON;WIN32_LEAN_AND_MEAN;NOMINMAX;BOOST_ALL_DYN_LINK"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@@ -271,7 +271,7 @@
/>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="LOG_FILE;LOG_STDOUT;LOG_WINEVENTLOG;WIN_SERVICE;USE_SSL_CRYPTO;NO_DAEMON;NO_EXEC;WIN32_LEAN_AND_MEAN;BOOST_ALL_DYN_LINK"
+ PreprocessorDefinitions="LOG_FILE;LOG_STDOUT;LOG_WINEVENTLOG;WIN_SERVICE;USE_SSL_CRYPTO;NO_DAEMON;WIN32_LEAN_AND_MEAN;NOMINMAX;BOOST_ALL_DYN_LINK"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
@@ -347,7 +347,7 @@
Name="VCCLCompilerTool"
AdditionalOptions="/I &quot;C:\Program Files\boost\boost_1_35_0\&quot;"
Optimization="0"
- PreprocessorDefinitions="LOG_FILE;LOG_STDOUT;LOG_WINEVENTLOG;NO_DAEMON;NO_EXEC;WIN32_LEAN_AND_MEAN;BOOST_ALL_DYN_LINK;ssize_t=long"
+ PreprocessorDefinitions="LOG_FILE;LOG_STDOUT;LOG_WINEVENTLOG;NO_DAEMON;WIN32_LEAN_AND_MEAN;NOMINMAX;BOOST_ALL_DYN_LINK;ssize_t=long"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@@ -421,7 +421,7 @@
/>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="LOG_FILE;LOG_STDOUT;LOG_WINEVENTLOG;NO_DAEMON;NO_EXEC;WIN32_LEAN_AND_MEAN;BOOST_ALL_DYN_LINK;ssize_t=long"
+ PreprocessorDefinitions="LOG_FILE;LOG_STDOUT;LOG_WINEVENTLOG;NO_DAEMON;WIN32_LEAN_AND_MEAN;NOMINMAX;BOOST_ALL_DYN_LINK;ssize_t=long"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
@@ -496,7 +496,7 @@
Name="VCCLCompilerTool"
AdditionalOptions="/I &quot;C:\Program Files\boost\boost_1_35_0\&quot;"
Optimization="0"
- PreprocessorDefinitions="LOG_FILE;LOG_STDOUT;LOG_WINEVENTLOG;WIN_SERVICE;NO_DAEMON;NO_EXEC;WIN32_LEAN_AND_MEAN;BOOST_ALL_DYN_LINK;ssize_t=long"
+ PreprocessorDefinitions="LOG_FILE;LOG_STDOUT;LOG_WINEVENTLOG;WIN_SERVICE;NO_DAEMON;WIN32_LEAN_AND_MEAN;NOMINMAX;BOOST_ALL_DYN_LINK;ssize_t=long"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@@ -572,7 +572,7 @@
/>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="LOG_FILE;LOG_STDOUT;LOG_WINEVENTLOG;WIN_SERVICE;NO_DAEMON;NO_EXEC;WIN32_LEAN_AND_MEAN;BOOST_ALL_DYN_LINK;ssize_t=long"
+ PreprocessorDefinitions="LOG_FILE;LOG_STDOUT;LOG_WINEVENTLOG;WIN_SERVICE;NO_DAEMON;WIN32_LEAN_AND_MEAN;NOMINMAX;BOOST_ALL_DYN_LINK;ssize_t=long"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
@@ -649,7 +649,7 @@
Name="VCCLCompilerTool"
AdditionalOptions="/I &quot;C:\Program Files\boost\boost_1_35_0\&quot;"
Optimization="0"
- PreprocessorDefinitions="LOG_FILE;LOG_STDOUT;LOG_WINEVENTLOG;USE_SSL_CRYPTO;NO_DAEMON;NO_EXEC;WIN32_LEAN_AND_MEAN;BOOST_ALL_DYN_LINK"
+ PreprocessorDefinitions="LOG_FILE;LOG_STDOUT;LOG_WINEVENTLOG;USE_SSL_CRYPTO;NO_DAEMON;WIN32_LEAN_AND_MEAN;NOMINMAX;BOOST_ALL_DYN_LINK"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@@ -724,7 +724,7 @@
/>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="LOG_FILE;LOG_STDOUT;LOG_WINEVENTLOG;USE_SSL_CRYPTO;NO_DAEMON;NO_EXEC;WIN32_LEAN_AND_MEAN;BOOST_ALL_DYN_LINK"
+ PreprocessorDefinitions="LOG_FILE;LOG_STDOUT;LOG_WINEVENTLOG;USE_SSL_CRYPTO;NO_DAEMON;WIN32_LEAN_AND_MEAN;NOMINMAX;BOOST_ALL_DYN_LINK"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
@@ -800,7 +800,7 @@
Name="VCCLCompilerTool"
AdditionalOptions="/I &quot;C:\Program Files\boost\boost_1_35_0\&quot;"
Optimization="0"
- PreprocessorDefinitions="LOG_FILE;LOG_STDOUT;LOG_WINEVENTLOG;WIN_SERVICE;USE_SSL_CRYPTO;NO_DAEMON;NO_EXEC;WIN32_LEAN_AND_MEAN;BOOST_ALL_DYN_LINK"
+ PreprocessorDefinitions="LOG_FILE;LOG_STDOUT;LOG_WINEVENTLOG;WIN_SERVICE;USE_SSL_CRYPTO;NO_DAEMON;WIN32_LEAN_AND_MEAN;NOMINMAX;BOOST_ALL_DYN_LINK"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@@ -877,7 +877,7 @@
/>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="LOG_FILE;LOG_STDOUT;LOG_WINEVENTLOG;WIN_SERVICE;USE_SSL_CRYPTO;NO_DAEMON;NO_EXEC;WIN32_LEAN_AND_MEAN;BOOST_ALL_DYN_LINK"
+ PreprocessorDefinitions="LOG_FILE;LOG_STDOUT;LOG_WINEVENTLOG;WIN_SERVICE;USE_SSL_CRYPTO;NO_DAEMON;WIN32_LEAN_AND_MEAN;NOMINMAX;BOOST_ALL_DYN_LINK"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
@@ -954,7 +954,7 @@
Name="VCCLCompilerTool"
AdditionalOptions="/I &quot;C:\Program Files\boost\boost_1_35_0\&quot;"
Optimization="0"
- PreprocessorDefinitions="LOG_FILE;LOG_STDOUT;LOG_WINEVENTLOG;NO_DAEMON;NO_EXEC;WIN32_LEAN_AND_MEAN;BOOST_ALL_DYN_LINK;ssize_t=long"
+ PreprocessorDefinitions="LOG_FILE;LOG_STDOUT;LOG_WINEVENTLOG;NO_DAEMON;WIN32_LEAN_AND_MEAN;NOMINMAX;BOOST_ALL_DYN_LINK;ssize_t=long"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@@ -1029,7 +1029,7 @@
/>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="LOG_FILE;LOG_STDOUT;LOG_WINEVENTLOG;NO_DAEMON;NO_EXEC;WIN32_LEAN_AND_MEAN;BOOST_ALL_DYN_LINK;ssize_t=long"
+ PreprocessorDefinitions="LOG_FILE;LOG_STDOUT;LOG_WINEVENTLOG;NO_DAEMON;WIN32_LEAN_AND_MEAN;NOMINMAX;BOOST_ALL_DYN_LINK;ssize_t=long"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
@@ -1105,7 +1105,7 @@
Name="VCCLCompilerTool"
AdditionalOptions="/I &quot;C:\Program Files\boost\boost_1_35_0\&quot;"
Optimization="0"
- PreprocessorDefinitions="LOG_FILE;LOG_STDOUT;LOG_WINEVENTLOG;WIN_SERVICE;NO_DAEMON;NO_EXEC;WIN32_LEAN_AND_MEAN;BOOST_ALL_DYN_LINK;ssize_t=long"
+ PreprocessorDefinitions="LOG_FILE;LOG_STDOUT;LOG_WINEVENTLOG;WIN_SERVICE;NO_DAEMON;WIN32_LEAN_AND_MEAN;NOMINMAX;BOOST_ALL_DYN_LINK;ssize_t=long"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@@ -1182,7 +1182,7 @@
/>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="LOG_FILE;LOG_STDOUT;LOG_WINEVENTLOG;WIN_SERVICE;NO_DAEMON;NO_EXEC;WIN32_LEAN_AND_MEAN;BOOST_ALL_DYN_LINK;ssize_t=long"
+ PreprocessorDefinitions="LOG_FILE;LOG_STDOUT;LOG_WINEVENTLOG;WIN_SERVICE;NO_DAEMON;WIN32_LEAN_AND_MEAN;NOMINMAX;BOOST_ALL_DYN_LINK;ssize_t=long"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
diff --git a/src/bsd/tunDevice.cpp b/src/bsd/tunDevice.cpp
index 1413b5f..9cd58df 100644
--- a/src/bsd/tunDevice.cpp
+++ b/src/bsd/tunDevice.cpp
@@ -253,7 +253,6 @@ int TunDevice::write(u_int8_t* buf, u_int32_t len)
void TunDevice::do_ifconfig()
{
-#ifndef NO_EXEC
std::ostringstream mtu_ss;
mtu_ss << conf_.mtu_;
StringVector args = boost::assign::list_of(actual_name_)(conf_.addr_.toString())("netmask")(conf_.netmask_.toString())("mtu")(mtu_ss.str());
@@ -272,7 +271,6 @@ void TunDevice::do_ifconfig()
#endif
}
sys_exec_ = new SysExec("/sbin/ifconfig", args);
-#endif
}
void TunDevice::waitUntilReady()
diff --git a/src/linux/tunDevice.cpp b/src/linux/tunDevice.cpp
index f4d6a72..ee6ac0e 100644
--- a/src/linux/tunDevice.cpp
+++ b/src/linux/tunDevice.cpp
@@ -158,12 +158,10 @@ void TunDevice::init_post()
void TunDevice::do_ifconfig()
{
-#ifndef NO_EXEC
std::ostringstream mtu_ss;
mtu_ss << conf_.mtu_;
StringVector args = boost::assign::list_of(actual_name_)(conf_.addr_.toString())("netmask")(conf_.netmask_.toString())("mtu")(mtu_ss.str());
sys_exec_ = new SysExec("/sbin/ifconfig", args);
-#endif
}
void TunDevice::waitUntilReady()
diff --git a/src/options.cpp b/src/options.cpp
index c393c9f..6458621 100644
--- a/src/options.cpp
+++ b/src/options.cpp
@@ -428,9 +428,7 @@ bool Options::parse(int argc, char* argv[])
PARSE_SCALAR_PARAM("-d","--dev", dev_name_, NOTHING)
PARSE_SCALAR_PARAM("-t","--type", dev_type_, NOTHING)
PARSE_SCALAR_PARAM("-n","--ifconfig", ifconfig_param_, NOTHING)
- #ifndef NO_EXEC
PARSE_SCALAR_PARAM("-x","--post-up-script", post_up_script_, NOTHING)
- #endif
#endif
#if defined(ANYTUN_OPTIONS) || defined(ANYCONF_OPTIONS)
@@ -607,9 +605,7 @@ void Options::printUsage()
std::cout << " [-d|--dev] <name> device name" << std::endl;
std::cout << " [-t|--type] <tun|tap> device type" << std::endl;
std::cout << " [-n|--ifconfig] <local>/<prefix> the local address for the tun/tap device and the used prefix length" << std::endl;
- #ifndef NO_EXEC
std::cout << " [-x|--post-up-script] <script> script gets called after interface is created" << std::endl;
- #endif
#endif
#if defined(ANYTUN_OPTIONS) || defined(ANYCONF_OPTIONS)
diff --git a/src/sysExec.h b/src/sysExec.h
index 6d0724e..b6efb45 100644
--- a/src/sysExec.h
+++ b/src/sysExec.h
@@ -33,8 +33,6 @@
#ifndef ANYTUN_sysExec_h_INCLUDED
#define ANYTUN_sysExec_h_INCLUDED
-#ifndef NO_EXEC
-
#include <vector>
#include <list>
#include <string>
@@ -74,4 +72,3 @@ class SysExec
};
#endif
-#endif