From 61eb255cc85160f7bb35602bbc10771be4da8708 Mon Sep 17 00:00:00 2001 From: mickeyl Date: Thu, 10 Apr 2003 17:26:35 +0000 Subject: New Feature: Write a capture file for later dissection with tcpdump-compatible tools! --- (limited to 'noncore') diff --git a/noncore/net/wellenreiter/gui/configbase.ui b/noncore/net/wellenreiter/gui/configbase.ui index 3ece270..ba4de32 100644 --- a/noncore/net/wellenreiter/gui/configbase.ui +++ b/noncore/net/wellenreiter/gui/configbase.ui @@ -11,8 +11,8 @@ 0 0 - 220 - 306 + 236 + 342 @@ -25,16 +25,16 @@ layoutSpacing - + margin - 3 + 6 spacing - 1 + 5 - + QLayoutWidget name @@ -83,14 +83,200 @@ - - QLayoutWidget + + QComboBox name - Layout7 + interfaceName + + + enabled + true - layoutSpacing + whatsThis + Choose the interface used for sniffing. + + + + QComboBox + + + text + <select> + + + + + text + cisco + + + + + text + wlan-ng + + + + + text + hostap + + + + + text + orinoco + + + + + text + <manual> + + + + + text + <file> + + + + name + deviceType + + + enabled + true + + + whatsThis + Choose the type of driver used for sniffing. + + + + QSpinBox + + name + hopInterval + + + enabled + true + + + suffix + ms + + + maxValue + 2000 + + + minValue + 100 + + + lineStep + 100 + + + whatsThis + Choose the channel hop interval. + + + + QLabel + + name + TextLabel3_3 + + + enabled + true + + + text + Hop Interval + + + + QLabel + + name + TextLabel2_3 + + + enabled + true + + + text + Device Type + + + + QLabel + + name + TextLabel1_2 + + + enabled + true + + + text + Interface Name + + + + QLabel + + name + TextLabel1_5 + + + text + Fake MAC: + + + + QLineEdit + + name + MAC + + + enabled + false + + + text + 44:44:44:44:44:44 + + + + QCheckBox + + name + activeScanning + + + enabled + false + + + text + Active Scanning (caution!) + + + + QLayoutWidget + + name + Layout5 @@ -99,36 +285,17 @@ spacing - 2 + 6 - - QComboBox - - name - interfaceName - - - enabled - true - - - whatsThis - Choose the interface used for sniffing. - - - - QCheckBox + + QLabel name - activeScanning - - - enabled - false + TextLabel1 text - Active Scanning (caution!) + sound on new net @@ -136,124 +303,96 @@ text - <select> + Ignore text - cisco + Touch text - wlan-ng + Key text - hostap + Alarm + + name + beaconSound + + + + QComboBox text - orinoco + Ignore text - <manual> + Touch text - <file> + Key + + + + + text + Alarm name - deviceType - - - enabled - true - - - whatsThis - Choose the type of driver used for sniffing. - - - - QCheckBox - - name - additionalInfo - - - enabled - false - - - text - Gather Additional Info - - - - QSpinBox - - name - hopInterval - - - enabled - true - - - suffix - ms - - - maxValue - 2000 - - - minValue - 100 - - - lineStep - 100 - - - whatsThis - Choose the channel hop interval. + netSound - + QLabel name - TextLabel3_3 - - - enabled - true + TextLabel1_3 text - Hop Interval + sound on beacon - - QLabel + + + + QLayoutWidget + + name + Layout7 + + + + margin + 0 + + + spacing + 6 + + + QCheckBox name - TextLabel2_3 + writeCaptureFile enabled @@ -261,27 +400,27 @@ text - Device Type + Write Capture File - - QLabel + + QToolButton name - TextLabel1_2 + getCaptureFileName enabled - true + false text - Interface Name + ... - + - + QLayoutWidget name @@ -330,43 +469,34 @@ - - QCheckBox - + + name - groupNetworks - - - enabled - false + Spacer1 - text - Group Detected Networks + orientation + Vertical - - - QCheckBox - name - enableActivity + sizeType + Expanding - - enabled - false - - - text - Enable Activity Display + + sizeHint + + 20 + 20 + - - + + QLayoutWidget name - Layout5 + Layout7 - + margin 0 @@ -375,92 +505,50 @@ spacing 6 - + QLabel name - TextLabel1 + TextLabel1_4 text - sound on new net - - - - QComboBox - - - text - Ignore - - - - - text - Touch - - - - - text - Key - - - - - text - Alarm - - - - name - beaconSound - - - - QComboBox - - - text - Ignore - - - - - text - Touch - - - - - text - Key - - - - - text - Alarm - - - - name - netSound + CaptureFile: - - QLabel + + QLineEdit name - TextLabel1_3 + captureFileName - text - sound on beacon + enabled + false - + - + + + + writeCaptureFile + toggled(bool) + getCaptureFileName + setEnabled(bool) + + + activeScanning + toggled(bool) + MAC + setEnabled(bool) + + + writeCaptureFile + toggled(bool) + captureFileName + setEnabled(bool) + + diff --git a/noncore/net/wellenreiter/gui/configwindow.cpp b/noncore/net/wellenreiter/gui/configwindow.cpp index 4aca526..716618e 100644 --- a/noncore/net/wellenreiter/gui/configwindow.cpp +++ b/noncore/net/wellenreiter/gui/configwindow.cpp @@ -21,9 +21,11 @@ #include #include #include +#include #include #include #include +#include #include #include @@ -85,6 +87,7 @@ WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char WellenreiterConfigWindow::_instance = this; connect( deviceType, SIGNAL( activated(int) ), this, SLOT( changedDeviceType(int) ) ); + connect( getCaptureFileName, SIGNAL( clicked() ), this, SLOT( getCaptureFileNameClicked() ) ); }; @@ -112,7 +115,7 @@ void WellenreiterConfigWindow::changedDeviceType(int t) { if ( t != DEVTYPE_FILE ) return; QString name = ( (WellenreiterMainWindow*) qApp->mainWidget() )->getFileName(false); - if ( !name.isNull() && QFile::exists( name ) ) + if ( !name.isEmpty() && QFile::exists( name ) ) { interfaceName->insertItem( name ); interfaceName->setCurrentItem( interfaceName->count()-1 ); @@ -124,3 +127,14 @@ void WellenreiterConfigWindow::changedDeviceType(int t) } + +void WellenreiterConfigWindow::getCaptureFileNameClicked() +{ + QString name = ( (WellenreiterMainWindow*) qApp->mainWidget() )->getFileName(true); + qDebug( "name = %s", (const char*) name ); + if ( !name.isEmpty() ) + { + captureFileName->setText( name ); + } +} + diff --git a/noncore/net/wellenreiter/gui/configwindow.h b/noncore/net/wellenreiter/gui/configwindow.h index 7df1a80..c7c70a6 100644 --- a/noncore/net/wellenreiter/gui/configwindow.h +++ b/noncore/net/wellenreiter/gui/configwindow.h @@ -45,6 +45,7 @@ class WellenreiterConfigWindow : public WellenreiterConfigBase public slots: void changedDeviceType(int); + void getCaptureFileNameClicked(); protected: QMap _devicetype; 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 @@ -30,9 +30,11 @@ using namespace Opie; // Qt +#include +#include #include +#include #include -#include #include #include #include @@ -320,9 +322,20 @@ void Wellenreiter::startClicked() // 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() ) { -- cgit v0.9.0.2