summaryrefslogtreecommitdiff
path: root/anytun.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'anytun.cpp')
-rw-r--r--anytun.cpp42
1 files changed, 21 insertions, 21 deletions
diff --git a/anytun.cpp b/anytun.cpp
index 7ac1dd5..56c23d5 100644
--- a/anytun.cpp
+++ b/anytun.cpp
@@ -56,32 +56,32 @@ int main(int argc, char* argv[])
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;
-
+ std::cout << "dev created (opened)" << std::endl;
+ std::cout << "dev opened - actual name is '" << dev->getActualName() << "'" << std::endl;
+ std::cout << "dev type is '" << dev->getType() << "'" << std::endl;
sleep(10);
-
- dev->close();
-
+ delete dev;
+ std::cout << "dev destroyed" << std::endl;
+
sleep(10);
+ dev = new TunDevice("tap", "192.168.202.1", "255.255.255.0");
+ std::cout << "dev created (opened)" << std::endl;
+ std::cout << "dev opened - actual name is '" << dev->getActualName() << "'" << std::endl;
+ std::cout << "dev type is '" << dev->getType() << "'" << std::endl;
+ sleep(10);
delete dev;
+ std::cout << "dev destroyed" << std::endl;
-// 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);
+ sleep(10);
-// delete dev;
-
+ dev = new TunDevice("tun17", "192.168.200.1", "192.168.201.1");
+ std::cout << "dev created (opened)" << std::endl;
+ std::cout << "dev opened - actual name is '" << dev->getActualName() << "'" << std::endl;
+ std::cout << "dev type is '" << dev->getType() << "'" << std::endl;
+ sleep(10);
+ delete dev;
+ std::cout << "dev destroyed" << std::endl;
+
return 0;
}