New upstream version 0.3.6
[anytun.git] / src / anytun.cpp
index 3f14a5e..36ca0aa 100644 (file)
@@ -46,6 +46,7 @@
 #include <boost/bind.hpp>
 #include <boost/thread.hpp>
 #include <boost/assign.hpp>
+#include <boost/scoped_ptr.hpp>
 #include <iostream>
 #include <fstream>
 
@@ -112,7 +113,7 @@ void createConnection(const PacketSourceEndpoint& remote_end, window_size_t seqS
 #endif
 }
 
-void createConnectionResolver(PacketSourceResolverIt& it, window_size_t seqSize, mux_t mux)
+void createConnectionResolver(PacketSourceResolverIt it, window_size_t seqSize, mux_t mux)
 {
   createConnection(*it, seqSize, mux);
 }
@@ -151,8 +152,8 @@ void sender(TunDevice* dev, PacketSource* src)
   }
 
   try {
-    std::auto_ptr<Cipher> c(CipherFactory::create(gOpt.getCipher(), KD_OUTBOUND));
-    std::auto_ptr<AuthAlgo> a(AuthAlgoFactory::create(gOpt.getAuthAlgo(), KD_OUTBOUND));
+    boost::scoped_ptr<Cipher> c(CipherFactory::create(gOpt.getCipher(), KD_OUTBOUND));
+    boost::scoped_ptr<AuthAlgo> a(AuthAlgoFactory::create(gOpt.getAuthAlgo(), KD_OUTBOUND));
 
     PlainPacket plain_packet(MAX_PACKET_LENGTH);
     EncryptedPacket encrypted_packet(MAX_PACKET_LENGTH, gOpt.getAuthTagLength());
@@ -243,8 +244,8 @@ void receiver(TunDevice* dev, PacketSource* src)
   }
 
   try {
-    std::auto_ptr<Cipher> c(CipherFactory::create(gOpt.getCipher(), KD_INBOUND));
-    std::auto_ptr<AuthAlgo> a(AuthAlgoFactory::create(gOpt.getAuthAlgo(), KD_INBOUND));
+    boost::scoped_ptr<Cipher> c(CipherFactory::create(gOpt.getCipher(), KD_INBOUND));
+    boost::scoped_ptr<AuthAlgo> a(AuthAlgoFactory::create(gOpt.getAuthAlgo(), KD_INBOUND));
 
     uint32_t auth_tag_length = gOpt.getAuthTagLength();
     EncryptedPacket encrypted_packet(MAX_PACKET_LENGTH, auth_tag_length);