author | mickeyl <mickeyl> | 2003-04-09 21:40:31 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-04-09 21:40:31 (UTC) |
commit | cf029a4007ea344c530d8a71cd0b012393ebd7ba (patch) (side-by-side diff) | |
tree | e9f584885299548b9316a6da05ad31845487e6d9 /noncore/net/wellenreiter/gui/wellenreiter.cpp | |
parent | b055856776807f0a459a86b1e1f62902d2d3a9c3 (diff) | |
download | opie-cf029a4007ea344c530d8a71cd0b012393ebd7ba.zip opie-cf029a4007ea344c530d8a71cd0b012393ebd7ba.tar.gz opie-cf029a4007ea344c530d8a71cd0b012393ebd7ba.tar.bz2 |
- improve keyboard handling
- enable sniffer-menu
- fix handling of start/stop button
- add simple statistic window, fancy will follow ;-)
Diffstat (limited to 'noncore/net/wellenreiter/gui/wellenreiter.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp index 0bfc8e9..3372883 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp @@ -34,6 +34,7 @@ using namespace Opie; #include <qmessagebox.h> #include <qcombobox.h> #include <qspinbox.h> +#include <qtoolbutton.h> #include <qmainwindow.h> // Standard @@ -52,7 +53,7 @@ using namespace Opie; #include "logwindow.h" #include "hexwindow.h" #include "configwindow.h" - +#include "statwindow.h" #include "manufacturers.h" Wellenreiter::Wellenreiter( QWidget* parent ) @@ -217,9 +218,8 @@ void Wellenreiter::receivePacket(OPacket* p) } } -void Wellenreiter::startStopClicked() -{ - if ( sniffing ) + +void Wellenreiter::stopClicked() { disconnect( SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) ); disconnect( SIGNAL( hopped(int) ), this, SLOT( channelHopped(int) ) ); @@ -249,9 +249,32 @@ void Wellenreiter::startStopClicked() // message the user QMessageBox::information( this, "Wellenreiter II", "Your wireless card\nshould now be usable again." ); + + sniffing = false; + emit( stoppedSniffing() ); + + // print out statistics + statwindow->log( "-----------------------------------------" ); + statwindow->log( "- Wellenreiter II Capturing Statistic -" ); + statwindow->log( "-----------------------------------------" ); + statwindow->log( "Packet Type | Receive Count" ); + + for( QMap<QString,int>::ConstIterator it = pcap->statistics().begin(); it != pcap->statistics().end(); ++it ) + { + QString left; + left.sprintf( "%s", (const char*) it.key() ); + left = left.leftJustify( 20 ); + left.append( '|' ); + QString right; + right.sprintf( "%d", it.data() ); + right = right.rightJustify( 7 ); + statwindow->log( left + right ); } - else +} + + +void Wellenreiter::startClicked() { // get configuration from config window @@ -278,9 +301,11 @@ void Wellenreiter::startStopClicked() case 2: iface->setMonitoring( new OWlanNGMonitoringInterface( iface ) ); break; case 3: iface->setMonitoring( new OHostAPMonitoringInterface( iface ) ); break; case 4: iface->setMonitoring( new OOrinocoMonitoringInterface( iface ) ); break; - default: assert( 0 ); // shouldn't happen + default: + QMessageBox::information( this, "Wellenreiter II", "Bring your device into\nmonitor mode now." ); } + if ( cardtype > 0 && cardtype < 5 ) iface->setMonitorMode( true ); if ( !iface->monitorMode() ) @@ -310,6 +335,5 @@ void Wellenreiter::startStopClicked() logwindow->log( "(i) Started Scanning." ); sniffing = true; - - } + emit( startedSniffing() ); } |