summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/wellenreiter/TODO7
-rw-r--r--noncore/net/wellenreiter/gui/main.cpp1
-rw-r--r--noncore/net/wellenreiter/gui/mainwindow.cpp5
-rw-r--r--noncore/net/wellenreiter/gui/packetview.cpp48
-rw-r--r--noncore/net/wellenreiter/gui/packetview.h19
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiter.cpp4
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiter.h4
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiterbase.cpp4
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiterbase.h4
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
@@ -45,16 +45,23 @@ ENGINE
- revamp hex window, make it more sophisticated than just a QMultiLineEdit
- tree view
- beep over headphone / customizable
- count/display number of wireless networks / APs since last start/stop
---------
FILES
---------
- write kismet-like .network format and format to be importable into AutoRoute
- 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
@@ -39,32 +39,33 @@ int main( int argc, char **argv )
WellenreiterMainWindow* w = new WellenreiterMainWindow();
#ifdef QWS
a.showMainWidget( w );
#else
a.setMainWidget( w );
w->setCaption( "Wellenreiter II" );
w->show();
#endif
a.processEvents(); // show the window before doing the safety checks
int result = -1;
static int killed = false;
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" );
check = false;
break;
}
}
if ( check )
{
// root check
if ( getuid() )
{
qWarning( QObject::tr( "Wellenreiter: trying to run as non-root!" ) );
result = QMessageBox::warning( w, " - Wellenreiter II - (non-root)", QObject::tr( "You have started Wellenreiter II\n"
"as non-root. You will have\nonly limited functionality.\nProceed anyway?" ),
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
@@ -3,33 +3,33 @@
**
** This file is part of Wellenreiter II.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
**********************************************************************/
#include "configwindow.h"
#include "gps.h"
#include "logwindow.h"
-#include "hexwindow.h"
+#include "packetview.h"
#include "mainwindow.h"
#include "wellenreiter.h"
#include "scanlist.h"
#include <qcombobox.h>
#include <qdatastream.h>
#include <qfile.h>
#include <qfileinfo.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qlineedit.h>
#include <qiconset.h>
#include <qmenubar.h>
#include <qmessagebox.h>
#include <qpopupmenu.h>
#include <qpushbutton.h>
@@ -319,48 +319,51 @@ void WellenreiterMainWindow::fileSaveSession()
if ( f.open(IO_WriteOnly) )
{
QDataStream t( &f );
t << *mw->netView();
f.close();
qDebug( "Saved session to file '%s'", (const char*) fname );
}
else
{
qDebug( "Problem saving session to file '%s'", (const char*) fname );
}
}
}
void WellenreiterMainWindow::fileSaveHex()
{
+ #warning DOES NOT WORK AT THE MOMENT
+ /*
QString fname = getFileName( true );
if ( !fname.isEmpty() )
{
QFile f( fname );
if ( f.open(IO_WriteOnly) )
{
QTextStream t( &f );
t << mw->hexWindow()->getLog();
f.close();
qDebug( "Saved hex log to file '%s'", (const char*) fname );
}
else
{
qDebug( "Problem saving hex log to file '%s'", (const char*) fname );
}
}
+ */
}
void WellenreiterMainWindow::fileLoadSession()
{
QString fname = getFileName( false );
if ( !fname.isEmpty() )
{
QFile f( fname );
if ( f.open(IO_ReadOnly) )
{
QDataStream t( &f );
t >> *mw->netView();
f.close();
qDebug( "Loaded session from file '%s'", (const char*) fname );
}
else
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
@@ -1,44 +1,68 @@
/**********************************************************************
** Copyright (C) 2002-2004 Michael 'Mickey' Lauer. All rights reserved.
**
** This file is part of Wellenreiter II.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
**********************************************************************/
#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 );
};
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( " <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
@@ -3,38 +3,47 @@
**
** This file is part of Wellenreiter II.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
**********************************************************************/
#ifndef PACKETVIEW_H
#define PACKETVIEW_H
-#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
{
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<OPacket> _packets;
};
#endif
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
@@ -4,33 +4,33 @@
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
***********************************************************************/
// Local
#include "gps.h"
#include "wellenreiter.h"
#include "scanlist.h"
#include "logwindow.h"
-#include "hexwindow.h"
+#include "packetview.h"
#include "configwindow.h"
#include "statwindow.h"
#include "graphwindow.h"
#include "protolistview.h"
// Opie
#ifdef QWS
#include <opie2/oapplication.h>
#include <opie2/odevice.h>
#else
#include <qapplication.h>
#endif
#include <opie2/omanufacturerdb.h>
#include <opie2/onetwork.h>
#include <opie2/opcap.h>
@@ -367,33 +367,33 @@ bool Wellenreiter::checkDumpPacket( OPacket* p )
logwindow->log( QString().sprintf( "(i) dump-discarding of '%s' packet requested.", (const char*) name ) );
return false;
}
}
else
{
qDebug( "protocol '%s' not checked in capturePackets.", (const char*) name );
}
++it;
}
return true;
}
void Wellenreiter::receivePacket( OPacket* p )
{
- hexWindow()->log( p->dump( 8 ) );
+ hexWindow()->add( p );
if ( checkDumpPacket( p ) )
{
pcap->dump( p );
}
// check for a management frame
OWaveLanManagementPacket* manage = static_cast<OWaveLanManagementPacket*>( childIfToParse( p, "802.11 Management" ) );
if ( manage )
{
handleManagementFrame( p, manage );
return;
}
// check for a control frame
OWaveLanControlPacket* control = static_cast<OWaveLanControlPacket*>( childIfToParse( p, "802.11 Control" ) );
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
@@ -20,48 +20,48 @@
#include <opie2/odevice.h>
using namespace Opie;
#endif
class QTimerEvent;
class QPixmap;
class OPacket;
class OWaveLanManagementPacket;
class OWaveLanControlPacket;
class OWaveLanDataPacket;
class OEthernetPacket;
class OARPPacket;
class OMacAddress;
class OIPPacket;
class OPacketCapturer;
class OWirelessNetworkInterface;
+class PacketView;
class WellenreiterConfigWindow;
class MLogWindow;
-class MHexWindow;
class GPS;
class Wellenreiter : public WellenreiterBase {
Q_OBJECT
public:
Wellenreiter( QWidget* parent = 0 );
~Wellenreiter();
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; };
public:
bool sniffing;
protected:
virtual void timerEvent( QTimerEvent* );
public slots:
void initialTimer();
void channelHopped(int);
void receivePacket(OPacket*);
void startClicked();
void stopClicked();
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
@@ -6,33 +6,33 @@
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
***********************************************************************/
#include "wellenreiterbase.h"
#include <qlabel.h>
#include <qlayout.h>
#include "logwindow.h"
-#include "hexwindow.h"
+#include "packetview.h"
#include "scanlist.h"
#include "statwindow.h"
#include "graphwindow.h"
#ifdef QWS
#include <qpe/resource.h>
#include <opie2/otabwidget.h>
using namespace Opie;
#else
#include "resource.h"
#include <qtabwidget.h>
#endif
/*
* Constructs a WellenreiterBase which is a child of 'parent', with the
@@ -69,33 +69,33 @@ WellenreiterBase::WellenreiterBase( QWidget* parent, const char* name, WFlags f
//--------- NETVIEW TAB --------------
netview = new MScanListView( ap );
apLayout->addWidget( netview );
//--------- GRAPH TAB --------------
graphwindow = new MGraphWindow( TabWidget, "Graph" );
//--------- LOG TAB --------------
logwindow = new MLogWindow( TabWidget, "Log" );
//--------- HEX TAB --------------
- hexwindow = new MHexWindow( TabWidget, "Hex" );
+ hexwindow = new PacketView( TabWidget, "Hex" );
//--------- STAT TAB --------------
statwindow = new MStatWindow( TabWidget, "Stat" );
//--------- ABOUT TAB --------------
about = new QWidget( TabWidget, "about" );
aboutLayout = new QGridLayout( about );
aboutLayout->setSpacing( 6 );
aboutLayout->setMargin( 11 );
PixmapLabel1_3_2 = new QLabel( about, "PixmapLabel1_3_2" );
PixmapLabel1_3_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, PixmapLabel1_3_2->sizePolicy().hasHeightForWidth() ) );
PixmapLabel1_3_2->setFrameShape( QLabel::Panel );
PixmapLabel1_3_2->setFrameShadow( QLabel::Sunken );
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
@@ -13,60 +13,60 @@
**
**********************************************************************/
#ifndef WELLENREITERBASE_H
#define WELLENREITERBASE_H
#include <qvariant.h>
#include <qwidget.h>
class QVBoxLayout;
class QHBoxLayout;
class QGridLayout;
class QLabel;
class MScanListView;
class MScanListItem;
class QPushButton;
class MLogWindow;
-class MHexWindow;
class MStatWindow;
class MGraphWindow;
+class PacketView;
#ifdef QWS
#include <opie2/otabwidget.h>
using namespace Opie;
#else
class QTabWidget;
#endif
class WellenreiterBase : public QWidget
{
Q_OBJECT
public:
WellenreiterBase( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
~WellenreiterBase();
#ifdef QWS
OTabWidget* TabWidget;
#else
QTabWidget* TabWidget;
#endif
QWidget* ap;
MScanListView* netview;
MLogWindow* logwindow;
- MHexWindow* hexwindow;
+ PacketView* hexwindow;
MStatWindow* statwindow;
MGraphWindow* graphwindow;
QWidget* about;
QLabel* PixmapLabel1_3_2;
QLabel* TextLabel1_4_2;
protected:
QVBoxLayout* WellenreiterBaseLayout;
QVBoxLayout* apLayout;
QGridLayout* aboutLayout;
bool event( QEvent* );
QPixmap* ani1;
QPixmap* ani2;
QPixmap* ani3;
QPixmap* ani4;