Diffstat (limited to 'noncore/net/wellenreiter/gui') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 41 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.h | 4 |
2 files changed, 37 insertions, 8 deletions
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 | ||
162 | void Wellenreiter::handleBeacon( OPacket* p, OWaveLanManagementPacket* beacon ) | 162 | void 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 | ||
213 | void 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 | |||
209 | void Wellenreiter::handleWlanData( OPacket* p, OWaveLanDataPacket* data, OMacAddress& from, OMacAddress& to ) | 228 | void 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; | |||
29 | class OWaveLanManagementPacket; | 29 | class OWaveLanManagementPacket; |
30 | class OWaveLanControlPacket; | ||
30 | class OWaveLanDataPacket; | 31 | class 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 ); |