-rw-r--r-- | libopie2/opienet/onetwork.cpp | 1 |
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 | |||
@@ -905,64 +905,65 @@ OWlanNGMonitoringInterface::OWlanNGMonitoringInterface( ONetworkInterface* iface | |||
905 | { | 905 | { |
906 | iface->setMonitoring( this ); | 906 | iface->setMonitoring( this ); |
907 | } | 907 | } |
908 | 908 | ||
909 | 909 | ||
910 | OWlanNGMonitoringInterface::~OWlanNGMonitoringInterface() | 910 | OWlanNGMonitoringInterface::~OWlanNGMonitoringInterface() |
911 | { | 911 | { |
912 | } | 912 | } |
913 | 913 | ||
914 | 914 | ||
915 | void OWlanNGMonitoringInterface::setEnabled( bool b ) | 915 | void 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 | ||
928 | QString OWlanNGMonitoringInterface::name() const | 928 | QString OWlanNGMonitoringInterface::name() const |
929 | { | 929 | { |
930 | return "wlan-ng"; | 930 | return "wlan-ng"; |
931 | } | 931 | } |
932 | 932 | ||
933 | 933 | ||
934 | void OWlanNGMonitoringInterface::setChannel( int ) | 934 | void 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 | ||
944 | OHostAPMonitoringInterface::OHostAPMonitoringInterface( ONetworkInterface* iface, bool prismHeader ) | 945 | OHostAPMonitoringInterface::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 | ||
950 | OHostAPMonitoringInterface::~OHostAPMonitoringInterface() | 951 | OHostAPMonitoringInterface::~OHostAPMonitoringInterface() |
951 | { | 952 | { |
952 | } | 953 | } |
953 | 954 | ||
954 | void OHostAPMonitoringInterface::setEnabled( bool b ) | 955 | void 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 ); |