X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Socket%2FNetdeviceController.cc;h=345679b382bf6974cf6e3b32dc9ce109c3ea3dad;hb=532240d72e09e19e57fac9bb55c2560b9c9e5b97;hp=7ce1f953bff4aa0a0582d09098f753442d64fadf;hpb=560113811e6d51fffb4ca004e7342ec362234cd2;p=senf.git diff --git a/Socket/NetdeviceController.cc b/Socket/NetdeviceController.cc index 7ce1f95..345679b 100644 --- a/Socket/NetdeviceController.cc +++ b/Socket/NetdeviceController.cc @@ -115,6 +115,27 @@ prefix_ void senf::NetdeviceController::mtu(int new_mtu) doIoctl( ifr, SIOCSIFMTU); } +prefix_ bool senf::NetdeviceController::promisc() + const +{ + struct ifreq ifr; + ifrName( ifr); + doIoctl( ifr, SIOCGIFFLAGS); + return ifr.ifr_flags & IFF_PROMISC; +} + +prefix_ void senf::NetdeviceController::promisc(bool mode) +{ + struct ifreq ifr; + ifrName( ifr); + doIoctl( ifr, SIOCGIFFLAGS); + if (mode) + ifr.ifr_flags |= IFF_PROMISC; + else + ifr.ifr_flags &= ~IFF_PROMISC; + doIoctl( ifr, SIOCSIFFLAGS); +} + prefix_ int senf::NetdeviceController::interfaceIndex() const {