summaryrefslogtreecommitdiff
path: root/noncore/net/wellenreiter/gui/wellenreiter.cpp
Unidiff
Diffstat (limited to 'noncore/net/wellenreiter/gui/wellenreiter.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiter.cpp32
1 files changed, 20 insertions, 12 deletions
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp
index c061319..62bda91 100644
--- a/noncore/net/wellenreiter/gui/wellenreiter.cpp
+++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp
@@ -165,17 +165,21 @@ void Wellenreiter::receivePacket(OPacket* p)
165 OWaveLanManagementDS* ds = static_cast<OWaveLanManagementDS*>( p->child( "802.11 DS" ) ); 165 OWaveLanManagementDS* ds = static_cast<OWaveLanManagementDS*>( p->child( "802.11 DS" ) );
166 int channel = ds ? ds->channel() : -1; 166 int channel = ds ? ds->channel() : -1;
167 167
168 OWaveLanPacket* header = static_cast<OWaveLanPacket*>( p->child( "802.11" ) ); 168 OWaveLanPacket* header = static_cast<OWaveLanPacket*>( p->child( "802.11" ) );
169 netView()->addNewItem( type, essid, header->macAddress2().toString(), beacon->canPrivacy(), channel, 0 ); 169 netView()->addNewItem( type, essid, header->macAddress2().toString(), beacon->canPrivacy(), channel, 0 );
170 170
171 // do we have a prism header? 171 // update graph window
172 OPrismHeaderPacket* prism = static_cast<OPrismHeaderPacket*>( p->child( "Prism" ) ); 172 if ( ds )
173 if ( ds && prism ) 173 {
174 graphwindow->traffic( ds->channel(), prism->signalStrength() ); 174 OPrismHeaderPacket* prism = static_cast<OPrismHeaderPacket*>( p->child( "Prism" ) );
175 175 if ( prism )
176 graphwindow->traffic( ds->channel(), prism->signalStrength() );
177 else
178 graphwindow->traffic( ds->channel(), 95 );
179 }
176 return; 180 return;
177 } 181 }
178 182
179 // check for a data frame 183 // check for a data frame
180 OWaveLanDataPacket* data = static_cast<OWaveLanDataPacket*>( p->child( "802.11 Data" ) ); 184 OWaveLanDataPacket* data = static_cast<OWaveLanDataPacket*>( p->child( "802.11 Data" ) );
181 if ( data ) 185 if ( data )
@@ -256,13 +260,14 @@ void Wellenreiter::stopClicked()
256 260
257 logwindow->log( "(i) Stopped Scanning." ); 261 logwindow->log( "(i) Stopped Scanning." );
258 assert( parent() ); 262 assert( parent() );
259 ( (QMainWindow*) parent() )->setCaption( "Wellenreiter II" ); 263 ( (QMainWindow*) parent() )->setCaption( "Wellenreiter II" );
260 264
261 // message the user 265 // message the user
262 QMessageBox::information( this, "Wellenreiter II", "Your wireless card\nshould now be usable again." ); 266 QMessageBox::information( this, "Wellenreiter II",
267 tr( "Your wireless card\nshould now be usable again." ) );
263 268
264 sniffing = false; 269 sniffing = false;
265 emit( stoppedSniffing() ); 270 emit( stoppedSniffing() );
266 271
267 // print out statistics 272 // print out statistics
268 for( QMap<QString,int>::ConstIterator it = pcap->statistics().begin(); it != pcap->statistics().end(); ++it ) 273 for( QMap<QString,int>::ConstIterator it = pcap->statistics().begin(); it != pcap->statistics().end(); ++it )
@@ -277,13 +282,14 @@ void Wellenreiter::startClicked()
277 const QString& interface = configwindow->interfaceName->currentText(); 282 const QString& interface = configwindow->interfaceName->currentText();
278 const int cardtype = configwindow->daemonDeviceType(); 283 const int cardtype = configwindow->daemonDeviceType();
279 const int interval = configwindow->daemonHopInterval(); 284 const int interval = configwindow->daemonHopInterval();
280 285
281 if ( ( interface == "" ) || ( cardtype == 0 ) ) 286 if ( ( interface == "" ) || ( cardtype == 0 ) )
282 { 287 {
283 QMessageBox::information( this, "Wellenreiter II", "Your device is not\nproperly configured. Please reconfigure!" ); 288 QMessageBox::information( this, "Wellenreiter II",
289 tr( "Your device is not\nproperly configured. Please reconfigure!" ) );
284 return; 290 return;
285 } 291 }
286 292
287 // configure device 293 // configure device
288 294
289 ONetwork* net = ONetwork::instance(); 295 ONetwork* net = ONetwork::instance();
@@ -294,33 +300,34 @@ void Wellenreiter::startClicked()
294 switch ( cardtype ) 300 switch ( cardtype )
295 { 301 {
296 case DEVTYPE_CISCO: iface->setMonitoring( new OCiscoMonitoringInterface( iface ) ); break; 302 case DEVTYPE_CISCO: iface->setMonitoring( new OCiscoMonitoringInterface( iface ) ); break;
297 case DEVTYPE_WLAN_NG: iface->setMonitoring( new OWlanNGMonitoringInterface( iface ) ); break; 303 case DEVTYPE_WLAN_NG: iface->setMonitoring( new OWlanNGMonitoringInterface( iface ) ); break;
298 case DEVTYPE_HOSTAP: iface->setMonitoring( new OHostAPMonitoringInterface( iface ) ); break; 304 case DEVTYPE_HOSTAP: iface->setMonitoring( new OHostAPMonitoringInterface( iface ) ); break;
299 case DEVTYPE_ORINOCO: iface->setMonitoring( new OOrinocoMonitoringInterface( iface ) ); break; 305 case DEVTYPE_ORINOCO: iface->setMonitoring( new OOrinocoMonitoringInterface( iface ) ); break;
300 case DEVTYPE_MANUAL: QMessageBox::information( this, "Wellenreiter II", "Bring your device into\nmonitor mode now." ); break; 306 case DEVTYPE_MANUAL: QMessageBox::information( this, "Wellenreiter II", tr( "Bring your device into\nmonitor mode now." ) ); break;
301 case DEVTYPE_FILE: qDebug( "Wellenreiter: Capturing from file '%s'", (const char*) interface ); break; 307 case DEVTYPE_FILE: qDebug( "Wellenreiter: Capturing from file '%s'", (const char*) interface ); break;
302 default: assert( 0 ); // shouldn't reach this 308 default: assert( 0 ); // shouldn't reach this
303 } 309 }
304 310
305 // switch device into monitor mode 311 // switch device into monitor mode
306 if ( cardtype < DEVTYPE_FILE ) 312 if ( cardtype < DEVTYPE_FILE )
307 { 313 {
308 if ( cardtype != DEVTYPE_MANUAL ) 314 if ( cardtype != DEVTYPE_MANUAL )
309 iface->setMonitorMode( true ); 315 iface->setMonitorMode( true );
310 if ( !iface->monitorMode() ) 316 if ( !iface->monitorMode() )
311 { 317 {
312 QMessageBox::warning( this, "Wellenreiter II", "Can't set device into monitor mode." ); 318 QMessageBox::warning( this, "Wellenreiter II",
319 tr( "Can't set device into monitor mode." ) );
313 return; 320 return;
314 } 321 }
315 } 322 }
316 323
317 // open pcap and start sniffing 324 // open pcap and start sniffing
318 if ( cardtype != DEVTYPE_FILE ) 325 if ( cardtype != DEVTYPE_FILE )
319 { 326 {
320 if ( configwindow->writeCaptureFile->isEnabled() ) 327 if ( configwindow->writeCaptureFile->isEnabled() ) //FIXME: bug!?
321 { 328 {
322 QString dumpname( configwindow->captureFileName->text() ); 329 QString dumpname( configwindow->captureFileName->text() );
323 dumpname.append( '-' ); 330 dumpname.append( '-' );
324 dumpname.append( QTime::currentTime().toString().replace( QRegExp( ":" ), "-" ) ); 331 dumpname.append( QTime::currentTime().toString().replace( QRegExp( ":" ), "-" ) );
325 dumpname.append( ".wellenreiter" ); 332 dumpname.append( ".wellenreiter" );
326 pcap->open( interface, dumpname ); 333 pcap->open( interface, dumpname );
@@ -334,13 +341,14 @@ void Wellenreiter::startClicked()
334 { 341 {
335 pcap->open( QFile( interface ) ); 342 pcap->open( QFile( interface ) );
336 } 343 }
337 344
338 if ( !pcap->isOpen() ) 345 if ( !pcap->isOpen() )
339 { 346 {
340 QMessageBox::warning( this, "Wellenreiter II", "Can't open packet capturer:\n" + QString(strerror( errno ) )); 347 QMessageBox::warning( this, "Wellenreiter II",
348 tr( "Can't open packet capturer:\n" ) + QString(strerror( errno ) ));
341 return; 349 return;
342 } 350 }
343 351
344 // set capturer to non-blocking mode 352 // set capturer to non-blocking mode
345 pcap->setBlocking( false ); 353 pcap->setBlocking( false );
346 354
@@ -364,13 +372,13 @@ void Wellenreiter::startClicked()
364 sniffing = true; 372 sniffing = true;
365 emit( startedSniffing() ); 373 emit( startedSniffing() );
366 if ( cardtype != DEVTYPE_FILE ) channelHopped( 6 ); // set title 374 if ( cardtype != DEVTYPE_FILE ) channelHopped( 6 ); // set title
367 else 375 else
368 { 376 {
369 assert( parent() ); 377 assert( parent() );
370 ( (QMainWindow*) parent() )->setCaption( "Wellenreiter II - replaying capture file..." ); 378 ( (QMainWindow*) parent() )->setCaption( tr( "Wellenreiter II - replaying capture file..." ) );
371 } 379 }
372} 380}
373 381
374 382
375void Wellenreiter::timerEvent( QTimerEvent* ) 383void Wellenreiter::timerEvent( QTimerEvent* )
376{ 384{