diff options
-rw-r--r-- | anytun.cpp | 28 | ||||
-rw-r--r-- | router.cpp | 4 | ||||
-rw-r--r-- | router.h | 4 | ||||
-rw-r--r-- | syncListenSocket.h | 4 | ||||
-rw-r--r-- | syncSocket.cpp | 16 |
5 files changed, 29 insertions, 27 deletions
@@ -68,16 +68,16 @@ void createConnection(const std::string & remote_host , u_int16_t remote_port, C SeqWindow seq(seqSize); - uint8_t key[] = { - 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', - 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', - 'q', 'r', 's', 't' - }; +// uint8_t key[] = { +// 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', +// 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', +// 'q', 'r', 's', 't' +// }; - uint8_t salt[] = { - 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', - 'i', 'j', 'k', 'l', 'm', 'n' - }; +// uint8_t salt[] = { +// 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', +// 'i', 'j', 'k', 'l', 'm', 'n' +// }; seq_nr_t seq_nr_=0; KeyDerivation kd; @@ -110,8 +110,8 @@ void encryptPacket(Packet & pack, Cypher & c, ConnectionParam & conn) bool decryptPacket(Packet & pack, Cypher & c, ConnectionParam & conn) { - u_int16_t sid = pack.getSenderId(); - u_int16_t seq = pack.getSeqNr(); +// u_int16_t sid = pack.getSenderId(); +// u_int16_t seq = pack.getSeqNr(); /* // decypher the packet Buffer tmp_key(16), tmp_salt(14); @@ -152,8 +152,8 @@ bool checkPacketAuthTag(Packet & pack, Cypher & c, ConnectionParam & conn) bool checkPacketSeqNr(Packet & pack,ConnectionParam & conn) { - u_int16_t sid = pack.getSenderId(); - u_int16_t seq = pack.getSeqNr(); +// u_int16_t sid = pack.getSenderId(); +// u_int16_t seq = pack.getSeqNr(); // compare sender_id and seq with window if(conn.seq_window_.hasSeqNr(pack.getSenderId(), pack.getSeqNr())) { @@ -236,7 +236,7 @@ void* receiver(void* p) { string remote_host; u_int16_t remote_port; - u_int16_t sid = 0, seq = 0; + // u_int16_t sid = 0, seq = 0; Packet pack(1600); // fix me... mtu size // read packet from socket @@ -33,7 +33,7 @@ #include "router.h" -Router::Router() +Router::Router(ConnectionList& cl) : con_list_(cl) { } @@ -49,5 +49,5 @@ void Router::addConnection(ConnectionParam &conn,const std::string &name) ConnectionParam Router::getRoute() { Lock lock(mutex_); - + return con_list_.getConnection(); } @@ -39,7 +39,7 @@ class Router { public: - Router(); + Router(ConnectionList& cl); ~Router(); void addConnection(ConnectionParam &conn,const std::string &name); ConnectionParam getRoute(); @@ -47,7 +47,7 @@ public: private: Router(const Router &s); void operator=(const Router &s); - ConnectionList con_list_; + ConnectionList& con_list_; Mutex mutex_; }; diff --git a/syncListenSocket.h b/syncListenSocket.h index 359c14d..2b62bf2 100644 --- a/syncListenSocket.h +++ b/syncListenSocket.h @@ -61,8 +61,8 @@ public: /** Constructor. \param h ISocketHandler reference \param use_creator Optional use of creator (default true) */ - SyncListenSocket(ISocketHandler& h, Y & y,bool use_creator = true) : Socket(h), m_depth(0), m_creator(NULL),y_(y) - ,m_bHasCreate(false) + SyncListenSocket(ISocketHandler& h, Y & y,bool use_creator = true) : Socket(h), m_depth(0), m_creator(NULL), + m_bHasCreate(false),y_(y) { if (use_creator) { diff --git a/syncSocket.cpp b/syncSocket.cpp index dbb1dfb..b74b365 100644 --- a/syncSocket.cpp +++ b/syncSocket.cpp @@ -1,12 +1,14 @@ - -#include "Sockets/Utility.h" -#include "syncSocket.h" -//#include <boost/archive/text_oarchive.hpp> -//#include <boost/archive/text_iarchive.hpp> #include <sstream> #include <iostream> #include <string> -#include "connectionParam.h" + +#include <boost/archive/text_oarchive.hpp> +#include <boost/archive/text_iarchive.hpp> + + +//#include "connectionParam.h" +#include "Sockets/Utility.h" +#include "syncSocket.h" SyncSocket::SyncSocket(ISocketHandler& h,ConnectionList & cl) :TcpSocket(h),cl_(cl) @@ -42,7 +44,7 @@ void SyncSocket::OnAccept() std::ostringstream sout; // boost::archive::text_oarchive oa(sout); ConnectionParam conn = cl_.getConnection(); - // oa << conn; +// oa << conn; Send(sout.str()+"\n"); } |