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
@@ -2,2 +2,3 @@
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
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
@@ -161,4 +161,8 @@ void Wellenreiter::handleNotification( OPacket* p )
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;
@@ -185,3 +189,3 @@ void Wellenreiter::handleBeacon( OPacket* p, OWaveLanManagementPacket* beacon )
185 189
186 GpsLocation loc( 0, 0 ); 190 GpsLocation loc( -111.111, -111.111 );
187 if ( configwindow->enableGPS->isChecked() ) 191 if ( configwindow->enableGPS->isChecked() )
@@ -208,2 +212,17 @@ void Wellenreiter::handleBeacon( OPacket* p, OWaveLanManagementPacket* beacon )
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 )
@@ -243,3 +262,3 @@ void Wellenreiter::handleEthernetData( OPacket* p, OEthernetPacket* data, OMacAd
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}
@@ -342,7 +361,15 @@ void Wellenreiter::receivePacket( OPacket* p )
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;
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
@@ -29,2 +29,3 @@ class OPacket;
29class OWaveLanManagementPacket; 29class OWaveLanManagementPacket;
30class OWaveLanControlPacket;
30class OWaveLanDataPacket; 31class OWaveLanDataPacket;
@@ -76,3 +77,4 @@ class Wellenreiter : public WellenreiterBase {
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 );