summaryrefslogtreecommitdiff
path: root/libopie2/opienet
authormickeyl <mickeyl>2003-05-05 14:57:27 (UTC)
committer mickeyl <mickeyl>2003-05-05 14:57:27 (UTC)
commit29f5c6e6bcb8db0f0e26da25dbf34b2685c01526 (patch) (unidiff)
treea05e296ff11d532fd3d5fd092aade07474d1ba95 /libopie2/opienet
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') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opienet/onetwork.cpp31
-rw-r--r--libopie2/opienet/onetwork.h11
-rw-r--r--libopie2/opienet/opcap.cpp2
3 files changed, 25 insertions, 19 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
@@ -811,4 +811,4 @@ bool OWirelessNetworkInterface::wioctl( int call ) const
811 811
812OMonitoringInterface::OMonitoringInterface( ONetworkInterface* iface ) 812OMonitoringInterface::OMonitoringInterface( ONetworkInterface* iface, bool prismHeader )
813 :_if( static_cast<OWirelessNetworkInterface*>( iface ) ) 813 :_if( static_cast<OWirelessNetworkInterface*>( iface ) ), _prismHeader( prismHeader )
814{ 814{
@@ -847,4 +847,4 @@ void OMonitoringInterface::setEnabled( bool b )
847 847
848OCiscoMonitoringInterface::OCiscoMonitoringInterface( ONetworkInterface* iface ) 848OCiscoMonitoringInterface::OCiscoMonitoringInterface( ONetworkInterface* iface, bool prismHeader )
849 :OMonitoringInterface( iface ) 849 :OMonitoringInterface( iface, prismHeader )
850{ 850{
@@ -895,4 +895,4 @@ void OCiscoMonitoringInterface::setChannel( int )
895 895
896OWlanNGMonitoringInterface::OWlanNGMonitoringInterface( ONetworkInterface* iface ) 896OWlanNGMonitoringInterface::OWlanNGMonitoringInterface( ONetworkInterface* iface, bool prismHeader )
897 :OMonitoringInterface( iface ) 897 :OMonitoringInterface( iface, prismHeader )
898{ 898{
@@ -912,4 +912,6 @@ void OWlanNGMonitoringInterface::setEnabled( bool b )
912 QString enable = b ? "true" : "false"; 912 QString enable = b ? "true" : "false";
913 QString prism = _prismHeader ? "true" : "false";
913 QString cmd; 914 QString cmd;
914 cmd.sprintf( "$(which wlanctl-ng) %s lnxreq_wlansniff channel=%d enable=%s", (const char*) _if->name(), 1, (const char*) enable ); 915 cmd.sprintf( "$(which wlanctl-ng) %s lnxreq_wlansniff channel=%d enable=%s prismheader=%s",
916 (const char*) _if->name(), 1, (const char*) enable, (const char*) prism );
915 system( cmd ); 917 system( cmd );
@@ -934,4 +936,4 @@ void OWlanNGMonitoringInterface::setChannel( int )
934 936
935OHostAPMonitoringInterface::OHostAPMonitoringInterface( ONetworkInterface* iface ) 937OHostAPMonitoringInterface::OHostAPMonitoringInterface( ONetworkInterface* iface, bool prismHeader )
936 :OMonitoringInterface( iface ) 938 :OMonitoringInterface( iface, prismHeader )
937{ 939{
@@ -952,5 +954,7 @@ void OHostAPMonitoringInterface::setEnabled( bool b )
952 954
955 int monitorCode = _prismHeader ? 1 : 2;
956
953 if ( b ) 957 if ( b )
954 { 958 {
955 _if->setPrivate( "monitor", 1, 2 ); 959 _if->setPrivate( "monitor", 1, monitorCode );
956 } 960 }
@@ -973,4 +977,4 @@ QString OHostAPMonitoringInterface::name() const
973 977
974OOrinocoMonitoringInterface::OOrinocoMonitoringInterface( ONetworkInterface* iface ) 978OOrinocoMonitoringInterface::OOrinocoMonitoringInterface( ONetworkInterface* iface, bool prismHeader )
975 :OMonitoringInterface( iface ) 979 :OMonitoringInterface( iface, prismHeader )
976{ 980{
@@ -987,3 +991,4 @@ void OOrinocoMonitoringInterface::setChannel( int c )
987{ 991{
988 _if->setPrivate( "monitor", 2, 1, c ); 992 int monitorCode = _prismHeader ? 1 : 2;
993 _if->setPrivate( "monitor", 2, monitorCode, c );
989} 994}
diff --git a/libopie2/opienet/onetwork.h b/libopie2/opienet/onetwork.h
index 1b38d02..eb9d506 100644
--- a/libopie2/opienet/onetwork.h
+++ b/libopie2/opienet/onetwork.h
@@ -454,3 +454,3 @@ class OMonitoringInterface
454 OMonitoringInterface(); 454 OMonitoringInterface();
455 OMonitoringInterface( ONetworkInterface* ); 455 OMonitoringInterface( ONetworkInterface*, bool _prismHeader );
456 virtual ~OMonitoringInterface(); 456 virtual ~OMonitoringInterface();
@@ -466,2 +466,3 @@ class OMonitoringInterface
466 OWirelessNetworkInterface* _if; 466 OWirelessNetworkInterface* _if;
467 bool _prismHeader;
467 468
@@ -478,3 +479,3 @@ class OCiscoMonitoringInterface : public OMonitoringInterface
478 public: 479 public:
479 OCiscoMonitoringInterface( ONetworkInterface* ); 480 OCiscoMonitoringInterface( ONetworkInterface*, bool _prismHeader );
480 virtual ~OCiscoMonitoringInterface(); 481 virtual ~OCiscoMonitoringInterface();
@@ -494,3 +495,3 @@ class OWlanNGMonitoringInterface : public OMonitoringInterface
494 public: 495 public:
495 OWlanNGMonitoringInterface( ONetworkInterface* ); 496 OWlanNGMonitoringInterface( ONetworkInterface*, bool _prismHeader );
496 virtual ~OWlanNGMonitoringInterface(); 497 virtual ~OWlanNGMonitoringInterface();
@@ -511,3 +512,3 @@ class OHostAPMonitoringInterface : public OMonitoringInterface
511 public: 512 public:
512 OHostAPMonitoringInterface( ONetworkInterface* ); 513 OHostAPMonitoringInterface( ONetworkInterface*, bool _prismHeader );
513 virtual ~OHostAPMonitoringInterface(); 514 virtual ~OHostAPMonitoringInterface();
@@ -526,3 +527,3 @@ class OOrinocoMonitoringInterface : public OMonitoringInterface
526 public: 527 public:
527 OOrinocoMonitoringInterface( ONetworkInterface* ); 528 OOrinocoMonitoringInterface( ONetworkInterface*, bool _prismHeader );
528 virtual ~OOrinocoMonitoringInterface(); 529 virtual ~OOrinocoMonitoringInterface();
diff --git a/libopie2/opienet/opcap.cpp b/libopie2/opienet/opcap.cpp
index e2ab6d7..f6d05ea 100644
--- a/libopie2/opienet/opcap.cpp
+++ b/libopie2/opienet/opcap.cpp
@@ -73,3 +73,3 @@ OPacket::OPacket( int datalink, packetheaderstruct header, const unsigned char*
73 default: 73 default:
74 qWarning( "OPacket::OPacket(): Received Packet over unsupported datalink '%s'!", datalink ); 74 qWarning( "OPacket::OPacket(): Received Packet over unsupported datalink (type %d)!", datalink );
75 } 75 }