summaryrefslogtreecommitdiff
path: root/anytun.cpp
diff options
context:
space:
mode:
authorOthmar Gsenger <otti@anytun.org>2007-12-23 11:18:11 +0000
committerOthmar Gsenger <otti@anytun.org>2007-12-23 11:18:11 +0000
commitc20c54ce8fef7f0edbafda26e9a202377f0ac895 (patch)
treee9f2f216e0566455058082f3b9bed934b02b5dd7 /anytun.cpp
parentfixed sender (no packets error) (diff)
added SyncQueue and SyncSocketHandler
Diffstat (limited to 'anytun.cpp')
-rw-r--r--anytun.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/anytun.cpp b/anytun.cpp
index 69d4a9a..5a0578a 100644
--- a/anytun.cpp
+++ b/anytun.cpp
@@ -49,7 +49,8 @@
#include "seqWindow.h"
#include "connectionList.h"
-#include "Sockets/SocketHandler.h"
+#include "syncQueue.h"
+#include "syncSocketHandler.h"
#include "syncListenSocket.h"
#include "syncSocket.h"
@@ -68,6 +69,7 @@ struct Param
TunDevice& dev;
PacketSource& src;
ConnectionList& cl;
+ SyncQueue & queue;
};
uint8_t key[] = {
@@ -236,7 +238,7 @@ void* syncListener(void* p )
{
Param* param = reinterpret_cast<Param*>(p);
- SOCKETS_NAMESPACE::SocketHandler h;
+ SyncSocketHandler h(param->queue);
SyncListenSocket<SyncSocket,ConnectionList> l(h,param->cl);
if (l.Bind(param->opt.getLocalSyncPort()))
@@ -343,8 +345,9 @@ int main(int argc, char* argv[])
if(opt.getRemoteAddr() != "")
createConnection(opt.getRemoteAddr(),opt.getRemotePort(),cl,opt.getSeqWindowSize());
+ SyncQueue queue;
- struct Param p = {opt, dev, *src, cl};
+ struct Param p = {opt, dev, *src, cl, queue};
cLog.msg(Log::PRIO_NOTICE) << "dev created (opened)";
cLog.msg(Log::PRIO_NOTICE) << "dev opened - actual name is '" << p.dev.getActualName() << "'";