summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opienet/onetwork.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/libopie2/opienet/onetwork.cpp b/libopie2/opienet/onetwork.cpp
index 751d841..1f529d2 100644
--- a/libopie2/opienet/onetwork.cpp
+++ b/libopie2/opienet/onetwork.cpp
@@ -889,96 +889,97 @@ QString OCiscoMonitoringInterface::name() const
889} 889}
890 890
891 891
892void OCiscoMonitoringInterface::setChannel( int ) 892void OCiscoMonitoringInterface::setChannel( int )
893{ 893{
894 // cisco devices automatically switch channels when in monitor mode 894 // cisco devices automatically switch channels when in monitor mode
895} 895}
896 896
897 897
898/*====================================================================================== 898/*======================================================================================
899 * OWlanNGMonitoringInterface 899 * OWlanNGMonitoringInterface
900 *======================================================================================*/ 900 *======================================================================================*/
901 901
902 902
903OWlanNGMonitoringInterface::OWlanNGMonitoringInterface( ONetworkInterface* iface, bool prismHeader ) 903OWlanNGMonitoringInterface::OWlanNGMonitoringInterface( ONetworkInterface* iface, bool prismHeader )
904 :OMonitoringInterface( iface, prismHeader ) 904 :OMonitoringInterface( iface, prismHeader )
905{ 905{
906 iface->setMonitoring( this ); 906 iface->setMonitoring( this );
907} 907}
908 908
909 909
910OWlanNGMonitoringInterface::~OWlanNGMonitoringInterface() 910OWlanNGMonitoringInterface::~OWlanNGMonitoringInterface()
911{ 911{
912} 912}
913 913
914 914
915void OWlanNGMonitoringInterface::setEnabled( bool b ) 915void OWlanNGMonitoringInterface::setEnabled( bool b )
916{ 916{
917 //FIXME: do nothing if its already in the same mode 917 //FIXME: do nothing if its already in the same mode
918 918
919 QString enable = b ? "true" : "false"; 919 QString enable = b ? "true" : "false";
920 QString prism = _prismHeader ? "true" : "false"; 920 QString prism = _prismHeader ? "true" : "false";
921 QString cmd; 921 QString cmd;
922 cmd.sprintf( "$(which wlanctl-ng) %s lnxreq_wlansniff channel=%d enable=%s prismheader=%s", 922 cmd.sprintf( "$(which wlanctl-ng) %s lnxreq_wlansniff channel=%d enable=%s prismheader=%s",
923 (const char*) _if->name(), 1, (const char*) enable, (const char*) prism ); 923 (const char*) _if->name(), 1, (const char*) enable, (const char*) prism );
924 system( cmd ); 924 system( cmd );
925} 925}
926 926
927 927
928QString OWlanNGMonitoringInterface::name() const 928QString OWlanNGMonitoringInterface::name() const
929{ 929{
930 return "wlan-ng"; 930 return "wlan-ng";
931} 931}
932 932
933 933
934void OWlanNGMonitoringInterface::setChannel( int ) 934void OWlanNGMonitoringInterface::setChannel( int )
935{ 935{
936 // wlan-ng devices automatically switch channels when in monitor mode 936 // wlan-ng devices automatically switch channels when in monitor mode
937 // NOTE: The above note no longer seems to be true for recent driver versions!
937} 938}
938 939
939 940
940/*====================================================================================== 941/*======================================================================================
941 * OHostAPMonitoringInterface 942 * OHostAPMonitoringInterface
942 *======================================================================================*/ 943 *======================================================================================*/
943 944
944OHostAPMonitoringInterface::OHostAPMonitoringInterface( ONetworkInterface* iface, bool prismHeader ) 945OHostAPMonitoringInterface::OHostAPMonitoringInterface( ONetworkInterface* iface, bool prismHeader )
945 :OMonitoringInterface( iface, prismHeader ) 946 :OMonitoringInterface( iface, prismHeader )
946{ 947{
947 iface->setMonitoring( this ); 948 iface->setMonitoring( this );
948} 949}
949 950
950OHostAPMonitoringInterface::~OHostAPMonitoringInterface() 951OHostAPMonitoringInterface::~OHostAPMonitoringInterface()
951{ 952{
952} 953}
953 954
954void OHostAPMonitoringInterface::setEnabled( bool b ) 955void OHostAPMonitoringInterface::setEnabled( bool b )
955{ 956{
956 // IW_MODE_MONITOR was introduced in Wireless Extensions Version 15 957 // IW_MODE_MONITOR was introduced in Wireless Extensions Version 15
957 // Wireless Extensions < Version 15 need iwpriv commandos for monitoring 958 // Wireless Extensions < Version 15 need iwpriv commandos for monitoring
958 959
959 #if WIRELESS_EXT > 14 960 #if WIRELESS_EXT > 14
960 if ( b ) 961 if ( b )
961 _if->setMode( "monitor" ); // IW_MODE_MONITOR doesn't support prism header 962 _if->setMode( "monitor" ); // IW_MODE_MONITOR doesn't support prism header
962 else 963 else
963 _if->setMode( "managed" ); 964 _if->setMode( "managed" );
964 #else 965 #else
965 int monitorCode = _prismHeader ? 1 : 2; 966 int monitorCode = _prismHeader ? 1 : 2;
966 if ( b ) 967 if ( b )
967 { 968 {
968 _if->setPrivate( "monitor", 1, monitorCode ); 969 _if->setPrivate( "monitor", 1, monitorCode );
969 } 970 }
970 else 971 else
971 { 972 {
972 _if->setPrivate( "monitor", 1, 0 ); 973 _if->setPrivate( "monitor", 1, 0 );
973 } 974 }
974 #endif 975 #endif
975} 976}
976 977
977 978
978QString OHostAPMonitoringInterface::name() const 979QString OHostAPMonitoringInterface::name() const
979{ 980{
980 return "hostap"; 981 return "hostap";
981} 982}
982 983
983 984
984/*====================================================================================== 985/*======================================================================================