author | mickeyl <mickeyl> | 2003-10-02 19:52:17 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-10-02 19:52:17 (UTC) |
commit | 0a9b6ef6ef6fd8d06d420fc25e8a67545815dc39 (patch) (unidiff) | |
tree | 31d9aa2694b2275303cea430934924cd8748dfa5 /libopie2 | |
parent | a5622a23c3083e1ff8a526713aed6a36aaf7a5bd (diff) | |
download | opie-0a9b6ef6ef6fd8d06d420fc25e8a67545815dc39.zip opie-0a9b6ef6ef6fd8d06d420fc25e8a67545815dc39.tar.gz opie-0a9b6ef6ef6fd8d06d420fc25e8a67545815dc39.tar.bz2 |
add note to self to look about automatic channel switching with wlan-ng devices
-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 | |||
@@ -841,192 +841,193 @@ bool OMonitoringInterface::enabled() const | |||
841 | { | 841 | { |
842 | return _if->monitorMode(); | 842 | return _if->monitorMode(); |
843 | } | 843 | } |
844 | 844 | ||
845 | 845 | ||
846 | void OMonitoringInterface::setEnabled( bool b ) | 846 | void OMonitoringInterface::setEnabled( bool b ) |
847 | { | 847 | { |
848 | } | 848 | } |
849 | 849 | ||
850 | 850 | ||
851 | /*====================================================================================== | 851 | /*====================================================================================== |
852 | * OCiscoMonitoringInterface | 852 | * OCiscoMonitoringInterface |
853 | *======================================================================================*/ | 853 | *======================================================================================*/ |
854 | 854 | ||
855 | OCiscoMonitoringInterface::OCiscoMonitoringInterface( ONetworkInterface* iface, bool prismHeader ) | 855 | OCiscoMonitoringInterface::OCiscoMonitoringInterface( ONetworkInterface* iface, bool prismHeader ) |
856 | :OMonitoringInterface( iface, prismHeader ) | 856 | :OMonitoringInterface( iface, prismHeader ) |
857 | { | 857 | { |
858 | iface->setMonitoring( this ); | 858 | iface->setMonitoring( this ); |
859 | } | 859 | } |
860 | 860 | ||
861 | 861 | ||
862 | OCiscoMonitoringInterface::~OCiscoMonitoringInterface() | 862 | OCiscoMonitoringInterface::~OCiscoMonitoringInterface() |
863 | { | 863 | { |
864 | } | 864 | } |
865 | 865 | ||
866 | 866 | ||
867 | void OCiscoMonitoringInterface::setEnabled( bool b ) | 867 | void OCiscoMonitoringInterface::setEnabled( bool b ) |
868 | { | 868 | { |
869 | QString fname; | 869 | QString fname; |
870 | fname.sprintf( "/proc/driver/aironet/%s", (const char*) _if->name() ); | 870 | fname.sprintf( "/proc/driver/aironet/%s", (const char*) _if->name() ); |
871 | QFile f( fname ); | 871 | QFile f( fname ); |
872 | if ( !f.exists() ) return; | 872 | if ( !f.exists() ) return; |
873 | 873 | ||
874 | if ( f.open( IO_WriteOnly ) ) | 874 | if ( f.open( IO_WriteOnly ) ) |
875 | { | 875 | { |
876 | QTextStream s( &f ); | 876 | QTextStream s( &f ); |
877 | s << "Mode: r"; | 877 | s << "Mode: r"; |
878 | s << "Mode: y"; | 878 | s << "Mode: y"; |
879 | s << "XmitPower: 1"; | 879 | s << "XmitPower: 1"; |
880 | } | 880 | } |
881 | 881 | ||
882 | // flushing and closing will be done automatically when f goes out of scope | 882 | // flushing and closing will be done automatically when f goes out of scope |
883 | } | 883 | } |
884 | 884 | ||
885 | 885 | ||
886 | QString OCiscoMonitoringInterface::name() const | 886 | QString OCiscoMonitoringInterface::name() const |
887 | { | 887 | { |
888 | return "cisco"; | 888 | return "cisco"; |
889 | } | 889 | } |
890 | 890 | ||
891 | 891 | ||
892 | void OCiscoMonitoringInterface::setChannel( int ) | 892 | void 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 | ||
903 | OWlanNGMonitoringInterface::OWlanNGMonitoringInterface( ONetworkInterface* iface, bool prismHeader ) | 903 | OWlanNGMonitoringInterface::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 | ||
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 ); |
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 | ||
978 | QString OHostAPMonitoringInterface::name() const | 979 | QString OHostAPMonitoringInterface::name() const |
979 | { | 980 | { |
980 | return "hostap"; | 981 | return "hostap"; |
981 | } | 982 | } |
982 | 983 | ||
983 | 984 | ||
984 | /*====================================================================================== | 985 | /*====================================================================================== |
985 | * OOrinocoNetworkInterface | 986 | * OOrinocoNetworkInterface |
986 | *======================================================================================*/ | 987 | *======================================================================================*/ |
987 | 988 | ||
988 | OOrinocoMonitoringInterface::OOrinocoMonitoringInterface( ONetworkInterface* iface, bool prismHeader ) | 989 | OOrinocoMonitoringInterface::OOrinocoMonitoringInterface( ONetworkInterface* iface, bool prismHeader ) |
989 | :OMonitoringInterface( iface, prismHeader ) | 990 | :OMonitoringInterface( iface, prismHeader ) |
990 | { | 991 | { |
991 | iface->setMonitoring( this ); | 992 | iface->setMonitoring( this ); |
992 | } | 993 | } |
993 | 994 | ||
994 | 995 | ||
995 | OOrinocoMonitoringInterface::~OOrinocoMonitoringInterface() | 996 | OOrinocoMonitoringInterface::~OOrinocoMonitoringInterface() |
996 | { | 997 | { |
997 | } | 998 | } |
998 | 999 | ||
999 | 1000 | ||
1000 | void OOrinocoMonitoringInterface::setChannel( int c ) | 1001 | void OOrinocoMonitoringInterface::setChannel( int c ) |
1001 | { | 1002 | { |
1002 | int monitorCode = _prismHeader ? 1 : 2; | 1003 | int monitorCode = _prismHeader ? 1 : 2; |
1003 | _if->setPrivate( "monitor", 2, monitorCode, c ); | 1004 | _if->setPrivate( "monitor", 2, monitorCode, c ); |
1004 | } | 1005 | } |
1005 | 1006 | ||
1006 | 1007 | ||
1007 | void OOrinocoMonitoringInterface::setEnabled( bool b ) | 1008 | void OOrinocoMonitoringInterface::setEnabled( bool b ) |
1008 | { | 1009 | { |
1009 | // IW_MODE_MONITOR was introduced in Wireless Extensions Version 15 | 1010 | // IW_MODE_MONITOR was introduced in Wireless Extensions Version 15 |
1010 | // Wireless Extensions < Version 15 need iwpriv commandos for monitoring | 1011 | // Wireless Extensions < Version 15 need iwpriv commandos for monitoring |
1011 | 1012 | ||
1012 | #if WIRELESS_EXT > 14 | 1013 | #if WIRELESS_EXT > 14 |
1013 | if ( b ) | 1014 | if ( b ) |
1014 | _if->setMode( "monitor" ); // IW_MODE_MONITOR doesn't support prism header | 1015 | _if->setMode( "monitor" ); // IW_MODE_MONITOR doesn't support prism header |
1015 | else | 1016 | else |
1016 | _if->setMode( "managed" ); | 1017 | _if->setMode( "managed" ); |
1017 | #else | 1018 | #else |
1018 | if ( b ) | 1019 | if ( b ) |
1019 | { | 1020 | { |
1020 | setChannel( 1 ); | 1021 | setChannel( 1 ); |
1021 | } | 1022 | } |
1022 | else | 1023 | else |
1023 | { | 1024 | { |
1024 | _if->setPrivate( "monitor", 2, 0, 0 ); | 1025 | _if->setPrivate( "monitor", 2, 0, 0 ); |
1025 | } | 1026 | } |
1026 | #endif | 1027 | #endif |
1027 | } | 1028 | } |
1028 | 1029 | ||
1029 | 1030 | ||
1030 | QString OOrinocoMonitoringInterface::name() const | 1031 | QString OOrinocoMonitoringInterface::name() const |
1031 | { | 1032 | { |
1032 | return "orinoco"; | 1033 | return "orinoco"; |