summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/mainwindow.cpp30
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiter.cpp12
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiter.h2
3 files changed, 22 insertions, 22 deletions
diff --git a/noncore/net/wellenreiter/gui/mainwindow.cpp b/noncore/net/wellenreiter/gui/mainwindow.cpp
index 8525109..ef7ffcf 100644
--- a/noncore/net/wellenreiter/gui/mainwindow.cpp
+++ b/noncore/net/wellenreiter/gui/mainwindow.cpp
@@ -1,80 +1,80 @@
/**********************************************************************
** 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 "configwindow.h"
#include "gps.h"
#include "logwindow.h"
#include "packetview.h"
#include "mainwindow.h"
#include "wellenreiter.h"
#include "scanlist.h"
/* OPIE */
#ifdef QWS
#include <qpe/resource.h>
#include <opie2/odebug.h>
#include <opie2/ofiledialog.h>
#else
#include "resource.h"
#include <qapplication.h>
-#include <qfiledialog.h>
+#include <qfiledialog.h>
#endif
using namespace Opie::Core;
using namespace Opie::Net;
using namespace Opie::Ui;
/* QT */
#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>
#include <qstatusbar.h>
#include <qspinbox.h>
#include <qtextstream.h>
#include <qtoolbutton.h>
#include <qwhatsthis.h>
/* STD */
#include <unistd.h>
WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * name, WFlags f )
:QMainWindow( parent, name, f )
{
cw = new WellenreiterConfigWindow( this );
mw = new Wellenreiter( this );
mw->setConfigWindow( cw );
setCentralWidget( mw );
// setup application icon
setIcon( Resource::loadPixmap( "wellenreiter/appicon-trans" ) );
#ifndef QWS
setIconText( "Wellenreiter/X11" );
#endif
// setup tool buttons
startButton = new QToolButton( 0 );
QWhatsThis::add( startButton, tr( "Click here to start scanning." ) );
#ifdef QWS
startButton->setAutoRaise( true );
@@ -144,351 +144,351 @@ WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * n
QPopupMenu* view = new QPopupMenu( mb );
view->insertItem( tr( "&Expand All" ), this, SLOT( viewExpandAll() ) );
view->insertItem( tr( "&Collapse All" ), this, SLOT( viewCollapseAll() ) );
QPopupMenu* demo = new QPopupMenu( mb );
demo->insertItem( tr( "&Add something" ), this, SLOT( demoAddStations() ) );
//demo->insertItem( tr( "&Read from GPSd" ), this, SLOT( demoReadFromGps() ) );
id = mb->insertItem( tr( "&File" ), file );
id = mb->insertItem( tr( "&View" ), view );
//mb->setItemEnabled( id, false );
id = mb->insertItem( tr( "&Sniffer" ), sniffer );
id = mb->insertItem( tr( "&Demo" ), demo );
mb->setItemEnabled( id, true );
mb->setItemEnabled( uploadID, false );
#ifdef QWS
mb->insertItem( startButton );
mb->insertItem( stopButton );
mb->insertItem( uploadButton );
mb->insertItem( d );
#else // Qt3 changed the insertion order. It's now totally random :(
mb->insertItem( d );
mb->insertItem( uploadButton );
mb->insertItem( stopButton );
mb->insertItem( startButton );
#endif
updateToolButtonState();
// setup status bar (for now only on X11)
#ifndef QWS
statusBar()->message( tr( "Ready." ) );
#endif
connect( mw, SIGNAL( startedSniffing() ), this, SLOT( changedSniffingState() ) );
connect( mw, SIGNAL( stoppedSniffing() ), this, SLOT( changedSniffingState() ) );
};
void WellenreiterMainWindow::showConfigure()
{
- odebug << "show configure..." << oendl;
+ odebug << "show configure..." << oendl;
cw->setCaption( tr( "Configure" ) );
int result = QPEApplication::execDialog( cw );
if ( result ) updateToolButtonState();
}
void WellenreiterMainWindow::updateToolButtonState()
{
const QString& interface = cw->interfaceName->currentText();
const int cardtype = cw->driverType();
if ( ( interface != "<select>" ) && ( cardtype != 0 ) )
{
startButton->setEnabled( true );
menuBar()->setItemEnabled( startID, true );
}
else
{
startButton->setEnabled( false );
menuBar()->setItemEnabled( startID, false );
}
}
void WellenreiterMainWindow::changedSniffingState()
{
startButton->setEnabled( !mw->sniffing );
menuBar()->setItemEnabled( startID, !mw->sniffing );
stopButton->setEnabled( mw->sniffing );
menuBar()->setItemEnabled( stopID, mw->sniffing );
- if ( !mw->sniffing )
+ if ( !mw->sniffing && QFile::exists( mw->dumpname ) )
{
menuBar()->setItemEnabled( uploadID, true );
uploadButton->setEnabled( true );
}
}
WellenreiterMainWindow::~WellenreiterMainWindow()
{
- odebug << "Wellenreiter: bye." << oendl;
+ odebug << "Wellenreiter: bye." << oendl;
};
void WellenreiterMainWindow::demoAddStations()
{
//mw = 0; // test SIGSEGV handling
mw->netView()->addNewItem( "managed", "Vanille", OMacAddress::fromString("00:00:20:EF:A6:43"), true, 6, 80, GpsLocation( 39.8794, -94.0936) );
mw->netView()->addNewItem( "managed", "Vanille", OMacAddress::fromString("00:30:6D:EF:A6:23"), true, 11, 10, GpsLocation( 0.0, 0.0 ) );
mw->netView()->addNewItem( "adhoc", "ELAN", OMacAddress::fromString("00:03:F8:E7:16:22"), false, 3, 10, GpsLocation( 5.5, 2.3 ) );
mw->netView()->addNewItem( "adhoc", "ELAN", OMacAddress::fromString("00:04:01:E7:56:62"), false, 3, 15, GpsLocation( 2.3, 5.5 ) );
mw->netView()->addNewItem( "adhoc", "ELAN", OMacAddress::fromString("00:05:8E:E7:56:E2"), false, 3, 20, GpsLocation( -10.0, -20.5 ) );
}
void WellenreiterMainWindow::demoReadFromGps()
{
WellenreiterConfigWindow* configwindow = WellenreiterConfigWindow::instance();
GPS* gps = new GPS( this );
- odebug << "Wellenreiter::demoReadFromGps(): url=gps://" << configwindow->gpsdHost->currentText() << ":" << configwindow->gpsdPort->value() << "/" << oendl;
+ odebug << "Wellenreiter::demoReadFromGps(): url=gps://" << configwindow->gpsdHost->currentText() << ":" << configwindow->gpsdPort->value() << "/" << oendl;
gps->open( configwindow->gpsdHost->currentText(), configwindow->gpsdPort->value() );
GpsLocation loc = gps->position();
QMessageBox::information( this, "Wellenreiter/Opie", tr( "GPS said:\n%1" ).arg( loc.dmsPosition() ) );
delete gps;
}
QString WellenreiterMainWindow::getFileName( bool save )
{
QMap<QString, QStringList> map;
map.insert( tr("All"), QStringList() );
QStringList text;
text << "text/*";
map.insert( tr("Text"), text );
text << "*";
map.insert( tr("All"), text );
QString str;
if ( save )
{
#ifdef QWS
str = OFileDialog::getSaveFileName( 2, "/", QString::null, map );
#else
str = QFileDialog::getSaveFileName();
#endif
if ( str.isEmpty() /*|| QFileInfo(str).isDir()*/ )
return "";
}
else
{
#ifdef QWS
str = OFileDialog::getOpenFileName( 2, "/", QString::null, map );
#else
str = QFileDialog::getOpenFileName();
#endif
if ( str.isEmpty() || !QFile(str).exists() || QFileInfo(str).isDir() )
return "";
}
return str;
}
void WellenreiterMainWindow::fileSaveLog()
{
QString fname = getFileName( true );
if ( !fname.isEmpty() )
{
QFile f( fname );
if ( f.open(IO_WriteOnly) )
{
QTextStream t( &f );
t << mw->logWindow()->getLog();
f.close();
- odebug << "Saved log to file '" << fname << "'" << oendl;
+ odebug << "Saved log to file '" << fname << "'" << oendl;
}
else
{
- odebug << "Problem saving log to file '" << fname << "'" << oendl;
+ odebug << "Problem saving log to file '" << fname << "'" << oendl;
}
}
}
void WellenreiterMainWindow::fileSaveSession()
{
QString fname = getFileName( true );
if ( !fname.isEmpty() )
{
QFile f( fname );
if ( f.open(IO_WriteOnly) )
{
QDataStream t( &f );
t << *mw->netView();
f.close();
- odebug << "Saved session to file '" << fname << "'" << oendl;
+ odebug << "Saved session to file '" << fname << "'" << oendl;
}
else
{
- odebug << "Problem saving session to file '" << fname << "'" << oendl;
+ odebug << "Problem saving session to file '" << fname << "'" << oendl;
}
}
}
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();
- odebug << "Saved hex log to file '" << fname << "'" << oendl;
+ odebug << "Saved hex log to file '" << fname << "'" << oendl;
}
else
{
- odebug << "Problem saving hex log to file '" << fname << "'" << oendl;
+ odebug << "Problem saving hex log to file '" << fname << "'" << oendl;
}
}
*/
}
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();
- odebug << "Loaded session from file '" << fname << "'" << oendl;
+ odebug << "Loaded session from file '" << fname << "'" << oendl;
}
else
{
- odebug << "Problem loading session from file '" << fname << "'" << oendl;
+ odebug << "Problem loading session from file '" << fname << "'" << oendl;
}
}
}
void WellenreiterMainWindow::fileNew()
{
mw->netView()->clear();
mw->logWindow()->clear();
mw->hexWindow()->clear();
}
void WellenreiterMainWindow::closeEvent( QCloseEvent* e )
{
if ( mw->isDaemonRunning() )
{
QMessageBox::warning( this, "Wellenreiter/Opie",
tr( "Sniffing in progress!\nPlease stop sniffing before closing." ) );
e->ignore();
}
else
{
QMainWindow::closeEvent( e );
}
}
static const char* CAP_hostname = "www.vanille.de";
#include <netdb.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
void WellenreiterMainWindow::uploadSession()
{
QLineEdit* from;
QLineEdit* location;
QLineEdit* comments;
QPushButton* accept;
QPushButton* reject;
QDialog* d = new QDialog( 0, "session upload", true );
d->setCaption( tr( "Upload Session" ) );
QGridLayout* g = new QGridLayout( d, 4, 2, 3 );
g->addWidget( new QLabel( tr( "From: " ), d ), 0, 0 );
g->addWidget( from = new QLineEdit( d ), 0, 1 );
g->addWidget( new QLabel( tr( "Location: " ), d ), 1, 0 );
g->addWidget( location = new QLineEdit( d ), 1, 1 );
g->addWidget( new QLabel( tr( "Comments: " ), d ), 2, 0 );
g->addWidget( comments = new QLineEdit( d ), 2, 1 );
g->addWidget( accept = new QPushButton( tr( "&Ok" ), d ), 3, 0 );
g->addWidget( reject = new QPushButton( tr( "&Cancel" ), d ), 3, 1 );
accept->setDefault( true );
accept->setAutoDefault( true );
from->setText( "WL II User" );
location->setText( "WL II Location" );
comments->setText( "No Comments." );
connect( accept, SIGNAL( clicked() ), d, SLOT( accept() ) );
connect( reject, SIGNAL( clicked() ), d, SLOT( reject() ) );
int result = d->exec();
if ( !result )
{
- odebug << "Session upload cancelled :(" << oendl;
+ odebug << "Session upload cancelled :(" << oendl;
return;
}
- odebug << "Starting upload..." << oendl;
+ odebug << "Starting upload..." << oendl;
struct sockaddr_in raddr;
struct hostent *rhost_info;
int sock = -1;
bool ok = false;
rhost_info = (struct hostent *) ::gethostbyname( CAP_hostname );
if ( rhost_info )
{
if ( !QFile::exists( mw->captureFileName() ) )
{
QMessageBox::warning( 0, tr( "Error" ), tr( "<p>Logfile '%1' doesn't exist</p>").arg( mw->captureFileName() ) );
return;
}
QFile f( mw->captureFileName() );
if ( !f.open( IO_ReadOnly ) )
{
QMessageBox::warning( 0, tr( "Error" ), tr( "<p>Can't open Logfile '%1'</p>").arg( mw->captureFileName() ) );
return;
}
int content_length = f.size();
::memset( &raddr, 0, sizeof (struct sockaddr_in) );
::memcpy( &raddr. sin_addr, rhost_info-> h_addr, rhost_info-> h_length );
raddr.sin_family = rhost_info-> h_addrtype;
raddr.sin_port = htons ( 80 );
sock = ::socket( AF_INET, SOCK_STREAM, 0 );
if ( sock >= 0 )
{
if ( ::connect ( sock, (struct sockaddr *) & raddr, sizeof (struct sockaddr)) >= 0 )
{
QString header;
QString content;
QString preambel;
header = ""
"POST /projects/capturedump.spy HTTP/1.1\r\n"
"Host: www.vanille.de\r\n"
"User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031010 Galeon/1.3.10\r\n"
"Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,image/jpeg,image/gif;q=0.2,*/*;q=0.1\r\n"
"Accept-Language: en\r\n"
"Accept-Encoding: gzip, deflate, compress;q=0.9\r\n"
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp
index fe8f22d..2f85790 100644
--- a/noncore/net/wellenreiter/gui/wellenreiter.cpp
+++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp
@@ -68,96 +68,97 @@ Wellenreiter::Wellenreiter( QWidget* parent )
{
logwindow->log( "(i) Wellenreiter has been started." );
//
// detect operating system
//
#ifdef QWS
QString sys;
sys.sprintf( "(i) Running on '%s'.", (const char*) ODevice::inst()->systemString() );
_system = ODevice::inst()->system();
logwindow->log( sys );
#endif
netview->setColumnWidthMode( 1, QListView::Manual );
connect( netview, SIGNAL( joinNetwork(const QString&,const QString&,int,const QString&) ),
this, SLOT( joinNetwork(const QString&,const QString&,int,const QString&) ) );
pcap = new OPacketCapturer();
pcap->setAutoDelete( false );
gps = new GPS( this );
QTimer::singleShot( 1000, this, SLOT( initialTimer() ) );
registerSignalHandler();
}
Wellenreiter::~Wellenreiter()
{
delete pcap;
//unregisterSignalHandler();
}
void Wellenreiter::initialTimer()
{
odebug << "preloading manufacturer database..." << oendl;
OManufacturerDB::instance();
}
void Wellenreiter::signalHandler( int sig )
{
oerr << "Aye! Received SIGSEGV or SIGBUS! Trying to exit gracefully..." << oendl;
if ( Wellenreiter::instance->sniffing )
{
+ Wellenreiter::instance->pcap->closeDumpFile();
Wellenreiter::instance->pcap->close();
Wellenreiter::instance->stopClicked();
}
oerr << "Phew. Seemed to work." << oendl;
::exit( -1 );
}
void Wellenreiter::registerSignalHandler()
{
Wellenreiter::instance = this;
struct sigaction action;
action.sa_handler = Wellenreiter::signalHandler;
if (sigemptyset(&action.sa_mask))
oerr << "sigemptyset() failure:" << strerror( errno ) << oendl;
if (sigaction(SIGSEGV, &action, NULL))
oerr << "can't set up a signal handler for SIGSEGV:" << strerror( errno ) << oendl;
if (sigaction(SIGBUS, &action, NULL))
oerr << "can't set up a signal handler for SIGBUS:" << strerror( errno ) << oendl;
odebug << "signal handlers setup." << oendl;
}
void Wellenreiter::setConfigWindow( WellenreiterConfigWindow* cw )
{
configwindow = cw;
}
void Wellenreiter::channelHopped(int c)
{
QString title = "Wellenreiter II -scan- [";
QString left;
if ( c > 1 ) left.fill( '.', c-1 );
title.append( left );
title.append( '|' );
if ( c < iface->channels() )
{
QString right;
right.fill( '.', iface->channels()-c );
title.append( right );
}
title.append( "]" );
//title.append( QString().sprintf( " %02d", c ) );
assert( parent() );
( (QMainWindow*) parent() )->setCaption( title );
}
@@ -577,108 +578,107 @@ void Wellenreiter::startClicked()
return;
}
}
// set monitor mode
bool usePrism = configwindow->usePrismHeader();
switch ( cardtype )
{
case DEVTYPE_CISCO: iface->setMonitoring( new OCiscoMonitoringInterface( iface, usePrism ) ); break;
case DEVTYPE_WLAN_NG: iface->setMonitoring( new OWlanNGMonitoringInterface( iface, usePrism ) ); break;
case DEVTYPE_HOSTAP: iface->setMonitoring( new OHostAPMonitoringInterface( iface, usePrism ) ); break;
case DEVTYPE_ORINOCO: iface->setMonitoring( new OOrinocoMonitoringInterface( iface, usePrism ) ); break;
case DEVTYPE_MANUAL: QMessageBox::information( this, "Wellenreiter II", tr( "Bring your device into\nmonitor mode now." ) ); break;
case DEVTYPE_FILE: odebug << "Wellenreiter: Capturing from file '" << interface << "'" << oendl; break;
default: assert( 0 ); // shouldn't reach this
}
// switch device into monitor mode
if ( cardtype < DEVTYPE_FILE )
{
if ( cardtype != DEVTYPE_MANUAL )
iface->setMode( "monitor" );
if ( iface->mode() != "monitor" )
{
if ( QMessageBox::warning( this, "Wellenreiter II",
tr( "Can't set interface '%1'\ninto monitor mode:\n" ).arg( iface->name() ) + strerror( errno ) +
tr( "\nContinue with limited functionality?" ), QMessageBox::Yes, QMessageBox::No ) == QMessageBox::No )
return;
}
}
// open GPS device
if ( configwindow->enableGPS->isChecked() )
{
odebug << "Wellenreiter:GPS enabled @ " << configwindow->gpsdHost->currentText() << ":" << configwindow->gpsdPort->value() << "" << oendl;
gps->open( configwindow->gpsdHost->currentText(), configwindow->gpsdPort->value() );
}
// open pcap and start sniffing
if ( configwindow->writeCaptureFile->isChecked() ) // write to a user specified capture file?
{
dumpname = configwindow->captureFileName->text();
if ( dumpname.isEmpty() ) dumpname = "captureFile";
dumpname.append( '-' );
dumpname.append( QTime::currentTime().toString().replace( QRegExp( ":" ), "-" ) );
dumpname.append( ".wellenreiter" );
}
- else // write it anyway ;)
- {
- dumpname = "/var/log/dump.wellenreiter";
- }
if ( cardtype != DEVTYPE_FILE )
pcap->open( interface );
else
pcap->openCaptureFile( interface );
- odebug << "Wellenreiter:: dumping to " << dumpname << "" << oendl;
- pcap->openDumpFile( dumpname );
+ if ( configwindow->writeCaptureFile->isChecked() )
+ {
+ odebug << "Wellenreiter:: dumping to " << dumpname << oendl;
+ pcap->openDumpFile( dumpname );
+ }
if ( !pcap->isOpen() )
{
QMessageBox::warning( this, "Wellenreiter II", tr( "Can't open packet capturer for\n'%1':\n" ).arg(
cardtype == DEVTYPE_FILE ? (const char*) interface : iface->name() ) + QString(strerror( errno ) ));
return;
}
// set capturer to non-blocking mode
pcap->setBlocking( false );
// start channel hopper
if ( cardtype != DEVTYPE_FILE )
{
logwindow->log( QString().sprintf( "(i) Starting channel hopper (d=%d ms)", configwindow->hopInterval->value() ) );
iface->setChannelHopping( configwindow->hopInterval->value() ); //use interval from config window
}
if ( cardtype != DEVTYPE_FILE )
{
// connect socket notifier and start channel hopper
connect( pcap, SIGNAL( receivedPacket(Opie::Net::OPacket*) ), this, SLOT( receivePacket(Opie::Net::OPacket*) ) );
connect( iface->channelHopper(), SIGNAL( hopped(int) ), this, SLOT( channelHopped(int) ) );
}
else
{
// start timer for reading packets
startTimer( 100 );
}
logwindow->log( "(i) Started Scanning." );
sniffing = true;
#ifdef QWS
if ( WellenreiterConfigWindow::instance()->disablePM->isChecked() )
{
QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Disable;
}
#else
#warning FIXME: setScreenSaverMode is not operational on the X11 build
#endif
emit( startedSniffing() );
if ( cardtype != DEVTYPE_FILE ) channelHopped( 6 ); // set title
else
{
assert( parent() );
( (QMainWindow*) parent() )->setCaption( tr( "Wellenreiter II - replaying capture file..." ) );
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.h b/noncore/net/wellenreiter/gui/wellenreiter.h
index 32e5690..f582a5f 100644
--- a/noncore/net/wellenreiter/gui/wellenreiter.h
+++ b/noncore/net/wellenreiter/gui/wellenreiter.h
@@ -10,103 +10,103 @@
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
**********************************************************************/
#ifndef WELLENREITER_H
#define WELLENREITER_H
#include "wellenreiterbase.h"
#ifdef QWS
#include <opie2/odevice.h>
#endif
#include <signal.h>
class QTimerEvent;
class QPixmap;
namespace Opie {namespace Net {class OPacket;}}
namespace Opie {namespace Net {class OWaveLanManagementPacket;}}
namespace Opie {namespace Net {class OWaveLanControlPacket;}}
namespace Opie {namespace Net {class OWaveLanDataPacket;}}
namespace Opie {namespace Net {class OEthernetPacket;}}
namespace Opie {namespace Net {class OARPPacket;}}
namespace Opie {namespace Net {class OMacAddress;}}
namespace Opie {namespace Net {class OIPPacket;}}
namespace Opie {namespace Net {class OPacket;}}
namespace Opie {namespace Net {class OWirelessNetworkInterface;}}
namespace Opie {namespace Net {class OPacketCapturer;}}
class PacketView;
class WellenreiterConfigWindow;
class MLogWindow;
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; };
PacketView* hexWindow() const { return hexwindow; };
bool isDaemonRunning() const { return sniffing; };
QString captureFileName() const { return dumpname; };
public:
+ QString dumpname;
bool sniffing;
static Wellenreiter* instance;
static void signalHandler( int sig );
protected:
virtual void timerEvent( QTimerEvent* );
public slots:
void initialTimer();
void channelHopped(int);
void receivePacket(Opie::Net::OPacket*);
void startClicked();
void stopClicked();
void joinNetwork(const QString&,const QString&,int,const QString&);
signals:
void startedSniffing();
void stoppedSniffing();
private:
void handleManagementFrame( Opie::Net::OPacket* p, Opie::Net::OWaveLanManagementPacket* );
void handleManagementFrameBeacon( Opie::Net::OPacket* p, Opie::Net::OWaveLanManagementPacket* );
void handleManagementFrameProbeRequest( Opie::Net::OPacket* p, Opie::Net::OWaveLanManagementPacket* );
void handleManagementFrameProbeResponse( Opie::Net::OPacket* p, Opie::Net::OWaveLanManagementPacket* );
void handleControlFrame( Opie::Net::OPacket* p, Opie::Net::OWaveLanControlPacket* control );
void handleWlanData( Opie::Net::OPacket* p, Opie::Net::OWaveLanDataPacket* data, Opie::Net::OMacAddress& from, Opie::Net::OMacAddress& to );
void handleEthernetData( Opie::Net::OPacket* p, Opie::Net::OEthernetPacket* data, Opie::Net::OMacAddress& from, Opie::Net::OMacAddress& to );
void handleARPData( Opie::Net::OPacket* p, Opie::Net::OARPPacket* arp, Opie::Net::OMacAddress& from, Opie::Net::OMacAddress& to );
void handleIPData( Opie::Net::OPacket* p, Opie::Net::OIPPacket* ip, Opie::Net::OMacAddress& from, Opie::Net::OMacAddress& to );
void handleNotification( Opie::Net::OPacket* p );
void doAction( const QString& action, const QString& protocol, Opie::Net::OPacket* p );
QObject* childIfToParse( Opie::Net::OPacket* p, const QString& protocol );
bool checkDumpPacket( Opie::Net::OPacket* p );
void registerSignalHandler();
private:
#ifdef QWS
Opie::Core::OSystem _system; // Opie Operating System identifier
#endif
- QString dumpname;
Opie::Net::OWirelessNetworkInterface* iface;
Opie::Net::OPacketCapturer* pcap;
WellenreiterConfigWindow* configwindow;
GPS* gps;
//void readConfig();
//void writeConfig();
};
#endif