Files
funstraw/tools/dump_tun.cc
2016-09-25 17:37:37 -07:00

19 lines
435 B
C++

#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";
}
}