}
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_;
}
}
prefix_ void senf::NetdeviceController::ifrName(ifreq& ifr)
+ const
{
::memset( &ifr, 0, sizeof(ifr));
ifr.ifr_ifindex = ifindex_;
prefix_ void senf::NetdeviceController::doIoctl(ifreq& ifr, int request)
+ const
{
if ( ::ioctl( sockfd_, request, &ifr ) < 0 )
throw SystemException();
NetdeviceController(int interface_index);
virtual ~NetdeviceController();
- MACAddress hardwareAddress();
- std::string interfaceName();
- int interfaceIndex(); ///< return the interface index of the interface
- int mtu();
- void mtu(int new_mtu);
+ MACAddress hardwareAddress() const;
+ std::string interfaceName() const;
+ int interfaceIndex() const; ///< return the interface index of the interface
+ int mtu() const;
+ void mtu(int new_mtu) const;
private:
void openSocket();
- void doIoctl(ifreq& ifr, int request);
- void ifrName(ifreq& ifr);
+ void doIoctl(ifreq& ifr, int request) const;
+ void ifrName(ifreq& ifr) const;
int sockfd_;
int ifindex_;
};