34 for (
int i = 0; i < 256; ++i)
42 throw tun_mac_util(
"unknown OSI layer");
43 const std::string node_str = tuntap + to_string(i);
44 const std::string node_fn =
"/dev/" + node_str;
46 ScopedFD fd(open(node_fn.c_str(), O_RDWR));
50 if (fcntl(fd(), F_SETFL, O_NONBLOCK) < 0)
51 throw tun_mac_util(
"fcntl error on " + node_fn +
" : " +
errinfo(errno));
57 throw tun_mac_util(std::string(
"error opening Mac ") +
layer.dev_type() +
" device");