summaryrefslogtreecommitdiff
path: root/src/anytun.cpp
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 /src/anytun.cpp
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
Diffstat (limited to 'src/anytun.cpp')
-rw-r--r--src/anytun.cpp15
1 files changed, 10 insertions, 5 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);