author | mickeyl <mickeyl> | 2004-03-09 17:59:55 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-03-09 17:59:55 (UTC) |
commit | dd34b866c0f3e5041696dd97cf356d86a8d6d212 (patch) (side-by-side diff) | |
tree | fb4c6e414b851a3000d91d34d38a666da1fbf95a | |
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 | 4 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiterbase.h | 4 |
9 files changed, 70 insertions, 26 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 @@ -60 +60,8 @@ ENGINE +- write wi-scan format like that: + # $Creator: Wellenreiter II Version 1.0.2 + # $Format: wi-scan + # Latitude Longitude ( SSID ) Type ( BSSID ) Time (GMT) [ SNR Sig Noise ] + # $DateGMT: 2004-02-07 + N 41.1008009 W 8.3893034 ( Porceven ) BBS ( 00:a0:f8:41:91:63 ) 22:32:39 (GMT) [ 21 177 156 ] + 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 @@ -54,2 +54,3 @@ int main( int argc, char **argv ) { + qDebug( "Wellenreiter::main() parsing argument %d = '%s'", i, argv[i] ); if ( !strcmp( "-nocheck", argv[i] ) ) 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 @@ -18,3 +18,3 @@ #include "logwindow.h" -#include "hexwindow.h" +#include "packetview.h" #include "mainwindow.h" @@ -334,2 +334,4 @@ void WellenreiterMainWindow::fileSaveHex() { + #warning DOES NOT WORK AT THE MOMENT + /* QString fname = getFileName( true ); @@ -350,2 +352,3 @@ void WellenreiterMainWindow::fileSaveHex() } + */ } 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 @@ -16,18 +16,38 @@ #include "packetview.h" -#include <qmultilineedit.h> + +/* OPIE */ +#include <opie2/opcap.h> + +/* QT */ +#include <qtextview.h> +#include <qspinbox.h> +#include <qlabel.h> +#include <qlayout.h> +#include <qlist.h> PacketView::PacketView( QWidget * parent, const char * name, WFlags f ) - :QVBox( parent, name, f ) + :QFrame( parent, name, f ) { - ledit = new QMultiLineEdit( this ); - ledit->setFont( QFont( "fixed", 10 ) ); - ledit->setReadOnly( true ); + _number = new QSpinBox( this ); + _number->setPrefix( "Packet # " ); + _label = new QLabel( this ); + _label->setText( "eth0 2004/03/08 - 00:00:21" ); + _list = new QLabel( this ); + _hex = new QTextView( this ); + + QVBoxLayout* vb = new QVBoxLayout( this, 2, 2 ); + QHBoxLayout* hb = new QHBoxLayout( vb, 2 ); + hb->addWidget( _label ); + hb->addWidget( _number ); + vb->addWidget( _list ); + vb->addWidget( _hex ); + + _packets.setAutoDelete( true ); + + _list->setText( "<b>[ 802.11 [ LLC [ IP [ UDP [ DHCP ] ] ] ] ]</b>" ); }; -void PacketView::log( const QString& text ) +void PacketView::add( OPacket* p ) { - int col; - int row; - ledit->getCursorPosition( &col, &row ); - ledit->insertAt( text, col, row ); + _packets.append( p ); }; @@ -36,3 +56,2 @@ const QString PacketView::getLog() const { - return ledit->text(); } @@ -41,3 +60,8 @@ void PacketView::clear() { - ledit->clear(); + _packets.clear(); + _number->setMinValue( 0 ); + _number->setMaxValue( 0 ); + _label->setText( "---" ); + _list->setText( " <b>-- no Packet available --</b> " ); + _hex->setText( " <i>-- no Packet available --</i> " ); } 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 @@ -18,8 +18,12 @@ -#include <qvbox.h> +#include <qlist.h> +#include <qframe.h> class QString; -class QMultiLineEdit; +class QSpinBox; +class QLabel; +class QTextView; +class OPacket; -class PacketView: public QVBox +class PacketView: public QFrame { @@ -29,3 +33,3 @@ class PacketView: public QVBox - void log( const QString& text ); + void add( OPacket* p ); const QString getLog() const; @@ -34,3 +38,8 @@ class PacketView: public QVBox protected: - QMultiLineEdit* ledit; + + QSpinBox* _number; + QLabel* _label; + QLabel* _list; + QTextView* _hex; + QList<OPacket> _packets; 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 @@ -19,3 +19,3 @@ #include "logwindow.h" -#include "hexwindow.h" +#include "packetview.h" #include "configwindow.h" @@ -382,3 +382,3 @@ void Wellenreiter::receivePacket( OPacket* p ) { - hexWindow()->log( p->dump( 8 ) ); + hexWindow()->add( 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 @@ -35,5 +35,5 @@ class OPacketCapturer; class OWirelessNetworkInterface; +class PacketView; class WellenreiterConfigWindow; class MLogWindow; -class MHexWindow; class GPS; @@ -50,3 +50,3 @@ class Wellenreiter : public WellenreiterBase { MLogWindow* logWindow() const { return logwindow; }; - MHexWindow* hexWindow() const { return hexwindow; }; + PacketView* hexWindow() const { return hexwindow; }; bool isDaemonRunning() const { return sniffing; }; 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 @@ -21,3 +21,3 @@ #include "logwindow.h" -#include "hexwindow.h" +#include "packetview.h" #include "scanlist.h" @@ -84,3 +84,3 @@ WellenreiterBase::WellenreiterBase( QWidget* parent, const char* name, WFlags f - hexwindow = new MHexWindow( TabWidget, "Hex" ); + hexwindow = new PacketView( TabWidget, "Hex" ); 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 @@ -28,5 +28,5 @@ class QPushButton; class MLogWindow; -class MHexWindow; class MStatWindow; class MGraphWindow; +class PacketView; @@ -55,3 +55,3 @@ public: MLogWindow* logwindow; - MHexWindow* hexwindow; + PacketView* hexwindow; MStatWindow* statwindow; |