author | mickeyl <mickeyl> | 2004-01-06 20:23:34 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-01-06 20:23:34 (UTC) |
commit | a513de3ae1549428595db1b6c70e4203b0a3dedd (patch) (side-by-side diff) | |
tree | bc6838aad156f2cb499ce69d1703d4c33839cfba | |
parent | 543c349726a63798491e85cf0dda89e79c6183d1 (diff) | |
download | opie-a513de3ae1549428595db1b6c70e4203b0a3dedd.zip opie-a513de3ae1549428595db1b6c70e4203b0a3dedd.tar.gz opie-a513de3ae1549428595db1b6c70e4203b0a3dedd.tar.bz2 |
display stations sending control frames
-rw-r--r-- | noncore/net/wellenreiter/ChangeLog | 1 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 41 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.h | 4 |
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 @@ + * Added parsing of control frames. Display stations sending them SSID "???" for now. * 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 ) -void Wellenreiter::handleBeacon( OPacket* p, OWaveLanManagementPacket* beacon ) +void Wellenreiter::handleManagementFrame( OPacket* p, OWaveLanManagementPacket* manage ) { + if ( manage->managementType() != "Beacon" ) return; // only handling beacons at that time + + OWaveLanManagementPacket* beacon = manage; + QString type; @@ -185,3 +189,3 @@ void Wellenreiter::handleBeacon( OPacket* p, OWaveLanManagementPacket* beacon ) - GpsLocation loc( 0, 0 ); + GpsLocation loc( -111.111, -111.111 ); if ( configwindow->enableGPS->isChecked() ) @@ -208,2 +212,17 @@ void Wellenreiter::handleBeacon( OPacket* p, OWaveLanManagementPacket* beacon ) +void Wellenreiter::handleControlFrame( OPacket* p, OWaveLanControlPacket* control ) +{ + OWaveLanPacket* header = static_cast<OWaveLanPacket*>( p->child( "802.11" ) ); + + if ( control->controlType() == "Acknowledge" ) + { + netView()->addNewItem( "adhoc", "???", header->macAddress1(), false, -1, 0, GpsLocation( -111.111, -111.111 ) ); + } + else + { + qDebug( "Wellenreiter::handleControlFrame - please handle %s in a future version! :D", (const char*) control->controlType() ); + } +} + + void Wellenreiter::handleWlanData( OPacket* p, OWaveLanDataPacket* data, OMacAddress& from, OMacAddress& to ) @@ -243,3 +262,3 @@ void Wellenreiter::handleEthernetData( OPacket* p, OEthernetPacket* data, OMacAd - netView()->addNewItem( "station", "<wired>", from, false, -1, 0, GpsLocation( 0, 0 ) ); + netView()->addNewItem( "station", "<wired>", from, false, -1, 0, GpsLocation( -111.111, -111.111 ) ); } @@ -342,7 +361,15 @@ void Wellenreiter::receivePacket( OPacket* p ) - // check if we received a beacon frame - OWaveLanManagementPacket* beacon = static_cast<OWaveLanManagementPacket*>( childIfToParse( p, "802.11 Management" ) ); - if ( beacon && beacon->managementType() == "Beacon" ) + // check for a management frame + OWaveLanManagementPacket* manage = static_cast<OWaveLanManagementPacket*>( childIfToParse( p, "802.11 Management" ) ); + if ( manage ) + { + handleManagementFrame( p, manage ); + return; + } + + // check for a control frame + OWaveLanControlPacket* control = static_cast<OWaveLanControlPacket*>( childIfToParse( p, "802.11 Control" ) ); + if ( control ) { - handleBeacon( p, beacon ); + handleControlFrame( p, control ); 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; class OWaveLanManagementPacket; +class OWaveLanControlPacket; class OWaveLanDataPacket; @@ -76,3 +77,4 @@ class Wellenreiter : public WellenreiterBase { private: - void handleBeacon( OPacket* p, OWaveLanManagementPacket* beacon ); + void handleManagementFrame( OPacket* p, OWaveLanManagementPacket* manage ); + void handleControlFrame( OPacket* p, OWaveLanControlPacket* control ); void handleWlanData( OPacket* p, OWaveLanDataPacket* data, OMacAddress& from, OMacAddress& to ); |