author | skyhusker <skyhusker> | 2005-04-20 10:20:20 (UTC) |
---|---|---|
committer | skyhusker <skyhusker> | 2005-04-20 10:20:20 (UTC) |
commit | f6b9c85c09692f298ffa5ee95e1f171a9e158502 (patch) (unidiff) | |
tree | d147bc5b67eb9bc3c7f042a4fa2fb1868d37faef | |
parent | 6ec538f7e4a84e4f76addaf558c415b7dffc659b (diff) | |
download | opie-f6b9c85c09692f298ffa5ee95e1f171a9e158502.zip opie-f6b9c85c09692f298ffa5ee95e1f171a9e158502.tar.gz opie-f6b9c85c09692f298ffa5ee95e1f171a9e158502.tar.bz2 |
Added function to set the associated AP address. Some improvements to scanNetwork(): read the signal quality, AP rates and fix channel reading when driver reports values < 1000.
-rw-r--r-- | libopie2/opienet/onetwork.cpp | 38 | ||||
-rw-r--r-- | libopie2/opienet/onetwork.h | 3 | ||||
-rw-r--r-- | libopie2/opienet/ostation.h | 2 |
3 files changed, 38 insertions, 5 deletions
diff --git a/libopie2/opienet/onetwork.cpp b/libopie2/opienet/onetwork.cpp index 546be9e..0a74019 100644 --- a/libopie2/opienet/onetwork.cpp +++ b/libopie2/opienet/onetwork.cpp | |||
@@ -17,63 +17,65 @@ | |||
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
19 | ..}^=.= = ; Library General Public License for more | 19 | ..}^=.= = ; Library General Public License for more |
20 | ++= -. .` .: details. | 20 | ++= -. .` .: details. |
21 | : = ...= . :.=- | 21 | : = ...= . :.=- |
22 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; You should have received a copy of the GNU |
23 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
26 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
28 | 28 | ||
29 | */ | 29 | */ |
30 | 30 | ||
31 | /* OPIE */ | 31 | /* OPIE */ |
32 | 32 | ||
33 | #include <opie2/onetwork.h> | 33 | #include <opie2/onetwork.h> |
34 | #include <opie2/ostation.h> | 34 | #include <opie2/ostation.h> |
35 | #include <opie2/odebug.h> | 35 | #include <opie2/odebug.h> |
36 | 36 | ||
37 | /* QT */ | 37 | /* QT */ |
38 | 38 | ||
39 | #include <qfile.h> | 39 | #include <qfile.h> |
40 | #include <qtextstream.h> | 40 | #include <qtextstream.h> |
41 | #include <qapplication.h> | ||
41 | 42 | ||
42 | /* UNIX */ | 43 | /* UNIX */ |
43 | 44 | ||
44 | #include <assert.h> | 45 | #include <assert.h> |
45 | #include <arpa/inet.h> | 46 | #include <arpa/inet.h> |
46 | #include <errno.h> | 47 | #include <errno.h> |
47 | #include <string.h> | 48 | #include <string.h> |
48 | #include <stdlib.h> | 49 | #include <stdlib.h> |
49 | #include <math.h> | 50 | #include <math.h> |
50 | #include <sys/ioctl.h> | 51 | #include <sys/ioctl.h> |
51 | #include <sys/socket.h> | 52 | #include <sys/socket.h> |
52 | #include <sys/types.h> | 53 | #include <sys/types.h> |
53 | #include <unistd.h> | 54 | #include <unistd.h> |
54 | #include <linux/sockios.h> | 55 | #include <linux/sockios.h> |
55 | #include <net/if_arp.h> | 56 | #include <net/if_arp.h> |
57 | #include <net/ethernet.h> | ||
56 | #include <stdarg.h> | 58 | #include <stdarg.h> |
57 | 59 | ||
58 | #ifndef NODEBUG | 60 | #ifndef NODEBUG |
59 | #include <opie2/odebugmapper.h> | 61 | #include <opie2/odebugmapper.h> |
60 | 62 | ||
61 | using namespace Opie::Core; | 63 | using namespace Opie::Core; |
62 | using namespace Opie::Net::Internal; | 64 | using namespace Opie::Net::Internal; |
63 | DebugMapper* debugmapper = new DebugMapper(); | 65 | DebugMapper* debugmapper = new DebugMapper(); |
64 | #endif | 66 | #endif |
65 | 67 | ||
66 | /*====================================================================================== | 68 | /*====================================================================================== |
67 | * ONetwork | 69 | * ONetwork |
68 | *======================================================================================*/ | 70 | *======================================================================================*/ |
69 | 71 | ||
70 | namespace Opie { | 72 | namespace Opie { |
71 | namespace Net { | 73 | namespace Net { |
72 | ONetwork* ONetwork::_instance = 0; | 74 | ONetwork* ONetwork::_instance = 0; |
73 | 75 | ||
74 | ONetwork::ONetwork() | 76 | ONetwork::ONetwork() |
75 | { | 77 | { |
76 | odebug << "ONetwork::ONetwork()" << oendl; | 78 | odebug << "ONetwork::ONetwork()" << oendl; |
77 | odebug << "ONetwork: This code has been compiled against Wireless Extensions V" << WIRELESS_EXT << oendl; | 79 | odebug << "ONetwork: This code has been compiled against Wireless Extensions V" << WIRELESS_EXT << oendl; |
78 | synchronize(); | 80 | synchronize(); |
79 | } | 81 | } |
@@ -470,48 +472,56 @@ OWirelessNetworkInterface::~OWirelessNetworkInterface() | |||
470 | 472 | ||
471 | struct iwreq& OWirelessNetworkInterface::iwr() const | 473 | struct iwreq& OWirelessNetworkInterface::iwr() const |
472 | { | 474 | { |
473 | return _iwr; | 475 | return _iwr; |
474 | } | 476 | } |
475 | 477 | ||
476 | 478 | ||
477 | void OWirelessNetworkInterface::init() | 479 | void OWirelessNetworkInterface::init() |
478 | { | 480 | { |
479 | odebug << "OWirelessNetworkInterface::init()" << oendl; | 481 | odebug << "OWirelessNetworkInterface::init()" << oendl; |
480 | memset( &_iwr, 0, sizeof( struct iwreq ) ); | 482 | memset( &_iwr, 0, sizeof( struct iwreq ) ); |
481 | buildInformation(); | 483 | buildInformation(); |
482 | buildPrivateList(); | 484 | buildPrivateList(); |
483 | dumpInformation(); | 485 | dumpInformation(); |
484 | } | 486 | } |
485 | 487 | ||
486 | 488 | ||
487 | bool OWirelessNetworkInterface::isAssociated() const | 489 | bool OWirelessNetworkInterface::isAssociated() const |
488 | { | 490 | { |
489 | //FIXME: handle different modes | 491 | //FIXME: handle different modes |
490 | return !(associatedAP() == OMacAddress::unknown); | 492 | return !(associatedAP() == OMacAddress::unknown); |
491 | } | 493 | } |
492 | 494 | ||
493 | 495 | ||
496 | void OWirelessNetworkInterface::setAssociatedAP( const OMacAddress& mac ) const | ||
497 | { | ||
498 | _iwr.u.ap_addr.sa_family = ARPHRD_ETHER; | ||
499 | ::memcpy(_iwr.u.ap_addr.sa_data, mac.native(), ETH_ALEN); | ||
500 | wioctl( SIOCSIWAP ); | ||
501 | } | ||
502 | |||
503 | |||
494 | OMacAddress OWirelessNetworkInterface::associatedAP() const | 504 | OMacAddress OWirelessNetworkInterface::associatedAP() const |
495 | { | 505 | { |
496 | if ( ioctl( SIOCGIWAP ) ) | 506 | if ( ioctl( SIOCGIWAP ) ) |
497 | return (const unsigned char*) &_ifr.ifr_hwaddr.sa_data[0]; | 507 | return (const unsigned char*) &_ifr.ifr_hwaddr.sa_data[0]; |
498 | else | 508 | else |
499 | return OMacAddress::unknown; | 509 | return OMacAddress::unknown; |
500 | } | 510 | } |
501 | 511 | ||
502 | 512 | ||
503 | void OWirelessNetworkInterface::buildInformation() | 513 | void OWirelessNetworkInterface::buildInformation() |
504 | { | 514 | { |
505 | //ML: If you listen carefully enough, you can hear lots of WLAN drivers suck | 515 | //ML: If you listen carefully enough, you can hear lots of WLAN drivers suck |
506 | //ML: The HostAP drivers need more than sizeof struct_iw range to complete | 516 | //ML: The HostAP drivers need more than sizeof struct_iw range to complete |
507 | //ML: SIOCGIWRANGE otherwise they fail with "Invalid Argument Length". | 517 | //ML: SIOCGIWRANGE otherwise they fail with "Invalid Argument Length". |
508 | //ML: The Wlan-NG drivers on the otherside fail (segfault!) if you allocate | 518 | //ML: The Wlan-NG drivers on the otherside fail (segfault!) if you allocate |
509 | //ML: _too much_ space. This is damn shitty crap *sigh* | 519 | //ML: _too much_ space. This is damn shitty crap *sigh* |
510 | //ML: We allocate a large memory region in RAM and check whether the | 520 | //ML: We allocate a large memory region in RAM and check whether the |
511 | //ML: driver pollutes this extra space. The complaint will be made on stdout, | 521 | //ML: driver pollutes this extra space. The complaint will be made on stdout, |
512 | //ML: so please forward this... | 522 | //ML: so please forward this... |
513 | 523 | ||
514 | struct iwreq wrq; | 524 | struct iwreq wrq; |
515 | int len = sizeof( struct iw_range )*2; | 525 | int len = sizeof( struct iw_range )*2; |
516 | char *buffer = (char*) malloc( len ); | 526 | char *buffer = (char*) malloc( len ); |
517 | //FIXME: Validate if we actually got the memory block | 527 | //FIXME: Validate if we actually got the memory block |
@@ -885,55 +895,53 @@ OStationList* OWirelessNetworkInterface::scanNetwork() | |||
885 | odebug << "ONetworkInterface::scanNetwork() - scan started." << oendl; | 895 | odebug << "ONetworkInterface::scanNetwork() - scan started." << oendl; |
886 | 896 | ||
887 | bool results = false; | 897 | bool results = false; |
888 | struct timeval tv; | 898 | struct timeval tv; |
889 | tv.tv_sec = 0; | 899 | tv.tv_sec = 0; |
890 | tv.tv_usec = 250000; // initial timeout ~ 250ms | 900 | tv.tv_usec = 250000; // initial timeout ~ 250ms |
891 | char buffer[IW_SCAN_MAX_DATA]; | 901 | char buffer[IW_SCAN_MAX_DATA]; |
892 | 902 | ||
893 | while ( !results && timeout > 0 ) | 903 | while ( !results && timeout > 0 ) |
894 | { | 904 | { |
895 | timeout -= tv.tv_usec; | 905 | timeout -= tv.tv_usec; |
896 | select( 0, 0, 0, 0, &tv ); | 906 | select( 0, 0, 0, 0, &tv ); |
897 | 907 | ||
898 | _iwr.u.data.pointer = &buffer[0]; | 908 | _iwr.u.data.pointer = &buffer[0]; |
899 | _iwr.u.data.flags = 0; | 909 | _iwr.u.data.flags = 0; |
900 | _iwr.u.data.length = sizeof buffer; | 910 | _iwr.u.data.length = sizeof buffer; |
901 | if ( wioctl( SIOCGIWSCAN ) ) | 911 | if ( wioctl( SIOCGIWSCAN ) ) |
902 | { | 912 | { |
903 | results = true; | 913 | results = true; |
904 | continue; | 914 | continue; |
905 | } | 915 | } |
906 | else if ( errno == EAGAIN) | 916 | else if ( errno == EAGAIN) |
907 | { | 917 | { |
908 | odebug << "ONetworkInterface::scanNetwork() - scan in progress..." << oendl; | 918 | odebug << "ONetworkInterface::scanNetwork() - scan in progress..." << oendl; |
909 | #if 0 | ||
910 | if ( qApp ) | 919 | if ( qApp ) |
911 | { | 920 | { |
912 | qApp->processEvents( 100 ); | 921 | qApp->processEvents( 100 ); |
913 | continue; | 922 | continue; |
914 | } | 923 | } |
915 | #endif | ||
916 | tv.tv_sec = 0; | 924 | tv.tv_sec = 0; |
917 | tv.tv_usec = 100000; | 925 | tv.tv_usec = 100000; |
918 | continue; | 926 | continue; |
919 | } | 927 | } |
920 | } | 928 | } |
921 | 929 | ||
922 | odebug << "ONetworkInterface::scanNetwork() - scan finished." << oendl; | 930 | odebug << "ONetworkInterface::scanNetwork() - scan finished." << oendl; |
923 | 931 | ||
924 | if ( results ) | 932 | if ( results ) |
925 | { | 933 | { |
926 | odebug << " - result length = " << _iwr.u.data.length << oendl; | 934 | odebug << " - result length = " << _iwr.u.data.length << oendl; |
927 | if ( !_iwr.u.data.length ) | 935 | if ( !_iwr.u.data.length ) |
928 | { | 936 | { |
929 | odebug << " - no results (empty neighbourhood)" << oendl; | 937 | odebug << " - no results (empty neighbourhood)" << oendl; |
930 | return stations; | 938 | return stations; |
931 | } | 939 | } |
932 | 940 | ||
933 | odebug << " - results are in!" << oendl; | 941 | odebug << " - results are in!" << oendl; |
934 | dumpBytes( (const unsigned char*) &buffer[0], _iwr.u.data.length ); | 942 | dumpBytes( (const unsigned char*) &buffer[0], _iwr.u.data.length ); |
935 | 943 | ||
936 | // parse results | 944 | // parse results |
937 | struct iw_event iwe; | 945 | struct iw_event iwe; |
938 | struct iw_stream_descr stream; | 946 | struct iw_stream_descr stream; |
939 | unsigned int cmd_index, event_type, event_len; | 947 | unsigned int cmd_index, event_type, event_len; |
@@ -1106,63 +1114,83 @@ OStationList* OWirelessNetworkInterface::scanNetwork() | |||
1106 | } | 1114 | } |
1107 | } | 1115 | } |
1108 | 1116 | ||
1109 | struct iw_event *we = &iwe; | 1117 | struct iw_event *we = &iwe; |
1110 | //------ | 1118 | //------ |
1111 | odebug << " - reading next event... cmd=" << we->cmd << ", len=" << we->len << oendl; | 1119 | odebug << " - reading next event... cmd=" << we->cmd << ", len=" << we->len << oendl; |
1112 | switch (we->cmd) | 1120 | switch (we->cmd) |
1113 | { | 1121 | { |
1114 | case SIOCGIWAP: | 1122 | case SIOCGIWAP: |
1115 | { | 1123 | { |
1116 | odebug << "SIOCGIWAP" << oendl; | 1124 | odebug << "SIOCGIWAP" << oendl; |
1117 | stations->append( new OStation() ); | 1125 | stations->append( new OStation() ); |
1118 | stations->last()->macAddress = (const unsigned char*) &we->u.ap_addr.sa_data[0]; | 1126 | stations->last()->macAddress = (const unsigned char*) &we->u.ap_addr.sa_data[0]; |
1119 | break; | 1127 | break; |
1120 | } | 1128 | } |
1121 | case SIOCGIWMODE: | 1129 | case SIOCGIWMODE: |
1122 | { | 1130 | { |
1123 | odebug << "SIOCGIWMODE" << oendl; | 1131 | odebug << "SIOCGIWMODE" << oendl; |
1124 | stations->last()->type = modeToString( we->u.mode ); | 1132 | stations->last()->type = modeToString( we->u.mode ); |
1125 | break; | 1133 | break; |
1126 | } | 1134 | } |
1127 | case SIOCGIWFREQ: | 1135 | case SIOCGIWFREQ: |
1128 | { | 1136 | { |
1129 | odebug << "SIOCGIWFREQ" << oendl; | 1137 | odebug << "SIOCGIWFREQ" << oendl; |
1130 | stations->last()->channel = _channels[ static_cast<int>(double( we->u.freq.m ) * pow( 10.0, we->u.freq.e ) / 1000000) ]; | 1138 | if ( we->u.freq.m > 1000 ) |
1139 | stations->last()->channel = _channels[ static_cast<int>(double( we->u.freq.m ) * pow( 10.0, we->u.freq.e ) / 1000000) ]; | ||
1140 | else | ||
1141 | stations->last()->channel = static_cast<int>(((double) we->u.freq.m) * pow( 10.0, we->u.freq.e )); | ||
1131 | break; | 1142 | break; |
1132 | } | 1143 | } |
1133 | case SIOCGIWESSID: | 1144 | case SIOCGIWESSID: |
1134 | { | 1145 | { |
1135 | odebug << "SIOCGIWESSID" << oendl; | 1146 | odebug << "SIOCGIWESSID" << oendl; |
1136 | we->u.essid.length = '\0'; // make sure it is zero terminated | 1147 | we->u.essid.length = '\0'; // make sure it is zero terminated |
1137 | stations->last()->ssid = static_cast<const char*> (we->u.essid.pointer); | 1148 | stations->last()->ssid = static_cast<const char*> (we->u.essid.pointer); |
1138 | odebug << "ESSID: " << stations->last()->ssid << oendl; | 1149 | odebug << "ESSID: " << stations->last()->ssid << oendl; |
1139 | break; | 1150 | break; |
1140 | } | 1151 | } |
1152 | case IWEVQUAL: | ||
1153 | { | ||
1154 | odebug << "IWEVQUAL" << oendl; | ||
1155 | stations->last()->level = static_cast<int>(we->u.qual.level); | ||
1156 | break; /* Quality part of statistics (scan) */ | ||
1157 | } | ||
1158 | case SIOCGIWENCODE: | ||
1159 | { | ||
1160 | odebug << "SIOCGIWENCODE" << oendl; | ||
1161 | stations->last()->encrypted = !(we->u.data.flags & IW_ENCODE_DISABLED); | ||
1162 | break; | ||
1163 | } | ||
1164 | |||
1165 | case SIOCGIWRATE: | ||
1166 | { | ||
1167 | odebug << "SIOCGIWRATE" << oendl; | ||
1168 | stations->last()->rates.append(we->u.bitrate.value); | ||
1169 | break; | ||
1170 | } | ||
1141 | case SIOCGIWSENS: odebug << "SIOCGIWSENS" << oendl; break; | 1171 | case SIOCGIWSENS: odebug << "SIOCGIWSENS" << oendl; break; |
1142 | case SIOCGIWENCODE: odebug << "SIOCGIWENCODE" << oendl; break; | ||
1143 | case IWEVTXDROP: odebug << "IWEVTXDROP" << oendl; break; /* Packet dropped to excessive retry */ | 1172 | case IWEVTXDROP: odebug << "IWEVTXDROP" << oendl; break; /* Packet dropped to excessive retry */ |
1144 | case IWEVQUAL: odebug << "IWEVQUAL" << oendl; break; /* Quality part of statistics (scan) */ | ||
1145 | case IWEVCUSTOM: odebug << "IWEVCUSTOM" << oendl; break; /* Driver specific ascii string */ | 1173 | case IWEVCUSTOM: odebug << "IWEVCUSTOM" << oendl; break; /* Driver specific ascii string */ |
1146 | case IWEVREGISTERED: odebug << "IWEVREGISTERED" << oendl; break; /* Discovered a new node (AP mode) */ | 1174 | case IWEVREGISTERED: odebug << "IWEVREGISTERED" << oendl; break; /* Discovered a new node (AP mode) */ |
1147 | case IWEVEXPIRED: odebug << "IWEVEXPIRED" << oendl; break; /* Expired a node (AP mode) */ | 1175 | case IWEVEXPIRED: odebug << "IWEVEXPIRED" << oendl; break; /* Expired a node (AP mode) */ |
1148 | default: odebug << "unhandled event" << oendl; | 1176 | default: odebug << "unhandled event" << oendl; |
1149 | } | 1177 | } |
1150 | 1178 | ||
1151 | } while (true); | 1179 | } while (true); |
1152 | } | 1180 | } |
1153 | else | 1181 | else |
1154 | { | 1182 | { |
1155 | odebug << " - no results (timeout) :(" << oendl; | 1183 | odebug << " - no results (timeout) :(" << oendl; |
1156 | } | 1184 | } |
1157 | return stations; | 1185 | return stations; |
1158 | } | 1186 | } |
1159 | 1187 | ||
1160 | 1188 | ||
1161 | int OWirelessNetworkInterface::signalStrength() const | 1189 | int OWirelessNetworkInterface::signalStrength() const |
1162 | { | 1190 | { |
1163 | iw_statistics stat; | 1191 | iw_statistics stat; |
1164 | ::memset( &stat, 0, sizeof stat ); | 1192 | ::memset( &stat, 0, sizeof stat ); |
1165 | _iwr.u.data.pointer = (char*) &stat; | 1193 | _iwr.u.data.pointer = (char*) &stat; |
1166 | _iwr.u.data.flags = 0; | 1194 | _iwr.u.data.flags = 0; |
1167 | _iwr.u.data.length = sizeof stat; | 1195 | _iwr.u.data.length = sizeof stat; |
1168 | 1196 | ||
diff --git a/libopie2/opienet/onetwork.h b/libopie2/opienet/onetwork.h index 4d9912d..fa9f39f 100644 --- a/libopie2/opienet/onetwork.h +++ b/libopie2/opienet/onetwork.h | |||
@@ -392,48 +392,51 @@ class OWirelessNetworkInterface : public ONetworkInterface | |||
392 | virtual OChannelHopper* channelHopper() const; | 392 | virtual OChannelHopper* channelHopper() const; |
393 | /** | 393 | /** |
394 | * Set the station @a nickname. | 394 | * Set the station @a nickname. |
395 | */ | 395 | */ |
396 | virtual void setNickName( const QString& nickname ); | 396 | virtual void setNickName( const QString& nickname ); |
397 | /** | 397 | /** |
398 | * @returns the current station nickname. | 398 | * @returns the current station nickname. |
399 | */ | 399 | */ |
400 | virtual QString nickName() const; | 400 | virtual QString nickName() const; |
401 | /** | 401 | /** |
402 | * Invoke the private IOCTL @a command with a @number of parameters on the network interface. | 402 | * Invoke the private IOCTL @a command with a @number of parameters on the network interface. |
403 | * @see OPrivateIOCTL | 403 | * @see OPrivateIOCTL |
404 | */ | 404 | */ |
405 | virtual void setPrivate( const QString& command, int number, ... ); | 405 | virtual void setPrivate( const QString& command, int number, ... ); |
406 | /** | 406 | /** |
407 | * @returns true if the interface is featuring the private IOCTL @command. | 407 | * @returns true if the interface is featuring the private IOCTL @command. |
408 | */ | 408 | */ |
409 | virtual bool hasPrivate( const QString& command ); | 409 | virtual bool hasPrivate( const QString& command ); |
410 | virtual void getPrivate( const QString& command ); //FIXME: Implement and document this | 410 | virtual void getPrivate( const QString& command ); //FIXME: Implement and document this |
411 | /** | 411 | /** |
412 | * @returns true if the interface is associated to an access point | 412 | * @returns true if the interface is associated to an access point |
413 | * @note: This information is only valid if the interface is in managed mode. | 413 | * @note: This information is only valid if the interface is in managed mode. |
414 | */ | 414 | */ |
415 | virtual bool isAssociated() const; | 415 | virtual bool isAssociated() const; |
416 | /** Set the @a mac associated AP address. | ||
417 | */ | ||
418 | virtual void setAssociatedAP( const OMacAddress& mac ) const; | ||
416 | /** | 419 | /** |
417 | * @returns the MAC address of the Access Point if the device is in infrastructure mode. | 420 | * @returns the MAC address of the Access Point if the device is in infrastructure mode. |
418 | * @returns a (more or less random) cell ID address if the device is in adhoc mode. | 421 | * @returns a (more or less random) cell ID address if the device is in adhoc mode. |
419 | */ | 422 | */ |
420 | virtual OMacAddress associatedAP() const; | 423 | virtual OMacAddress associatedAP() const; |
421 | /** | 424 | /** |
422 | * Set the @a ssid (Service Set ID) string. This is used to decide | 425 | * Set the @a ssid (Service Set ID) string. This is used to decide |
423 | * which network to associate with (use "any" to let the driver decide). | 426 | * which network to associate with (use "any" to let the driver decide). |
424 | */ | 427 | */ |
425 | virtual void setSSID( const QString& ssid ); | 428 | virtual void setSSID( const QString& ssid ); |
426 | /** | 429 | /** |
427 | * @returns the current SSID (Service Set ID). | 430 | * @returns the current SSID (Service Set ID). |
428 | */ | 431 | */ |
429 | virtual QString SSID() const; | 432 | virtual QString SSID() const; |
430 | /** | 433 | /** |
431 | * Perform scanning the wireless network neighbourhood. | 434 | * Perform scanning the wireless network neighbourhood. |
432 | * @note: UNSTABLE API - UNDER CONSTRUCTION - DON'T USE! | 435 | * @note: UNSTABLE API - UNDER CONSTRUCTION - DON'T USE! |
433 | */ | 436 | */ |
434 | virtual OStationList* scanNetwork(); | 437 | virtual OStationList* scanNetwork(); |
435 | /** | 438 | /** |
436 | * @return signal strength to associated neighbour (in percent). | 439 | * @return signal strength to associated neighbour (in percent). |
437 | * In infrastructure mode, this is the signal strength of the Access Point. | 440 | * In infrastructure mode, this is the signal strength of the Access Point. |
438 | * In other modes the result is driver dependent. | 441 | * In other modes the result is driver dependent. |
439 | */ | 442 | */ |
diff --git a/libopie2/opienet/ostation.h b/libopie2/opienet/ostation.h index 5219d92..86c9a52 100644 --- a/libopie2/opienet/ostation.h +++ b/libopie2/opienet/ostation.h | |||
@@ -16,68 +16,70 @@ | |||
16 | : .. .:, . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
19 | ..}^=.= = ; Library General Public License for more | 19 | ..}^=.= = ; Library General Public License for more |
20 | ++= -. .` .: details. | 20 | ++= -. .` .: details. |
21 | : = ...= . :.=- | 21 | : = ...= . :.=- |
22 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; You should have received a copy of the GNU |
23 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
26 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
28 | 28 | ||
29 | */ | 29 | */ |
30 | 30 | ||
31 | #ifndef OSTATION_H | 31 | #ifndef OSTATION_H |
32 | #define OSTATION_H | 32 | #define OSTATION_H |
33 | 33 | ||
34 | #include <opie2/onetutils.h> | 34 | #include <opie2/onetutils.h> |
35 | 35 | ||
36 | #include <qlist.h> | 36 | #include <qlist.h> |
37 | #include <qstring.h> | 37 | #include <qstring.h> |
38 | #include <qhostaddress.h> | 38 | #include <qhostaddress.h> |
39 | #include <qobject.h> | 39 | #include <qobject.h> |
40 | #include <qvaluelist.h> | ||
40 | 41 | ||
41 | #include <sys/types.h> | 42 | #include <sys/types.h> |
42 | 43 | ||
43 | namespace Opie { | 44 | namespace Opie { |
44 | namespace Net { | 45 | namespace Net { |
45 | 46 | ||
46 | class OStation; | 47 | class OStation; |
47 | 48 | ||
48 | 49 | ||
49 | typedef QList<OStation> OStationList; | 50 | typedef QList<OStation> OStationList; |
50 | 51 | ||
51 | /*====================================================================================== | 52 | /*====================================================================================== |
52 | * OStation | 53 | * OStation |
53 | *======================================================================================*/ | 54 | *======================================================================================*/ |
54 | 55 | ||
55 | class OStation | 56 | class OStation |
56 | { | 57 | { |
57 | public: | 58 | public: |
58 | OStation(); | 59 | OStation(); |
59 | ~OStation(); | 60 | ~OStation(); |
60 | 61 | ||
61 | void dump(); | 62 | void dump(); |
62 | 63 | ||
63 | /* Ethernet */ | 64 | /* Ethernet */ |
64 | QString type; | 65 | QString type; |
65 | OMacAddress macAddress; | 66 | OMacAddress macAddress; |
66 | QHostAddress ipAddress; | 67 | QHostAddress ipAddress; |
67 | 68 | ||
68 | /* WaveLan */ | 69 | /* WaveLan */ |
69 | QString ssid; | 70 | QString ssid; |
70 | OMacAddress apAddress; | 71 | OMacAddress apAddress; |
71 | int channel; | 72 | int channel; |
72 | int level; | 73 | int level; |
73 | bool encrypted; | 74 | bool encrypted; |
75 | QValueList <int> rates; | ||
74 | private: | 76 | private: |
75 | class Private; | 77 | class Private; |
76 | Private *d; | 78 | Private *d; |
77 | }; | 79 | }; |
78 | 80 | ||
79 | } | 81 | } |
80 | } | 82 | } |
81 | 83 | ||
82 | #endif // OSTATION_H | 84 | #endif // OSTATION_H |
83 | 85 | ||