From: mtk Date: Tue, 4 May 2010 15:14:12 +0000 (+0000) Subject: added support for get/set TxQueueLen X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=f877e260b7f08c22e5838c2134edb18f899691fb;p=senf.git added support for get/set TxQueueLen git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1617 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/senf/Socket/NetdeviceController.cc b/senf/Socket/NetdeviceController.cc index 80379c1..d91d141 100644 --- a/senf/Socket/NetdeviceController.cc +++ b/senf/Socket/NetdeviceController.cc @@ -115,6 +115,24 @@ prefix_ void senf::NetdeviceController::mtu(int new_mtu) doIoctl( ifr, SIOCSIFMTU); } +prefix_ int senf::NetdeviceController::txqueuelen() + const +{ + struct ifreq ifr; + ifrName( ifr); + doIoctl( ifr, SIOCGIFTXQLEN); + return ifr.ifr_qlen; +} + +prefix_ void senf::NetdeviceController::txqueuelen(int new_txqueuelen) +{ + struct ifreq ifr; + ifrName( ifr); + ifr.ifr_qlen = new_txqueuelen; + doIoctl( ifr, SIOCSIFTXQLEN); +} + + prefix_ bool senf::NetdeviceController::promisc() const { diff --git a/senf/Socket/NetdeviceController.hh b/senf/Socket/NetdeviceController.hh index 3699f77..0d15068 100644 --- a/senf/Socket/NetdeviceController.hh +++ b/senf/Socket/NetdeviceController.hh @@ -82,6 +82,12 @@ namespace senf { Setting the MTU to too small values may cause kernel crashes. */ + int txqueuelen() const; ///< return the Tx Queue Length + void txqueuelen(int new_mtu); ///< set the Tx Queue Length + /**< Set the Tx Queue Length (in Packets) MTU of the device. + Note, that this is a privileged operation. */ + + bool promisc() const; ///< return \c true if interface is in promiscuous mode void promisc(bool mode); ///< enable/disable promiscuous mode of the interface /**< Note, that this is a privileged operation. */