X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Socket%2FNetdeviceController.hh;h=babe980fbd38663c664d26095e70ee88b65a629c;hb=ef0be4d0484ff659d17e02a421ad5beaaa76e646;hp=dbc5ce6154c3dcbcfb4559ccdc1f853f2ef358ac;hpb=ab05c3d687d911b4d204aa20bf900dc23d174545;p=senf.git diff --git a/Socket/NetdeviceController.hh b/Socket/NetdeviceController.hh index dbc5ce6..babe980 100644 --- a/Socket/NetdeviceController.hh +++ b/Socket/NetdeviceController.hh @@ -24,8 +24,8 @@ \brief NetdeviceController public header */ -#ifndef HH_NetdeviceController_ -#define HH_NetdeviceController_ 1 +#ifndef HH_SENF_Socket_NetdeviceController_ +#define HH_SENF_Socket_NetdeviceController_ 1 // Custom includes #include @@ -38,24 +38,41 @@ namespace senf { - /** \brief NetdeviceController - - \todo document me + /** \brief Netdevice Controller + + This controller provides an interface which can be used to configure network + devices. Note, that some setting members are privileged operations. + + \see manual page netdevice(7) for more informations. + \todo Add 'promisc' member to enable/disable promiscuous mode */ class NetdeviceController { public: NetdeviceController(std::string const & interface_name); + ///< Construct a new controller for the given interface name. NetdeviceController(int interface_index); + ///< Construct a new controller for the given interface index. virtual ~NetdeviceController(); - + + int interfaceIndex() const; ///< return the interface index MACAddress hardwareAddress() const; + ///< return hardware address + void hardwareAddress(const MACAddress &newAddress); + ///< set hardware address + /**< Note, that setting the hardware address is a privileged operation. */ std::string interfaceName() const; - int interfaceIndex() const; ///< return the interface index of the interface - int mtu() const; - void mtu(int new_mtu) const; - + ///< return interface name + void interfaceName(const std::string &newName); + ///< set interface name + /**< Changes the name of the interface. Note, that this is a + privileged operation. It is only allowed when the interface is not up. */ + int mtu() const; ///< return the Maximum Transmission Unit + void mtu(int new_mtu); ///< set the Maximum Transmission Unit + /**< Set the MTU (Maximum Transfer Unit) of the device. + Note, that this is a privileged operation. + Setting the MTU to too small values may cause kernel crashes. */ private: void openSocket(); void doIoctl(ifreq& ifr, int request) const; @@ -73,7 +90,7 @@ namespace senf { //#include "NetdeviceController.mpp" #endif - + // Local Variables: // mode: c++ // fill-column: 100