summaryrefslogtreecommitdiff
path: root/anytun.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'anytun.cpp')
-rw-r--r--anytun.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/anytun.cpp b/anytun.cpp
index 9aedadb..7ac1dd5 100644
--- a/anytun.cpp
+++ b/anytun.cpp
@@ -32,6 +32,7 @@
#include "datatypes.h"
+#include "tunDevice.h"
#include "buffer.h"
int main(int argc, char* argv[])
@@ -52,5 +53,35 @@ int main(int argc, char* argv[])
for(unsigned int i=0;i<c.getLength();++i)
c[i] = i;
+ TunDevice* dev;
+
+ dev = new TunDevice("tun", "192.168.200.1", "192.168.201.1");
+ dev->open();
+ std::cout << "dev has actual name: " << dev->getActualName() << std::endl;
+
+ sleep(10);
+
+ dev->close();
+
+ sleep(10);
+
+ delete dev;
+
+// dev = new TunDevice("tap", "192.168.202.1", "255.255.255.0");
+// dev->open();
+// std::cout << "dev has actual name: " << dev->getActualName() << std::endl;
+
+// sleep(10);
+
+// delete dev;
+
+// dev = new TunDevice("tun12", "192.168.200.1", "192.168.201.1");
+// dev->open();
+// std::cout << "dev has actual name: " << dev->getActualName() << std::endl;
+
+// sleep(10);
+
+// delete dev;
+
return 0;
}