diff options
author | Christian Pointner <equinox@anytun.org> | 2008-11-24 21:43:12 +0000 |
---|---|---|
committer | Christian Pointner <equinox@anytun.org> | 2008-11-24 21:43:12 +0000 |
commit | 449e530ab242c22e9fe7cb923f78568b4f0d325c (patch) | |
tree | 52d6263ba5c192095775a504908012c1d8e71b88 | |
parent | switched to endpoint (diff) |
switched to endpoint @ anytun-config as well
-rw-r--r-- | src/anytun-config.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/anytun-config.cpp b/src/anytun-config.cpp index 6fde887..933a6dc 100644 --- a/src/anytun-config.cpp +++ b/src/anytun-config.cpp @@ -43,20 +43,21 @@ #include "connectionList.h" #include "routingTable.h" #include "networkAddress.h" +#include "packetSource.h" #include "syncQueue.h" #include "syncCommand.h" -void createConnection(const std::string & remote_host, u_int16_t remote_port, ConnectionList & cl, u_int16_t seqSize, SyncQueue & queue, mux_t mux) +void createConnection(const PacketSourceEndpoint & remote_end, ConnectionList & cl, u_int16_t seqSize, SyncQueue & queue, mux_t mux) { SeqWindow * seq = new SeqWindow(seqSize); seq_nr_t seq_nr_ = 0; KeyDerivation * kd = KeyDerivationFactory::create( gOpt.getKdPrf() ); kd->init( gOpt.getKey(), gOpt.getSalt() ); - cLog.msg(Log::PRIO_NOTICE) << "added connection remote host " << remote_host << ":" << remote_port; - ConnectionParam connparam ( (*kd), (*seq), seq_nr_, remote_host, remote_port ); + cLog.msg(Log::PRIO_NOTICE) << "added connection remote host " << remote_end; + ConnectionParam connparam ( (*kd), (*seq), seq_nr_, remote_end ); cl.addConnection( connparam, mux ); std::ostringstream sout; @@ -99,7 +100,12 @@ int main(int argc, char* argv[]) ConnectionList cl; SyncQueue queue; - createConnection(gOpt.getRemoteAddr(),gOpt.getRemotePort(),cl,gOpt.getSeqWindowSize(), queue, gOpt.getMux()); + boost::asio::io_service io_service; + boost::asio::ip::udp::resolver resolver(io_service); + boost::asio::ip::udp::resolver::query query(gOpt.getRemoteAddr(), gOpt.getRemotePort()); + boost::asio::ip::udp::endpoint endpoint = *resolver.resolve(query); + + createConnection(endpoint,cl,gOpt.getSeqWindowSize(), queue, gOpt.getMux()); return ret; } |