{
int f;
if ( (f = ::open("/dev/net/tun", O_RDWR)) < 0 )
- throw SystemException();
+ SENF_THROW_SYSTEM_EXCEPTION("Could not open tap control device: /dev/net/tun.");
struct ifreq ifr;
::memset( &ifr, 0, sizeof(ifr));
ifr.ifr_flags = IFF_TAP;
ifr.ifr_flags |= IFF_NO_PI;
interface_name.copy( ifr.ifr_name, IFNAMSIZ);
if (::ioctl(f, TUNSETIFF, (void *) &ifr) < 0 )
- throw SystemException();
+ SENF_THROW_SYSTEM_EXCEPTION( "Could not create tap device: ") << ifr.ifr_name << ".";
fd(f);
}
return 0;
ssize_t l = ::recv(fd(),0,0,MSG_PEEK | MSG_TRUNC);
if (l < 0)
- //throw SystemException();
+ //SENF_THROW_SYSTEM_EXCEPTION("");
return 1588;
return l;
}
return 0;
int n;
if (::ioctl(body().fd(),SIOCINQ,&n) < 0)
- throw SystemException();
+ SENF_THROW_SYSTEM_EXCEPTION("");
return n;
}
*/