From 802c9ab6b89fd10f709aa012e8ff075e9b4a5d7f Mon Sep 17 00:00:00 2001 From: mickeyl Date: Thu, 09 Oct 2003 16:01:08 +0000 Subject: - fix monitor mode on orinoco. Although WE > 14 define the standard mode "MONITOR", the orinoco monitor patch for 0.13e still does not use that... - add documentation, a warning, and a runtime check for setChannel(0) --- (limited to 'libopie2') diff --git a/libopie2/opienet/onetwork.cpp b/libopie2/opienet/onetwork.cpp index 45ee4c0..767651e 100644 --- a/libopie2/opienet/onetwork.cpp +++ b/libopie2/opienet/onetwork.cpp @@ -593,6 +593,12 @@ int OWirelessNetworkInterface::channel() const void OWirelessNetworkInterface::setChannel( int c ) const { + if ( c ) + { + qWarning( "OWirelessNetworkInterface::setChannel( 0 ) called - fix your application!" ); + return; + } + if ( !_mon ) { memset( &_iwr, 0, sizeof( struct iwreq ) ); @@ -939,7 +945,7 @@ void OWlanNGMonitoringInterface::setChannel( int c ) QString prism = _prismHeader ? "true" : "false"; QString cmd; cmd.sprintf( "$(which wlanctl-ng) %s lnxreq_wlansniff channel=%d enable=%s prismheader=%s", - (const char*) _if->name(), c+1, (const char*) enable, (const char*) prism ); + (const char*) _if->name(), c, (const char*) enable, (const char*) prism ); system( cmd ); } @@ -1015,8 +1021,10 @@ void OOrinocoMonitoringInterface::setEnabled( bool b ) { // IW_MODE_MONITOR was introduced in Wireless Extensions Version 15 // Wireless Extensions < Version 15 need iwpriv commandos for monitoring + // However, as of recent orinoco drivers, IW_MODE_MONITOR is still not supported - #if WIRELESS_EXT > 14 + #if 0 + //#if WIRELESS_EXT > 14 if ( b ) _if->setMode( "monitor" ); // IW_MODE_MONITOR doesn't support prism header else diff --git a/libopie2/opienet/onetwork.h b/libopie2/opienet/onetwork.h index 2553a61..00d1ebb 100644 --- a/libopie2/opienet/onetwork.h +++ b/libopie2/opienet/onetwork.h @@ -336,6 +336,8 @@ class OWirelessNetworkInterface : public ONetworkInterface /** * Setting the @a channel of the interface changes the radio frequency (RF) * of the corresponding wireless network device. + * @note Common channel range is within [1-14]. A value of 0 is not allowed. + * @see channels() */ virtual void setChannel( int channel ) const; /** -- cgit v0.9.0.2