congestvpn/main.cpp

18 lines
461 B
C++
Raw Normal View History

2020-06-02 13:08:23 +02:00
#include <cstdio>
#include <unistd.h>
#include "TunDevice.hpp"
int main(void) {
try {
TunDevice tun_dev("cvpn%d");
printf("Tunnel device opened: <%s>, fd <%d>.\nSleeping 10 seconds.\n",
tun_dev.get_dev_name().c_str(), tun_dev.get_fd());
sleep(10);
printf("Shutting down.\n");
} catch(const TunDevice::InitializationError& exn) {
fprintf(stderr, "ERROR: %s\n", exn.what());
}
return 0;
}