author | mickeyl <mickeyl> | 2003-07-01 22:08:53 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-07-01 22:08:53 (UTC) |
commit | fbf388246a16c1cd36e209ba24731929b93c21c0 (patch) (side-by-side diff) | |
tree | c6fd6bf3f6e341460feec4cca67355ac04f845ac /libopie2 | |
parent | d12216b371c89ee1142ade36e7e519041bcb8370 (diff) | |
download | opie-fbf388246a16c1cd36e209ba24731929b93c21c0.zip opie-fbf388246a16c1cd36e209ba24731929b93c21c0.tar.gz opie-fbf388246a16c1cd36e209ba24731929b93c21c0.tar.bz2 |
add monitor mode handling for recent kernels (WE>14)
-rw-r--r-- | libopie2/opienet/onetwork.cpp | 28 | ||||
-rw-r--r-- | libopie2/opienet/onetwork.h | 8 |
2 files changed, 29 insertions, 7 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 @@ -69,2 +69,3 @@ ONetwork::ONetwork() qDebug( "ONetwork::ONetwork()" ); + qDebug( "ONetwork: This code has been compiled against Wireless Extensions V%d", WIRELESS_EXT ); synchronize(); @@ -111,2 +112,8 @@ void ONetwork::synchronize() +short ONetwork::wirelessExtensionVersion() +{ + return WIRELESS_EXT; +} + + int ONetwork::count() const @@ -951,7 +958,9 @@ void OHostAPMonitoringInterface::setEnabled( bool b ) - //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 ) @@ -964,2 +973,3 @@ void OHostAPMonitoringInterface::setEnabled( bool b ) } + #endif } @@ -998,2 +1008,11 @@ 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 ) @@ -1006,2 +1025,3 @@ void OOrinocoMonitoringInterface::setEnabled( bool b ) } + #endif } diff --git a/libopie2/opienet/onetwork.h b/libopie2/opienet/onetwork.h index cfb999d..2553a61 100644 --- a/libopie2/opienet/onetwork.h +++ b/libopie2/opienet/onetwork.h @@ -106,9 +106,7 @@ class ONetwork : public QObject */ - // FIXME QString? -zecke bool isWirelessInterface( const char* interface ) const; /** - * @returns a pointer to the @ref ONetworkInterface object for the specified @a interface or 0, if not found + * @returns a pointer to the @ref ONetworkInterface object for the specified @a interface or 0, if not found. * @see ONetworkInterface */ - // FIXME: const QString& is prefered over QString!!! -zecke ONetworkInterface* interface( const QString& interface ) const; @@ -120,2 +118,6 @@ class ONetwork : public QObject void synchronize(); + /** + * @returns the wireless extension version used at compile time. + **/ + static short wirelessExtensionVersion(); |