author | mickeyl <mickeyl> | 2004-03-09 17:59:55 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-03-09 17:59:55 (UTC) |
commit | dd34b866c0f3e5041696dd97cf356d86a8d6d212 (patch) (unidiff) | |
tree | fb4c6e414b851a3000d91d34d38a666da1fbf95a /noncore/net/wellenreiter | |
parent | 25434cbbcd2d2473c9cd3d486cec7a96a6a6323e (diff) | |
download | opie-dd34b866c0f3e5041696dd97cf356d86a8d6d212.zip opie-dd34b866c0f3e5041696dd97cf356d86a8d6d212.tar.gz opie-dd34b866c0f3e5041696dd97cf356d86a8d6d212.tar.bz2 |
on the way to a new hex window
-rw-r--r-- | noncore/net/wellenreiter/TODO | 7 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/main.cpp | 1 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/mainwindow.cpp | 5 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/packetview.cpp | 48 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/packetview.h | 19 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 4 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.h | 4 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiterbase.cpp | 14 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiterbase.h | 4 |
9 files changed, 75 insertions, 31 deletions
diff --git a/noncore/net/wellenreiter/TODO b/noncore/net/wellenreiter/TODO index f3fd205..5f37ddf 100644 --- a/noncore/net/wellenreiter/TODO +++ b/noncore/net/wellenreiter/TODO | |||
@@ -59,2 +59,9 @@ ENGINE | |||
59 | new network - further beacons just blow up the capture file) | 59 | new network - further beacons just blow up the capture file) |
60 | 60 | ||
61 | - write wi-scan format like that: | ||
62 | # $Creator: Wellenreiter II Version 1.0.2 | ||
63 | # $Format: wi-scan | ||
64 | # Latitude Longitude ( SSID ) Type ( BSSID ) Time (GMT) [ SNR Sig Noise ] | ||
65 | # $DateGMT: 2004-02-07 | ||
66 | N 41.1008009 W 8.3893034 ( Porceven ) BBS ( 00:a0:f8:41:91:63 ) 22:32:39 (GMT) [ 21 177 156 ] | ||
67 | |||
diff --git a/noncore/net/wellenreiter/gui/main.cpp b/noncore/net/wellenreiter/gui/main.cpp index be7a528..7dcc583 100644 --- a/noncore/net/wellenreiter/gui/main.cpp +++ b/noncore/net/wellenreiter/gui/main.cpp | |||
@@ -53,4 +53,5 @@ int main( int argc, char **argv ) | |||
53 | for ( int i = 1; i < argc; ++i ) | 53 | for ( int i = 1; i < argc; ++i ) |
54 | { | 54 | { |
55 | qDebug( "Wellenreiter::main() parsing argument %d = '%s'", i, argv[i] ); | ||
55 | if ( !strcmp( "-nocheck", argv[i] ) ) | 56 | if ( !strcmp( "-nocheck", argv[i] ) ) |
56 | { | 57 | { |
diff --git a/noncore/net/wellenreiter/gui/mainwindow.cpp b/noncore/net/wellenreiter/gui/mainwindow.cpp index 6f57a7f..5cc0daf 100644 --- a/noncore/net/wellenreiter/gui/mainwindow.cpp +++ b/noncore/net/wellenreiter/gui/mainwindow.cpp | |||
@@ -17,5 +17,5 @@ | |||
17 | #include "gps.h" | 17 | #include "gps.h" |
18 | #include "logwindow.h" | 18 | #include "logwindow.h" |
19 | #include "hexwindow.h" | 19 | #include "packetview.h" |
20 | #include "mainwindow.h" | 20 | #include "mainwindow.h" |
21 | #include "wellenreiter.h" | 21 | #include "wellenreiter.h" |
@@ -333,4 +333,6 @@ void WellenreiterMainWindow::fileSaveSession() | |||
333 | void WellenreiterMainWindow::fileSaveHex() | 333 | void WellenreiterMainWindow::fileSaveHex() |
334 | { | 334 | { |
335 | #warning DOES NOT WORK AT THE MOMENT | ||
336 | /* | ||
335 | QString fname = getFileName( true ); | 337 | QString fname = getFileName( true ); |
336 | if ( !fname.isEmpty() ) | 338 | if ( !fname.isEmpty() ) |
@@ -349,4 +351,5 @@ void WellenreiterMainWindow::fileSaveHex() | |||
349 | } | 351 | } |
350 | } | 352 | } |
353 | */ | ||
351 | } | 354 | } |
352 | 355 | ||
diff --git a/noncore/net/wellenreiter/gui/packetview.cpp b/noncore/net/wellenreiter/gui/packetview.cpp index e986b49..ef5d020 100644 --- a/noncore/net/wellenreiter/gui/packetview.cpp +++ b/noncore/net/wellenreiter/gui/packetview.cpp | |||
@@ -15,30 +15,54 @@ | |||
15 | 15 | ||
16 | #include "packetview.h" | 16 | #include "packetview.h" |
17 | #include <qmultilineedit.h> | 17 | |
18 | /* OPIE */ | ||
19 | #include <opie2/opcap.h> | ||
20 | |||
21 | /* QT */ | ||
22 | #include <qtextview.h> | ||
23 | #include <qspinbox.h> | ||
24 | #include <qlabel.h> | ||
25 | #include <qlayout.h> | ||
26 | #include <qlist.h> | ||
18 | 27 | ||
19 | PacketView::PacketView( QWidget * parent, const char * name, WFlags f ) | 28 | PacketView::PacketView( QWidget * parent, const char * name, WFlags f ) |
20 | :QVBox( parent, name, f ) | 29 | :QFrame( parent, name, f ) |
21 | { | 30 | { |
22 | ledit = new QMultiLineEdit( this ); | 31 | _number = new QSpinBox( this ); |
23 | ledit->setFont( QFont( "fixed", 10 ) ); | 32 | _number->setPrefix( "Packet # " ); |
24 | ledit->setReadOnly( true ); | 33 | _label = new QLabel( this ); |
34 | _label->setText( "eth0 2004/03/08 - 00:00:21" ); | ||
35 | _list = new QLabel( this ); | ||
36 | _hex = new QTextView( this ); | ||
37 | |||
38 | QVBoxLayout* vb = new QVBoxLayout( this, 2, 2 ); | ||
39 | QHBoxLayout* hb = new QHBoxLayout( vb, 2 ); | ||
40 | hb->addWidget( _label ); | ||
41 | hb->addWidget( _number ); | ||
42 | vb->addWidget( _list ); | ||
43 | vb->addWidget( _hex ); | ||
44 | |||
45 | _packets.setAutoDelete( true ); | ||
46 | |||
47 | _list->setText( "<b>[ 802.11 [ LLC [ IP [ UDP [ DHCP ] ] ] ] ]</b>" ); | ||
25 | }; | 48 | }; |
26 | 49 | ||
27 | void PacketView::log( const QString& text ) | 50 | void PacketView::add( OPacket* p ) |
28 | { | 51 | { |
29 | int col; | 52 | _packets.append( p ); |
30 | int row; | ||
31 | ledit->getCursorPosition( &col, &row ); | ||
32 | ledit->insertAt( text, col, row ); | ||
33 | }; | 53 | }; |
34 | 54 | ||
35 | const QString PacketView::getLog() const | 55 | const QString PacketView::getLog() const |
36 | { | 56 | { |
37 | return ledit->text(); | ||
38 | } | 57 | } |
39 | 58 | ||
40 | void PacketView::clear() | 59 | void PacketView::clear() |
41 | { | 60 | { |
42 | ledit->clear(); | 61 | _packets.clear(); |
62 | _number->setMinValue( 0 ); | ||
63 | _number->setMaxValue( 0 ); | ||
64 | _label->setText( "---" ); | ||
65 | _list->setText( " <b>-- no Packet available --</b> " ); | ||
66 | _hex->setText( " <i>-- no Packet available --</i> " ); | ||
43 | } | 67 | } |
44 | 68 | ||
diff --git a/noncore/net/wellenreiter/gui/packetview.h b/noncore/net/wellenreiter/gui/packetview.h index ee3cf3a..b5f2b26 100644 --- a/noncore/net/wellenreiter/gui/packetview.h +++ b/noncore/net/wellenreiter/gui/packetview.h | |||
@@ -17,10 +17,14 @@ | |||
17 | #define PACKETVIEW_H | 17 | #define PACKETVIEW_H |
18 | 18 | ||
19 | #include <qvbox.h> | 19 | #include <qlist.h> |
20 | #include <qframe.h> | ||
20 | 21 | ||
21 | class QString; | 22 | class QString; |
22 | class QMultiLineEdit; | 23 | class QSpinBox; |
24 | class QLabel; | ||
25 | class QTextView; | ||
26 | class OPacket; | ||
23 | 27 | ||
24 | class PacketView: public QVBox | 28 | class PacketView: public QFrame |
25 | { | 29 | { |
26 | 30 | ||
@@ -28,10 +32,15 @@ class PacketView: public QVBox | |||
28 | PacketView( QWidget * parent = 0, const char * name = "PacketView", WFlags f = 0 ); | 32 | PacketView( QWidget * parent = 0, const char * name = "PacketView", WFlags f = 0 ); |
29 | 33 | ||
30 | void log( const QString& text ); | 34 | void add( OPacket* p ); |
31 | const QString getLog() const; | 35 | const QString getLog() const; |
32 | void clear(); | 36 | void clear(); |
33 | 37 | ||
34 | protected: | 38 | protected: |
35 | QMultiLineEdit* ledit; | 39 | |
40 | QSpinBox* _number; | ||
41 | QLabel* _label; | ||
42 | QLabel* _list; | ||
43 | QTextView* _hex; | ||
44 | QList<OPacket> _packets; | ||
36 | 45 | ||
37 | }; | 46 | }; |
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp index 67e3940..ce416e5 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp | |||
@@ -18,5 +18,5 @@ | |||
18 | #include "scanlist.h" | 18 | #include "scanlist.h" |
19 | #include "logwindow.h" | 19 | #include "logwindow.h" |
20 | #include "hexwindow.h" | 20 | #include "packetview.h" |
21 | #include "configwindow.h" | 21 | #include "configwindow.h" |
22 | #include "statwindow.h" | 22 | #include "statwindow.h" |
@@ -381,5 +381,5 @@ bool Wellenreiter::checkDumpPacket( OPacket* p ) | |||
381 | void Wellenreiter::receivePacket( OPacket* p ) | 381 | void Wellenreiter::receivePacket( OPacket* p ) |
382 | { | 382 | { |
383 | hexWindow()->log( p->dump( 8 ) ); | 383 | hexWindow()->add( p ); |
384 | 384 | ||
385 | if ( checkDumpPacket( p ) ) | 385 | if ( checkDumpPacket( p ) ) |
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.h b/noncore/net/wellenreiter/gui/wellenreiter.h index 745486f..d02813b 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.h +++ b/noncore/net/wellenreiter/gui/wellenreiter.h | |||
@@ -34,7 +34,7 @@ class OIPPacket; | |||
34 | class OPacketCapturer; | 34 | class OPacketCapturer; |
35 | class OWirelessNetworkInterface; | 35 | class OWirelessNetworkInterface; |
36 | class PacketView; | ||
36 | class WellenreiterConfigWindow; | 37 | class WellenreiterConfigWindow; |
37 | class MLogWindow; | 38 | class MLogWindow; |
38 | class MHexWindow; | ||
39 | class GPS; | 39 | class GPS; |
40 | 40 | ||
@@ -49,5 +49,5 @@ class Wellenreiter : public WellenreiterBase { | |||
49 | MScanListView* netView() const { return netview; }; | 49 | MScanListView* netView() const { return netview; }; |
50 | MLogWindow* logWindow() const { return logwindow; }; | 50 | MLogWindow* logWindow() const { return logwindow; }; |
51 | MHexWindow* hexWindow() const { return hexwindow; }; | 51 | PacketView* hexWindow() const { return hexwindow; }; |
52 | bool isDaemonRunning() const { return sniffing; }; | 52 | bool isDaemonRunning() const { return sniffing; }; |
53 | QString captureFileName() const { return dumpname; }; | 53 | QString captureFileName() const { return dumpname; }; |
diff --git a/noncore/net/wellenreiter/gui/wellenreiterbase.cpp b/noncore/net/wellenreiter/gui/wellenreiterbase.cpp index f57dba2..3d0595d 100644 --- a/noncore/net/wellenreiter/gui/wellenreiterbase.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiterbase.cpp | |||
@@ -20,5 +20,5 @@ | |||
20 | 20 | ||
21 | #include "logwindow.h" | 21 | #include "logwindow.h" |
22 | #include "hexwindow.h" | 22 | #include "packetview.h" |
23 | #include "scanlist.h" | 23 | #include "scanlist.h" |
24 | #include "statwindow.h" | 24 | #include "statwindow.h" |
@@ -37,5 +37,5 @@ using namespace Opie; | |||
37 | /* | 37 | /* |
38 | * Constructs a WellenreiterBase which is a child of 'parent', with the | 38 | * Constructs a WellenreiterBase which is a child of 'parent', with the |
39 | * name 'name' and widget flags set to 'f' | 39 | * name 'name' and widget flags set to 'f' |
40 | */ | 40 | */ |
41 | WellenreiterBase::WellenreiterBase( QWidget* parent, const char* name, WFlags fl ) | 41 | WellenreiterBase::WellenreiterBase( QWidget* parent, const char* name, WFlags fl ) |
@@ -46,5 +46,5 @@ WellenreiterBase::WellenreiterBase( QWidget* parent, const char* name, WFlags f | |||
46 | //ani3 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot180" ) ); | 46 | //ani3 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot180" ) ); |
47 | //ani4 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot270" ) ); | 47 | //ani4 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot270" ) ); |
48 | 48 | ||
49 | if ( !name ) | 49 | if ( !name ) |
50 | setName( "WellenreiterBase" ); | 50 | setName( "WellenreiterBase" ); |
@@ -83,5 +83,5 @@ WellenreiterBase::WellenreiterBase( QWidget* parent, const char* name, WFlags f | |||
83 | //--------- HEX TAB -------------- | 83 | //--------- HEX TAB -------------- |
84 | 84 | ||
85 | hexwindow = new MHexWindow( TabWidget, "Hex" ); | 85 | hexwindow = new PacketView( TabWidget, "Hex" ); |
86 | 86 | ||
87 | //--------- STAT TAB -------------- | 87 | //--------- STAT TAB -------------- |
@@ -156,5 +156,5 @@ WellenreiterBase::~WellenreiterBase() | |||
156 | } | 156 | } |
157 | 157 | ||
158 | /* | 158 | /* |
159 | * Main event handler. Reimplemented to handle application | 159 | * Main event handler. Reimplemented to handle application |
160 | * font changes | 160 | * font changes |
@@ -162,10 +162,10 @@ WellenreiterBase::~WellenreiterBase() | |||
162 | bool WellenreiterBase::event( QEvent* ev ) | 162 | bool WellenreiterBase::event( QEvent* ev ) |
163 | { | 163 | { |
164 | bool ret = QWidget::event( ev ); | 164 | bool ret = QWidget::event( ev ); |
165 | if ( ev->type() == QEvent::ApplicationFontChange ) { | 165 | if ( ev->type() == QEvent::ApplicationFontChange ) { |
166 | //QFont Log_2_font( Log_2->font() ); | 166 | //QFont Log_2_font( Log_2->font() ); |
167 | //Log_2_font.setFamily( "adobe-courier" ); | 167 | //Log_2_font.setFamily( "adobe-courier" ); |
168 | //Log_2_font.setPointSize( 8 ); | 168 | //Log_2_font.setPointSize( 8 ); |
169 | //Log_2->setFont( Log_2_font ); | 169 | //Log_2->setFont( Log_2_font ); |
170 | QFont TextLabel1_4_2_font( TextLabel1_4_2->font() ); | 170 | QFont TextLabel1_4_2_font( TextLabel1_4_2->font() ); |
171 | TextLabel1_4_2_font.setFamily( "adobe-helvetica" ); | 171 | TextLabel1_4_2_font.setFamily( "adobe-helvetica" ); |
diff --git a/noncore/net/wellenreiter/gui/wellenreiterbase.h b/noncore/net/wellenreiter/gui/wellenreiterbase.h index 5e00ddc..126aad2 100644 --- a/noncore/net/wellenreiter/gui/wellenreiterbase.h +++ b/noncore/net/wellenreiter/gui/wellenreiterbase.h | |||
@@ -27,7 +27,7 @@ class MScanListItem; | |||
27 | class QPushButton; | 27 | class QPushButton; |
28 | class MLogWindow; | 28 | class MLogWindow; |
29 | class MHexWindow; | ||
30 | class MStatWindow; | 29 | class MStatWindow; |
31 | class MGraphWindow; | 30 | class MGraphWindow; |
31 | class PacketView; | ||
32 | 32 | ||
33 | #ifdef QWS | 33 | #ifdef QWS |
@@ -54,5 +54,5 @@ public: | |||
54 | MScanListView* netview; | 54 | MScanListView* netview; |
55 | MLogWindow* logwindow; | 55 | MLogWindow* logwindow; |
56 | MHexWindow* hexwindow; | 56 | PacketView* hexwindow; |
57 | MStatWindow* statwindow; | 57 | MStatWindow* statwindow; |
58 | MGraphWindow* graphwindow; | 58 | MGraphWindow* graphwindow; |