Diffstat (limited to 'noncore/net/wellenreiter/gui/wellenreiter.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp index fad6efd..822bde8 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp | |||
@@ -138,30 +138,30 @@ void Wellenreiter::handleNotification( OPacket* p ) | |||
138 | while ( (o = it.current()) != 0 ) | 138 | while ( (o = it.current()) != 0 ) |
139 | { | 139 | { |
140 | QString name = it.current()->name(); | 140 | QString name = it.current()->name(); |
141 | if ( configwindow->parsePackets->isProtocolChecked( name ) ) | 141 | if ( configwindow->parsePackets->isProtocolChecked( name ) ) |
142 | { | 142 | { |
143 | QString action = configwindow->parsePackets->protocolAction( name ); | 143 | QString action = configwindow->parsePackets->protocolAction( name ); |
144 | odebug << "parsePacket-action for '" << (const char*) name << "' seems to be '" << (const char*) action << "'" << oendl; | 144 | odebug << "parsePacket-action for '" << (const char*) name << "' seems to be '" << action << "'" << oendl; |
145 | doAction( action, name, p ); | 145 | doAction( action, name, p ); |
146 | } | 146 | } |
147 | else | 147 | else |
148 | { | 148 | { |
149 | odebug << "protocol '" << (const char*) name << "' not checked in parsePackets." << oendl; | 149 | odebug << "protocol '" << name << "' not checked in parsePackets." << oendl; |
150 | } | 150 | } |
151 | ++it; | 151 | ++it; |
152 | } | 152 | } |
153 | } | 153 | } |
154 | 154 | ||
155 | 155 | ||
156 | void Wellenreiter::handleManagementFrame( OPacket* p, OWaveLanManagementPacket* manage ) | 156 | void Wellenreiter::handleManagementFrame( OPacket* p, OWaveLanManagementPacket* manage ) |
157 | { | 157 | { |
158 | if ( manage->managementType() == "Beacon" ) handleManagementFrameBeacon( p, manage ); | 158 | if ( manage->managementType() == "Beacon" ) handleManagementFrameBeacon( p, manage ); |
159 | else if ( manage->managementType() == "ProbeRequest" ) handleManagementFrameProbeRequest( p, manage ); | 159 | else if ( manage->managementType() == "ProbeRequest" ) handleManagementFrameProbeRequest( p, manage ); |
160 | else if ( manage->managementType() == "ProbeResponse" ) handleManagementFrameProbeResponse( p, manage ); | 160 | else if ( manage->managementType() == "ProbeResponse" ) handleManagementFrameProbeResponse( p, manage ); |
161 | else owarn << "Wellenreiter::handleManagementFrame(): '" << (const char*) manage->managementType() << "' - please handle me!" << oendl; | 161 | else owarn << "Wellenreiter::handleManagementFrame(): '" << manage->managementType() << "' - please handle me!" << oendl; |
162 | } | 162 | } |
163 | 163 | ||
164 | 164 | ||
165 | void Wellenreiter::handleManagementFrameProbeRequest( OPacket* p, OWaveLanManagementPacket* request ) | 165 | void Wellenreiter::handleManagementFrameProbeRequest( OPacket* p, OWaveLanManagementPacket* request ) |
166 | { | 166 | { |
167 | OWaveLanManagementSSID* ssid = static_cast<OWaveLanManagementSSID*>( p->child( "802.11 SSID" ) ); | 167 | OWaveLanManagementSSID* ssid = static_cast<OWaveLanManagementSSID*>( p->child( "802.11 SSID" ) ); |
@@ -244,13 +244,13 @@ void Wellenreiter::handleControlFrame( OPacket* p, OWaveLanControlPacket* contro | |||
244 | if ( control->controlType() == "Acknowledge" ) | 244 | if ( control->controlType() == "Acknowledge" ) |
245 | { | 245 | { |
246 | netView()->addNewItem( "adhoc", "<unknown>", header->macAddress1(), false, -1, 0, GpsLocation( -111, -111 ) ); | 246 | netView()->addNewItem( "adhoc", "<unknown>", header->macAddress1(), false, -1, 0, GpsLocation( -111, -111 ) ); |
247 | } | 247 | } |
248 | else | 248 | else |
249 | { | 249 | { |
250 | odebug << "Wellenreiter::handleControlFrame - please handle " << (const char*) control->controlType() << " in a future version! :D" << oendl; | 250 | odebug << "Wellenreiter::handleControlFrame - please handle " << control->controlType() << " in a future version! :D" << oendl; |
251 | } | 251 | } |
252 | } | 252 | } |
253 | 253 | ||
254 | 254 | ||
255 | void Wellenreiter::handleWlanData( OPacket* p, OWaveLanDataPacket* data, OMacAddress& from, OMacAddress& to ) | 255 | void Wellenreiter::handleWlanData( OPacket* p, OWaveLanDataPacket* data, OMacAddress& from, OMacAddress& to ) |
256 | { | 256 | { |
@@ -293,13 +293,13 @@ void Wellenreiter::handleEthernetData( OPacket* p, OEthernetPacket* data, OMacAd | |||
293 | 293 | ||
294 | void Wellenreiter::handleARPData( OPacket* p, OARPPacket*, OMacAddress& source, OMacAddress& dest ) | 294 | void Wellenreiter::handleARPData( OPacket* p, OARPPacket*, OMacAddress& source, OMacAddress& dest ) |
295 | { | 295 | { |
296 | OARPPacket* arp = (OARPPacket*) p->child( "ARP" ); | 296 | OARPPacket* arp = (OARPPacket*) p->child( "ARP" ); |
297 | if ( arp ) | 297 | if ( arp ) |
298 | { | 298 | { |
299 | odebug << "Received ARP traffic (type '" << (const char*) arp->type() << "'): " << oendl; | 299 | odebug << "Received ARP traffic (type '" << arp->type() << "'): " << oendl; |
300 | if ( arp->type() == "REQUEST" ) | 300 | if ( arp->type() == "REQUEST" ) |
301 | { | 301 | { |
302 | netView()->identify( arp->senderMacAddress(), arp->senderIPV4Address().toString() ); | 302 | netView()->identify( arp->senderMacAddress(), arp->senderIPV4Address().toString() ); |
303 | } | 303 | } |
304 | else if ( arp->type() == "REPLY" ) | 304 | else if ( arp->type() == "REPLY" ) |
305 | { | 305 | { |
@@ -314,22 +314,22 @@ void Wellenreiter::handleIPData( OPacket* p, OIPPacket* ip, OMacAddress& source, | |||
314 | { | 314 | { |
315 | //TODO: Implement more IP based protocols | 315 | //TODO: Implement more IP based protocols |
316 | 316 | ||
317 | ODHCPPacket* dhcp = (ODHCPPacket*) p->child( "DHCP" ); | 317 | ODHCPPacket* dhcp = (ODHCPPacket*) p->child( "DHCP" ); |
318 | if ( dhcp ) | 318 | if ( dhcp ) |
319 | { | 319 | { |
320 | odebug << "Received DHCP '" << (const char*) dhcp->type() << "' packet" << oendl; | 320 | odebug << "Received DHCP '" << dhcp->type() << "' packet" << oendl; |
321 | if ( dhcp->type() == "OFFER" ) | 321 | if ( dhcp->type() == "OFFER" ) |
322 | { | 322 | { |
323 | odebug << "DHCP: '" << (const char*) source.toString() << "' ('" << (const char*) dhcp->serverAddress().toString() << "') seems to be a DHCP server." << oendl; | 323 | odebug << "DHCP: '" << (const char*) source.toString() << "' ('" << dhcp->serverAddress().toString() << "') seems to be a DHCP server." << oendl; |
324 | netView()->identify( source, dhcp->serverAddress().toString() ); | 324 | netView()->identify( source, dhcp->serverAddress().toString() ); |
325 | netView()->addService( "DHCP", source, dhcp->serverAddress().toString() ); | 325 | netView()->addService( "DHCP", source, dhcp->serverAddress().toString() ); |
326 | } | 326 | } |
327 | else if ( dhcp->type() == "ACK" ) | 327 | else if ( dhcp->type() == "ACK" ) |
328 | { | 328 | { |
329 | odebug << "DHCP: '" << (const char*) dhcp->clientMacAddress().toString() << "' ('" << (const char*) dhcp->yourAddress().toString() << "') accepted the offered DHCP address." << oendl; | 329 | odebug << "DHCP: '" << (const char*) dhcp->clientMacAddress().toString() << "' ('" << dhcp->yourAddress().toString() << "') accepted the offered DHCP address." << oendl; |
330 | netView()->identify( dhcp->clientMacAddress(), dhcp->yourAddress().toString() ); | 330 | netView()->identify( dhcp->clientMacAddress(), dhcp->yourAddress().toString() ); |
331 | } | 331 | } |
332 | } | 332 | } |
333 | } | 333 | } |
334 | 334 | ||
335 | 335 | ||
@@ -357,22 +357,22 @@ bool Wellenreiter::checkDumpPacket( OPacket* p ) | |||
357 | while ( (o = it.current()) != 0 ) | 357 | while ( (o = it.current()) != 0 ) |
358 | { | 358 | { |
359 | QString name = it.current()->name(); | 359 | QString name = it.current()->name(); |
360 | if ( configwindow->capturePackets->isProtocolChecked( name ) ) | 360 | if ( configwindow->capturePackets->isProtocolChecked( name ) ) |
361 | { | 361 | { |
362 | QString action = configwindow->capturePackets->protocolAction( name ); | 362 | QString action = configwindow->capturePackets->protocolAction( name ); |
363 | odebug << "capturePackets-action for '" << (const char*) name << "' seems to be '" << (const char*) action << "'" << oendl; | 363 | odebug << "capturePackets-action for '" << (const char*) name << "' seems to be '" << action << "'" << oendl; |
364 | if ( action == "Discard" ) | 364 | if ( action == "Discard" ) |
365 | { | 365 | { |
366 | logwindow->log( QString().sprintf( "(i) dump-discarding of '%s' packet requested.", (const char*) name ) ); | 366 | logwindow->log( QString().sprintf( "(i) dump-discarding of '%s' packet requested.", (const char*) name ) ); |
367 | return false; | 367 | return false; |
368 | } | 368 | } |
369 | } | 369 | } |
370 | else | 370 | else |
371 | { | 371 | { |
372 | odebug << "protocol '" << (const char*) name << "' not checked in capturePackets." << oendl; | 372 | odebug << "protocol '" << name << "' not checked in capturePackets." << oendl; |
373 | } | 373 | } |
374 | ++it; | 374 | ++it; |
375 | } | 375 | } |
376 | return true; | 376 | return true; |
377 | } | 377 | } |
378 | 378 | ||
@@ -540,13 +540,13 @@ void Wellenreiter::startClicked() | |||
540 | { | 540 | { |
541 | case DEVTYPE_CISCO: iface->setMonitoring( new OCiscoMonitoringInterface( iface, usePrism ) ); break; | 541 | case DEVTYPE_CISCO: iface->setMonitoring( new OCiscoMonitoringInterface( iface, usePrism ) ); break; |
542 | case DEVTYPE_WLAN_NG: iface->setMonitoring( new OWlanNGMonitoringInterface( iface, usePrism ) ); break; | 542 | case DEVTYPE_WLAN_NG: iface->setMonitoring( new OWlanNGMonitoringInterface( iface, usePrism ) ); break; |
543 | case DEVTYPE_HOSTAP: iface->setMonitoring( new OHostAPMonitoringInterface( iface, usePrism ) ); break; | 543 | case DEVTYPE_HOSTAP: iface->setMonitoring( new OHostAPMonitoringInterface( iface, usePrism ) ); break; |
544 | case DEVTYPE_ORINOCO: iface->setMonitoring( new OOrinocoMonitoringInterface( iface, usePrism ) ); break; | 544 | case DEVTYPE_ORINOCO: iface->setMonitoring( new OOrinocoMonitoringInterface( iface, usePrism ) ); break; |
545 | case DEVTYPE_MANUAL: QMessageBox::information( this, "Wellenreiter II", tr( "Bring your device into\nmonitor mode now." ) ); break; | 545 | case DEVTYPE_MANUAL: QMessageBox::information( this, "Wellenreiter II", tr( "Bring your device into\nmonitor mode now." ) ); break; |
546 | case DEVTYPE_FILE: odebug << "Wellenreiter: Capturing from file '" << (const char*) interface << "'" << oendl; break; | 546 | case DEVTYPE_FILE: odebug << "Wellenreiter: Capturing from file '" << interface << "'" << oendl; break; |
547 | default: assert( 0 ); // shouldn't reach this | 547 | default: assert( 0 ); // shouldn't reach this |
548 | } | 548 | } |
549 | 549 | ||
550 | // switch device into monitor mode | 550 | // switch device into monitor mode |
551 | if ( cardtype < DEVTYPE_FILE ) | 551 | if ( cardtype < DEVTYPE_FILE ) |
552 | { | 552 | { |
@@ -561,13 +561,13 @@ void Wellenreiter::startClicked() | |||
561 | } | 561 | } |
562 | } | 562 | } |
563 | 563 | ||
564 | // open GPS device | 564 | // open GPS device |
565 | if ( configwindow->enableGPS->isChecked() ) | 565 | if ( configwindow->enableGPS->isChecked() ) |
566 | { | 566 | { |
567 | odebug << "Wellenreiter:GPS enabled @ " << (const char*) configwindow->gpsdHost->currentText() << ":" << configwindow->gpsdPort->value() << "" << oendl; | 567 | odebug << "Wellenreiter:GPS enabled @ " << configwindow->gpsdHost->currentText() << ":" << configwindow->gpsdPort->value() << "" << oendl; |
568 | gps->open( configwindow->gpsdHost->currentText(), configwindow->gpsdPort->value() ); | 568 | gps->open( configwindow->gpsdHost->currentText(), configwindow->gpsdPort->value() ); |
569 | } | 569 | } |
570 | 570 | ||
571 | // open pcap and start sniffing | 571 | // open pcap and start sniffing |
572 | 572 | ||
573 | if ( configwindow->writeCaptureFile->isChecked() ) // write to a user specified capture file? | 573 | if ( configwindow->writeCaptureFile->isChecked() ) // write to a user specified capture file? |
@@ -585,13 +585,13 @@ void Wellenreiter::startClicked() | |||
585 | 585 | ||
586 | if ( cardtype != DEVTYPE_FILE ) | 586 | if ( cardtype != DEVTYPE_FILE ) |
587 | pcap->open( interface ); | 587 | pcap->open( interface ); |
588 | else | 588 | else |
589 | pcap->open( QFile( interface ) ); | 589 | pcap->open( QFile( interface ) ); |
590 | 590 | ||
591 | odebug << "Wellenreiter:: dumping to " << (const char*) dumpname << "" << oendl; | 591 | odebug << "Wellenreiter:: dumping to " << dumpname << "" << oendl; |
592 | pcap->openDumpFile( dumpname ); | 592 | pcap->openDumpFile( dumpname ); |
593 | 593 | ||
594 | if ( !pcap->isOpen() ) | 594 | if ( !pcap->isOpen() ) |
595 | { | 595 | { |
596 | QMessageBox::warning( this, "Wellenreiter II", tr( "Can't open packet capturer for\n'%1':\n" ).arg( | 596 | QMessageBox::warning( this, "Wellenreiter II", tr( "Can't open packet capturer for\n'%1':\n" ).arg( |
597 | cardtype == DEVTYPE_FILE ? (const char*) interface : iface->name() ) + QString(strerror( errno ) )); | 597 | cardtype == DEVTYPE_FILE ? (const char*) interface : iface->name() ) + QString(strerror( errno ) )); |