Diffstat (limited to 'noncore/net/wellenreiter/gui/wellenreiter.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp index 45d7142..25632f3 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp | |||
@@ -160,128 +160,128 @@ void Wellenreiter::handleNotification( OPacket* p ) | |||
160 | 160 | ||
161 | 161 | ||
162 | void Wellenreiter::handleManagementFrame( OPacket* p, OWaveLanManagementPacket* manage ) | 162 | void Wellenreiter::handleManagementFrame( OPacket* p, OWaveLanManagementPacket* manage ) |
163 | { | 163 | { |
164 | if ( manage->managementType() != "Beacon" ) return; // only handling beacons at that time | 164 | if ( manage->managementType() != "Beacon" ) return; // only handling beacons at that time |
165 | 165 | ||
166 | OWaveLanManagementPacket* beacon = manage; | 166 | OWaveLanManagementPacket* beacon = manage; |
167 | 167 | ||
168 | QString type; | 168 | QString type; |
169 | if ( beacon->canIBSS() ) | 169 | if ( beacon->canIBSS() ) |
170 | { | 170 | { |
171 | type = "adhoc"; | 171 | type = "adhoc"; |
172 | } | 172 | } |
173 | else if ( beacon->canESS() ) | 173 | else if ( beacon->canESS() ) |
174 | { | 174 | { |
175 | type = "managed"; | 175 | type = "managed"; |
176 | } | 176 | } |
177 | else | 177 | else |
178 | { | 178 | { |
179 | qWarning( "Wellenreiter::invalid frame [possibly noise] detected!" ); | 179 | qWarning( "Wellenreiter::invalid frame [possibly noise] detected!" ); |
180 | return; | 180 | return; |
181 | } | 181 | } |
182 | 182 | ||
183 | OWaveLanManagementSSID* ssid = static_cast<OWaveLanManagementSSID*>( p->child( "802.11 SSID" ) ); | 183 | OWaveLanManagementSSID* ssid = static_cast<OWaveLanManagementSSID*>( p->child( "802.11 SSID" ) ); |
184 | QString essid = ssid ? ssid->ID() : QString("<unknown>"); | 184 | QString essid = ssid ? ssid->ID( true /* decloak */ ) : QString("<unknown>"); |
185 | OWaveLanManagementDS* ds = static_cast<OWaveLanManagementDS*>( p->child( "802.11 DS" ) ); | 185 | OWaveLanManagementDS* ds = static_cast<OWaveLanManagementDS*>( p->child( "802.11 DS" ) ); |
186 | int channel = ds ? ds->channel() : -1; | 186 | int channel = ds ? ds->channel() : -1; |
187 | 187 | ||
188 | OWaveLanPacket* header = static_cast<OWaveLanPacket*>( p->child( "802.11" ) ); | 188 | OWaveLanPacket* header = static_cast<OWaveLanPacket*>( p->child( "802.11" ) ); |
189 | 189 | ||
190 | GpsLocation loc( -111.111, -111.111 ); | 190 | GpsLocation loc( -111, -111 ); |
191 | if ( configwindow->enableGPS->isChecked() ) | 191 | if ( configwindow->enableGPS->isChecked() ) |
192 | { | 192 | { |
193 | // TODO: add check if GPS is working!? | 193 | // TODO: add check if GPS is working!? |
194 | qDebug( "Wellenreiter::gathering GPS data..." ); | 194 | qDebug( "Wellenreiter::gathering GPS data..." ); |
195 | loc = gps->position(); | 195 | loc = gps->position(); |
196 | qDebug( "Wellenreiter::GPS data received is ( %f , %f ) - dms string = '%s'", loc.latitude(), loc.longitude(), loc.dmsPosition().latin1() ); | 196 | qDebug( "Wellenreiter::GPS data received is ( %f , %f ) - dms string = '%s'", loc.latitude(), loc.longitude(), loc.dmsPosition().latin1() ); |
197 | } | 197 | } |
198 | 198 | ||
199 | netView()->addNewItem( type, essid, header->macAddress2(), beacon->canPrivacy(), channel, 0, loc ); | 199 | netView()->addNewItem( type, essid, header->macAddress2(), beacon->canPrivacy(), channel, 0, loc ); |
200 | 200 | ||
201 | // update graph window | 201 | // update graph window |
202 | if ( ds ) | 202 | if ( ds ) |
203 | { | 203 | { |
204 | OPrismHeaderPacket* prism = static_cast<OPrismHeaderPacket*>( p->child( "Prism" ) ); | 204 | OPrismHeaderPacket* prism = static_cast<OPrismHeaderPacket*>( p->child( "Prism" ) ); |
205 | if ( prism ) | 205 | if ( prism ) |
206 | graphwindow->traffic( ds->channel(), prism->signalStrength() ); | 206 | graphwindow->traffic( ds->channel(), prism->signalStrength() ); |
207 | else | 207 | else |
208 | graphwindow->traffic( ds->channel(), 95 ); | 208 | graphwindow->traffic( ds->channel(), 95 ); |
209 | } | 209 | } |
210 | } | 210 | } |
211 | 211 | ||
212 | 212 | ||
213 | void Wellenreiter::handleControlFrame( OPacket* p, OWaveLanControlPacket* control ) | 213 | void Wellenreiter::handleControlFrame( OPacket* p, OWaveLanControlPacket* control ) |
214 | { | 214 | { |
215 | OWaveLanPacket* header = static_cast<OWaveLanPacket*>( p->child( "802.11" ) ); | 215 | OWaveLanPacket* header = static_cast<OWaveLanPacket*>( p->child( "802.11" ) ); |
216 | 216 | ||
217 | if ( control->controlType() == "Acknowledge" ) | 217 | if ( control->controlType() == "Acknowledge" ) |
218 | { | 218 | { |
219 | netView()->addNewItem( "adhoc", "???", header->macAddress1(), false, -1, 0, GpsLocation( -111.111, -111.111 ) ); | 219 | netView()->addNewItem( "adhoc", "???", header->macAddress1(), false, -1, 0, GpsLocation( -111, -111 ) ); |
220 | } | 220 | } |
221 | else | 221 | else |
222 | { | 222 | { |
223 | qDebug( "Wellenreiter::handleControlFrame - please handle %s in a future version! :D", (const char*) control->controlType() ); | 223 | qDebug( "Wellenreiter::handleControlFrame - please handle %s in a future version! :D", (const char*) control->controlType() ); |
224 | } | 224 | } |
225 | } | 225 | } |
226 | 226 | ||
227 | 227 | ||
228 | void Wellenreiter::handleWlanData( OPacket* p, OWaveLanDataPacket* data, OMacAddress& from, OMacAddress& to ) | 228 | void Wellenreiter::handleWlanData( OPacket* p, OWaveLanDataPacket* data, OMacAddress& from, OMacAddress& to ) |
229 | { | 229 | { |
230 | OWaveLanPacket* wlan = (OWaveLanPacket*) p->child( "802.11" ); | 230 | OWaveLanPacket* wlan = (OWaveLanPacket*) p->child( "802.11" ); |
231 | if ( wlan->fromDS() && !wlan->toDS() ) | 231 | if ( wlan->fromDS() && !wlan->toDS() ) |
232 | { | 232 | { |
233 | netView()->fromDStraffic( wlan->macAddress3(), wlan->macAddress1(), wlan->macAddress2() ); | 233 | netView()->fromDStraffic( wlan->macAddress3(), wlan->macAddress1(), wlan->macAddress2() ); |
234 | from = wlan->macAddress3(); | 234 | from = wlan->macAddress3(); |
235 | to = wlan->macAddress2(); | 235 | to = wlan->macAddress2(); |
236 | } | 236 | } |
237 | else if ( !wlan->fromDS() && wlan->toDS() ) | 237 | else if ( !wlan->fromDS() && wlan->toDS() ) |
238 | { | 238 | { |
239 | netView()->toDStraffic( wlan->macAddress2(), wlan->macAddress3(), wlan->macAddress1() ); | 239 | netView()->toDStraffic( wlan->macAddress2(), wlan->macAddress3(), wlan->macAddress1() ); |
240 | from = wlan->macAddress2(); | 240 | from = wlan->macAddress2(); |
241 | to = wlan->macAddress3(); | 241 | to = wlan->macAddress3(); |
242 | } | 242 | } |
243 | else if ( wlan->fromDS() && wlan->toDS() ) | 243 | else if ( wlan->fromDS() && wlan->toDS() ) |
244 | { | 244 | { |
245 | netView()->WDStraffic( wlan->macAddress4(), wlan->macAddress3(), wlan->macAddress1(), wlan->macAddress2() ); | 245 | netView()->WDStraffic( wlan->macAddress4(), wlan->macAddress3(), wlan->macAddress1(), wlan->macAddress2() ); |
246 | from = wlan->macAddress4(); | 246 | from = wlan->macAddress4(); |
247 | to = wlan->macAddress3(); | 247 | to = wlan->macAddress3(); |
248 | } | 248 | } |
249 | else | 249 | else |
250 | { | 250 | { |
251 | netView()->IBSStraffic( wlan->macAddress2(), wlan->macAddress1(), wlan->macAddress3() ); | 251 | netView()->IBSStraffic( wlan->macAddress2(), wlan->macAddress1(), wlan->macAddress3() ); |
252 | from = wlan->macAddress2(); | 252 | from = wlan->macAddress2(); |
253 | to = wlan->macAddress1(); | 253 | to = wlan->macAddress1(); |
254 | } | 254 | } |
255 | } | 255 | } |
256 | 256 | ||
257 | 257 | ||
258 | void Wellenreiter::handleEthernetData( OPacket* p, OEthernetPacket* data, OMacAddress& from, OMacAddress& to ) | 258 | void Wellenreiter::handleEthernetData( OPacket* p, OEthernetPacket* data, OMacAddress& from, OMacAddress& to ) |
259 | { | 259 | { |
260 | from = data->sourceAddress(); | 260 | from = data->sourceAddress(); |
261 | to = data->destinationAddress(); | 261 | to = data->destinationAddress(); |
262 | 262 | ||
263 | netView()->addNewItem( "station", "<wired>", from, false, -1, 0, GpsLocation( -111.111, -111.111 ) ); | 263 | netView()->addNewItem( "station", "<wired>", from, false, -1, 0, GpsLocation( -111, -111 ) ); |
264 | } | 264 | } |
265 | 265 | ||
266 | 266 | ||
267 | void Wellenreiter::handleARPData( OPacket* p, OARPPacket*, OMacAddress& source, OMacAddress& dest ) | 267 | void Wellenreiter::handleARPData( OPacket* p, OARPPacket*, OMacAddress& source, OMacAddress& dest ) |
268 | { | 268 | { |
269 | OARPPacket* arp = (OARPPacket*) p->child( "ARP" ); | 269 | OARPPacket* arp = (OARPPacket*) p->child( "ARP" ); |
270 | if ( arp ) | 270 | if ( arp ) |
271 | { | 271 | { |
272 | qDebug( "Received ARP traffic (type '%s'): ", (const char*) arp->type() ); | 272 | qDebug( "Received ARP traffic (type '%s'): ", (const char*) arp->type() ); |
273 | if ( arp->type() == "REQUEST" ) | 273 | if ( arp->type() == "REQUEST" ) |
274 | { | 274 | { |
275 | netView()->identify( arp->senderMacAddress(), arp->senderIPV4Address().toString() ); | 275 | netView()->identify( arp->senderMacAddress(), arp->senderIPV4Address().toString() ); |
276 | } | 276 | } |
277 | else if ( arp->type() == "REPLY" ) | 277 | else if ( arp->type() == "REPLY" ) |
278 | { | 278 | { |
279 | netView()->identify( arp->senderMacAddress(), arp->senderIPV4Address().toString() ); | 279 | netView()->identify( arp->senderMacAddress(), arp->senderIPV4Address().toString() ); |
280 | netView()->identify( arp->targetMacAddress(), arp->targetIPV4Address().toString() ); | 280 | netView()->identify( arp->targetMacAddress(), arp->targetIPV4Address().toString() ); |
281 | } | 281 | } |
282 | } | 282 | } |
283 | } | 283 | } |
284 | 284 | ||
285 | 285 | ||
286 | void Wellenreiter::handleIPData( OPacket* p, OIPPacket* ip, OMacAddress& source, OMacAddress& dest ) | 286 | void Wellenreiter::handleIPData( OPacket* p, OIPPacket* ip, OMacAddress& source, OMacAddress& dest ) |
287 | { | 287 | { |