X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Socket%2FNetdeviceController.hh;h=cabf6a448743dc2530676cf2afff0053965fec23;hb=3cb0a2ff50b8f1111da34b696e64fb1b037cd683;hp=50f878f6ed58ec800d76bad28c59252edccdd485;hpb=d91d33394bc18350f20407201bd5fbe7346f8f7f;p=senf.git diff --git a/Socket/NetdeviceController.hh b/Socket/NetdeviceController.hh index 50f878f..cabf6a4 100644 --- a/Socket/NetdeviceController.hh +++ b/Socket/NetdeviceController.hh @@ -1,9 +1,9 @@ -// $Id: AddressingPolicy.hh 296 2007-07-10 20:39:34Z g0dil $ +// $Id$ // // Copyright (C) 2007 -// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) -// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) -// Thorsten Horstmann +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY +// Thorsten Horstmann // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -29,8 +29,10 @@ // Custom includes #include +#include #include "Protocols/Raw/MACAddress.hh" + //#include "NetdeviceController.mpp" ///////////////////////////////hh.p//////////////////////////////////////// @@ -39,19 +41,32 @@ namespace senf { /** \brief NetdeviceController \todo document me + \todo Add 'promisc' member to enable/disable promiscuous mode */ class NetdeviceController { public: - NetdeviceController(std::string const interface_name); - + NetdeviceController(std::string const & interface_name); + NetdeviceController(int interface_index); virtual ~NetdeviceController(); - MACAddress hardwareAddress(); + int interfaceIndex() const; ///< return the interface index + MACAddress hardwareAddress() const; ///< return hardware address + void hardwareAddress(const MACAddress &newAddress); ///< set hardware address + + std::string interfaceName() const; ///< return interface name + void interfaceName(const std::string &newName) const; ///< set interface name + + int mtu() const; ///< return the Maximum Transmission Unit + void mtu(int new_mtu) const; //< set the Maximum Transmission Unit + private: + void openSocket(); + void doIoctl(ifreq& ifr, int request) const; + void ifrName(ifreq& ifr) const; int sockfd_; - std::string interfacename_; + int ifindex_; }; }