diff options
Diffstat (limited to 'anytun.cpp')
-rw-r--r-- | anytun.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
@@ -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; } |