Renamed p2tp to swift everywhere.
authorVictor Grishchenko <victor.grishchenko@gmail.com>
Tue, 26 Jan 2010 16:27:36 +0000 (17:27 +0100)
committerVictor Grishchenko <victor.grishchenko@gmail.com>
Tue, 26 Jan 2010 16:27:36 +0000 (17:27 +0100)
For the purpose of consistency.

30 files changed:
bin64.cpp
compat.cpp
compat.h
compat/hirestimeofday.cpp
compat/hirestimeofday.h
compat/util.cpp
compat/util.h
datagram.cpp
datagram.h
exec/hasher.cpp
exec/leecher.cpp
exec/seeder.cpp
exec/trial.cpp
ext/ledbat_controller.cpp
ext/mmap_storer.cpp
ext/seq_picker.cpp
ext/simple_selector.cpp
hashtree.cpp
hashtree.h
mfold/doseq.sh
send_control.cpp
sendrecv.cpp
swift.cpp [moved from p2tp.cpp with 86% similarity]
swift.h [moved from p2tp.h with 99% similarity]
tests/connecttest.cpp
tests/dgramtest.cpp
tests/hashtest.cpp
tests/ledbattest.cpp
tests/transfertest.cpp
transfer.cpp

index 6b2ccb5..bb26154 100644 (file)
--- a/bin64.cpp
+++ b/bin64.cpp
@@ -1,6 +1,6 @@
 /*
  *  bin64.cpp
- *  p2tp
+ *  swift
  *
  *  Created by Victor Grishchenko on 10/10/09.
  *  Copyright 2009 Delft University of Technology. All rights reserved.
index 0945744..c81bdbf 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  compat.cpp
- *  p2tp
+ *  swift
  *
  *  Created by Arno Bakker, Victor Grishchenko
  *  Copyright 2009 Delft University of Technology. All rights reserved.
@@ -21,7 +21,7 @@
 #include <sys/time.h>
 #endif
 
-namespace p2tp {
+namespace swift {
 
 #ifdef _WIN32
 static HANDLE map_handles[1024];
index 1bfeedf..ffd1378 100644 (file)
--- a/compat.h
+++ b/compat.h
@@ -33,7 +33,7 @@
 #define S_IROTH _S_IREAD
 #endif
 
-namespace p2tp {
+namespace swift {
 
 /** tint is the time integer type; microsecond-precise. */
 typedef int64_t tint;
index f5aad7c..29595be 100644 (file)
@@ -11,7 +11,7 @@
 #include <sys/time.h>\r
 #endif\r
 \r
-namespace p2tp {\r
+namespace swift {\r
 \r
 HiResTimeOfDay* HiResTimeOfDay::_instance = 0;\r
 \r
@@ -112,7 +112,7 @@ tint HiResTimeOfDay::getTimeUSec(void)
   \r
   \r
   \r
-// ARNOTODO: move to p2tp.cpp\r
+// ARNOTODO: move to swift.cpp\r
 \r
 #ifdef _WIN32\r
 static WSADATA _WSAData;\r
@@ -138,7 +138,7 @@ void LibraryInit(void)
 #ifdef TEST\r
 #include <iostream>\r
 \r
-using namespace p2tp;\r
+using namespace swift;\r
 \r
 int main()\r
 {\r
index 731da1e..362dd96 100644 (file)
@@ -17,7 +17,7 @@
 #include <windows.h>\r
 #endif\r
 \r
-namespace p2tp {\r
+namespace swift {\r
 \r
 typedef int64_t tint;\r
 #define TINT_SEC ((tint)1000000)\r
index 281dfac..579ef84 100644 (file)
@@ -11,7 +11,7 @@
 #include <Tchar.h>\r
 #endif\r
 \r
-namespace p2tp\r
+namespace swift\r
 {\r
 \r
 std::string gettmpdir(void)\r
index aa99df6..dd9256b 100644 (file)
@@ -10,7 +10,7 @@
 \r
 #include <string>\r
 \r
-namespace p2tp\r
+namespace swift\r
 {\r
        /**\r
         * Return path of temporary directory.\r
index 76ec217..93124e0 100644 (file)
@@ -19,7 +19,7 @@
 #include "datagram.h"
 #include "compat.h"
 
-namespace p2tp {
+namespace swift {
 
 tint Datagram::now = Datagram::Time();
 tint Datagram::start = now;
index 6866be1..30a9ec3 100644 (file)
@@ -37,7 +37,7 @@
 #include "compat.h"
 
 
-namespace p2tp {
+namespace swift {
 
 #define MAXDGRAMSZ 2800
 #ifndef _WIN32
index 1e7127e..c95f119 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  hasher.cpp
- *  p2tp
+ *  swift
  *
  *  Created by Victor Grishchenko on 11/8/09.
  *  Copyright 2009 Delft University of Technology. All rights reserved.
@@ -17,7 +17,7 @@ int main (int argn, char** args) {
         return 1;
     }
 
-    p2tp::HashTree* ht = new p2tp::HashTree(args[1]);
+    swift::HashTree* ht = new swift::HashTree(args[1]);
 
     printf("SHA1 Merkle tree root hash: %s\n",ht->root_hash().hex().c_str());
 
index ff08ad8..38cdaa7 100644 (file)
@@ -1,16 +1,16 @@
 /*
  *  leecher.cpp
- *  p2tp
+ *  swift
  *
  *  Created by Victor Grishchenko on 11/3/09.
  *  Copyright 2009 Delft University of Technology. All rights reserved.
  *
  */
-#include "p2tp.h"
+#include "swift.h"
 #include <time.h>
 
 
-using namespace p2tp;
+using namespace swift;
 
 
 /** P2TP downloader. Params: root hash, filename, tracker ip/port, own ip/port */
@@ -28,7 +28,7 @@ int main (int argn, char** args) {
         return -2;
     }
 
-    p2tp::LibraryInit();
+    swift::LibraryInit();
 
     char* filename = args[2];
 
@@ -43,28 +43,28 @@ int main (int argn, char** args) {
     else
         bindaddr = Address((uint32_t)INADDR_ANY,rand()%10000+7000);
 
-    assert(0<p2tp::Listen(bindaddr));
+    assert(0<swift::Listen(bindaddr));
 
-       p2tp::SetTracker(tracker);
+       swift::SetTracker(tracker);
 
-       int file = p2tp::Open(filename,root_hash);
+       int file = swift::Open(filename,root_hash);
     printf("Downloading %s\n",root_hash.hex().c_str());
 
     tint start = NOW;
 
-    while (!p2tp::IsComplete(file)){// && NOW-start<TINT_SEC*60) {
-           p2tp::Loop(TINT_SEC);
+    while (!swift::IsComplete(file)){// && NOW-start<TINT_SEC*60) {
+           swift::Loop(TINT_SEC);
         eprintf("done %lli of %lli (seq %lli) %lli dgram %lli bytes up, %lli dgram %lli bytes down\n",
-               p2tp::Complete(file), p2tp::Size(file), p2tp::SeqComplete(file),
+               swift::Complete(file), swift::Size(file), swift::SeqComplete(file),
                Datagram::dgrams_up, Datagram::bytes_up,
                Datagram::dgrams_down, Datagram::bytes_down );
     }
 
-    bool complete = p2tp::IsComplete(file);
+    bool complete = swift::IsComplete(file);
 
-       p2tp::Close(file);
+       swift::Close(file);
 
-       p2tp::Shutdown();
+       swift::Shutdown();
 
     return !complete;
 }
index 629f7d4..9f78fa6 100644 (file)
@@ -6,10 +6,10 @@
  *  Copyright 2009 Delft University of Technology. All rights reserved.
  *
  */
-#include "p2tp.h"
+#include "swift.h"
 
 
-using namespace p2tp;
+using namespace swift;
 
 
 /** P2TP seeder. Params: filename, own ip/port, tracker ip/port */
@@ -20,13 +20,13 @@ int main (int argn, char** args) {
         return -1;
     }
 
-    p2tp::LibraryInit();
+    swift::LibraryInit();
 
     char* filename = args[1];
 
     if (argn>=4) {
         Address tracker(args[3]);
-        p2tp::SetTracker(tracker);
+        swift::SetTracker(tracker);
     }
     Address bindaddr(args[2]);
 
@@ -35,22 +35,22 @@ int main (int argn, char** args) {
         return -2;
     }
 
-    assert(0<p2tp::Listen(bindaddr));
+    assert(0<swift::Listen(bindaddr));
     printf("seeder bound to %s\n",bindaddr.str());
 
 
-       int file = p2tp::Open(filename);
+       int file = swift::Open(filename);
     printf("seeding %s %s\n",filename,RootMerkleHash(file).hex().c_str());
 
     while (true) {
-           p2tp::Loop(TINT_SEC*60);
+           swift::Loop(TINT_SEC*60);
         printf("%lli dgram %lli bytes up, %lli dgram %lli bytes down\n",
                Datagram::dgrams_up, Datagram::bytes_up,
                Datagram::dgrams_down, Datagram::bytes_down );
     }
 
-       p2tp::Close(file);
+       swift::Close(file);
 
-       p2tp::Shutdown();
+       swift::Shutdown();
 
 }
index 10d7728..2850be1 100644 (file)
@@ -1,12 +1,12 @@
 /*
  *  leecher.cpp
- *  p2tp
+ *  swift
  *
  *  Created by Victor Grishchenko on 11/3/09.
  *  Copyright 2009 Delft University of Technology. All rights reserved.
  *
  */
-#include "p2tp.h"
+#include "swift.h"
 #include <time.h>
 #include <string>
 #include "compat/util.h"
@@ -15,7 +15,7 @@
 #endif
 
 
-using namespace p2tp;
+using namespace swift;
 
 
 /** P2TP downloader. Params: root hash, filename, tracker ip/port, own ip/port */
@@ -23,7 +23,7 @@ int main (int argn, char** args) {
     THIS IS NOT TRIAL BRANCH
     srand(time(NULL));
     Sha1Hash root_hash(true,"32e5d9d2d8c0f6073e2820cf47b15b58c2e42a23");
-    p2tp::LibraryInit();
+    swift::LibraryInit();
 
     // Arno: use tempdir
     std::string tmpdir = gettmpdir();
@@ -37,27 +37,27 @@ int main (int argn, char** args) {
             bindaddr((uint32_t)INADDR_ANY,10000),
             fallback("victor2.p2p-next.org:12345");
 
-    if (0>p2tp::Listen(bindaddr)) {
+    if (0>swift::Listen(bindaddr)) {
         print_error("cannot bind");
         return 1;
     }
-       p2tp::SetTracker(tracker);
-       int file = p2tp::Open(filename,root_hash);
+       swift::SetTracker(tracker);
+       int file = swift::Open(filename,root_hash);
     printf("Downloading %s\n",root_hash.hex().c_str());
     int count = 400;
-    while (!p2tp::IsComplete(file) && count-->0) {
-           p2tp::Loop(TINT_SEC/10);
+    while (!swift::IsComplete(file) && count-->0) {
+           swift::Loop(TINT_SEC/10);
         if (count==100) 
             FileTransfer::file(file)->OnPexIn(fallback);
         printf("done %lli of %lli (seq %lli) %lli dgram %lli bytes up, %lli dgram %lli bytes down\n",
-               p2tp::Complete(file), p2tp::Size(file), p2tp::SeqComplete(file),
+               swift::Complete(file), swift::Size(file), swift::SeqComplete(file),
                Datagram::dgrams_up, Datagram::bytes_up,
                Datagram::dgrams_down, Datagram::bytes_down );
     }
-    int ret = !p2tp::IsComplete(file);
+    int ret = !swift::IsComplete(file);
 
-       p2tp::Close(file);
-       p2tp::Shutdown();
+       swift::Close(file);
+       swift::Shutdown();
 
     return ret;
 
index 5bc19bd..090911a 100644 (file)
@@ -1,15 +1,15 @@
 /*
  *  ledbat_controller.cpp
- *  p2tp
+ *  swift
  *
  *  Created by Victor Grishchenko on 10/6/09.
  *  Copyright 2009 Delft University of Technology. All rights reserved.
  *
  */
 
-#include "p2tp.h"
+#include "swift.h"
 
-using namespace p2tp;
+using namespace swift;
 
 class LedbatController : public CongestionController {
 public:
index aeff70c..dfa5b1b 100644 (file)
@@ -1,12 +1,12 @@
 /*
  *  mmap_storer.cpp
- *  p2tp
+ *  swift
  *
  *  Created by Victor Grishchenko on 10/7/09.
  *  Copyright 2009 Delft University of Technology. All rights reserved.
  *
  */
-#include "p2tp.h"
+#include "swift.h"
 
 class MMappedStorer : public DataStorer {
 public:
index 3132236..dfaa20b 100644 (file)
@@ -1,16 +1,19 @@
 /*
  *  seq_picker.cpp
- *  p2tp
+ *  swift
  *
  *  Created by Victor Grishchenko on 10/6/09.
  *  Copyright 2009 Delft University of Technology. All rights reserved.
  *
  */
 
-#include "p2tp.h"
+#include "swift.h"
 
-using namespace p2tp;
+using namespace swift;
 
+
+/** Picks pieces nearly sequentialy; some local randomization (twisting)
+    is introduced to prevent synchronization among multiple channels. */
 class SeqPiecePicker : public PiecePicker {
     
     binmap_t            ack_hint_out_;
@@ -41,7 +44,7 @@ public:
         if (!file().size()) {
             return bin64_t(0,0); // whoever sends it first
         }
-    retry:
+    retry:      // bite me
         twist_ &= (file().peak(0)) & ((1<<6)-1);
         if (twist_) {
             offer.twist(twist_);
index 2396b11..3b51e98 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  simple_selector.cpp
- *  p2tp
+ *  swift
  *
  *  Created by Victor Grishchenko on 10/6/09.
  *  Copyright 2009 Delft University of Technology. All rights reserved.
@@ -8,9 +8,9 @@
  */
 
 #include <queue>
-#include "p2tp.h"
+#include "swift.h"
 
-using namespace p2tp;
+using namespace swift;
 
 class SimpleSelector : public PeerSelector {
     typedef std::pair<Address,Sha1Hash> memo_t;
index 47213e7..538d05d 100644 (file)
@@ -22,7 +22,7 @@
 #endif
 
 
-using namespace p2tp;
+using namespace swift;
 
 #define HASHSZ 20
 const size_t Sha1Hash::SIZE = HASHSZ;
index 7878bf1..e31d8a4 100644 (file)
@@ -13,7 +13,7 @@
 #include <string.h>
 #include <string>
 
-namespace p2tp {
+namespace swift {
 
 
 /** SHA-1 hash, 20 bytes of data */
index 30e0461..b61d969 100755 (executable)
@@ -5,7 +5,13 @@
 # docmd.sh); all failed executions are
 # put to the FAILURES file
 rm -f FAILURES
-for srv in `cat servers.txt`; do
+
+if [ -z "$SERVERS" ]; then
+    SERVERS="das2.txt"
+fi
+HOSTS=`cat $SERVERS | awk '{print $2}'`
+
+for srv in $HOSTS; do
     ( for cmd in $@; do
         if ! ./docmd.sh $srv $cmd; then
             echo $srv >> FAILURES
index 4e504dd..11b9110 100644 (file)
@@ -7,9 +7,9 @@
  *
  */
 
-#include "p2tp.h"
+#include "swift.h"
 
-using namespace p2tp;
+using namespace swift;
 using namespace std;
 
 tint Channel::MIN_DEV = 50*TINT_MSEC;
index 72d00fc..1533ce5 100644 (file)
@@ -6,11 +6,11 @@
  *  Copyright 2009 Delft University of Technology. All rights reserved.
  *
  */
-#include "p2tp.h"
+#include "swift.h"
 #include "compat/util.h"
 
 
-using namespace p2tp;
+using namespace swift;
 using namespace std;
 
 /*
similarity index 86%
rename from p2tp.cpp
rename to swift.cpp
index 65390d9..350a1fd 100644 (file)
--- a/p2tp.cpp
+++ b/swift.cpp
@@ -1,5 +1,5 @@
 /*
- *  p2tp.cpp
+ *  swift.cpp
  *  serp++
  *
  *  Created by Victor Grishchenko on 3/6/09.
 #include <string.h>
 
 //#include <glog/logging.h>
-#include "p2tp.h"
+#include "swift.h"
 #include "datagram.h"
 
 using namespace std;
-using namespace p2tp;
+using namespace swift;
 
-p2tp::tint Channel::last_tick = 0;
+swift::tint Channel::last_tick = 0;
 int Channel::MAX_REORDERING = 4;
 bool Channel::SELF_CONN_OK = false;
-p2tp::tint Channel::TIMEOUT = TINT_SEC*60;
+swift::tint Channel::TIMEOUT = TINT_SEC*60;
 std::vector<Channel*> Channel::channels(1);
 SOCKET Channel::sockets[8] = {0,0,0,0,0,0,0,0};
 int Channel::socket_count = 0;
@@ -70,7 +70,7 @@ Channel::~Channel () {
 }
 
 
-void     p2tp::SetTracker(const Address& tracker) {
+void     swift::SetTracker(const Address& tracker) {
     Channel::tracker = tracker;
 }
 
@@ -83,7 +83,7 @@ int Channel::EncodeID(int unscrambled) {
 }
 
 
-int     p2tp::Listen (Address addr) {
+int     swift::Listen (Address addr) {
     int sock = Datagram::Bind(addr);
     if (sock!=INVALID_SOCKET)
         Channel::sockets[Channel::socket_count++] = sock;
@@ -91,7 +91,7 @@ int     p2tp::Listen (Address addr) {
 }
 
 
-void    p2tp::Shutdown (int sock_des) {
+void    swift::Shutdown (int sock_des) {
     for(int i=0; i<Channel::socket_count; i++)
         if (sock_des==-1 || Channel::sockets[i]==sock_des) {
             Datagram::Close(Channel::sockets[i]);
@@ -100,12 +100,12 @@ void    p2tp::Shutdown (int sock_des) {
 }
 
 
-void    p2tp::Loop (tint till) {
+void    swift::Loop (tint till) {
     Channel::Loop(till);
 }
 
 
-int      p2tp::Open (const char* filename, const Sha1Hash& hash) {
+int      swift::Open (const char* filename, const Sha1Hash& hash) {
     FileTransfer* ft = new FileTransfer(filename, hash);
     int fdes = ft->file().file_descriptor();
     if (fdes>0) {
@@ -126,19 +126,19 @@ int      p2tp::Open (const char* filename, const Sha1Hash& hash) {
 }
 
 
-void    p2tp::Close (int fd) {
+void    swift::Close (int fd) {
     // FIXME delete all channels
     if (fd>FileTransfer::files.size() && FileTransfer::files[fd])
         delete FileTransfer::files[fd];
 }
 
 
-void    p2tp::AddPeer (Address address, const Sha1Hash& root) {
+void    swift::AddPeer (Address address, const Sha1Hash& root) {
     Channel::peer_selector->AddPeer(address,root);
 }
 
 
-uint64_t  p2tp::Size (int fdes) {
+uint64_t  swift::Size (int fdes) {
     if (FileTransfer::files.size()>fdes && FileTransfer::files[fdes])
         return FileTransfer::files[fdes]->file().size();
     else
@@ -146,7 +146,7 @@ uint64_t  p2tp::Size (int fdes) {
 }
 
 
-bool  p2tp::IsComplete (int fdes) {
+bool  swift::IsComplete (int fdes) {
     if (FileTransfer::files.size()>fdes && FileTransfer::files[fdes])
         return FileTransfer::files[fdes]->file().is_complete();
     else
@@ -154,7 +154,7 @@ bool  p2tp::IsComplete (int fdes) {
 }
 
 
-uint64_t  p2tp::Complete (int fdes) {
+uint64_t  swift::Complete (int fdes) {
     if (FileTransfer::files.size()>fdes && FileTransfer::files[fdes])
         return FileTransfer::files[fdes]->file().complete();
     else
@@ -162,7 +162,7 @@ uint64_t  p2tp::Complete (int fdes) {
 }
 
 
-uint64_t  p2tp::SeqComplete (int fdes) {
+uint64_t  swift::SeqComplete (int fdes) {
     if (FileTransfer::files.size()>fdes && FileTransfer::files[fdes])
         return FileTransfer::files[fdes]->file().seq_complete();
     else
@@ -170,7 +170,7 @@ uint64_t  p2tp::SeqComplete (int fdes) {
 }
 
 
-const Sha1Hash& p2tp::RootMerkleHash (int file) {
+const Sha1Hash& swift::RootMerkleHash (int file) {
     FileTransfer* trans = FileTransfer::file(file);
     if (!trans)
         return Sha1Hash::ZERO;
diff --git a/p2tp.h b/swift.h
similarity index 99%
rename from p2tp.h
rename to swift.h
index f372998..8c65dd3 100644 (file)
--- a/p2tp.h
+++ b/swift.h
@@ -1,5 +1,5 @@
 /*
- *  p2tp.h
+ *  swift.h
  *  the main header file for libswift, normally you should only read this one
  *
  *  Created by Victor Grishchenko on 3/6/09.
@@ -63,7 +63,7 @@ Messages
 #include "datagram.h"
 #include "hashtree.h"
 
-namespace p2tp {
+namespace swift {
 
     #define NOW Datagram::now
     
index 580a373..40a7ae5 100644 (file)
@@ -9,11 +9,11 @@
 
 #include <gtest/gtest.h>
 //#include <glog/logging.h>
-#include "p2tp.h"
+#include "swift.h"
 #include <time.h>
 
 
-using namespace p2tp;
+using namespace swift;
 
 
 TEST(P2TP,CwndTest) {
@@ -26,35 +26,35 @@ TEST(P2TP,CwndTest) {
     int size = st.st_size;//, sizek = (st.st_size>>10) + (st.st_size%1024?1:0) ;
     Channel::SELF_CONN_OK = true;
 
-    int sock1 = p2tp::Listen(7001);
+    int sock1 = swift::Listen(7001);
        ASSERT_TRUE(sock1>=0);
 
-       int file = p2tp::Open("doc/sofi.jpg");
+       int file = swift::Open("doc/sofi.jpg");
     FileTransfer* fileobj = FileTransfer::file(file);
     //FileTransfer::instance++;
 
-    p2tp::SetTracker(Address("127.0.0.1",7001));
+    swift::SetTracker(Address("127.0.0.1",7001));
 
-       int copy = p2tp::Open("doc/sofi-copy.jpg",fileobj->root_hash());
+       int copy = swift::Open("doc/sofi-copy.jpg",fileobj->root_hash());
 
-       p2tp::Loop(TINT_SEC);
+       swift::Loop(TINT_SEC);
 
     int count = 0;
-    while (p2tp::SeqComplete(copy)!=size && count++<600)
-        p2tp::Loop(TINT_SEC);
-    ASSERT_EQ(size,p2tp::SeqComplete(copy));
+    while (swift::SeqComplete(copy)!=size && count++<600)
+        swift::Loop(TINT_SEC);
+    ASSERT_EQ(size,swift::SeqComplete(copy));
 
-       p2tp::Close(file);
-       p2tp::Close(copy);
+       swift::Close(file);
+       swift::Close(copy);
 
-       p2tp::Shutdown(sock1);
+       swift::Shutdown(sock1);
 
 }
 
 
 int main (int argc, char** argv) {
 
-       p2tp::LibraryInit();
+       swift::LibraryInit();
        testing::InitGoogleTest(&argc, argv);
        int ret = RUN_ALL_TESTS();
        return ret;
index 8ad68bf..eb7443c 100644 (file)
@@ -9,9 +9,9 @@
 #include <gtest/gtest.h>
 //#include <glog/logging.h>
 #include "datagram.h"
-#include "p2tp.h" // Arno: for LibraryInit
+#include "swift.h" // Arno: for LibraryInit
 
-using namespace p2tp;
+using namespace swift;
 
 TEST(Datagram, AddressTest) {
     Address addr("127.0.0.1:1000");
@@ -103,7 +103,7 @@ TEST(Datagram,TwoPortTest) {
 
 int main (int argc, char** argv) {
 
-       p2tp::LibraryInit();
+       swift::LibraryInit();
 
        testing::InitGoogleTest(&argc, argv);
        return RUN_ALL_TESTS();
index d988fb1..db4ac83 100644 (file)
@@ -11,7 +11,7 @@
 #include <gtest/gtest.h>
 #include "hashtree.h"
 
-using namespace p2tp;
+using namespace swift;
 
 char hash123[] = "a8fdc205a9f19cc1c7507a60c4f01b13d11d7fd0";
 char rooth123[] = "d0bdb8ba28076d84d2b3a0e62521b998e42349a1";
index 55af714..29d00ce 100644 (file)
@@ -3,10 +3,10 @@
 #include <vector>
 #include <deque>
 #include "datagram.h"
-#include "p2tp.h"
+#include "swift.h"
 #include <gtest/gtest.h>
 
-using namespace p2tp;
+using namespace swift;
 using namespace std;
 
 /**
@@ -169,7 +169,7 @@ TEST(Datagram,LedbatTest) {
 int main (int argc, char** argv) {
     printf("Warning: use the script to set up dummynet!\n");
 
-    p2tp::LibraryInit();
+    swift::LibraryInit();
     testing::InitGoogleTest(&argc, argv);
     return RUN_ALL_TESTS();
 
index fbd0e47..36a92a2 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  transfertest.cpp
- *  p2tp
+ *  swift
  *
  *  Created by Victor Grishchenko on 10/7/09.
  *  Copyright 2009 Delft University of Technology. All rights reserved.
@@ -8,11 +8,11 @@
  */
 //#include <gtest/gtest.h>
 //#include <glog/logging.h>
-#include "p2tp.h"
+#include "swift.h"
 #include "compat.h"
 #include <gtest/gtest.h>
 
-using namespace p2tp;
+using namespace swift;
 
 const char* BTF = "test_file";
 
index 08205ee..70c7a0e 100644 (file)
 #include <errno.h>
 #include <string>
 #include <sstream>
-#include "p2tp.h"
+#include "swift.h"
 #include "compat/util.h"
 
 #include "ext/seq_picker.cpp" // FIXME FIXME FIXME FIXME 
 
-using namespace p2tp;
+using namespace swift;
 
 std::vector<FileTransfer*> FileTransfer::files(20);