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.cpp28
1 files changed, 24 insertions, 4 deletions
diff --git a/libopie2/opienet/onetwork.cpp b/libopie2/opienet/onetwork.cpp
index 6cef5cf..751d841 100644
--- a/libopie2/opienet/onetwork.cpp
+++ b/libopie2/opienet/onetwork.cpp
@@ -68,4 +68,5 @@ ONetwork::ONetwork()
{
qDebug( "ONetwork::ONetwork()" );
+ qDebug( "ONetwork: This code has been compiled against Wireless Extensions V%d", WIRELESS_EXT );
synchronize();
}
@@ -110,4 +111,10 @@ void ONetwork::synchronize()
+short ONetwork::wirelessExtensionVersion()
+{
+ return WIRELESS_EXT;
+}
+
+
int ONetwork::count() const
{
@@ -950,9 +957,11 @@ void OHostAPMonitoringInterface::setEnabled( bool b )
// Wireless Extensions < Version 15 need iwpriv commandos for monitoring
- //TODO: check wireless extensions version on runtime and use
- //TODO: SIOCSIWMODE( IW_MODE_MONITOR ) if running on WE >= 15
-
+ #if WIRELESS_EXT > 14
+ if ( b )
+ _if->setMode( "monitor" ); // IW_MODE_MONITOR doesn't support prism header
+ else
+ _if->setMode( "managed" );
+ #else
int monitorCode = _prismHeader ? 1 : 2;
-
if ( b )
{
@@ -963,4 +972,5 @@ void OHostAPMonitoringInterface::setEnabled( bool b )
_if->setPrivate( "monitor", 1, 0 );
}
+ #endif
}
@@ -997,4 +1007,13 @@ void OOrinocoMonitoringInterface::setChannel( int c )
void OOrinocoMonitoringInterface::setEnabled( bool b )
{
+ // IW_MODE_MONITOR was introduced in Wireless Extensions Version 15
+ // Wireless Extensions < Version 15 need iwpriv commandos for monitoring
+
+ #if WIRELESS_EXT > 14
+ if ( b )
+ _if->setMode( "monitor" ); // IW_MODE_MONITOR doesn't support prism header
+ else
+ _if->setMode( "managed" );
+ #else
if ( b )
{
@@ -1005,4 +1024,5 @@ void OOrinocoMonitoringInterface::setEnabled( bool b )
_if->setPrivate( "monitor", 2, 0, 0 );
}
+ #endif
}