summaryrefslogtreecommitdiff
path: root/libopie2/opienet/onetwork.cpp
authormickeyl <mickeyl>2003-05-05 14:57:27 (UTC)
committer mickeyl <mickeyl>2003-05-05 14:57:27 (UTC)
commit29f5c6e6bcb8db0f0e26da25dbf34b2685c01526 (patch) (side-by-side diff)
treea05e296ff11d532fd3d5fd092aade07474d1ba95 /libopie2/opienet/onetwork.cpp
parenta5818261bec2d0a6d903fef9baeed1a7abc85275 (diff)
downloadopie-29f5c6e6bcb8db0f0e26da25dbf34b2685c01526.zip
opie-29f5c6e6bcb8db0f0e26da25dbf34b2685c01526.tar.gz
opie-29f5c6e6bcb8db0f0e26da25dbf34b2685c01526.tar.bz2
- fix segfault on unknown linktype (thanks groucho)
- make capturing using PRISM headers optional
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
@@ -810,6 +810,6 @@ bool OWirelessNetworkInterface::wioctl( int call ) const
*======================================================================================*/
-OMonitoringInterface::OMonitoringInterface( ONetworkInterface* iface )
- :_if( static_cast<OWirelessNetworkInterface*>( iface ) )
+OMonitoringInterface::OMonitoringInterface( ONetworkInterface* iface, bool prismHeader )
+ :_if( static_cast<OWirelessNetworkInterface*>( iface ) ), _prismHeader( prismHeader )
{
}
@@ -846,6 +846,6 @@ void OMonitoringInterface::setEnabled( bool b )
*======================================================================================*/
-OCiscoMonitoringInterface::OCiscoMonitoringInterface( ONetworkInterface* iface )
- :OMonitoringInterface( iface )
+OCiscoMonitoringInterface::OCiscoMonitoringInterface( ONetworkInterface* iface, bool prismHeader )
+ :OMonitoringInterface( iface, prismHeader )
{
iface->setMonitoring( this );
@@ -894,6 +894,6 @@ void OCiscoMonitoringInterface::setChannel( int )
-OWlanNGMonitoringInterface::OWlanNGMonitoringInterface( ONetworkInterface* iface )
- :OMonitoringInterface( iface )
+OWlanNGMonitoringInterface::OWlanNGMonitoringInterface( ONetworkInterface* iface, bool prismHeader )
+ :OMonitoringInterface( iface, prismHeader )
{
iface->setMonitoring( this );
@@ -911,6 +911,8 @@ void OWlanNGMonitoringInterface::setEnabled( bool b )
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 );
}
@@ -933,6 +935,6 @@ void OWlanNGMonitoringInterface::setChannel( int )
*======================================================================================*/
-OHostAPMonitoringInterface::OHostAPMonitoringInterface( ONetworkInterface* iface )
- :OMonitoringInterface( iface )
+OHostAPMonitoringInterface::OHostAPMonitoringInterface( ONetworkInterface* iface, bool prismHeader )
+ :OMonitoringInterface( iface, prismHeader )
{
iface->setMonitoring( this );
@@ -951,7 +953,9 @@ void OHostAPMonitoringInterface::setEnabled( bool b )
//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
@@ -972,6 +976,6 @@ QString OHostAPMonitoringInterface::name() const
*======================================================================================*/
-OOrinocoMonitoringInterface::OOrinocoMonitoringInterface( ONetworkInterface* iface )
- :OMonitoringInterface( iface )
+OOrinocoMonitoringInterface::OOrinocoMonitoringInterface( ONetworkInterface* iface, bool prismHeader )
+ :OMonitoringInterface( iface, prismHeader )
{
iface->setMonitoring( this );
@@ -986,5 +990,6 @@ OOrinocoMonitoringInterface::~OOrinocoMonitoringInterface()
void OOrinocoMonitoringInterface::setChannel( int c )
{
- _if->setPrivate( "monitor", 2, 1, c );
+ int monitorCode = _prismHeader ? 1 : 2;
+ _if->setPrivate( "monitor", 2, monitorCode, c );
}