summaryrefslogtreecommitdiff
path: root/libopie2
authormickeyl <mickeyl>2003-07-01 22:08:53 (UTC)
committer mickeyl <mickeyl>2003-07-01 22:08:53 (UTC)
commitfbf388246a16c1cd36e209ba24731929b93c21c0 (patch) (unidiff)
treec6fd6bf3f6e341460feec4cca67355ac04f845ac /libopie2
parentd12216b371c89ee1142ade36e7e519041bcb8370 (diff)
downloadopie-fbf388246a16c1cd36e209ba24731929b93c21c0.zip
opie-fbf388246a16c1cd36e209ba24731929b93c21c0.tar.gz
opie-fbf388246a16c1cd36e209ba24731929b93c21c0.tar.bz2
add monitor mode handling for recent kernels (WE>14)
Diffstat (limited to 'libopie2') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opienet/onetwork.cpp28
-rw-r--r--libopie2/opienet/onetwork.h8
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()
69 qDebug( "ONetwork::ONetwork()" ); 69 qDebug( "ONetwork::ONetwork()" );
70 qDebug( "ONetwork: This code has been compiled against Wireless Extensions V%d", WIRELESS_EXT );
70 synchronize(); 71 synchronize();
@@ -111,2 +112,8 @@ void ONetwork::synchronize()
111 112
113short ONetwork::wirelessExtensionVersion()
114{
115 return WIRELESS_EXT;
116}
117
118
112int ONetwork::count() const 119int ONetwork::count() const
@@ -951,7 +958,9 @@ void OHostAPMonitoringInterface::setEnabled( bool b )
951 958
952 //TODO: check wireless extensions version on runtime and use 959 #if WIRELESS_EXT > 14
953 //TODO: SIOCSIWMODE( IW_MODE_MONITOR ) if running on WE >= 15 960 if ( b )
954 961 _if->setMode( "monitor" ); // IW_MODE_MONITOR doesn't support prism header
962 else
963 _if->setMode( "managed" );
964 #else
955 int monitorCode = _prismHeader ? 1 : 2; 965 int monitorCode = _prismHeader ? 1 : 2;
956
957 if ( b ) 966 if ( b )
@@ -964,2 +973,3 @@ void OHostAPMonitoringInterface::setEnabled( bool b )
964 } 973 }
974 #endif
965} 975}
@@ -998,2 +1008,11 @@ void OOrinocoMonitoringInterface::setEnabled( bool b )
998{ 1008{
1009 // IW_MODE_MONITOR was introduced in Wireless Extensions Version 15
1010 // Wireless Extensions < Version 15 need iwpriv commandos for monitoring
1011
1012 #if WIRELESS_EXT > 14
1013 if ( b )
1014 _if->setMode( "monitor" ); // IW_MODE_MONITOR doesn't support prism header
1015 else
1016 _if->setMode( "managed" );
1017 #else
999 if ( b ) 1018 if ( b )
@@ -1006,2 +1025,3 @@ void OOrinocoMonitoringInterface::setEnabled( bool b )
1006 } 1025 }
1026 #endif
1007} 1027}
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
106 */ 106 */
107 // FIXME QString? -zecke
108 bool isWirelessInterface( const char* interface ) const; 107 bool isWirelessInterface( const char* interface ) const;
109 /** 108 /**
110 * @returns a pointer to the @ref ONetworkInterface object for the specified @a interface or 0, if not found 109 * @returns a pointer to the @ref ONetworkInterface object for the specified @a interface or 0, if not found.
111 * @see ONetworkInterface 110 * @see ONetworkInterface
112 */ 111 */
113 // FIXME: const QString& is prefered over QString!!! -zecke
114 ONetworkInterface* interface( const QString& interface ) const; 112 ONetworkInterface* interface( const QString& interface ) const;
@@ -120,2 +118,6 @@ class ONetwork : public QObject
120 void synchronize(); 118 void synchronize();
119 /**
120 * @returns the wireless extension version used at compile time.
121 **/
122 static short wirelessExtensionVersion();
121 123