author | mickeyl <mickeyl> | 2003-04-30 18:50:47 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-04-30 18:50:47 (UTC) |
commit | e6428d30a5dc90ed3ec6ca7e1cb3f92c81437cc0 (patch) (unidiff) | |
tree | 06f7877ef85b91531c4f75681e1cd91881703c18 | |
parent | 027458b66cffbfaf07c394a1a622a1f01970e11c (diff) | |
download | opie-e6428d30a5dc90ed3ec6ca7e1cb3f92c81437cc0.zip opie-e6428d30a5dc90ed3ec6ca7e1cb3f92c81437cc0.tar.gz opie-e6428d30a5dc90ed3ec6ca7e1cb3f92c81437cc0.tar.bz2 |
- autoscrolling for hex- and logwindow
- revamped statistics window
-rw-r--r-- | noncore/net/wellenreiter/README | 4 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/hexwindow.cpp | 13 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/hexwindow.h | 6 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/logwindow.cpp | 15 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/statwindow.cpp | 36 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/statwindow.h | 11 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 18 | ||||
-rwxr-xr-x | noncore/net/wellenreiter/makedist.sh | 2 |
8 files changed, 47 insertions, 58 deletions
diff --git a/noncore/net/wellenreiter/README b/noncore/net/wellenreiter/README index 291f1fe..ec621b9 100644 --- a/noncore/net/wellenreiter/README +++ b/noncore/net/wellenreiter/README | |||
@@ -1,67 +1,67 @@ | |||
1 | /************************************************************************ | 1 | /************************************************************************ |
2 | /* W e l l e n r e i t e r I I | 2 | /* W e l l e n r e i t e r I I |
3 | /* =============================== | 3 | /* =============================== |
4 | /* | 4 | /* |
5 | /* Version: ALPHA-2-April | 5 | /* Version: April BETA |
6 | /************************************************************************ | 6 | /************************************************************************ |
7 | 7 | ||
8 | ---------------------------------------------------- | 8 | ---------------------------------------------------- |
9 | Release Notes for Opie-ALPHA Version April 2003 | 9 | Release Notes for Opie-Wellenreiter Version BETA April 2003 |
10 | ---------------------------------------------------- | 10 | ---------------------------------------------------- |
11 | 11 | ||
12 | ===================== | 12 | ===================== |
13 | = Supported Devices | 13 | = Supported Devices |
14 | ===================== | 14 | ===================== |
15 | 15 | ||
16 | - HERMES chipset [ orinoco or hostap ], e.g. Lucent/Agere cards, ... | 16 | - HERMES chipset [ orinoco or hostap ], e.g. Lucent/Agere cards, ... |
17 | - PRISM2 chipset [ orinoco or hostap ], e.g. D-Link, Buffallo, ... | 17 | - PRISM2 chipset [ orinoco or hostap ], e.g. D-Link, Buffallo, ... |
18 | - SYMBOL/SPECTRUM chipset [ orinoco ], e.g. Symbol Spectrum 24, Socket Lowpower CF, ... | 18 | - SYMBOL/SPECTRUM chipset [ orinoco ], e.g. Symbol Spectrum 24, Socket Lowpower CF, ... |
19 | - CISCO chipset | 19 | - CISCO chipset |
20 | - wlan-ng supported chipsets | 20 | - wlan-ng supported chipsets |
21 | 21 | ||
22 | ===================== | 22 | ===================== |
23 | = Build | 23 | = Build |
24 | ===================== | 24 | ===================== |
25 | 25 | ||
26 | To compile a standalone Wellenreiter for X11, you need Qt3 and the development | 26 | To compile a standalone Wellenreiter for X11, you need Qt3 and the development |
27 | packages for Qt3, e.g. libqt3-devel. | 27 | packages for Qt3, e.g. libqt3-devel. |
28 | 28 | ||
29 | * Set $QTDIR to the appropriate directory (e.g. /usr/lib/qt3) | 29 | * Set $QTDIR to the appropriate directory (e.g. /usr/lib/qt3) |
30 | * './build make' | 30 | * './build make' |
31 | * as root, './build install' | 31 | * as root, './build install' |
32 | * Wellenreiter will be installed in /usr/local | 32 | * Wellenreiter will be installed in /usr/local |
33 | 33 | ||
34 | ===================== | 34 | ===================== |
35 | = Precompiled Binaries | 35 | = Precompiled Binaries |
36 | ===================== | 36 | ===================== |
37 | 37 | ||
38 | Precompiled binaries are available for the PDA-Version. | 38 | Precompiled binaries are available for the PDA-Version. |
39 | Get them from http://opie.net.wox.org/wellenreiter/ | 39 | Get them from http://opie.net.wox.org/wellenreiter/ |
40 | 40 | ||
41 | ===================== | 41 | ===================== |
42 | = Run | 42 | = Run |
43 | ===================== | 43 | ===================== |
44 | 44 | ||
45 | * Configure your device by pressing the configure toolbutton (to the right) | 45 | * Configure your device by pressing the configure toolbutton (to the right) |
46 | * Start Sniffing by pressing the execute toolbutton which will be enabled, | 46 | * Start Sniffing by pressing the execute toolbutton which will be enabled, |
47 | if your device has been properly configured. | 47 | if your device has been properly configured. |
48 | 48 | ||
49 | ===================== | 49 | ===================== |
50 | = Credits = | 50 | = Credits = |
51 | ===================== | 51 | ===================== |
52 | 52 | ||
53 | Wellenreiter II is (C) 2002-2003 M-M-M | 53 | Wellenreiter II is (C) 2002-2003 M-M-M |
54 | 54 | ||
55 | Max Moser <max@remote-exploit.org> | 55 | Max Moser <max@remote-exploit.org> |
56 | Martin J. Muench <mjm@remote-exploit.org> | 56 | Martin J. Muench <mjm@remote-exploit.org> |
57 | Michael Lauer <mickeyl@handhelds.org> | 57 | Michael Lauer <mickeyl@handhelds.org> |
58 | 58 | ||
59 | ===================== | 59 | ===================== |
60 | = Links = | 60 | = Links = |
61 | ===================== | 61 | ===================== |
62 | 62 | ||
63 | Wellenreiter: http://www.remote-exploit.org | 63 | Wellenreiter: http://www.remote-exploit.org |
64 | Wellenreiter/Opie: http://opie.net.wox.org/wellenreiter | 64 | Wellenreiter/Opie: http://opie.net.wox.org/wellenreiter |
65 | Opie Project: http://opie.handhelds.org | 65 | Opie Project: http://opie.handhelds.org |
66 | OpenZaurus Project: http://openzaurus.org | 66 | OpenZaurus Project: http://openzaurus.org |
67 | 67 | ||
diff --git a/noncore/net/wellenreiter/gui/hexwindow.cpp b/noncore/net/wellenreiter/gui/hexwindow.cpp index 8b17285..2f011ca 100644 --- a/noncore/net/wellenreiter/gui/hexwindow.cpp +++ b/noncore/net/wellenreiter/gui/hexwindow.cpp | |||
@@ -1,45 +1,44 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. | 2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Opie Environment. | 4 | ** This file is part of Opie Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | **********************************************************************/ | 14 | **********************************************************************/ |
15 | 15 | ||
16 | #include "hexwindow.h" | 16 | #include "hexwindow.h" |
17 | #include <qmultilineedit.h> | 17 | #include <qmultilineedit.h> |
18 | 18 | ||
19 | MHexWindow::MHexWindow( QWidget * parent, const char * name, WFlags f ) | 19 | MHexWindow::MHexWindow( QWidget * parent, const char * name, WFlags f ) |
20 | :QVBox( parent, name, f ) | 20 | :QVBox( parent, name, f ) |
21 | { | 21 | { |
22 | ledit = new QMultiLineEdit( this ); | 22 | ledit = new QMultiLineEdit( this ); |
23 | ledit->setFont( QFont( "fixed", 10 ) ); | 23 | ledit->setFont( QFont( "fixed", 10 ) ); |
24 | 24 | ledit->setReadOnly( true ); | |
25 | // FIXME: Set properties( font, read-only, etc...) | ||
26 | |||
27 | }; | 25 | }; |
28 | 26 | ||
29 | void MHexWindow::log( QString text ) | 27 | void MHexWindow::log( const QString& text ) |
30 | { | 28 | { |
31 | 29 | int col; | |
32 | ledit->append( text ); | 30 | int row; |
33 | 31 | ledit->getCursorPosition( &col, &row ); | |
32 | ledit->insertAt( text, col, row ); | ||
34 | }; | 33 | }; |
35 | 34 | ||
36 | const QString MHexWindow::getLog() const | 35 | const QString MHexWindow::getLog() const |
37 | { | 36 | { |
38 | return ledit->text(); | 37 | return ledit->text(); |
39 | } | 38 | } |
40 | 39 | ||
41 | void MHexWindow::clear() | 40 | void MHexWindow::clear() |
42 | { | 41 | { |
43 | ledit->clear(); | 42 | ledit->clear(); |
44 | } | 43 | } |
45 | 44 | ||
diff --git a/noncore/net/wellenreiter/gui/hexwindow.h b/noncore/net/wellenreiter/gui/hexwindow.h index f2f870c..3d4ec0f 100644 --- a/noncore/net/wellenreiter/gui/hexwindow.h +++ b/noncore/net/wellenreiter/gui/hexwindow.h | |||
@@ -1,40 +1,40 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. | 2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Opie Environment. | 4 | ** This file is part of Opie Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | **********************************************************************/ | 14 | **********************************************************************/ |
15 | 15 | ||
16 | #ifndef HEXWINDOW_H | 16 | #ifndef HEXWINDOW_H |
17 | #define HEXWINDOW_H | 17 | #define HEXWINDOW_H |
18 | 18 | ||
19 | #include <qvbox.h> | 19 | #include <qvbox.h> |
20 | 20 | ||
21 | class QString; | 21 | class QString; |
22 | class QMultiLineEdit; | 22 | class QMultiLineEdit; |
23 | 23 | ||
24 | class MHexWindow: public QVBox | 24 | class MHexWindow: public QVBox |
25 | { | 25 | { |
26 | 26 | ||
27 | public: | 27 | public: |
28 | MHexWindow( QWidget * parent = 0, const char * name = "MHexWindow", WFlags f = 0 ); | 28 | MHexWindow( QWidget * parent = 0, const char * name = "MHexWindow", WFlags f = 0 ); |
29 | 29 | ||
30 | void log( QString text ); | 30 | void log( const QString& text ); |
31 | const QString getLog() const; | 31 | const QString getLog() const; |
32 | void clear(); | 32 | void clear(); |
33 | 33 | ||
34 | protected: | 34 | protected: |
35 | QMultiLineEdit* ledit; | 35 | QMultiLineEdit* ledit; |
36 | 36 | ||
37 | }; | 37 | }; |
38 | 38 | ||
39 | #endif | 39 | #endif |
40 | 40 | ||
diff --git a/noncore/net/wellenreiter/gui/logwindow.cpp b/noncore/net/wellenreiter/gui/logwindow.cpp index 55e2ccb..12f74fd 100644 --- a/noncore/net/wellenreiter/gui/logwindow.cpp +++ b/noncore/net/wellenreiter/gui/logwindow.cpp | |||
@@ -1,47 +1,50 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. | 2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Opie Environment. | 4 | ** This file is part of Opie Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | **********************************************************************/ | 14 | **********************************************************************/ |
15 | 15 | ||
16 | #include "logwindow.h" | 16 | #include "logwindow.h" |
17 | #include <qmultilineedit.h> | 17 | #include <qmultilineedit.h> |
18 | #include <qdatetime.h> | 18 | #include <qdatetime.h> |
19 | 19 | ||
20 | MLogWindow::MLogWindow( QWidget * parent, const char * name, WFlags f ) | 20 | MLogWindow::MLogWindow( QWidget * parent, const char * name, WFlags f ) |
21 | :QVBox( parent, name, f ) | 21 | :QVBox( parent, name, f ) |
22 | { | 22 | { |
23 | ledit = new QMultiLineEdit( this ); | 23 | ledit = new QMultiLineEdit( this ); |
24 | 24 | ledit->setReadOnly( true ); | |
25 | // FIXME: Set properties( font, read-only, etc...) | ||
26 | |||
27 | } | 25 | } |
28 | 26 | ||
27 | |||
29 | void MLogWindow::log( QString text ) | 28 | void MLogWindow::log( QString text ) |
30 | { | 29 | { |
31 | QTime time = QTime::currentTime(); | 30 | QTime time = QTime::currentTime(); |
32 | QString line; | 31 | QString line; |
33 | line.sprintf( "[%s] %s", (const char*) time.toString(), (const char*) text ); | 32 | line.sprintf( "[%s] %s\n", (const char*) time.toString(), (const char*) text ); |
34 | ledit->append( line ); | 33 | int col; |
34 | int row; | ||
35 | ledit->getCursorPosition( &col, &row ); | ||
36 | ledit->insertAt( line, col, row ); | ||
35 | qDebug( line ); | 37 | qDebug( line ); |
36 | |||
37 | } | 38 | } |
38 | 39 | ||
40 | |||
39 | void MLogWindow::clear() | 41 | void MLogWindow::clear() |
40 | { | 42 | { |
41 | ledit->clear(); | 43 | ledit->clear(); |
42 | } | 44 | } |
43 | 45 | ||
46 | |||
44 | const QString MLogWindow::getLog() const | 47 | const QString MLogWindow::getLog() const |
45 | { | 48 | { |
46 | return ledit->text(); | 49 | return ledit->text(); |
47 | } | 50 | } |
diff --git a/noncore/net/wellenreiter/gui/statwindow.cpp b/noncore/net/wellenreiter/gui/statwindow.cpp index 07d34ef..2c8c774 100644 --- a/noncore/net/wellenreiter/gui/statwindow.cpp +++ b/noncore/net/wellenreiter/gui/statwindow.cpp | |||
@@ -1,45 +1,43 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. | 2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Opie Environment. | 4 | ** This file is part of Opie Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | **********************************************************************/ | 14 | **********************************************************************/ |
15 | 15 | ||
16 | #include "statwindow.h" | 16 | #include "statwindow.h" |
17 | #include <qmultilineedit.h> | 17 | #include <opie2/olistview.h> |
18 | 18 | ||
19 | MStatWindow::MStatWindow( QWidget * parent, const char * name, WFlags f ) | 19 | MStatWindow::MStatWindow( QWidget * parent, const char * name, WFlags f ) |
20 | :QVBox( parent, name, f ) | 20 | :QVBox( parent, name, f ) |
21 | { | 21 | { |
22 | ledit = new QMultiLineEdit( this ); | 22 | table = new OListView( this ); |
23 | ledit->setFont( QFont( "fixed", 10 ) ); | 23 | table->addColumn( "Protocol" ); |
24 | 24 | table->addColumn( "Count" ); | |
25 | // FIXME: Set properties( font, read-only, etc...) | 25 | table->setItemMargin( 2 ); |
26 | |||
27 | }; | 26 | }; |
28 | 27 | ||
29 | void MStatWindow::log( QString text ) | ||
30 | { | ||
31 | |||
32 | ledit->append( text ); | ||
33 | |||
34 | }; | ||
35 | |||
36 | const QString MStatWindow::getLog() const | ||
37 | { | ||
38 | return ledit->text(); | ||
39 | } | ||
40 | 28 | ||
41 | void MStatWindow::clear() | 29 | void MStatWindow::updateCounter( const QString& protocol, int counter ) |
42 | { | 30 | { |
43 | ledit->clear(); | 31 | QListViewItemIterator it( table ); |
32 | for ( ; it.current(); ++it ) | ||
33 | { | ||
34 | if ( it.current()->text( 0 ) == protocol ) | ||
35 | { | ||
36 | it.current()->setText( 1, QString::number( counter ) ); | ||
37 | return; | ||
38 | } | ||
39 | } | ||
40 | |||
41 | new OListViewItem( table, protocol, QString::number( counter ) ); | ||
44 | } | 42 | } |
45 | 43 | ||
diff --git a/noncore/net/wellenreiter/gui/statwindow.h b/noncore/net/wellenreiter/gui/statwindow.h index bbdf777..0ab4b50 100644 --- a/noncore/net/wellenreiter/gui/statwindow.h +++ b/noncore/net/wellenreiter/gui/statwindow.h | |||
@@ -1,40 +1,43 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. | 2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Opie Environment. | 4 | ** This file is part of Opie Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | **********************************************************************/ | 14 | **********************************************************************/ |
15 | 15 | ||
16 | #ifndef STATWINDOW_H | 16 | #ifndef STATWINDOW_H |
17 | #define STATWINDOW_H | 17 | #define STATWINDOW_H |
18 | 18 | ||
19 | #include <qvbox.h> | 19 | #include <qvbox.h> |
20 | 20 | ||
21 | class QString; | 21 | class QString; |
22 | class QMultiLineEdit; | 22 | class OListView; |
23 | 23 | ||
24 | class MStatWindow: public QVBox | 24 | class MStatWindow: public QVBox |
25 | { | 25 | { |
26 | Q_OBJECT | ||
26 | 27 | ||
27 | public: | 28 | public: |
28 | MStatWindow( QWidget * parent = 0, const char * name = "MStatWindow", WFlags f = 0 ); | 29 | MStatWindow( QWidget * parent = 0, const char * name = "MStatWindow", WFlags f = 0 ); |
29 | 30 | ||
30 | void log( QString text ); | 31 | void log( QString text ); |
31 | const QString getLog() const; | 32 | const QString getLog() const; |
32 | void clear(); | 33 | void clear(); |
33 | 34 | ||
35 | void updateCounter( const QString&, int ); | ||
36 | |||
34 | protected: | 37 | protected: |
35 | QMultiLineEdit* ledit; | 38 | OListView* table; |
36 | 39 | ||
37 | }; | 40 | }; |
38 | 41 | ||
39 | #endif | 42 | #endif |
40 | 43 | ||
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp index 0105e09..5ec9ee4 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp | |||
@@ -1,130 +1,131 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. | 2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Opie Environment. | 4 | ** This file is part of Opie Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ***********************************************************************/ | 14 | ***********************************************************************/ |
15 | 15 | ||
16 | // Opie | 16 | // Opie |
17 | 17 | ||
18 | #ifdef QWS | 18 | #ifdef QWS |
19 | #include <opie/odevice.h> | 19 | #include <opie/odevice.h> |
20 | using namespace Opie; | 20 | using namespace Opie; |
21 | #endif | 21 | #endif |
22 | 22 | ||
23 | #ifdef QWS | 23 | #ifdef QWS |
24 | #include <opie2/oapplication.h> | 24 | #include <opie2/oapplication.h> |
25 | #else | 25 | #else |
26 | #include <qapplication.h> | 26 | #include <qapplication.h> |
27 | #endif | 27 | #endif |
28 | #include <opie2/onetwork.h> | 28 | #include <opie2/onetwork.h> |
29 | #include <opie2/opcap.h> | 29 | #include <opie2/opcap.h> |
30 | 30 | ||
31 | // Qt | 31 | // Qt |
32 | 32 | ||
33 | #include <qcheckbox.h> | 33 | #include <qcheckbox.h> |
34 | #include <qcombobox.h> | 34 | #include <qcombobox.h> |
35 | #include <qdatetime.h> | ||
35 | #include <qpushbutton.h> | 36 | #include <qpushbutton.h> |
36 | #include <qlineedit.h> | 37 | #include <qlineedit.h> |
37 | #include <qmessagebox.h> | 38 | #include <qmessagebox.h> |
38 | #include <qregexp.h> | 39 | #include <qregexp.h> |
39 | #include <qspinbox.h> | 40 | #include <qspinbox.h> |
40 | #include <qtoolbutton.h> | 41 | #include <qtoolbutton.h> |
41 | #include <qmainwindow.h> | 42 | #include <qmainwindow.h> |
42 | 43 | ||
43 | // Standard | 44 | // Standard |
44 | 45 | ||
45 | #include <assert.h> | 46 | #include <assert.h> |
46 | #include <errno.h> | 47 | #include <errno.h> |
47 | #include <unistd.h> | 48 | #include <unistd.h> |
48 | #include <string.h> | 49 | #include <string.h> |
49 | #include <sys/types.h> | 50 | #include <sys/types.h> |
50 | #include <stdlib.h> | 51 | #include <stdlib.h> |
51 | 52 | ||
52 | // Local | 53 | // Local |
53 | 54 | ||
54 | #include "wellenreiter.h" | 55 | #include "wellenreiter.h" |
55 | #include "scanlist.h" | 56 | #include "scanlist.h" |
56 | #include "logwindow.h" | 57 | #include "logwindow.h" |
57 | #include "hexwindow.h" | 58 | #include "hexwindow.h" |
58 | #include "configwindow.h" | 59 | #include "configwindow.h" |
59 | #include "statwindow.h" | 60 | #include "statwindow.h" |
60 | #include "manufacturers.h" | 61 | #include "manufacturers.h" |
61 | 62 | ||
62 | Wellenreiter::Wellenreiter( QWidget* parent ) | 63 | Wellenreiter::Wellenreiter( QWidget* parent ) |
63 | : WellenreiterBase( parent, 0, 0 ), | 64 | : WellenreiterBase( parent, 0, 0 ), |
64 | sniffing( false ), iface( 0 ), manufacturerdb( 0 ), configwindow( 0 ) | 65 | sniffing( false ), iface( 0 ), manufacturerdb( 0 ), configwindow( 0 ) |
65 | { | 66 | { |
66 | 67 | ||
67 | // | 68 | // |
68 | // construct manufacturer database | 69 | // construct manufacturer database |
69 | // | 70 | // |
70 | 71 | ||
71 | QString manufile; | 72 | QString manufile; |
72 | #ifdef QWS | 73 | #ifdef QWS |
73 | manufile.sprintf( "%s/share/wellenreiter/manufacturers.dat", (const char*) QPEApplication::qpeDir() ); | 74 | manufile.sprintf( "%s/share/wellenreiter/manufacturers.dat", (const char*) QPEApplication::qpeDir() ); |
74 | #else | 75 | #else |
75 | manufile.sprintf( "/usr/local/share/wellenreiter/manufacturers.dat" ); | 76 | manufile.sprintf( "/usr/local/share/wellenreiter/manufacturers.dat" ); |
76 | #endif | 77 | #endif |
77 | manufacturerdb = new ManufacturerDB( manufile ); | 78 | manufacturerdb = new ManufacturerDB( manufile ); |
78 | 79 | ||
79 | logwindow->log( "(i) Wellenreiter has been started." ); | 80 | logwindow->log( "(i) Wellenreiter has been started." ); |
80 | 81 | ||
81 | // | 82 | // |
82 | // detect operating system | 83 | // detect operating system |
83 | // | 84 | // |
84 | 85 | ||
85 | #ifdef QWS | 86 | #ifdef QWS |
86 | QString sys; | 87 | QString sys; |
87 | sys.sprintf( "(i) Running on '%s'.", (const char*) ODevice::inst()->systemString() ); | 88 | sys.sprintf( "(i) Running on '%s'.", (const char*) ODevice::inst()->systemString() ); |
88 | _system = ODevice::inst()->system(); | 89 | _system = ODevice::inst()->system(); |
89 | logwindow->log( sys ); | 90 | logwindow->log( sys ); |
90 | #endif | 91 | #endif |
91 | 92 | ||
92 | // setup GUI | 93 | // setup GUI |
93 | netview->setColumnWidthMode( 1, QListView::Manual ); | 94 | netview->setColumnWidthMode( 1, QListView::Manual ); |
94 | 95 | ||
95 | if ( manufacturerdb ) | 96 | if ( manufacturerdb ) |
96 | netview->setManufacturerDB( manufacturerdb ); | 97 | netview->setManufacturerDB( manufacturerdb ); |
97 | 98 | ||
98 | pcap = new OPacketCapturer(); | 99 | pcap = new OPacketCapturer(); |
99 | 100 | ||
100 | } | 101 | } |
101 | 102 | ||
102 | 103 | ||
103 | Wellenreiter::~Wellenreiter() | 104 | Wellenreiter::~Wellenreiter() |
104 | { | 105 | { |
105 | // no need to delete child widgets, Qt does it all for us | 106 | // no need to delete child widgets, Qt does it all for us |
106 | 107 | ||
107 | delete manufacturerdb; | 108 | delete manufacturerdb; |
108 | delete pcap; | 109 | delete pcap; |
109 | } | 110 | } |
110 | 111 | ||
111 | 112 | ||
112 | void Wellenreiter::setConfigWindow( WellenreiterConfigWindow* cw ) | 113 | void Wellenreiter::setConfigWindow( WellenreiterConfigWindow* cw ) |
113 | { | 114 | { |
114 | configwindow = cw; | 115 | configwindow = cw; |
115 | } | 116 | } |
116 | 117 | ||
117 | 118 | ||
118 | void Wellenreiter::channelHopped(int c) | 119 | void Wellenreiter::channelHopped(int c) |
119 | { | 120 | { |
120 | QString title = "Wellenreiter II -scan- ["; | 121 | QString title = "Wellenreiter II -scan- ["; |
121 | QString left; | 122 | QString left; |
122 | if ( c > 1 ) left.fill( '.', c-1 ); | 123 | if ( c > 1 ) left.fill( '.', c-1 ); |
123 | title.append( left ); | 124 | title.append( left ); |
124 | title.append( '|' ); | 125 | title.append( '|' ); |
125 | if ( c < iface->channels() ) | 126 | if ( c < iface->channels() ) |
126 | { | 127 | { |
127 | QString right; | 128 | QString right; |
128 | right.fill( '.', iface->channels()-c ); | 129 | right.fill( '.', iface->channels()-c ); |
129 | title.append( right ); | 130 | title.append( right ); |
130 | } | 131 | } |
@@ -164,209 +165,194 @@ void Wellenreiter::receivePacket(OPacket* p) | |||
164 | int channel = ds ? ds->channel() : -1; | 165 | int channel = ds ? ds->channel() : -1; |
165 | 166 | ||
166 | OWaveLanPacket* header = static_cast<OWaveLanPacket*>( p->child( "802.11" ) ); | 167 | OWaveLanPacket* header = static_cast<OWaveLanPacket*>( p->child( "802.11" ) ); |
167 | netView()->addNewItem( type, essid, header->macAddress2().toString(), beacon->canPrivacy(), channel, 0 ); | 168 | netView()->addNewItem( type, essid, header->macAddress2().toString(), beacon->canPrivacy(), channel, 0 ); |
168 | return; | 169 | return; |
169 | } | 170 | } |
170 | 171 | ||
171 | // check for a data frame | 172 | // check for a data frame |
172 | OWaveLanDataPacket* data = static_cast<OWaveLanDataPacket*>( p->child( "802.11 Data" ) ); | 173 | OWaveLanDataPacket* data = static_cast<OWaveLanDataPacket*>( p->child( "802.11 Data" ) ); |
173 | if ( data ) | 174 | if ( data ) |
174 | { | 175 | { |
175 | OWaveLanPacket* wlan = (OWaveLanPacket*) p->child( "802.11" ); | 176 | OWaveLanPacket* wlan = (OWaveLanPacket*) p->child( "802.11" ); |
176 | if ( wlan->fromDS() && !wlan->toDS() ) | 177 | if ( wlan->fromDS() && !wlan->toDS() ) |
177 | { | 178 | { |
178 | qDebug( "FromDS traffic: '%s' -> '%s' via '%s'", | 179 | qDebug( "FromDS traffic: '%s' -> '%s' via '%s'", |
179 | (const char*) wlan->macAddress3().toString(true), | 180 | (const char*) wlan->macAddress3().toString(true), |
180 | (const char*) wlan->macAddress1().toString(true), | 181 | (const char*) wlan->macAddress1().toString(true), |
181 | (const char*) wlan->macAddress2().toString(true) ); | 182 | (const char*) wlan->macAddress2().toString(true) ); |
182 | netView()->traffic( "fromDS", wlan->macAddress3().toString(), | 183 | netView()->traffic( "fromDS", wlan->macAddress3().toString(), |
183 | wlan->macAddress1().toString(), | 184 | wlan->macAddress1().toString(), |
184 | wlan->macAddress2().toString() ); | 185 | wlan->macAddress2().toString() ); |
185 | } | 186 | } |
186 | else | 187 | else |
187 | if ( !wlan->fromDS() && wlan->toDS() ) | 188 | if ( !wlan->fromDS() && wlan->toDS() ) |
188 | { | 189 | { |
189 | qDebug( "ToDS traffic: '%s' -> '%s' via '%s'", | 190 | qDebug( "ToDS traffic: '%s' -> '%s' via '%s'", |
190 | (const char*) wlan->macAddress2().toString(true), | 191 | (const char*) wlan->macAddress2().toString(true), |
191 | (const char*) wlan->macAddress3().toString(true), | 192 | (const char*) wlan->macAddress3().toString(true), |
192 | (const char*) wlan->macAddress1().toString(true) ); | 193 | (const char*) wlan->macAddress1().toString(true) ); |
193 | netView()->traffic( "toDS", wlan->macAddress2().toString(), | 194 | netView()->traffic( "toDS", wlan->macAddress2().toString(), |
194 | wlan->macAddress3().toString(), | 195 | wlan->macAddress3().toString(), |
195 | wlan->macAddress1().toString() ); | 196 | wlan->macAddress1().toString() ); |
196 | } | 197 | } |
197 | else | 198 | else |
198 | if ( wlan->fromDS() && wlan->toDS() ) | 199 | if ( wlan->fromDS() && wlan->toDS() ) |
199 | { | 200 | { |
200 | qDebug( "WSD(bridge) traffic: '%s' -> '%s' via '%s' and '%s'", | 201 | qDebug( "WSD(bridge) traffic: '%s' -> '%s' via '%s' and '%s'", |
201 | (const char*) wlan->macAddress4().toString(true), | 202 | (const char*) wlan->macAddress4().toString(true), |
202 | (const char*) wlan->macAddress3().toString(true), | 203 | (const char*) wlan->macAddress3().toString(true), |
203 | (const char*) wlan->macAddress1().toString(true), | 204 | (const char*) wlan->macAddress1().toString(true), |
204 | (const char*) wlan->macAddress2().toString(true) ); | 205 | (const char*) wlan->macAddress2().toString(true) ); |
205 | netView()->traffic( "WSD", wlan->macAddress4().toString(), | 206 | netView()->traffic( "WSD", wlan->macAddress4().toString(), |
206 | wlan->macAddress3().toString(), | 207 | wlan->macAddress3().toString(), |
207 | wlan->macAddress1().toString(), | 208 | wlan->macAddress1().toString(), |
208 | wlan->macAddress2().toString() ); | 209 | wlan->macAddress2().toString() ); |
209 | } | 210 | } |
210 | else | 211 | else |
211 | { | 212 | { |
212 | qDebug( "IBSS(AdHoc) traffic: '%s' -> '%s' (Cell: '%s')'", | 213 | qDebug( "IBSS(AdHoc) traffic: '%s' -> '%s' (Cell: '%s')'", |
213 | (const char*) wlan->macAddress2().toString(true), | 214 | (const char*) wlan->macAddress2().toString(true), |
214 | (const char*) wlan->macAddress1().toString(true), | 215 | (const char*) wlan->macAddress1().toString(true), |
215 | (const char*) wlan->macAddress3().toString(true) ); | 216 | (const char*) wlan->macAddress3().toString(true) ); |
216 | netView()->traffic( "IBSS", wlan->macAddress2().toString(), | 217 | netView()->traffic( "IBSS", wlan->macAddress2().toString(), |
217 | wlan->macAddress1().toString(), | 218 | wlan->macAddress1().toString(), |
218 | wlan->macAddress3().toString() ); | 219 | wlan->macAddress3().toString() ); |
219 | } | 220 | } |
220 | return; | 221 | return; |
221 | } | 222 | } |
222 | } | 223 | } |
223 | 224 | ||
224 | 225 | ||
225 | void Wellenreiter::stopClicked() | 226 | void Wellenreiter::stopClicked() |
226 | { | 227 | { |
227 | if ( iface ) | 228 | if ( iface ) |
228 | { | 229 | { |
229 | disconnect( SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) ); | 230 | disconnect( SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) ); |
230 | disconnect( SIGNAL( hopped(int) ), this, SLOT( channelHopped(int) ) ); | 231 | disconnect( SIGNAL( hopped(int) ), this, SLOT( channelHopped(int) ) ); |
231 | iface->setChannelHopping(); // stop hopping channels | 232 | iface->setChannelHopping(); // stop hopping channels |
232 | } | 233 | } |
233 | else | 234 | else |
234 | killTimers(); | 235 | killTimers(); |
235 | 236 | ||
236 | pcap->close(); | 237 | pcap->close(); |
237 | sniffing = false; | 238 | sniffing = false; |
238 | 239 | ||
239 | if ( iface ) | 240 | if ( iface ) |
240 | { | 241 | { |
241 | // switch off monitor mode | 242 | // switch off monitor mode |
242 | iface->setMonitorMode( false ); | 243 | iface->setMonitorMode( false ); |
243 | // switch off promisc flag | 244 | // switch off promisc flag |
244 | iface->setPromiscuousMode( false ); | 245 | iface->setPromiscuousMode( false ); |
245 | 246 | ||
246 | system( "cardctl reset; sleep 1" ); //FIXME: Use OProcess | 247 | system( "cardctl reset; sleep 1" ); //FIXME: Use OProcess |
247 | } | 248 | } |
248 | 249 | ||
249 | logwindow->log( "(i) Stopped Scanning." ); | 250 | logwindow->log( "(i) Stopped Scanning." ); |
250 | assert( parent() ); | 251 | assert( parent() ); |
251 | ( (QMainWindow*) parent() )->setCaption( "Wellenreiter II" ); | 252 | ( (QMainWindow*) parent() )->setCaption( "Wellenreiter II" ); |
252 | 253 | ||
253 | // message the user | 254 | // message the user |
254 | QMessageBox::information( this, "Wellenreiter II", "Your wireless card\nshould now be usable again." ); | 255 | QMessageBox::information( this, "Wellenreiter II", "Your wireless card\nshould now be usable again." ); |
255 | 256 | ||
256 | sniffing = false; | 257 | sniffing = false; |
257 | emit( stoppedSniffing() ); | 258 | emit( stoppedSniffing() ); |
258 | 259 | ||
259 | // print out statistics | 260 | // print out statistics |
260 | statwindow->log( "-----------------------------------------" ); | ||
261 | statwindow->log( "- Wellenreiter II Capturing Statistic -" ); | ||
262 | statwindow->log( "-----------------------------------------" ); | ||
263 | statwindow->log( "Packet Type | Receive Count" ); | ||
264 | |||
265 | for( QMap<QString,int>::ConstIterator it = pcap->statistics().begin(); it != pcap->statistics().end(); ++it ) | 261 | for( QMap<QString,int>::ConstIterator it = pcap->statistics().begin(); it != pcap->statistics().end(); ++it ) |
266 | { | 262 | statwindow->updateCounter( it.key(), it.data() ); |
267 | QString left; | ||
268 | left.sprintf( "%s", (const char*) it.key() ); | ||
269 | left = left.leftJustify( 20 ); | ||
270 | left.append( '|' ); | ||
271 | QString right; | ||
272 | right.sprintf( "%d", it.data() ); | ||
273 | right = right.rightJustify( 7 ); | ||
274 | statwindow->log( left + right ); | ||
275 | } | ||
276 | |||
277 | } | 263 | } |
278 | 264 | ||
279 | 265 | ||
280 | void Wellenreiter::startClicked() | 266 | void Wellenreiter::startClicked() |
281 | { | 267 | { |
282 | // get configuration from config window | 268 | // get configuration from config window |
283 | 269 | ||
284 | const QString& interface = configwindow->interfaceName->currentText(); | 270 | const QString& interface = configwindow->interfaceName->currentText(); |
285 | const int cardtype = configwindow->daemonDeviceType(); | 271 | const int cardtype = configwindow->daemonDeviceType(); |
286 | const int interval = configwindow->daemonHopInterval(); | 272 | const int interval = configwindow->daemonHopInterval(); |
287 | 273 | ||
288 | if ( ( interface == "" ) || ( cardtype == 0 ) ) | 274 | if ( ( interface == "" ) || ( cardtype == 0 ) ) |
289 | { | 275 | { |
290 | QMessageBox::information( this, "Wellenreiter II", "Your device is not\nproperly configured. Please reconfigure!" ); | 276 | QMessageBox::information( this, "Wellenreiter II", "Your device is not\nproperly configured. Please reconfigure!" ); |
291 | return; | 277 | return; |
292 | } | 278 | } |
293 | 279 | ||
294 | // configure device | 280 | // configure device |
295 | 281 | ||
296 | ONetwork* net = ONetwork::instance(); | 282 | ONetwork* net = ONetwork::instance(); |
297 | iface = static_cast<OWirelessNetworkInterface*>(net->interface( interface )); | 283 | iface = static_cast<OWirelessNetworkInterface*>(net->interface( interface )); |
298 | 284 | ||
299 | // set monitor mode | 285 | // set monitor mode |
300 | 286 | ||
301 | switch ( cardtype ) | 287 | switch ( cardtype ) |
302 | { | 288 | { |
303 | case DEVTYPE_CISCO: iface->setMonitoring( new OCiscoMonitoringInterface( iface ) ); break; | 289 | case DEVTYPE_CISCO: iface->setMonitoring( new OCiscoMonitoringInterface( iface ) ); break; |
304 | case DEVTYPE_WLAN_NG: iface->setMonitoring( new OWlanNGMonitoringInterface( iface ) ); break; | 290 | case DEVTYPE_WLAN_NG: iface->setMonitoring( new OWlanNGMonitoringInterface( iface ) ); break; |
305 | case DEVTYPE_HOSTAP: iface->setMonitoring( new OHostAPMonitoringInterface( iface ) ); break; | 291 | case DEVTYPE_HOSTAP: iface->setMonitoring( new OHostAPMonitoringInterface( iface ) ); break; |
306 | case DEVTYPE_ORINOCO: iface->setMonitoring( new OOrinocoMonitoringInterface( iface ) ); break; | 292 | case DEVTYPE_ORINOCO: iface->setMonitoring( new OOrinocoMonitoringInterface( iface ) ); break; |
307 | case DEVTYPE_MANUAL: QMessageBox::information( this, "Wellenreiter II", "Bring your device into\nmonitor mode now." ); break; | 293 | case DEVTYPE_MANUAL: QMessageBox::information( this, "Wellenreiter II", "Bring your device into\nmonitor mode now." ); break; |
308 | case DEVTYPE_FILE: qDebug( "Wellenreiter: Capturing from file '%s'", (const char*) interface ); break; | 294 | case DEVTYPE_FILE: qDebug( "Wellenreiter: Capturing from file '%s'", (const char*) interface ); break; |
309 | default: assert( 0 ); // shouldn't reach this | 295 | default: assert( 0 ); // shouldn't reach this |
310 | } | 296 | } |
311 | 297 | ||
312 | // switch device into monitor mode | 298 | // switch device into monitor mode |
313 | if ( cardtype < DEVTYPE_FILE ) | 299 | if ( cardtype < DEVTYPE_FILE ) |
314 | { | 300 | { |
315 | if ( cardtype != DEVTYPE_MANUAL ) | 301 | if ( cardtype != DEVTYPE_MANUAL ) |
316 | iface->setMonitorMode( true ); | 302 | iface->setMonitorMode( true ); |
317 | if ( !iface->monitorMode() ) | 303 | if ( !iface->monitorMode() ) |
318 | { | 304 | { |
319 | QMessageBox::warning( this, "Wellenreiter II", "Can't set device into monitor mode." ); | 305 | QMessageBox::warning( this, "Wellenreiter II", "Can't set device into monitor mode." ); |
320 | return; | 306 | return; |
321 | } | 307 | } |
322 | } | 308 | } |
323 | 309 | ||
324 | // open pcap and start sniffing | 310 | // open pcap and start sniffing |
325 | if ( cardtype != DEVTYPE_FILE ) | 311 | if ( cardtype != DEVTYPE_FILE ) |
326 | { | 312 | { |
327 | if ( configwindow->writeCaptureFile->isEnabled() ) | 313 | if ( configwindow->writeCaptureFile->isEnabled() ) |
328 | { | 314 | { |
329 | QString dumpname( configwindow->captureFileName->text() ); | 315 | QString dumpname( configwindow->captureFileName->text() ); |
330 | dumpname.append( '-' ); | 316 | dumpname.append( '-' ); |
331 | dumpname.append( QTime::currentTime().toString().replace( QRegExp( ":" ), "-" ) ); | 317 | dumpname.append( QTime::currentTime().toString().replace( QRegExp( ":" ), "-" ) ); |
332 | dumpname.append( ".wellenreiter" ); | 318 | dumpname.append( ".wellenreiter" ); |
333 | pcap->open( interface, dumpname ); | 319 | pcap->open( interface, dumpname ); |
334 | } | 320 | } |
335 | else | 321 | else |
336 | { | 322 | { |
337 | pcap->open( interface ); | 323 | pcap->open( interface ); |
338 | } | 324 | } |
339 | } | 325 | } |
340 | else | 326 | else |
341 | { | 327 | { |
342 | pcap->open( QFile( interface ) ); | 328 | pcap->open( QFile( interface ) ); |
343 | } | 329 | } |
344 | 330 | ||
345 | if ( !pcap->isOpen() ) | 331 | if ( !pcap->isOpen() ) |
346 | { | 332 | { |
347 | QMessageBox::warning( this, "Wellenreiter II", "Can't open packet capturer:\n" + QString(strerror( errno ) )); | 333 | QMessageBox::warning( this, "Wellenreiter II", "Can't open packet capturer:\n" + QString(strerror( errno ) )); |
348 | return; | 334 | return; |
349 | } | 335 | } |
350 | 336 | ||
351 | // set capturer to non-blocking mode | 337 | // set capturer to non-blocking mode |
352 | pcap->setBlocking( false ); | 338 | pcap->setBlocking( false ); |
353 | 339 | ||
354 | // start channel hopper | 340 | // start channel hopper |
355 | if ( cardtype != DEVTYPE_FILE ) | 341 | if ( cardtype != DEVTYPE_FILE ) |
356 | iface->setChannelHopping( 1000 ); //use interval from config window | 342 | iface->setChannelHopping( 1000 ); //use interval from config window |
357 | 343 | ||
358 | if ( cardtype != DEVTYPE_FILE ) | 344 | if ( cardtype != DEVTYPE_FILE ) |
359 | { | 345 | { |
360 | // connect socket notifier and start channel hopper | 346 | // connect socket notifier and start channel hopper |
361 | connect( pcap, SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) ); | 347 | connect( pcap, SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) ); |
362 | connect( iface->channelHopper(), SIGNAL( hopped(int) ), this, SLOT( channelHopped(int) ) ); | 348 | connect( iface->channelHopper(), SIGNAL( hopped(int) ), this, SLOT( channelHopped(int) ) ); |
363 | } | 349 | } |
364 | else | 350 | else |
365 | { | 351 | { |
366 | // start timer for reading packets | 352 | // start timer for reading packets |
367 | startTimer( 100 ); | 353 | startTimer( 100 ); |
368 | } | 354 | } |
369 | 355 | ||
370 | logwindow->log( "(i) Started Scanning." ); | 356 | logwindow->log( "(i) Started Scanning." ); |
371 | sniffing = true; | 357 | sniffing = true; |
372 | emit( startedSniffing() ); | 358 | emit( startedSniffing() ); |
diff --git a/noncore/net/wellenreiter/makedist.sh b/noncore/net/wellenreiter/makedist.sh index 1795ae5..cfb0b16 100755 --- a/noncore/net/wellenreiter/makedist.sh +++ b/noncore/net/wellenreiter/makedist.sh | |||
@@ -1,54 +1,54 @@ | |||
1 | VERSION=2-alpha2 | 1 | VERSION=2-beta |
2 | 2 | ||
3 | TGZDIR=$PWD | 3 | TGZDIR=$PWD |
4 | 4 | ||
5 | # script to make a .tgz distributable for the Wellenreiter X11 Standalone Version | 5 | # script to make a .tgz distributable for the Wellenreiter X11 Standalone Version |
6 | 6 | ||
7 | find . -name "*.o"|xargs rm -f | 7 | find . -name "*.o"|xargs rm -f |
8 | find . -name "Makefile"|xargs rm -f | 8 | find . -name "Makefile"|xargs rm -f |
9 | find . -name "*moc*"|xargs rm -f | 9 | find . -name "*moc*"|xargs rm -f |
10 | #TMPFILE=`mktemp -d -q /tmp/build.XXXXXX` | 10 | #TMPFILE=`mktemp -d -q /tmp/build.XXXXXX` |
11 | TMPFILE=/tmp/build | 11 | TMPFILE=/tmp/build |
12 | #if [ $? -ne 0 ]; then | 12 | #if [ $? -ne 0 ]; then |
13 | # echo "$0: Can't create temp file, exiting..." | 13 | # echo "$0: Can't create temp file, exiting..." |
14 | # exit 1 | 14 | # exit 1 |
15 | #fi | 15 | #fi |
16 | 16 | ||
17 | TMPDIR=$TMPFILE/wellenreiter$VERSION | 17 | TMPDIR=$TMPFILE/wellenreiter$VERSION |
18 | OUTPUT=$TMPDIR/output | 18 | OUTPUT=$TMPDIR/output |
19 | 19 | ||
20 | mkdir -p $TMPDIR/libopie2/opieui | 20 | mkdir -p $TMPDIR/libopie2/opieui |
21 | mkdir -p $TMPDIR/libopie2/opienet | 21 | mkdir -p $TMPDIR/libopie2/opienet |
22 | mkdir -p $TMPDIR/include/opie2 | 22 | mkdir -p $TMPDIR/include/opie2 |
23 | mkdir -p $OUTPUT/share/wellenreiter/pics | 23 | mkdir -p $OUTPUT/share/wellenreiter/pics |
24 | mkdir -p $OUTPUT/share/wellenreiter | 24 | mkdir -p $OUTPUT/share/wellenreiter |
25 | cp -dfR gui $TMPDIR | 25 | cp -dfR gui $TMPDIR |
26 | cp -dfR lib $TMPDIR | 26 | cp -dfR lib $TMPDIR |
27 | cp -dfR build README wellenreiter.pro $TMPDIR | 27 | cp -dfR build README wellenreiter.pro $TMPDIR |
28 | cp -dfR $OPIEDIR/pics/wellenreiter/* $OUTPUT/share/wellenreiter/ | 28 | cp -dfR $OPIEDIR/pics/wellenreiter/* $OUTPUT/share/wellenreiter/ |
29 | cp -dfR $OPIEDIR/share/wellenreiter/* $OUTPUT/share/wellenreiter/ | 29 | cp -dfR $OPIEDIR/share/wellenreiter/* $OUTPUT/share/wellenreiter/ |
30 | 30 | ||
31 | # take care about sourcefiles | 31 | # take care about sourcefiles |
32 | 32 | ||
33 | FILES="libopie2/opienet/onetwork.h libopie2/opienet/onetwork.cpp \ | 33 | FILES="libopie2/opienet/onetwork.h libopie2/opienet/onetwork.cpp \ |
34 | libopie2/opienet/opcap.h libopie2/opienet/opcap.cpp libopie2/opienet/802_11_user.h \ | 34 | libopie2/opienet/opcap.h libopie2/opienet/opcap.cpp libopie2/opienet/802_11_user.h \ |
35 | libopie2/opienet/onetutils.h libopie2/opienet/onetutils.cpp \ | 35 | libopie2/opienet/onetutils.h libopie2/opienet/onetutils.cpp \ |
36 | libopie2/opienet/omanufacturerdb.h libopie2/opienet/omanufacturerdb.cpp \ | 36 | libopie2/opienet/omanufacturerdb.h libopie2/opienet/omanufacturerdb.cpp \ |
37 | libopie2/opieui/olistview.cpp libopie2/opieui/olistview.h" | 37 | libopie2/opieui/olistview.cpp libopie2/opieui/olistview.h" |
38 | 38 | ||
39 | for i in $FILES | 39 | for i in $FILES |
40 | do cp -dfR $OPIEDIR/$i $TMPDIR/$i | 40 | do cp -dfR $OPIEDIR/$i $TMPDIR/$i |
41 | done | 41 | done |
42 | 42 | ||
43 | # make includes | 43 | # make includes |
44 | pushd $TMPDIR/include/opie2 | 44 | pushd $TMPDIR/include/opie2 |
45 | ln -sf ../../libopie2/opieui/*.h . | 45 | ln -sf ../../libopie2/opieui/*.h . |
46 | ln -sf ../../libopie2/opienet/*.h . | 46 | ln -sf ../../libopie2/opienet/*.h . |
47 | popd | 47 | popd |
48 | 48 | ||
49 | find $TMPDIR -name "CVS"|xargs rm -rf | 49 | find $TMPDIR -name "CVS"|xargs rm -rf |
50 | 50 | ||
51 | pushd $TMPFILE | 51 | pushd $TMPFILE |
52 | tar czf $TGZDIR/wellenreiter$VERSION.tgz wellenreiter$VERSION | 52 | tar czf $TGZDIR/wellenreiter$VERSION.tgz wellenreiter$VERSION |
53 | popd | 53 | popd |
54 | 54 | ||