summaryrefslogtreecommitdiff
authormickeyl <mickeyl>2004-01-06 20:23:34 (UTC)
committer mickeyl <mickeyl>2004-01-06 20:23:34 (UTC)
commita513de3ae1549428595db1b6c70e4203b0a3dedd (patch) (unidiff)
treebc6838aad156f2cb499ce69d1703d4c33839cfba
parent543c349726a63798491e85cf0dda89e79c6183d1 (diff)
downloadopie-a513de3ae1549428595db1b6c70e4203b0a3dedd.zip
opie-a513de3ae1549428595db1b6c70e4203b0a3dedd.tar.gz
opie-a513de3ae1549428595db1b6c70e4203b0a3dedd.tar.bz2
display stations sending control frames
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/ChangeLog1
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiter.cpp41
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiter.h4
3 files changed, 38 insertions, 8 deletions
diff --git a/noncore/net/wellenreiter/ChangeLog b/noncore/net/wellenreiter/ChangeLog
index 755ed76..8bf8cc8 100644
--- a/noncore/net/wellenreiter/ChangeLog
+++ b/noncore/net/wellenreiter/ChangeLog
@@ -1,4 +1,5 @@
1 2004-??-?? Michael Lauer <mickey@Vanille.de> 1 2004-??-?? Michael Lauer <mickey@Vanille.de>
2 2
3 * Added parsing of control frames. Display stations sending them SSID "???" for now.
3 * Added command line option "-nocheck" to skip non-root and dhcp tests 4 * Added command line option "-nocheck" to skip non-root and dhcp tests
4 * Improved the speed reading the manufacturer list 5 * Improved the speed reading the manufacturer list
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp
index 5575d6e..45d7142 100644
--- a/noncore/net/wellenreiter/gui/wellenreiter.cpp
+++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp
@@ -160,6 +160,10 @@ void Wellenreiter::handleNotification( OPacket* p )
160 160
161 161
162void Wellenreiter::handleBeacon( OPacket* p, OWaveLanManagementPacket* beacon ) 162void Wellenreiter::handleManagementFrame( OPacket* p, OWaveLanManagementPacket* manage )
163{ 163{
164 if ( manage->managementType() != "Beacon" ) return; // only handling beacons at that time
165
166 OWaveLanManagementPacket* beacon = manage;
167
164 QString type; 168 QString type;
165 if ( beacon->canIBSS() ) 169 if ( beacon->canIBSS() )
@@ -184,5 +188,5 @@ void Wellenreiter::handleBeacon( OPacket* p, OWaveLanManagementPacket* beacon )
184 OWaveLanPacket* header = static_cast<OWaveLanPacket*>( p->child( "802.11" ) ); 188 OWaveLanPacket* header = static_cast<OWaveLanPacket*>( p->child( "802.11" ) );
185 189
186 GpsLocation loc( 0, 0 ); 190 GpsLocation loc( -111.111, -111.111 );
187 if ( configwindow->enableGPS->isChecked() ) 191 if ( configwindow->enableGPS->isChecked() )
188 { 192 {
@@ -207,4 +211,19 @@ void Wellenreiter::handleBeacon( OPacket* p, OWaveLanManagementPacket* beacon )
207 211
208 212
213void Wellenreiter::handleControlFrame( OPacket* p, OWaveLanControlPacket* control )
214{
215 OWaveLanPacket* header = static_cast<OWaveLanPacket*>( p->child( "802.11" ) );
216
217 if ( control->controlType() == "Acknowledge" )
218 {
219 netView()->addNewItem( "adhoc", "???", header->macAddress1(), false, -1, 0, GpsLocation( -111.111, -111.111 ) );
220 }
221 else
222 {
223 qDebug( "Wellenreiter::handleControlFrame - please handle %s in a future version! :D", (const char*) control->controlType() );
224 }
225}
226
227
209void Wellenreiter::handleWlanData( OPacket* p, OWaveLanDataPacket* data, OMacAddress& from, OMacAddress& to ) 228void Wellenreiter::handleWlanData( OPacket* p, OWaveLanDataPacket* data, OMacAddress& from, OMacAddress& to )
210{ 229{
@@ -242,5 +261,5 @@ void Wellenreiter::handleEthernetData( OPacket* p, OEthernetPacket* data, OMacAd
242 to = data->destinationAddress(); 261 to = data->destinationAddress();
243 262
244 netView()->addNewItem( "station", "<wired>", from, false, -1, 0, GpsLocation( 0, 0 ) ); 263 netView()->addNewItem( "station", "<wired>", from, false, -1, 0, GpsLocation( -111.111, -111.111 ) );
245} 264}
246 265
@@ -341,9 +360,17 @@ void Wellenreiter::receivePacket( OPacket* p )
341 } 360 }
342 361
343 // check if we received a beacon frame 362 // check for a management frame
344 OWaveLanManagementPacket* beacon = static_cast<OWaveLanManagementPacket*>( childIfToParse( p, "802.11 Management" ) ); 363 OWaveLanManagementPacket* manage = static_cast<OWaveLanManagementPacket*>( childIfToParse( p, "802.11 Management" ) );
345 if ( beacon && beacon->managementType() == "Beacon" ) 364 if ( manage )
365 {
366 handleManagementFrame( p, manage );
367 return;
368 }
369
370 // check for a control frame
371 OWaveLanControlPacket* control = static_cast<OWaveLanControlPacket*>( childIfToParse( p, "802.11 Control" ) );
372 if ( control )
346 { 373 {
347 handleBeacon( p, beacon ); 374 handleControlFrame( p, control );
348 return; 375 return;
349 } 376 }
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.h b/noncore/net/wellenreiter/gui/wellenreiter.h
index 58dd1fd..5414fda 100644
--- a/noncore/net/wellenreiter/gui/wellenreiter.h
+++ b/noncore/net/wellenreiter/gui/wellenreiter.h
@@ -28,4 +28,5 @@ class QPixmap;
28class OPacket; 28class OPacket;
29class OWaveLanManagementPacket; 29class OWaveLanManagementPacket;
30class OWaveLanControlPacket;
30class OWaveLanDataPacket; 31class OWaveLanDataPacket;
31class OEthernetPacket; 32class OEthernetPacket;
@@ -75,5 +76,6 @@ class Wellenreiter : public WellenreiterBase {
75 76
76 private: 77 private:
77 void handleBeacon( OPacket* p, OWaveLanManagementPacket* beacon ); 78 void handleManagementFrame( OPacket* p, OWaveLanManagementPacket* manage );
79 void handleControlFrame( OPacket* p, OWaveLanControlPacket* control );
78 void handleWlanData( OPacket* p, OWaveLanDataPacket* data, OMacAddress& from, OMacAddress& to ); 80 void handleWlanData( OPacket* p, OWaveLanDataPacket* data, OMacAddress& from, OMacAddress& to );
79 void handleEthernetData( OPacket* p, OEthernetPacket* data, OMacAddress& from, OMacAddress& to ); 81 void handleEthernetData( OPacket* p, OEthernetPacket* data, OMacAddress& from, OMacAddress& to );