Diffstat (limited to 'libopie2/opienet/onetwork.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opienet/onetwork.cpp | 38 |
1 files changed, 33 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 | |||
@@ -40,2 +40,3 @@ | |||
40 | #include <qtextstream.h> | 40 | #include <qtextstream.h> |
41 | #include <qapplication.h> | ||
41 | 42 | ||
@@ -55,2 +56,3 @@ | |||
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> |
@@ -493,2 +495,10 @@ bool OWirelessNetworkInterface::isAssociated() const | |||
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 |
@@ -908,3 +918,2 @@ OStationList* OWirelessNetworkInterface::scanNetwork() | |||
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 ) |
@@ -914,3 +923,2 @@ OStationList* OWirelessNetworkInterface::scanNetwork() | |||
914 | } | 923 | } |
915 | #endif | ||
916 | tv.tv_sec = 0; | 924 | tv.tv_sec = 0; |
@@ -1129,3 +1137,6 @@ OStationList* OWirelessNetworkInterface::scanNetwork() | |||
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; |
@@ -1140,6 +1151,23 @@ OStationList* OWirelessNetworkInterface::scanNetwork() | |||
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 */ |