Libraryize test.cc

This commit is contained in:
Ian Gulliver
2016-09-25 17:37:37 -07:00
parent c067cbd71e
commit f31ccaad16
10 changed files with 100 additions and 102 deletions

18
tools/dump_tun.cc Normal file
View File

@@ -0,0 +1,18 @@
#include "lib/tun_tap_device.h"
#include "glog/logging.h"
using funstraw::TunTapDevice;
int main(int argc, char* argv[]) {
google::InitGoogleLogging(argv[0]);
TunTapDevice dev("", TunTapDevice::kIfFormatTun | TunTapDevice::kIfNoPacketInfo, TunTapDevice::kFdReadOnly);
LOG(INFO) << "Device: " << dev.Name();
while (true) {
char buf[2048];
auto bytes = dev.Read(buf);
LOG(INFO) << bytes << " byte packet";
}
}