author | mickeyl <mickeyl> | 2004-02-23 19:04:50 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-02-23 19:04:50 (UTC) |
commit | 7206bf5ae8a9940a9c30a9dc3dd3cb663e64874b (patch) (side-by-side diff) | |
tree | f48e9183a4ffcb9d9bc4c448f79c6f424ac4a387 | |
parent | 4f8be1658bc82040bac404aa98fe70c24239f10c (diff) | |
download | opie-7206bf5ae8a9940a9c30a9dc3dd3cb663e64874b.zip opie-7206bf5ae8a9940a9c30a9dc3dd3cb663e64874b.tar.gz opie-7206bf5ae8a9940a9c30a9dc3dd3cb663e64874b.tar.bz2 |
The Orinoco (and Symbol/Spectrum) driver recently got the monitor mode
patch applied. It uses the WE15 IW_MODE_MONITOR.
Fix OOrinocoMonitoringInterface to work with recent Orinoco drivers
-rw-r--r-- | libopie2/opienet/onetwork.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/libopie2/opienet/onetwork.cpp b/libopie2/opienet/onetwork.cpp index 36f409b..915814d 100644 --- a/libopie2/opienet/onetwork.cpp +++ b/libopie2/opienet/onetwork.cpp @@ -1104,122 +1104,125 @@ void OCiscoMonitoringInterface::setChannel( int ) OWlanNGMonitoringInterface::OWlanNGMonitoringInterface( ONetworkInterface* iface, bool prismHeader )
:OMonitoringInterface( iface, prismHeader )
{
iface->setMonitoring( this );
}
OWlanNGMonitoringInterface::~OWlanNGMonitoringInterface()
{
}
void OWlanNGMonitoringInterface::setEnabled( bool b )
{
//FIXME: do nothing if its already in the same mode
QString enable = b ? "true" : "false";
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(), 1, (const char*) enable, (const char*) prism );
system( cmd );
}
QString OWlanNGMonitoringInterface::name() const
{
return "wlan-ng";
}
void OWlanNGMonitoringInterface::setChannel( int c )
{
//NOTE: Older wlan-ng drivers automatically hopped channels while lnxreq_wlansniff=true. Newer ones don't.
QString enable = "true"; //_if->monitorMode() ? "true" : "false";
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, (const char*) enable, (const char*) prism );
system( cmd );
}
/*======================================================================================
* OHostAPMonitoringInterface
*======================================================================================*/
OHostAPMonitoringInterface::OHostAPMonitoringInterface( ONetworkInterface* iface, bool prismHeader )
:OMonitoringInterface( iface, prismHeader )
{
iface->setMonitoring( this );
}
OHostAPMonitoringInterface::~OHostAPMonitoringInterface()
{
}
void OHostAPMonitoringInterface::setEnabled( bool b )
{
int monitorCode = _prismHeader ? 1 : 2;
if ( b )
{
_if->setPrivate( "monitor", 1, monitorCode );
}
else
{
_if->setPrivate( "monitor", 1, 0 );
}
}
QString OHostAPMonitoringInterface::name() const
{
return "hostap";
}
/*======================================================================================
* OOrinocoNetworkInterface
*======================================================================================*/
OOrinocoMonitoringInterface::OOrinocoMonitoringInterface( ONetworkInterface* iface, bool prismHeader )
:OMonitoringInterface( iface, prismHeader )
{
iface->setMonitoring( this );
}
OOrinocoMonitoringInterface::~OOrinocoMonitoringInterface()
{
}
void OOrinocoMonitoringInterface::setChannel( int c )
{
+ if ( !_if->hasPrivate( "monitor" ) )
+ {
+ this->OMonitoringInterface::setChannel( c );
+ }
+ else
+ {
int monitorCode = _prismHeader ? 1 : 2;
_if->setPrivate( "monitor", 2, monitorCode, 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
- // However, as of recent orinoco drivers, IW_MODE_MONITOR is still not supported
-
if ( b )
{
setChannel( 1 );
}
else
{
_if->setPrivate( "monitor", 2, 0, 0 );
}
}
QString OOrinocoMonitoringInterface::name() const
{
return "orinoco";
}
|