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.cpp31
1 files changed, 18 insertions, 13 deletions
diff --git a/libopie2/opienet/onetwork.cpp b/libopie2/opienet/onetwork.cpp
index 2dfff1d..6cef5cf 100644
--- a/libopie2/opienet/onetwork.cpp
+++ b/libopie2/opienet/onetwork.cpp
@@ -806,14 +806,14 @@ bool OWirelessNetworkInterface::wioctl( int call ) const
/*======================================================================================
* OMonitoringInterface
*======================================================================================*/
-OMonitoringInterface::OMonitoringInterface( ONetworkInterface* iface )
- :_if( static_cast<OWirelessNetworkInterface*>( iface ) )
+OMonitoringInterface::OMonitoringInterface( ONetworkInterface* iface, bool prismHeader )
+ :_if( static_cast<OWirelessNetworkInterface*>( iface ) ), _prismHeader( prismHeader )
{
}
OMonitoringInterface::~OMonitoringInterface()
{
@@ -842,14 +842,14 @@ void OMonitoringInterface::setEnabled( bool b )
/*======================================================================================
* OCiscoMonitoringInterface
*======================================================================================*/
-OCiscoMonitoringInterface::OCiscoMonitoringInterface( ONetworkInterface* iface )
- :OMonitoringInterface( iface )
+OCiscoMonitoringInterface::OCiscoMonitoringInterface( ONetworkInterface* iface, bool prismHeader )
+ :OMonitoringInterface( iface, prismHeader )
{
iface->setMonitoring( this );
}
OCiscoMonitoringInterface::~OCiscoMonitoringInterface()
@@ -890,14 +890,14 @@ void OCiscoMonitoringInterface::setChannel( int )
/*======================================================================================
* OWlanNGMonitoringInterface
*======================================================================================*/
-OWlanNGMonitoringInterface::OWlanNGMonitoringInterface( ONetworkInterface* iface )
- :OMonitoringInterface( iface )
+OWlanNGMonitoringInterface::OWlanNGMonitoringInterface( ONetworkInterface* iface, bool prismHeader )
+ :OMonitoringInterface( iface, prismHeader )
{
iface->setMonitoring( this );
}
OWlanNGMonitoringInterface::~OWlanNGMonitoringInterface()
@@ -907,14 +907,16 @@ 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", (const char*) _if->name(), 1, (const char*) enable );
+ 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
{
@@ -929,14 +931,14 @@ void OWlanNGMonitoringInterface::setChannel( int )
/*======================================================================================
* OHostAPMonitoringInterface
*======================================================================================*/
-OHostAPMonitoringInterface::OHostAPMonitoringInterface( ONetworkInterface* iface )
- :OMonitoringInterface( iface )
+OHostAPMonitoringInterface::OHostAPMonitoringInterface( ONetworkInterface* iface, bool prismHeader )
+ :OMonitoringInterface( iface, prismHeader )
{
iface->setMonitoring( this );
}
OHostAPMonitoringInterface::~OHostAPMonitoringInterface()
{
@@ -947,15 +949,17 @@ void OHostAPMonitoringInterface::setEnabled( bool b )
// IW_MODE_MONITOR was introduced in Wireless Extensions Version 15
// 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
+ int monitorCode = _prismHeader ? 1 : 2;
+
if ( b )
{
- _if->setPrivate( "monitor", 1, 2 );
+ _if->setPrivate( "monitor", 1, monitorCode );
}
else
{
_if->setPrivate( "monitor", 1, 0 );
}
}
@@ -968,27 +972,28 @@ QString OHostAPMonitoringInterface::name() const
/*======================================================================================
* OOrinocoNetworkInterface
*======================================================================================*/
-OOrinocoMonitoringInterface::OOrinocoMonitoringInterface( ONetworkInterface* iface )
- :OMonitoringInterface( iface )
+OOrinocoMonitoringInterface::OOrinocoMonitoringInterface( ONetworkInterface* iface, bool prismHeader )
+ :OMonitoringInterface( iface, prismHeader )
{
iface->setMonitoring( this );
}
OOrinocoMonitoringInterface::~OOrinocoMonitoringInterface()
{
}
void OOrinocoMonitoringInterface::setChannel( int c )
{
- _if->setPrivate( "monitor", 2, 1, c );
+ int monitorCode = _prismHeader ? 1 : 2;
+ _if->setPrivate( "monitor", 2, monitorCode, c );
}
void OOrinocoMonitoringInterface::setEnabled( bool b )
{
if ( b )