author | mickeyl <mickeyl> | 2003-04-10 17:26:35 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-04-10 17:26:35 (UTC) |
commit | 61eb255cc85160f7bb35602bbc10771be4da8708 (patch) (side-by-side diff) | |
tree | b66826f283d0ba41d3e27a44b8a0d63a7abc1238 /noncore/net/wellenreiter/gui/wellenreiter.cpp | |
parent | 1064aea74c5dd7b3d4f87e483bd85f3fac0cf03c (diff) | |
download | opie-61eb255cc85160f7bb35602bbc10771be4da8708.zip opie-61eb255cc85160f7bb35602bbc10771be4da8708.tar.gz opie-61eb255cc85160f7bb35602bbc10771be4da8708.tar.bz2 |
New Feature: Write a capture file for later dissection with tcpdump-compatible tools!
Diffstat (limited to 'noncore/net/wellenreiter/gui/wellenreiter.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp index 5c10c3b..be2a86e 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp @@ -9,51 +9,53 @@ ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ***********************************************************************/ // Opie #ifdef QWS #include <opie/odevice.h> using namespace Opie; #endif #ifdef QWS #include <opie2/oapplication.h> #else #include <qapplication.h> #endif #include <opie2/onetwork.h> #include <opie2/opcap.h> // Qt +#include <qcheckbox.h> +#include <qcombobox.h> #include <qpushbutton.h> +#include <qlineedit.h> #include <qmessagebox.h> -#include <qcombobox.h> #include <qspinbox.h> #include <qtoolbutton.h> #include <qmainwindow.h> // Standard #include <assert.h> #include <errno.h> #include <unistd.h> #include <string.h> #include <sys/types.h> #include <stdlib.h> // Local #include "wellenreiter.h" #include "scanlist.h" #include "logwindow.h" #include "hexwindow.h" #include "configwindow.h" #include "statwindow.h" #include "manufacturers.h" Wellenreiter::Wellenreiter( QWidget* parent ) @@ -299,51 +301,62 @@ void Wellenreiter::startClicked() { case DEVTYPE_CISCO: iface->setMonitoring( new OCiscoMonitoringInterface( iface ) ); break; case DEVTYPE_WLAN_NG: iface->setMonitoring( new OWlanNGMonitoringInterface( iface ) ); break; case DEVTYPE_HOSTAP: iface->setMonitoring( new OHostAPMonitoringInterface( iface ) ); break; case DEVTYPE_ORINOCO: iface->setMonitoring( new OOrinocoMonitoringInterface( iface ) ); break; case DEVTYPE_MANUAL: QMessageBox::information( this, "Wellenreiter II", "Bring your device into\nmonitor mode now." ); break; case DEVTYPE_FILE: qDebug( "Wellenreiter: Capturing from file '%s'", (const char*) interface ); break; default: assert( 0 ); // shouldn't reach this } // switch device into monitor mode if ( cardtype < DEVTYPE_FILE ) { if ( cardtype != DEVTYPE_MANUAL ) iface->setMonitorMode( true ); if ( !iface->monitorMode() ) { QMessageBox::warning( this, "Wellenreiter II", "Can't set device into monitor mode." ); return; } } // open pcap and start sniffing if ( cardtype != DEVTYPE_FILE ) - pcap->open( interface ); + { + if ( configwindow->writeCaptureFile->isEnabled() ) + { + pcap->open( interface, configwindow->captureFileName->text() ); + } + else + { + pcap->open( interface ); + } + } else + { pcap->open( QFile( interface ) ); + } if ( !pcap->isOpen() ) { QMessageBox::warning( this, "Wellenreiter II", "Can't open packet capturer:\n" + QString(strerror( errno ) )); return; } // set capturer to non-blocking mode pcap->setBlocking( false ); // start channel hopper if ( cardtype != DEVTYPE_FILE ) iface->setChannelHopping( 1000 ); //use interval from config window if ( cardtype != DEVTYPE_FILE ) { // connect socket notifier and start channel hopper connect( pcap, SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) ); connect( iface->channelHopper(), SIGNAL( hopped(int) ), this, SLOT( channelHopped(int) ) ); } else { // start timer for reading packets startTimer( 100 ); |