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.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/libopie2/opienet/onetwork.cpp b/libopie2/opienet/onetwork.cpp
index 95c813f..6a9280f 100644
--- a/libopie2/opienet/onetwork.cpp
+++ b/libopie2/opienet/onetwork.cpp
@@ -1,30 +1,27 @@
1/* 1/*
2                 This file is part of the Opie Project 2                 This file is part of the Opie Project
3              Copyright (C) 2003 by the Wellenreiter team: 3              Copyright (C) 2003 by Michael 'Mickey' Lauer <mickey@Vanille.de>
4 Martin J. Muench <mjm@remote-exploit.org>
5 Max Moser <mmo@remote-exploit.org
6 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de>
7 =. 4 =.
8 .=l. 5 .=l.
9           .>+-= 6           .>+-=
10 _;:,     .>    :=|. This program is free software; you can 7 _;:,     .>    :=|. This program is free software; you can
11.> <`_,   >  .   <= redistribute it and/or modify it under 8.> <`_,   >  .   <= redistribute it and/or modify it under
12:`=1 )Y*s>-.--   : the terms of the GNU Library General Public 9:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
13.="- .-=="i,     .._ License as published by the Free Software 10.="- .-=="i,     .._ License as published by the Free Software
14 - .   .-<_>     .<> Foundation; either version 2 of the License, 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
15     ._= =}       : or (at your option) any later version. 12     ._= =}       : or (at your option) any later version.
16    .%`+i>       _;_. 13    .%`+i>       _;_.
17    .i_,=:_.      -<s. This program is distributed in the hope that 14    .i_,=:_.      -<s. This program is distributed in the hope that
18     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
19    : ..    .:,     . . . without even the implied warranty of 16    : ..    .:,     . . . without even the implied warranty of
20    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
21  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
22..}^=.=       =       ; Library General Public License for more 19..}^=.=       =       ; Library General Public License for more
23++=   -.     .`     .: details. 20++=   -.     .`     .: details.
24 :     =  ...= . :.=- 21 :     =  ...= . :.=-
25 -.   .:....=;==+<; You should have received a copy of the GNU 22 -.   .:....=;==+<; You should have received a copy of the GNU
26  -_. . .   )=.  = Library General Public License along with 23  -_. . .   )=.  = Library General Public License along with
27    --        :-=` this library; see the file COPYING.LIB. 24    --        :-=` this library; see the file COPYING.LIB.
28 If not, write to the Free Software Foundation, 25 If not, write to the Free Software Foundation,
29 Inc., 59 Temple Place - Suite 330, 26 Inc., 59 Temple Place - Suite 330,
30 Boston, MA 02111-1307, USA. 27 Boston, MA 02111-1307, USA.
@@ -929,48 +926,49 @@ OStationList* OWirelessNetworkInterface::scanNetwork()
929 { 926 {
930 qDebug( "SIOCGIWFREQ" ); 927 qDebug( "SIOCGIWFREQ" );
931 stations->last()->channel = _channels[ static_cast<int>(double( we->u.freq.m ) * pow( 10.0, we->u.freq.e ) / 1000000) ]; 928 stations->last()->channel = _channels[ static_cast<int>(double( we->u.freq.m ) * pow( 10.0, we->u.freq.e ) / 1000000) ];
932 break; 929 break;
933 } 930 }
934 case SIOCGIWESSID: 931 case SIOCGIWESSID:
935 { 932 {
936 qDebug( "SIOCGIWESSID" ); 933 qDebug( "SIOCGIWESSID" );
937 stations->last()->ssid = we->u.essid.pointer; 934 stations->last()->ssid = we->u.essid.pointer;
938 break; 935 break;
939 } 936 }
940 case SIOCGIWSENS: qDebug( "SIOCGIWSENS" ); break; 937 case SIOCGIWSENS: qDebug( "SIOCGIWSENS" ); break;
941 case SIOCGIWENCODE: qDebug( "SIOCGIWENCODE" ); break; 938 case SIOCGIWENCODE: qDebug( "SIOCGIWENCODE" ); break;
942 case IWEVTXDROP: qDebug( "IWEVTXDROP" ); break; /* Packet dropped to excessive retry */ 939 case IWEVTXDROP: qDebug( "IWEVTXDROP" ); break; /* Packet dropped to excessive retry */
943 case IWEVQUAL: qDebug( "IWEVQUAL" ); break; /* Quality part of statistics (scan) */ 940 case IWEVQUAL: qDebug( "IWEVQUAL" ); break; /* Quality part of statistics (scan) */
944 case IWEVCUSTOM: qDebug( "IWEVCUSTOM" ); break; /* Driver specific ascii string */ 941 case IWEVCUSTOM: qDebug( "IWEVCUSTOM" ); break; /* Driver specific ascii string */
945 case IWEVREGISTERED: qDebug( "IWEVREGISTERED" ); break; /* Discovered a new node (AP mode) */ 942 case IWEVREGISTERED: qDebug( "IWEVREGISTERED" ); break; /* Discovered a new node (AP mode) */
946 case IWEVEXPIRED: qDebug( "IWEVEXPIRED" ); break; /* Expired a node (AP mode) */ 943 case IWEVEXPIRED: qDebug( "IWEVEXPIRED" ); break; /* Expired a node (AP mode) */
947 default: qDebug( "unhandled event" ); 944 default: qDebug( "unhandled event" );
948 } 945 }
949 946
950 offset += we->len; 947 offset += we->len;
951 we = (struct iw_event*) &buffer[offset]; 948 we = (struct iw_event*) &buffer[offset];
952 } 949 }
950 return stations;
953 951
954 return stations; 952 return stations;
955 953
956 } 954 }
957 else 955 else
958 { 956 {
959 qDebug( " - no results (timeout) :(" ); 957 qDebug( " - no results (timeout) :(" );
960 return stations; 958 return stations;
961 } 959 }
962} 960}
963 961
964 962
965bool OWirelessNetworkInterface::wioctl( int call, struct iwreq& iwreq ) const 963bool OWirelessNetworkInterface::wioctl( int call, struct iwreq& iwreq ) const
966{ 964{
967 #ifndef NODEBUG 965 #ifndef NODEBUG
968 int result = ::ioctl( _sfd, call, &iwreq ); 966 int result = ::ioctl( _sfd, call, &iwreq );
969 if ( result == -1 ) 967 if ( result == -1 )
970 qDebug( "ONetworkInterface::wioctl (%s) call %s (0x%04X) - Status: Failed: %d (%s)", name(), (const char*) debugmapper->map( call ), call, result, strerror( errno ) ); 968 qDebug( "ONetworkInterface::wioctl (%s) call %s (0x%04X) - Status: Failed: %d (%s)", name(), (const char*) debugmapper->map( call ), call, result, strerror( errno ) );
971 else 969 else
972 qDebug( "ONetworkInterface::wioctl (%s) call %s (0x%04X) - Status: Ok.", name(), (const char*) debugmapper->map( call ), call ); 970 qDebug( "ONetworkInterface::wioctl (%s) call %s (0x%04X) - Status: Ok.", name(), (const char*) debugmapper->map( call ), call );
973 return ( result != -1 ); 971 return ( result != -1 );
974 #else 972 #else
975 return ::ioctl( _sfd, call, &iwreq ) != -1; 973 return ::ioctl( _sfd, call, &iwreq ) != -1;
976 #endif 974 #endif