summaryrefslogtreecommitdiff
path: root/libopie2/opienet/onetwork.cpp
Side-by-side diff
Diffstat (limited to 'libopie2/opienet/onetwork.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opienet/onetwork.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/libopie2/opienet/onetwork.cpp b/libopie2/opienet/onetwork.cpp
index 2548a04..66fa215 100644
--- a/libopie2/opienet/onetwork.cpp
+++ b/libopie2/opienet/onetwork.cpp
@@ -49,12 +49,13 @@
#include <math.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
#include <linux/sockios.h>
+#include <stdarg.h>
using namespace std;
/*======================================================================================
* ONetwork
*======================================================================================*/
@@ -579,12 +580,44 @@ QString OWirelessNetworkInterface::nickName() const
str[_iwr.u.data.length] = 0x0; // some drivers (e.g. wlan-ng) don't zero-terminate the string
return str;
}
}
+void OWirelessNetworkInterface::setPrivate( const QString& call, int numargs, ... )
+{
+ OPrivateIOCTL* priv = static_cast<OPrivateIOCTL*>( child( (const char*) call ) );
+ if ( !priv )
+ {
+ qDebug( "OWirelessNetworkInterface::setPrivate(): interface '%s' does not support private ioctl '%s'", name(), (const char*) call );
+ return;
+ }
+ if ( priv->numberSetArgs() != numargs )
+ {
+ qDebug( "OWirelessNetworkInterface::setPrivate(): parameter count not matching. '%s' expects %d arguments, but got %d", (const char*) call, priv->numberSetArgs(), numargs );
+ return;
+ }
+
+ qDebug( "OWirelessNetworkInterface::setPrivate(): about to call '%s' on interface '%s'", (const char*) call, name() );
+ memset( &_iwr, 0, sizeof _iwr );
+ va_list argp;
+ va_start( argp, numargs );
+ for ( int i = 0; i < numargs; ++i )
+ {
+ priv->setParameter( i, va_arg( argp, int ) );
+ }
+ va_end( argp );
+ priv->invoke();
+}
+
+
+void OWirelessNetworkInterface::getPrivate( const QString& call )
+{
+}
+
+
QString OWirelessNetworkInterface::SSID() const
{
char str[IW_ESSID_MAX_SIZE];
_iwr.u.essid.pointer = &str[0];
_iwr.u.essid.length = IW_ESSID_MAX_SIZE;
if ( !wioctl( SIOCGIWESSID ) )