From dd34b866c0f3e5041696dd97cf356d86a8d6d212 Mon Sep 17 00:00:00 2001 From: mickeyl Date: Tue, 09 Mar 2004 17:59:55 +0000 Subject: on the way to a new hex window --- 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 @@ -58,3 +58,10 @@ ENGINE - implement beacon stripping (the first beacon is enough to detect a new network - further beacons just blow up the capture file) +- 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 @@ -52,6 +52,7 @@ int main( int argc, char **argv ) bool check = true; for ( int i = 1; i < argc; ++i ) { + qDebug( "Wellenreiter::main() parsing argument %d = '%s'", i, argv[i] ); if ( !strcmp( "-nocheck", argv[i] ) ) { qDebug( "-nocheck found" ); 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 @@ -16,7 +16,7 @@ #include "configwindow.h" #include "gps.h" #include "logwindow.h" -#include "hexwindow.h" +#include "packetview.h" #include "mainwindow.h" #include "wellenreiter.h" #include "scanlist.h" @@ -332,6 +332,8 @@ void WellenreiterMainWindow::fileSaveSession() void WellenreiterMainWindow::fileSaveHex() { + #warning DOES NOT WORK AT THE MOMENT + /* QString fname = getFileName( true ); if ( !fname.isEmpty() ) { @@ -348,6 +350,7 @@ void WellenreiterMainWindow::fileSaveHex() qDebug( "Problem saving hex log to file '%s'", (const char*) fname ); } } + */ } void WellenreiterMainWindow::fileLoadSession() 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 @@ -14,31 +14,55 @@ **********************************************************************/ #include "packetview.h" -#include + +/* OPIE */ +#include + +/* QT */ +#include +#include +#include +#include +#include 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( "[ 802.11 [ LLC [ IP [ UDP [ DHCP ] ] ] ] ]" ); }; -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 ); }; const QString PacketView::getLog() const { - return ledit->text(); } void PacketView::clear() { - ledit->clear(); + _packets.clear(); + _number->setMinValue( 0 ); + _number->setMaxValue( 0 ); + _label->setText( "---" ); + _list->setText( " -- no Packet available -- " ); + _hex->setText( " -- no Packet available -- " ); } 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 @@ -16,23 +16,32 @@ #ifndef PACKETVIEW_H #define PACKETVIEW_H -#include +#include +#include class QString; -class QMultiLineEdit; +class QSpinBox; +class QLabel; +class QTextView; +class OPacket; -class PacketView: public QVBox +class PacketView: public QFrame { public: PacketView( QWidget * parent = 0, const char * name = "PacketView", WFlags f = 0 ); - void log( const QString& text ); + void add( OPacket* p ); const QString getLog() const; void clear(); protected: - QMultiLineEdit* ledit; + + QSpinBox* _number; + QLabel* _label; + QLabel* _list; + QTextView* _hex; + QList _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 @@ -17,7 +17,7 @@ #include "wellenreiter.h" #include "scanlist.h" #include "logwindow.h" -#include "hexwindow.h" +#include "packetview.h" #include "configwindow.h" #include "statwindow.h" #include "graphwindow.h" @@ -380,7 +380,7 @@ bool Wellenreiter::checkDumpPacket( OPacket* p ) void Wellenreiter::receivePacket( OPacket* p ) { - hexWindow()->log( p->dump( 8 ) ); + hexWindow()->add( p ); 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 @@ -33,9 +33,9 @@ class OMacAddress; class OIPPacket; class OPacketCapturer; class OWirelessNetworkInterface; +class PacketView; class WellenreiterConfigWindow; class MLogWindow; -class MHexWindow; class GPS; class Wellenreiter : public WellenreiterBase { @@ -48,7 +48,7 @@ class Wellenreiter : public WellenreiterBase { void setConfigWindow( WellenreiterConfigWindow* cw ); MScanListView* netView() const { return netview; }; MLogWindow* logWindow() const { return logwindow; }; - MHexWindow* hexWindow() const { return hexwindow; }; + PacketView* hexWindow() const { return hexwindow; }; bool isDaemonRunning() const { return sniffing; }; 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 @@ -19,7 +19,7 @@ #include #include "logwindow.h" -#include "hexwindow.h" +#include "packetview.h" #include "scanlist.h" #include "statwindow.h" #include "graphwindow.h" @@ -36,7 +36,7 @@ using namespace Opie; /* * Constructs a WellenreiterBase which is a child of 'parent', with the - * name 'name' and widget flags set to 'f' + * name 'name' and widget flags set to 'f' */ WellenreiterBase::WellenreiterBase( QWidget* parent, const char* name, WFlags fl ) : QWidget( parent, name, fl ) @@ -45,7 +45,7 @@ WellenreiterBase::WellenreiterBase( QWidget* parent, const char* name, WFlags f //ani2 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot90" ) ); //ani3 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot180" ) ); //ani4 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot270" ) ); - + if ( !name ) setName( "WellenreiterBase" ); resize( 191, 294 ); @@ -82,7 +82,7 @@ WellenreiterBase::WellenreiterBase( QWidget* parent, const char* name, WFlags f //--------- HEX TAB -------------- - hexwindow = new MHexWindow( TabWidget, "Hex" ); + hexwindow = new PacketView( TabWidget, "Hex" ); //--------- STAT TAB -------------- @@ -155,18 +155,18 @@ WellenreiterBase::~WellenreiterBase() // no need to delete child widgets, Qt does it all for us } -/* +/* * Main event handler. Reimplemented to handle application * font changes */ bool WellenreiterBase::event( QEvent* ev ) { - bool ret = QWidget::event( ev ); + bool ret = QWidget::event( ev ); if ( ev->type() == QEvent::ApplicationFontChange ) { //QFont Log_2_font( Log_2->font() ); //Log_2_font.setFamily( "adobe-courier" ); //Log_2_font.setPointSize( 8 ); - //Log_2->setFont( Log_2_font ); + //Log_2->setFont( Log_2_font ); QFont TextLabel1_4_2_font( TextLabel1_4_2->font() ); TextLabel1_4_2_font.setFamily( "adobe-helvetica" ); TextLabel1_4_2_font.setPointSize( 10 ); 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 @@ -26,9 +26,9 @@ class MScanListView; class MScanListItem; class QPushButton; class MLogWindow; -class MHexWindow; class MStatWindow; class MGraphWindow; +class PacketView; #ifdef QWS #include @@ -53,7 +53,7 @@ public: QWidget* ap; MScanListView* netview; MLogWindow* logwindow; - MHexWindow* hexwindow; + PacketView* hexwindow; MStatWindow* statwindow; MGraphWindow* graphwindow; QWidget* about; -- cgit v0.9.0.2