summaryrefslogtreecommitdiff
path: root/libopie2/opienet/onetwork.cpp
Unidiff
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
806 806
807 807
808/*====================================================================================== 808/*======================================================================================
809 * OMonitoringInterface 809 * OMonitoringInterface
810 *======================================================================================*/ 810 *======================================================================================*/
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{
815} 815}
816 816
817 817
818OMonitoringInterface::~OMonitoringInterface() 818OMonitoringInterface::~OMonitoringInterface()
819{ 819{
@@ -842,14 +842,14 @@ void OMonitoringInterface::setEnabled( bool b )
842 842
843 843
844/*====================================================================================== 844/*======================================================================================
845 * OCiscoMonitoringInterface 845 * OCiscoMonitoringInterface
846 *======================================================================================*/ 846 *======================================================================================*/
847 847
848OCiscoMonitoringInterface::OCiscoMonitoringInterface( ONetworkInterface* iface ) 848OCiscoMonitoringInterface::OCiscoMonitoringInterface( ONetworkInterface* iface, bool prismHeader )
849 :OMonitoringInterface( iface ) 849 :OMonitoringInterface( iface, prismHeader )
850{ 850{
851 iface->setMonitoring( this ); 851 iface->setMonitoring( this );
852} 852}
853 853
854 854
855OCiscoMonitoringInterface::~OCiscoMonitoringInterface() 855OCiscoMonitoringInterface::~OCiscoMonitoringInterface()
@@ -890,14 +890,14 @@ void OCiscoMonitoringInterface::setChannel( int )
890 890
891/*====================================================================================== 891/*======================================================================================
892 * OWlanNGMonitoringInterface 892 * OWlanNGMonitoringInterface
893 *======================================================================================*/ 893 *======================================================================================*/
894 894
895 895
896OWlanNGMonitoringInterface::OWlanNGMonitoringInterface( ONetworkInterface* iface ) 896OWlanNGMonitoringInterface::OWlanNGMonitoringInterface( ONetworkInterface* iface, bool prismHeader )
897 :OMonitoringInterface( iface ) 897 :OMonitoringInterface( iface, prismHeader )
898{ 898{
899 iface->setMonitoring( this ); 899 iface->setMonitoring( this );
900} 900}
901 901
902 902
903OWlanNGMonitoringInterface::~OWlanNGMonitoringInterface() 903OWlanNGMonitoringInterface::~OWlanNGMonitoringInterface()
@@ -907,14 +907,16 @@ OWlanNGMonitoringInterface::~OWlanNGMonitoringInterface()
907 907
908void OWlanNGMonitoringInterface::setEnabled( bool b ) 908void OWlanNGMonitoringInterface::setEnabled( bool b )
909{ 909{
910 //FIXME: do nothing if its already in the same mode 910 //FIXME: do nothing if its already in the same mode
911 911
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 );
916} 918}
917 919
918 920
919QString OWlanNGMonitoringInterface::name() const 921QString OWlanNGMonitoringInterface::name() const
920{ 922{
@@ -929,14 +931,14 @@ void OWlanNGMonitoringInterface::setChannel( int )
929 931
930 932
931/*====================================================================================== 933/*======================================================================================
932 * OHostAPMonitoringInterface 934 * OHostAPMonitoringInterface
933 *======================================================================================*/ 935 *======================================================================================*/
934 936
935OHostAPMonitoringInterface::OHostAPMonitoringInterface( ONetworkInterface* iface ) 937OHostAPMonitoringInterface::OHostAPMonitoringInterface( ONetworkInterface* iface, bool prismHeader )
936 :OMonitoringInterface( iface ) 938 :OMonitoringInterface( iface, prismHeader )
937{ 939{
938 iface->setMonitoring( this ); 940 iface->setMonitoring( this );
939} 941}
940 942
941OHostAPMonitoringInterface::~OHostAPMonitoringInterface() 943OHostAPMonitoringInterface::~OHostAPMonitoringInterface()
942{ 944{
@@ -947,15 +949,17 @@ void OHostAPMonitoringInterface::setEnabled( bool b )
947 // IW_MODE_MONITOR was introduced in Wireless Extensions Version 15 949 // IW_MODE_MONITOR was introduced in Wireless Extensions Version 15
948 // Wireless Extensions < Version 15 need iwpriv commandos for monitoring 950 // Wireless Extensions < Version 15 need iwpriv commandos for monitoring
949 951
950 //TODO: check wireless extensions version on runtime and use 952 //TODO: check wireless extensions version on runtime and use
951 //TODO: SIOCSIWMODE( IW_MODE_MONITOR ) if running on WE >= 15 953 //TODO: SIOCSIWMODE( IW_MODE_MONITOR ) if running on WE >= 15
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 }
957 else 961 else
958 { 962 {
959 _if->setPrivate( "monitor", 1, 0 ); 963 _if->setPrivate( "monitor", 1, 0 );
960 } 964 }
961} 965}
@@ -968,27 +972,28 @@ QString OHostAPMonitoringInterface::name() const
968 972
969 973
970/*====================================================================================== 974/*======================================================================================
971 * OOrinocoNetworkInterface 975 * OOrinocoNetworkInterface
972 *======================================================================================*/ 976 *======================================================================================*/
973 977
974OOrinocoMonitoringInterface::OOrinocoMonitoringInterface( ONetworkInterface* iface ) 978OOrinocoMonitoringInterface::OOrinocoMonitoringInterface( ONetworkInterface* iface, bool prismHeader )
975 :OMonitoringInterface( iface ) 979 :OMonitoringInterface( iface, prismHeader )
976{ 980{
977 iface->setMonitoring( this ); 981 iface->setMonitoring( this );
978} 982}
979 983
980 984
981OOrinocoMonitoringInterface::~OOrinocoMonitoringInterface() 985OOrinocoMonitoringInterface::~OOrinocoMonitoringInterface()
982{ 986{
983} 987}
984 988
985 989
986void OOrinocoMonitoringInterface::setChannel( int c ) 990void 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}
990 995
991 996
992void OOrinocoMonitoringInterface::setEnabled( bool b ) 997void OOrinocoMonitoringInterface::setEnabled( bool b )
993{ 998{
994 if ( b ) 999 if ( b )