-rw-r--r-- | noncore/net/wellenreiter/gui/configbase.ui | 122 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/mainwindow.cpp | 13 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 1 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.h | 2 |
4 files changed, 79 insertions, 59 deletions
diff --git a/noncore/net/wellenreiter/gui/configbase.ui b/noncore/net/wellenreiter/gui/configbase.ui index 4fc8ea1..2c335df 100644 --- a/noncore/net/wellenreiter/gui/configbase.ui +++ b/noncore/net/wellenreiter/gui/configbase.ui @@ -6,18 +6,18 @@ <name>name</name> <cstring>WellenreiterConfigBase</cstring> </property> <property stdset="1"> <name>geometry</name> <rect> <x>0</x> <y>0</y> - <width>286</width> - <height>345</height> + <width>303</width> + <height>343</height> </rect> </property> <property stdset="1"> <name>caption</name> <string>Wellenreiter II COnfiguration Dialog</string> </property> <property> <name>layoutMargin</name> @@ -54,17 +54,17 @@ </property> <attribute> <name>title</name> <string>Interface</string> </attribute> <vbox> <property stdset="1"> <name>margin</name> - <number>11</number> + <number>6</number> </property> <property stdset="1"> <name>spacing</name> <number>6</number> </property> <widget> <class>QLayoutWidget</class> <property stdset="1"> @@ -701,17 +701,17 @@ </property> <attribute> <name>title</name> <string>UI</string> </attribute> <vbox> <property stdset="1"> <name>margin</name> - <number>11</number> + <number>6</number> </property> <property stdset="1"> <name>spacing</name> <number>6</number> </property> <widget> <class>QCheckBox</class> <property stdset="1"> @@ -768,16 +768,20 @@ </spacer> <widget> <class>QGroupBox</class> <property stdset="1"> <name>name</name> <cstring>GroupBox4_2</cstring> </property> <property stdset="1"> + <name>enabled</name> + <bool>false</bool> + </property> + <property stdset="1"> <name>title</name> <string>Action On Detecting</string> </property> <grid> <property stdset="1"> <name>margin</name> <number>11</number> </property> @@ -851,17 +855,17 @@ </property> <attribute> <name>title</name> <string>Intrusion</string> </attribute> <grid> <property stdset="1"> <name>margin</name> - <number>11</number> + <number>6</number> </property> <property stdset="1"> <name>spacing</name> <number>6</number> </property> <widget row="1" column="0" > <class>QGroupBox</class> <property stdset="1"> @@ -1061,30 +1065,56 @@ <property stdset="1"> <name>name</name> <cstring>tab</cstring> </property> <attribute> <name>title</name> <string>GPS</string> </attribute> - <widget> + <grid> + <property stdset="1"> + <name>margin</name> + <number>5</number> + </property> + <property stdset="1"> + <name>spacing</name> + <number>4</number> + </property> + <widget row="0" column="0" > <class>QLayoutWidget</class> <property stdset="1"> <name>name</name> - <cstring>Layout1</cstring> + <cstring>Layout6</cstring> </property> + <vbox> <property stdset="1"> - <name>geometry</name> - <rect> - <x>10</x> - <y>40</y> - <width>216</width> - <height>27</height> - </rect> + <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>enableGPS</cstring> + </property> + <property stdset="1"> + <name>text</name> + <string>Enable GPS logging w/ gpsd</string> + </property> + </widget> + <widget> + <class>QLayoutWidget</class> + <property stdset="1"> + <name>name</name> + <cstring>Layout1</cstring> </property> <hbox> <property stdset="1"> <name>margin</name> <number>0</number> </property> <property stdset="1"> <name>spacing</name> @@ -1158,79 +1188,65 @@ <property stdset="1"> <name>value</name> <number>2947</number> </property> </widget> </hbox> </widget> <widget> - <class>QLineEdit</class> + <class>QCheckBox</class> <property stdset="1"> <name>name</name> - <cstring>commandGPS</cstring> - </property> - <property stdset="1"> - <name>enabled</name> - <bool>false</bool> - </property> - <property stdset="1"> - <name>geometry</name> - <rect> - <x>10</x> - <y>110</y> - <width>210</width> - <height>22</height> - </rect> + <cstring>startGPS</cstring> </property> <property stdset="1"> <name>text</name> - <string>gpsd -p /dev/ttyS3 -s 57600</string> + <string>Start gpsd on localhost</string> </property> </widget> <widget> - <class>QCheckBox</class> + <class>QLineEdit</class> <property stdset="1"> <name>name</name> - <cstring>enableGPS</cstring> + <cstring>commandGPS</cstring> </property> <property stdset="1"> - <name>geometry</name> - <rect> - <x>10</x> - <y>10</y> - <width>199</width> - <height>21</height> - </rect> + <name>enabled</name> + <bool>false</bool> </property> <property stdset="1"> <name>text</name> - <string>Enable GPS logging w/ gpsd</string> + <string>gpsd -p /dev/ttyS3 -s 57600</string> </property> </widget> - <widget> - <class>QCheckBox</class> - <property stdset="1"> + <spacer> + <property> <name>name</name> - <cstring>startGPS</cstring> + <cstring>Spacer4_2</cstring> </property> <property stdset="1"> - <name>geometry</name> - <rect> - <x>10</x> - <y>80</y> - <width>171</width> - <height>21</height> - </rect> + <name>orientation</name> + <enum>Vertical</enum> </property> <property stdset="1"> - <name>text</name> - <string>Start gpsd on localhost</string> + <name>sizeType</name> + <enum>Expanding</enum> + </property> + <property> + <name>sizeHint</name> + <size> + <width>20</width> + <height>20</height> + </size> </property> + </spacer> + </vbox> </widget> + </grid> </widget> </widget> </grid> </widget> <customwidgets> <customwidget> <class>ProtocolListView</class> <header location="local">protolistview.h</header> diff --git a/noncore/net/wellenreiter/gui/mainwindow.cpp b/noncore/net/wellenreiter/gui/mainwindow.cpp index bb46dd7..ca9851c 100644 --- a/noncore/net/wellenreiter/gui/mainwindow.cpp +++ b/noncore/net/wellenreiter/gui/mainwindow.cpp @@ -417,26 +417,28 @@ void WellenreiterMainWindow::uploadSession() struct sockaddr_in raddr; struct hostent *rhost_info; int sock = -1; bool ok = false; rhost_info = (struct hostent *) ::gethostbyname( CAP_hostname ); if ( rhost_info ) { - if ( !QFile::exists( "/var/log/dump.wellenreiter" ) ) + + + if ( !QFile::exists( mw->captureFileName() ) ) { - QMessageBox::warning( 0, tr( "Error" ), tr( "<p>Logfile doesn't exist</p>") ); + QMessageBox::warning( 0, tr( "Error" ), tr( "<p>Logfile '%1' doesn't exist</p>").arg( mw->captureFileName() ) ); return; } - QFile f( "/var/log/dump.wellenreiter" ); + QFile f( mw->captureFileName() ); if ( !f.open( IO_ReadOnly ) ) { - QMessageBox::warning( 0, tr( "Error" ), tr( "<p>Can't open Logfile</p>") ); + QMessageBox::warning( 0, tr( "Error" ), tr( "<p>Can't open Logfile '%1'</p>").arg( mw->captureFileName() ) ); return; } int content_length = f.size(); ::memset( &raddr, 0, sizeof (struct sockaddr_in) ); ::memcpy( &raddr. sin_addr, rhost_info-> h_addr, rhost_info-> h_length ); raddr.sin_family = rhost_info-> h_addrtype; @@ -476,26 +478,27 @@ void WellenreiterMainWindow::uploadSession() "Content-Disposition: form-data; name=\"Location\"\r\n" "\r\n" "%2\r\n" "-----------------------------97267758015830030481215568065\r\n" "Content-Disposition: form-data; name=\"Comments\"\r\n" "\r\n" "%3\r\n" "-----------------------------97267758015830030481215568065\r\n" - "Content-Disposition: form-data; name=\"upfile\"; filename=\"/var/log/dump.wellenreiter\"\r\n" + "Content-Disposition: form-data; name=\"upfile\"; filename=\"%4\"\r\n" "Content-Type: application/octet-stream\r\n" "\r\n"; preambel = "" "\r\n-----------------------------97267758015830030481215568065--\r\n"; content = content.arg( from->text().isEmpty() ? QString( "Anonymous Wellenreiter II User" ) : from->text() ); content = content.arg( location->text().isEmpty() ? QString( "Anonymous Wellenreiter II Location" ) : location->text() ); content = content.arg( comments->text().isEmpty() ? QString( "Anonymous Wellenreiter II Comments" ) : comments->text() ); + content = content.arg( mw->captureFileName() ); header = header.arg( QString::number( content.length() + f.size() + preambel.length() ) ); // write header const char* ascii = header.latin1(); uint ascii_len = ::strlen( ascii ); ::write ( sock, ascii, ascii_len ); diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp index ec89f1e..9255a6d 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp @@ -502,17 +502,16 @@ void Wellenreiter::startClicked() if ( configwindow->enableGPS->isChecked() ) { qDebug( "Wellenreiter:GPS enabled @ %s:%d", (const char*) configwindow->gpsdHost->currentText(), configwindow->gpsdPort->value() ); gps->open( configwindow->gpsdHost->currentText(), configwindow->gpsdPort->value() ); } // open pcap and start sniffing - QString dumpname; if ( configwindow->writeCaptureFile->isChecked() ) // write to a user specified capture file? { dumpname = configwindow->captureFileName->text(); if ( dumpname.isEmpty() ) dumpname = "captureFile"; dumpname.append( '-' ); dumpname.append( QTime::currentTime().toString().replace( QRegExp( ":" ), "-" ) ); dumpname.append( ".wellenreiter" ); } diff --git a/noncore/net/wellenreiter/gui/wellenreiter.h b/noncore/net/wellenreiter/gui/wellenreiter.h index d882500..58dd1fd 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.h +++ b/noncore/net/wellenreiter/gui/wellenreiter.h @@ -46,16 +46,17 @@ class Wellenreiter : public WellenreiterBase { Wellenreiter( QWidget* parent = 0 ); ~Wellenreiter(); void setConfigWindow( WellenreiterConfigWindow* cw ); MScanListView* netView() const { return netview; }; MLogWindow* logWindow() const { return logwindow; }; MHexWindow* hexWindow() const { return hexwindow; }; bool isDaemonRunning() const { return sniffing; }; + QString captureFileName() const { return dumpname; }; public: bool sniffing; protected: virtual void timerEvent( QTimerEvent* ); public slots: @@ -83,16 +84,17 @@ class Wellenreiter : public WellenreiterBase { QObject* childIfToParse( OPacket* p, const QString& protocol ); bool checkDumpPacket( OPacket* p ); private: #ifdef QWS OSystem _system; // Opie Operating System identifier #endif + QString dumpname; OWirelessNetworkInterface* iface; OPacketCapturer* pcap; WellenreiterConfigWindow* configwindow; GPS* gps; //void readConfig(); //void writeConfig(); }; |