// $Id$
//
// Copyright (C) 2007
-// Fraunhofer Institute for Open Communication Systems (FOKUS)
-// Competence Center NETwork research (NET), St. Augustin, GERMANY
+// Fraunhofer Institute for Open Communication Systems (FOKUS)
+// Competence Center NETwork research (NET), St. Augustin, GERMANY
// Thorsten Horstmann <tho@berlios.de>
//
// This program is free software; you can redistribute it and/or modify
}
prefix_ std::string senf::NetdeviceController::interfaceName()
+ const
{
struct ifreq ifr;
ifrName( ifr);
}
prefix_ senf::MACAddress senf::NetdeviceController::hardwareAddress()
+ const
{
struct ifreq ifr;
ifrName( ifr);
}
prefix_ int senf::NetdeviceController::mtu()
+ const
{
struct ifreq ifr;
ifrName( ifr);
}
prefix_ void senf::NetdeviceController::mtu(int new_mtu)
+ const
{
struct ifreq ifr;
ifrName( ifr);
}
prefix_ int senf::NetdeviceController::interfaceIndex()
+ const
{
return ifindex_;
}
{
sockfd_ = ::socket( PF_INET, SOCK_DGRAM, 0);
if ( sockfd_ < 0)
- throwErrno();
+ throw SystemException( "Could not open socket for NetdeviceController");
}
prefix_ void senf::NetdeviceController::ifrName(ifreq& ifr)
+ const
{
::memset( &ifr, 0, sizeof(ifr));
ifr.ifr_ifindex = ifindex_;
if ( ::ioctl( sockfd_, SIOCGIFNAME, &ifr ) < 0 )
- throwErrno();
+ throw SystemException(
+ "NetdeviceController: Could not discover the name of the interface with index ") << ifindex_;
}
-
prefix_ void senf::NetdeviceController::doIoctl(ifreq& ifr, int request)
+ const
{
if ( ::ioctl( sockfd_, request, &ifr ) < 0 )
- throwErrno();
+ throw SystemException();
}
///////////////////////////////cc.e////////////////////////////////////////