-rw-r--r-- | noncore/net/wellenreiter/gui/configbase.ui | 512 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/configwindow.cpp | 16 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/configwindow.h | 1 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 17 |
4 files changed, 331 insertions, 215 deletions
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 @@ -12,6 +12,6 @@ <x>0</x> <y>0</y> - <width>220</width> - <height>306</height> + <width>236</width> + <height>342</height> </rect> </property> @@ -26,14 +26,14 @@ <name>layoutSpacing</name> </property> - <vbox> + <grid> <property stdset="1"> <name>margin</name> - <number>3</number> + <number>6</number> </property> <property stdset="1"> <name>spacing</name> - <number>1</number> + <number>5</number> </property> - <widget> + <widget row="0" column="0" rowspan="1" colspan="3" > <class>QLayoutWidget</class> <property stdset="1"> @@ -84,12 +84,198 @@ </hbox> </widget> - <widget> - <class>QLayoutWidget</class> + <widget row="1" column="0" rowspan="1" colspan="2" > + <class>QComboBox</class> <property stdset="1"> <name>name</name> - <cstring>Layout7</cstring> + <cstring>interfaceName</cstring> + </property> + <property stdset="1"> + <name>enabled</name> + <bool>true</bool> </property> <property> - <name>layoutSpacing</name> + <name>whatsThis</name> + <string>Choose the interface used for sniffing.</string> + </property> + </widget> + <widget row="2" column="0" rowspan="1" colspan="2" > + <class>QComboBox</class> + <item> + <property> + <name>text</name> + <string><select></string> + </property> + </item> + <item> + <property> + <name>text</name> + <string>cisco</string> + </property> + </item> + <item> + <property> + <name>text</name> + <string>wlan-ng</string> + </property> + </item> + <item> + <property> + <name>text</name> + <string>hostap</string> + </property> + </item> + <item> + <property> + <name>text</name> + <string>orinoco</string> + </property> + </item> + <item> + <property> + <name>text</name> + <string><manual></string> + </property> + </item> + <item> + <property> + <name>text</name> + <string><file></string> + </property> + </item> + <property stdset="1"> + <name>name</name> + <cstring>deviceType</cstring> + </property> + <property stdset="1"> + <name>enabled</name> + <bool>true</bool> + </property> + <property> + <name>whatsThis</name> + <string>Choose the type of driver used for sniffing.</string> + </property> + </widget> + <widget row="3" column="0" rowspan="1" colspan="2" > + <class>QSpinBox</class> + <property stdset="1"> + <name>name</name> + <cstring>hopInterval</cstring> + </property> + <property stdset="1"> + <name>enabled</name> + <bool>true</bool> + </property> + <property stdset="1"> + <name>suffix</name> + <string> ms</string> + </property> + <property stdset="1"> + <name>maxValue</name> + <number>2000</number> + </property> + <property stdset="1"> + <name>minValue</name> + <number>100</number> + </property> + <property stdset="1"> + <name>lineStep</name> + <number>100</number> + </property> + <property> + <name>whatsThis</name> + <string>Choose the channel hop interval.</string> + </property> + </widget> + <widget row="3" column="2" > + <class>QLabel</class> + <property stdset="1"> + <name>name</name> + <cstring>TextLabel3_3</cstring> + </property> + <property stdset="1"> + <name>enabled</name> + <bool>true</bool> + </property> + <property stdset="1"> + <name>text</name> + <string>Hop Interval</string> + </property> + </widget> + <widget row="2" column="2" > + <class>QLabel</class> + <property stdset="1"> + <name>name</name> + <cstring>TextLabel2_3</cstring> + </property> + <property stdset="1"> + <name>enabled</name> + <bool>true</bool> + </property> + <property stdset="1"> + <name>text</name> + <string>Device Type</string> + </property> + </widget> + <widget row="1" column="2" > + <class>QLabel</class> + <property stdset="1"> + <name>name</name> + <cstring>TextLabel1_2</cstring> + </property> + <property stdset="1"> + <name>enabled</name> + <bool>true</bool> + </property> + <property stdset="1"> + <name>text</name> + <string>Interface Name</string> + </property> + </widget> + <widget row="5" column="0" > + <class>QLabel</class> + <property stdset="1"> + <name>name</name> + <cstring>TextLabel1_5</cstring> + </property> + <property stdset="1"> + <name>text</name> + <string>Fake MAC:</string> + </property> + </widget> + <widget row="5" column="1" rowspan="1" colspan="2" > + <class>QLineEdit</class> + <property stdset="1"> + <name>name</name> + <cstring>MAC</cstring> + </property> + <property stdset="1"> + <name>enabled</name> + <bool>false</bool> + </property> + <property stdset="1"> + <name>text</name> + <string>44:44:44:44:44:44</string> + </property> + </widget> + <widget row="4" column="0" rowspan="1" colspan="3" > + <class>QCheckBox</class> + <property stdset="1"> + <name>name</name> + <cstring>activeScanning</cstring> + </property> + <property stdset="1"> + <name>enabled</name> + <bool>false</bool> + </property> + <property stdset="1"> + <name>text</name> + <string>Active Scanning (caution!)</string> + </property> + </widget> + <widget row="10" column="0" rowspan="1" colspan="3" > + <class>QLayoutWidget</class> + <property stdset="1"> + <name>name</name> + <cstring>Layout5</cstring> </property> <grid> @@ -100,34 +286,15 @@ <property stdset="1"> <name>spacing</name> - <number>2</number> + <number>6</number> </property> - <widget row="0" column="0" > - <class>QComboBox</class> - <property stdset="1"> - <name>name</name> - <cstring>interfaceName</cstring> - </property> - <property stdset="1"> - <name>enabled</name> - <bool>true</bool> - </property> - <property> - <name>whatsThis</name> - <string>Choose the interface used for sniffing.</string> - </property> - </widget> - <widget row="4" column="0" rowspan="1" colspan="2" > - <class>QCheckBox</class> + <widget row="0" column="1" > + <class>QLabel</class> <property stdset="1"> <name>name</name> - <cstring>activeScanning</cstring> - </property> - <property stdset="1"> - <name>enabled</name> - <bool>false</bool> + <cstring>TextLabel1</cstring> </property> <property stdset="1"> <name>text</name> - <string>Active Scanning (caution!)</string> + <string>sound on new net</string> </property> </widget> @@ -137,5 +304,5 @@ <property> <name>text</name> - <string><select></string> + <string>Ignore</string> </property> </item> @@ -143,5 +310,5 @@ <property> <name>text</name> - <string>cisco</string> + <string>Touch</string> </property> </item> @@ -149,5 +316,5 @@ <property> <name>text</name> - <string>wlan-ng</string> + <string>Key</string> </property> </item> @@ -155,11 +322,18 @@ <property> <name>text</name> - <string>hostap</string> + <string>Alarm</string> </property> </item> + <property stdset="1"> + <name>name</name> + <cstring>beaconSound</cstring> + </property> + </widget> + <widget row="0" column="0" > + <class>QComboBox</class> <item> <property> <name>text</name> - <string>orinoco</string> + <string>Ignore</string> </property> </item> @@ -167,5 +341,5 @@ <property> <name>text</name> - <string><manual></string> + <string>Touch</string> </property> </item> @@ -173,86 +347,51 @@ <property> <name>text</name> - <string><file></string> + <string>Key</string> + </property> + </item> + <item> + <property> + <name>text</name> + <string>Alarm</string> </property> </item> <property stdset="1"> <name>name</name> - <cstring>deviceType</cstring> - </property> - <property stdset="1"> - <name>enabled</name> - <bool>true</bool> - </property> - <property> - <name>whatsThis</name> - <string>Choose the type of driver used for sniffing.</string> - </property> - </widget> - <widget row="3" column="0" rowspan="1" colspan="2" > - <class>QCheckBox</class> - <property stdset="1"> - <name>name</name> - <cstring>additionalInfo</cstring> - </property> - <property stdset="1"> - <name>enabled</name> - <bool>false</bool> - </property> - <property stdset="1"> - <name>text</name> - <string>Gather Additional Info</string> - </property> - </widget> - <widget row="2" column="0" > - <class>QSpinBox</class> - <property stdset="1"> - <name>name</name> - <cstring>hopInterval</cstring> - </property> - <property stdset="1"> - <name>enabled</name> - <bool>true</bool> - </property> - <property stdset="1"> - <name>suffix</name> - <string> ms</string> - </property> - <property stdset="1"> - <name>maxValue</name> - <number>2000</number> - </property> - <property stdset="1"> - <name>minValue</name> - <number>100</number> - </property> - <property stdset="1"> - <name>lineStep</name> - <number>100</number> - </property> - <property> - <name>whatsThis</name> - <string>Choose the channel hop interval.</string> + <cstring>netSound</cstring> </property> </widget> - <widget row="2" column="1" > + <widget row="1" column="1" > <class>QLabel</class> <property stdset="1"> <name>name</name> - <cstring>TextLabel3_3</cstring> - </property> - <property stdset="1"> - <name>enabled</name> - <bool>true</bool> + <cstring>TextLabel1_3</cstring> </property> <property stdset="1"> <name>text</name> - <string>Hop Interval</string> + <string>sound on beacon</string> </property> </widget> - <widget row="1" column="1" > - <class>QLabel</class> + </grid> + </widget> + <widget row="8" column="0" rowspan="1" colspan="3" > + <class>QLayoutWidget</class> + <property stdset="1"> + <name>name</name> + <cstring>Layout7</cstring> + </property> + <hbox> + <property stdset="1"> + <name>margin</name> + <number>0</number> + </property> + <property stdset="1"> + <name>spacing</name> + <number>6</number> + </property> + <widget> + <class>QCheckBox</class> <property stdset="1"> <name>name</name> - <cstring>TextLabel2_3</cstring> + <cstring>writeCaptureFile</cstring> </property> <property stdset="1"> @@ -262,25 +401,25 @@ <property stdset="1"> <name>text</name> - <string>Device Type</string> + <string>Write Capture File</string> </property> </widget> - <widget row="0" column="1" > - <class>QLabel</class> + <widget> + <class>QToolButton</class> <property stdset="1"> <name>name</name> - <cstring>TextLabel1_2</cstring> + <cstring>getCaptureFileName</cstring> </property> <property stdset="1"> <name>enabled</name> - <bool>true</bool> + <bool>false</bool> </property> <property stdset="1"> <name>text</name> - <string>Interface Name</string> + <string>...</string> </property> </widget> - </grid> + </hbox> </widget> - <widget> + <widget row="7" column="0" rowspan="1" colspan="3" > <class>QLayoutWidget</class> <property stdset="1"> @@ -331,41 +470,32 @@ </hbox> </widget> - <widget> - <class>QCheckBox</class> - <property stdset="1"> + <spacer row="6" column="2" > + <property> <name>name</name> - <cstring>groupNetworks</cstring> - </property> - <property stdset="1"> - <name>enabled</name> - <bool>false</bool> + <cstring>Spacer1</cstring> </property> <property stdset="1"> - <name>text</name> - <string>Group Detected Networks</string> + <name>orientation</name> + <enum>Vertical</enum> </property> - </widget> - <widget> - <class>QCheckBox</class> <property stdset="1"> - <name>name</name> - <cstring>enableActivity</cstring> + <name>sizeType</name> + <enum>Expanding</enum> </property> - <property stdset="1"> - <name>enabled</name> - <bool>false</bool> - </property> - <property stdset="1"> - <name>text</name> - <string>Enable Activity Display</string> + <property> + <name>sizeHint</name> + <size> + <width>20</width> + <height>20</height> + </size> </property> - </widget> - <widget> + </spacer> + <widget row="9" column="0" rowspan="1" colspan="3" > <class>QLayoutWidget</class> <property stdset="1"> <name>name</name> - <cstring>Layout5</cstring> + <cstring>Layout7</cstring> </property> - <grid> + <hbox> <property stdset="1"> <name>margin</name> @@ -376,91 +506,49 @@ <number>6</number> </property> - <widget row="0" column="1" > + <widget> <class>QLabel</class> <property stdset="1"> <name>name</name> - <cstring>TextLabel1</cstring> + <cstring>TextLabel1_4</cstring> </property> <property stdset="1"> <name>text</name> - <string>sound on new net</string> - </property> - </widget> - <widget row="1" column="0" > - <class>QComboBox</class> - <item> - <property> - <name>text</name> - <string>Ignore</string> - </property> - </item> - <item> - <property> - <name>text</name> - <string>Touch</string> - </property> - </item> - <item> - <property> - <name>text</name> - <string>Key</string> - </property> - </item> - <item> - <property> - <name>text</name> - <string>Alarm</string> - </property> - </item> - <property stdset="1"> - <name>name</name> - <cstring>beaconSound</cstring> - </property> - </widget> - <widget row="0" column="0" > - <class>QComboBox</class> - <item> - <property> - <name>text</name> - <string>Ignore</string> - </property> - </item> - <item> - <property> - <name>text</name> - <string>Touch</string> - </property> - </item> - <item> - <property> - <name>text</name> - <string>Key</string> - </property> - </item> - <item> - <property> - <name>text</name> - <string>Alarm</string> - </property> - </item> - <property stdset="1"> - <name>name</name> - <cstring>netSound</cstring> + <string>CaptureFile:</string> </property> </widget> - <widget row="1" column="1" > - <class>QLabel</class> + <widget> + <class>QLineEdit</class> <property stdset="1"> <name>name</name> - <cstring>TextLabel1_3</cstring> + <cstring>captureFileName</cstring> </property> <property stdset="1"> - <name>text</name> - <string>sound on beacon</string> + <name>enabled</name> + <bool>false</bool> </property> </widget> - </grid> + </hbox> </widget> - </vbox> + </grid> </widget> +<connections> + <connection> + <sender>writeCaptureFile</sender> + <signal>toggled(bool)</signal> + <receiver>getCaptureFileName</receiver> + <slot>setEnabled(bool)</slot> + </connection> + <connection> + <sender>activeScanning</sender> + <signal>toggled(bool)</signal> + <receiver>MAC</receiver> + <slot>setEnabled(bool)</slot> + </connection> + <connection> + <sender>writeCaptureFile</sender> + <signal>toggled(bool)</signal> + <receiver>captureFileName</receiver> + <slot>setEnabled(bool)</slot> + </connection> +</connections> </UI> 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 @@ -22,7 +22,9 @@ #include <qcombobox.h> #include <qfile.h> +#include <qlineedit.h> #include <qlayout.h> #include <qmap.h> #include <qpushbutton.h> +#include <qtoolbutton.h> #include <qspinbox.h> #include <qtextstream.h> @@ -86,4 +88,5 @@ WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char connect( deviceType, SIGNAL( activated(int) ), this, SLOT( changedDeviceType(int) ) ); + connect( getCaptureFileName, SIGNAL( clicked() ), this, SLOT( getCaptureFileNameClicked() ) ); }; @@ -113,5 +116,5 @@ 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 ); @@ -125,2 +128,13 @@ 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 @@ -46,4 +46,5 @@ class WellenreiterConfigWindow : public WellenreiterConfigBase public slots: void changedDeviceType(int); + void getCaptureFileNameClicked(); protected: 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 @@ -31,7 +31,9 @@ using namespace Opie; // 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> @@ -321,7 +323,18 @@ 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() ) |