summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOthmar Gsenger <otti@anytun.org>2008-12-11 14:47:08 +0000
committerOthmar Gsenger <otti@anytun.org>2008-12-11 14:47:08 +0000
commitd7a5235d9a3702cdbe2fd67d5aac7368d2484a87 (patch)
treee0891a60dccf3e471b5b689fd3e84e35d9d89c5f
parentremoved old includes (diff)
mainly type and define fixes
partly builds on windows without conversion between host and network byte order working compile defines: NOCRYPT;NODAEMON;NOEXEC;NOPACKED;NOSYSLOG;NOSIGNALCONTROLLER;WIN32_LEAN_AND_MEAN
-rw-r--r--src/anytun.cpp15
-rw-r--r--src/anytun.suobin28672 -> 31744 bytes
-rw-r--r--src/anytun.vcproj16
-rw-r--r--src/networkAddress.cpp2
-rw-r--r--src/networkAddress.h4
-rw-r--r--src/networkPrefix.h8
-rw-r--r--src/routingTable.h2
-rw-r--r--src/syncRouteCommand.h2
8 files changed, 33 insertions, 16 deletions
diff --git a/src/anytun.cpp b/src/anytun.cpp
index 05d2164..ba1a6ab 100644
--- a/src/anytun.cpp
+++ b/src/anytun.cpp
@@ -84,7 +84,7 @@
#define SESSION_KEYLEN_ENCR 16 // TODO: hardcoded size
#define SESSION_KEYLEN_SALT 14 // TODO: hardcoded size
-void createConnection(const PacketSourceEndpoint & remote_end, ConnectionList & cl, u_int16_t seqSize, SyncQueue & queue, mux_t mux)
+void createConnection(const PacketSourceEndpoint & remote_end, ConnectionList & cl, window_size_t seqSize, SyncQueue & queue, mux_t mux)
{
SeqWindow * seq= new SeqWindow(seqSize);
seq_nr_t seq_nr_=0;
@@ -414,13 +414,13 @@ int main(int argc, char* argv[])
daemonize();
daemonized = true;
}
-#endif
if(pidFile.is_open()) {
pid_t pid = getpid();
pidFile << pid;
pidFile.close();
}
+#endif
#ifndef NOSIGNALCONTROLLER
SignalController sig;
@@ -436,7 +436,9 @@ int main(int argc, char* argv[])
#endif
boost::thread senderThread(boost::bind(sender,&p));
+#ifndef NOSIGNALCONTROLLER
boost::thread receiverThread(boost::bind(receiver,&p));
+#endif
#ifndef ANYTUN_NOSYNC
boost::thread * syncListenerThread;
if(gOpt.getLocalSyncPort() != "")
@@ -448,10 +450,13 @@ int main(int argc, char* argv[])
connectThreads.push_back(new boost::thread(boost::bind(syncConnector,point)));
}
#endif
-
- int ret = sig.run();
-
+
+#ifndef NOSIGNALCONTROLLER
+ int ret = sig.run();
return ret;
+#else
+ receiver(&p);
+#endif
// TODO cleanup here!
/*
pthread_cancel(senderThread);
diff --git a/src/anytun.suo b/src/anytun.suo
index ca83e2c..2048495 100644
--- a/src/anytun.suo
+++ b/src/anytun.suo
Binary files differ
diff --git a/src/anytun.vcproj b/src/anytun.vcproj
index 4e092db..f27ba21 100644
--- a/src/anytun.vcproj
+++ b/src/anytun.vcproj
@@ -42,7 +42,7 @@
Name="VCCLCompilerTool"
AdditionalOptions="/I &quot;C:\Program Files\boost\boost_1_35_0\&quot;"
Optimization="0"
- PreprocessorDefinitions="NOCRYPT;NODAEMON;NOEXEC;NOPACKED;NOSYSLOG;NOROUTING;NOSIGNALCONTROLLER"
+ PreprocessorDefinitions="NOCRYPT;NODAEMON;NOEXEC;NOPACKED;NOSYSLOG;NOSIGNALCONTROLLER;WIN32_LEAN_AND_MEAN"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@@ -113,7 +113,7 @@
/>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="NOCRYPT;NODAEMON;NOEXEC;NOPACKED"
+ PreprocessorDefinitions="NOCRYPT;NODAEMON;NOEXEC;NOPACKED;NOSYSLOG;NOSIGNALCONTROLLER"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
@@ -238,6 +238,10 @@
>
</File>
<File
+ RelativePath=".\routingTable.h"
+ >
+ </File>
+ <File
RelativePath=".\rtpSession.h"
>
</File>
@@ -386,6 +390,10 @@
>
</File>
<File
+ RelativePath=".\routingTable.cpp"
+ >
+ </File>
+ <File
RelativePath=".\rtpSession.cpp"
>
</File>
@@ -433,6 +441,10 @@
RelativePath=".\syncTcpConnection.cpp"
>
</File>
+ <File
+ RelativePath=".\tunDevice.cpp"
+ >
+ </File>
</Filter>
</Files>
<Globals>
diff --git a/src/networkAddress.cpp b/src/networkAddress.cpp
index 9f22e4b..a3f98d9 100644
--- a/src/networkAddress.cpp
+++ b/src/networkAddress.cpp
@@ -69,7 +69,7 @@ NetworkAddress::NetworkAddress(boost::asio::ip::address_v4 ipv4_address)
ipv4_address_ = ipv4_address;
}
-NetworkAddress::NetworkAddress(uint64_t ethernet_address)
+NetworkAddress::NetworkAddress(u_int64_t ethernet_address)
{
network_address_type_=ethernet;
ethernet_address_=ethernet_address;
diff --git a/src/networkAddress.h b/src/networkAddress.h
index 75935bb..81fbe59 100644
--- a/src/networkAddress.h
+++ b/src/networkAddress.h
@@ -55,7 +55,7 @@ public:
NetworkAddress(const std::string &);
NetworkAddress(boost::asio::ip::address_v6);
NetworkAddress(boost::asio::ip::address_v4);
- NetworkAddress(uint64_t);
+ NetworkAddress(u_int64_t);
NetworkAddress(const network_address_type_t type, const char * address );
~NetworkAddress();
void setNetworkAddress(const network_address_type_t type, const std::string & address );
@@ -66,7 +66,7 @@ protected:
Mutex mutex_;
boost::asio::ip::address_v4 ipv4_address_;
boost::asio::ip::address_v6 ipv6_address_;
- uint64_t ethernet_address_;
+ u_int64_t ethernet_address_;
network_address_type_t network_address_type_;
private:
NetworkAddress operator=(const NetworkAddress &s);
diff --git a/src/networkPrefix.h b/src/networkPrefix.h
index 336233c..53ebf0c 100644
--- a/src/networkPrefix.h
+++ b/src/networkPrefix.h
@@ -43,16 +43,16 @@ class NetworkPrefix : public NetworkAddress
{
public:
NetworkPrefix();
- NetworkPrefix(const NetworkAddress &, uint8_t length);
+ NetworkPrefix(const NetworkAddress &, u_int8_t length);
NetworkPrefix(const NetworkPrefix &);
- void setNetworkPrefixLength(uint8_t length );
- uint8_t getNetworkPrefixLength();
+ void setNetworkPrefixLength(u_int8_t length );
+ u_int8_t getNetworkPrefixLength();
bool operator<(const NetworkPrefix &s) const;
private:
operator NetworkAddress();
void operator=(const NetworkPrefix &s);
- uint8_t length_;
+ u_int8_t length_;
friend class boost::serialization::access;
template<class Archive>
void serialize(Archive & ar, const unsigned int version)
diff --git a/src/routingTable.h b/src/routingTable.h
index ca19f28..eee8836 100644
--- a/src/routingTable.h
+++ b/src/routingTable.h
@@ -55,7 +55,7 @@ public:
void clear();
Mutex& getMutex();
u_int16_t* getOrNewRoutingTEUnlocked(const NetworkPrefix & addr);
- uint16_t getCountUnlocked();
+ u_int16_t getCountUnlocked();
RoutingMap::iterator getBeginUnlocked();
RoutingMap::iterator getEndUnlocked();
diff --git a/src/syncRouteCommand.h b/src/syncRouteCommand.h
index 61bc7b1..349ae93 100644
--- a/src/syncRouteCommand.h
+++ b/src/syncRouteCommand.h
@@ -46,7 +46,7 @@ public:
private:
SyncRouteCommand(const SyncRouteCommand &);
- uint16_t count_;
+ u_int16_t count_;
NetworkPrefix addr_;
friend class boost::serialization::access;
template<class Archive>