summaryrefslogtreecommitdiff
authormickeyl <mickeyl>2003-04-05 23:08:46 (UTC)
committer mickeyl <mickeyl>2003-04-05 23:08:46 (UTC)
commitb7682f160fafe69bfd47dcfb1c88f2ac2b1afaf5 (patch) (side-by-side diff)
tree68c5a0c5da88fff94582d2e6a072d8e9bbeaaf30
parent6a949f685bd3fb50f810ad603eaafdb57720077c (diff)
downloadopie-b7682f160fafe69bfd47dcfb1c88f2ac2b1afaf5.zip
opie-b7682f160fafe69bfd47dcfb1c88f2ac2b1afaf5.tar.gz
opie-b7682f160fafe69bfd47dcfb1c88f2ac2b1afaf5.tar.bz2
- correct beacon bug (off-by-one)
- display hex dump per packet in hex window - allow saving hex window contents
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/hexwindow.cpp10
-rw-r--r--noncore/net/wellenreiter/gui/hexwindow.h1
-rw-r--r--noncore/net/wellenreiter/gui/mainwindow.cpp23
-rw-r--r--noncore/net/wellenreiter/gui/mainwindow.h1
-rw-r--r--noncore/net/wellenreiter/gui/scanlist.cpp4
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiter.cpp5
6 files changed, 38 insertions, 6 deletions
diff --git a/noncore/net/wellenreiter/gui/hexwindow.cpp b/noncore/net/wellenreiter/gui/hexwindow.cpp
index a3022f4..8b17285 100644
--- a/noncore/net/wellenreiter/gui/hexwindow.cpp
+++ b/noncore/net/wellenreiter/gui/hexwindow.cpp
@@ -1,39 +1,45 @@
/**********************************************************************
** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved.
**
** This file is part of Opie Environment.
**
** 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 "hexwindow.h"
#include <qmultilineedit.h>
MHexWindow::MHexWindow( QWidget * parent, const char * name, WFlags f )
:QVBox( parent, name, f )
{
ledit = new QMultiLineEdit( this );
-
+ ledit->setFont( QFont( "fixed", 10 ) );
+
// FIXME: Set properties( font, read-only, etc...)
-
+
};
void MHexWindow::log( QString text )
{
ledit->append( text );
};
+const QString MHexWindow::getLog() const
+{
+ return ledit->text();
+}
+
void MHexWindow::clear()
{
ledit->clear();
}
diff --git a/noncore/net/wellenreiter/gui/hexwindow.h b/noncore/net/wellenreiter/gui/hexwindow.h
index 2618b8c..f2f870c 100644
--- a/noncore/net/wellenreiter/gui/hexwindow.h
+++ b/noncore/net/wellenreiter/gui/hexwindow.h
@@ -1,39 +1,40 @@
/**********************************************************************
** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved.
**
** This file is part of Opie Environment.
**
** 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 HEXWINDOW_H
#define HEXWINDOW_H
#include <qvbox.h>
class QString;
class QMultiLineEdit;
class MHexWindow: public QVBox
{
public:
MHexWindow( QWidget * parent = 0, const char * name = "MHexWindow", WFlags f = 0 );
void log( QString text );
+ const QString getLog() const;
void clear();
protected:
QMultiLineEdit* ledit;
};
#endif
diff --git a/noncore/net/wellenreiter/gui/mainwindow.cpp b/noncore/net/wellenreiter/gui/mainwindow.cpp
index 8e0164f..69d2b3a 100644
--- a/noncore/net/wellenreiter/gui/mainwindow.cpp
+++ b/noncore/net/wellenreiter/gui/mainwindow.cpp
@@ -46,129 +46,130 @@ WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * n
{
cw = new WellenreiterConfigWindow( this );
mw = new Wellenreiter( this );
mw->setConfigWindow( cw );
setCentralWidget( mw );
// setup application icon
#ifndef QWS
setIcon( Resource::loadPixmap( "wellenreiter/appicon-trans" ) );
setIconText( "Wellenreiter/X11" );
#endif
// setup icon sets
infoIconSet = new QIconSet( Resource::loadPixmap( "wellenreiter/InfoIcon" ) );
settingsIconSet = new QIconSet( Resource::loadPixmap( "wellenreiter/SettingsIcon" ) );
#ifdef QWS
searchIconSet = new QIconSet( Resource::loadPixmap( "wellenreiter/SearchIcon" ) );
cancelIconSet = new QIconSet( Resource::loadPixmap( "wellenreiter/CancelIcon" ) );
#else
startStopIconSet = new QIconSet();
startStopIconSet->setPixmap( Resource::loadPixmap( "wellenreiter/SearchIcon" ), QIconSet::Automatic, QIconSet::Normal, QIconSet::Off );
startStopIconSet->setPixmap( Resource::loadPixmap( "wellenreiter/CancelIcon" ), QIconSet::Automatic, QIconSet::Normal, QIconSet::On );
#endif
// setup tool buttons
startStopButton = new QToolButton( 0 );
#ifdef QWS
startStopButton->setAutoRaise( true );
#endif
#ifdef QWS
startStopButton->setOnIconSet( *cancelIconSet );
startStopButton->setOffIconSet( *searchIconSet );
#else
startStopButton->setIconSet( *startStopIconSet );
#endif
startStopButton->setToggleButton( true );
connect( startStopButton, SIGNAL( clicked() ), mw, SLOT( startStopClicked() ) );
startStopButton->setEnabled( false );
QToolButton* c = new QToolButton( 0 );
#ifdef QWS
c->setAutoRaise( true );
#endif
c->setIconSet( *infoIconSet );
c->setEnabled( false );
QToolButton* d = new QToolButton( 0 );
#ifdef QWS
d->setAutoRaise( true );
#endif
d->setIconSet( *settingsIconSet );
connect( d, SIGNAL( clicked() ), this, SLOT( showConfigure() ) );
// setup menu bar
int id;
QMenuBar* mb = menuBar();
QPopupMenu* fileSave = new QPopupMenu( mb );
fileSave->insertItem( "&Session...", this, SLOT( fileSaveSession() ) );
- fileSave->insertItem( "&Log...", this, SLOT( fileSaveLog() ) );
+ fileSave->insertItem( "&Text Log...", this, SLOT( fileSaveLog() ) );
+ fileSave->insertItem( "&Hex Log...", this, SLOT( fileSaveHex() ) );
QPopupMenu* fileLoad = new QPopupMenu( mb );
fileLoad->insertItem( "&Session...", this, SLOT( fileLoadSession() ) );
//fileLoad->insertItem( "&Log", this, SLOT( fileLoadLog() ) );
QPopupMenu* file = new QPopupMenu( mb );
file->insertItem( "&New", this, SLOT( fileNew() ) );
id = file->insertItem( "&Load", fileLoad );
file->insertItem( "&Save", fileSave );
file->insertSeparator();
file->insertItem( "&Exit", qApp, SLOT( quit() ) );
QPopupMenu* view = new QPopupMenu( mb );
view->insertItem( "&Configure..." );
QPopupMenu* sniffer = new QPopupMenu( mb );
sniffer->insertItem( "&Configure..." );
sniffer->insertSeparator();
QPopupMenu* demo = new QPopupMenu( mb );
demo->insertItem( "&Add something", this, SLOT( demoAddStations() ) );
id = mb->insertItem( "&File", file );
id = mb->insertItem( "&View", view );
mb->setItemEnabled( id, false );
id = mb->insertItem( "&Sniffer", sniffer );
mb->setItemEnabled( id, false );
id = mb->insertItem( "&Demo", demo );
mb->setItemEnabled( id, true );
#ifdef QWS
mb->insertItem( startStopButton );
mb->insertItem( c );
mb->insertItem( d );
#else // Qt3 changed the insertion order. It's now totally random :(
mb->insertItem( d );
mb->insertItem( c );
mb->insertItem( startStopButton );
#endif
// setup status bar (for now only on X11)
#ifndef QWS
statusBar()->message( "Ready." );
#endif
};
void WellenreiterMainWindow::showConfigure()
{
qDebug( "show configure..." );
cw->setCaption( tr( "Configure" ) );
#ifdef QWS
cw->showMaximized();
#endif
int result = cw->exec();
if ( result )
{
// check configuration from config window
const QString& interface = cw->interfaceName->currentText();
const int cardtype = cw->daemonDeviceType();
const int interval = cw->daemonHopInterval();
@@ -219,103 +220,123 @@ QString WellenreiterMainWindow::getFileName( bool save )
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();
qDebug( "Saved log to file '%s'", (const char*) fname );
}
else
{
qDebug( "Problem saving log to file '%s'", (const char*) fname );
}
}
}
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();
qDebug( "Saved session to file '%s'", (const char*) fname );
}
else
{
qDebug( "Problem saving session to file '%s'", (const char*) fname );
}
}
}
+void WellenreiterMainWindow::fileSaveHex()
+{
+ 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
{
qDebug( "Problem loading session from file '%s'", (const char*) fname );
}
}
}
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", "Sniffing in progress!\nPlease stop sniffing before closing." );
e->ignore();
}
else
{
QMainWindow::closeEvent( e );
}
}
diff --git a/noncore/net/wellenreiter/gui/mainwindow.h b/noncore/net/wellenreiter/gui/mainwindow.h
index e06a60c..1b08c5b 100644
--- a/noncore/net/wellenreiter/gui/mainwindow.h
+++ b/noncore/net/wellenreiter/gui/mainwindow.h
@@ -1,61 +1,62 @@
/**********************************************************************
** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved.
**
** This file is part of Opie Environment.
**
** 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 MAINWINDOW_H
#define MAINWINDOW_H
#include <qmainwindow.h>
class Wellenreiter;
class WellenreiterConfigWindow;
class QIconSet;
class QToolButton;
class WellenreiterMainWindow: public QMainWindow
{
Q_OBJECT
public:
WellenreiterMainWindow( QWidget * parent = 0, const char * name = "mainwindow", WFlags f = 0 );
~WellenreiterMainWindow();
protected:
Wellenreiter* mw;
WellenreiterConfigWindow* cw;
QIconSet* startStopIconSet;
const QIconSet* searchIconSet;
const QIconSet* infoIconSet;
const QIconSet* settingsIconSet;
const QIconSet* cancelIconSet;
QToolButton* startStopButton;
protected:
virtual void closeEvent( QCloseEvent* );
private:
QString getFileName( bool save );
public slots:
void showConfigure();
void demoAddStations();
void fileSaveLog();
+ void fileSaveHex();
void fileSaveSession();
void fileLoadSession();
void fileNew();
};
#endif
diff --git a/noncore/net/wellenreiter/gui/scanlist.cpp b/noncore/net/wellenreiter/gui/scanlist.cpp
index a006a3c..34c69f5 100644
--- a/noncore/net/wellenreiter/gui/scanlist.cpp
+++ b/noncore/net/wellenreiter/gui/scanlist.cpp
@@ -133,178 +133,178 @@ void MScanListView::addNewItem( QString type, QString essid, QString macaddr, bo
{
qDebug( "subitemtext: %s", (const char*) item->text( 2 ) );
item = static_cast<MScanListItem*> ( item->itemBelow() );
}
if ( item )
{
// we have already seen this item, it's a dupe
#ifdef DEBUG
qDebug( "%s is a dupe - ignoring...", (const char*) macaddr );
#endif
item->receivedBeacon();
return;
}
}
else
{
s.sprintf( "(i) new network: '%s'", (const char*) essid );
network = new MScanListItem( this, "networks", essid, QString::null, 0, 0, 0 );
}
// insert new station as child from network
// no essid to reduce clutter, maybe later we have a nick or stationname to display!?
qDebug( "inserting new station %s", (const char*) macaddr );
MScanListItem* station = new MScanListItem( network, type, "", macaddr, wep, channel, signal );
if ( _manufacturerdb )
station->setManufacturer( _manufacturerdb->lookup( macaddr ) );
if ( type == "managed" )
{
s.sprintf( "(i) new AP in '%s' [%d]", (const char*) essid, channel );
}
else
{
s.sprintf( "(i) new adhoc station in '%s' [%d]", (const char*) essid, channel );
}
}
#ifdef QWS
#include <qpe/resource.h>
#else
#include "resource.h"
#endif
const int col_type = 0;
const int col_essid = 0;
const int col_sig = 1;
const int col_ap = 2;
const int col_channel = 3;
const int col_wep = 4;
const int col_traffic = 5;
const int col_manuf = 6;
const int col_firstseen = 7;
const int col_lastseen = 8;
MScanListItem::MScanListItem( QListView* parent, QString type, QString essid, QString macaddr,
bool wep, int channel, int signal )
:OListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ),
_type( type ), _essid( essid ), _macaddr( macaddr ), _wep( wep ),
- _channel( channel ), _signal( signal ), _beacons( 0 )
+ _channel( channel ), _signal( signal ), _beacons( 1 )
{
qDebug( "creating scanlist item" );
if ( WellenreiterConfigWindow::instance() && type == "networks" )
playSound( WellenreiterConfigWindow::instance()->soundOnNetwork() );
decorateItem( type, essid, macaddr, wep, channel, signal );
}
MScanListItem::MScanListItem( QListViewItem* parent, QString type, QString essid, QString macaddr,
bool wep, int channel, int signal )
:OListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null )
{
qDebug( "creating scanlist item" );
decorateItem( type, essid, macaddr, wep, channel, signal );
}
OListViewItem* MScanListItem::childFactory()
{
return new MScanListItem( this );
}
void MScanListItem::serializeTo( QDataStream& s ) const
{
qDebug( "serializing MScanListItem" );
OListViewItem::serializeTo( s );
s << _type;
s << (Q_UINT8) _wep;
}
void MScanListItem::serializeFrom( QDataStream& s )
{
qDebug( "serializing MScanListItem" );
OListViewItem::serializeFrom( s );
s >> _type;
s >> (Q_UINT8) _wep;
QString name;
name.sprintf( "wellenreiter/%s", (const char*) _type );
setPixmap( col_type, Resource::loadPixmap( name ) );
if ( _wep )
setPixmap( col_wep, Resource::loadPixmap( "wellenreiter/cracked" ) ); //FIXME: rename the pixmap!
listView()->triggerUpdate();
}
void MScanListItem::decorateItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal )
{
qDebug( "decorating scanlist item %s / %s / %s [%d]",
(const char*) type,
(const char*) essid,
(const char*) macaddr,
channel );
// set icon for managed or adhoc mode
QString name;
name.sprintf( "wellenreiter/%s", (const char*) type );
setPixmap( col_type, Resource::loadPixmap( name ) );
// set icon for wep (wireless encryption protocol)
if ( wep )
setPixmap( col_wep, Resource::loadPixmap( "wellenreiter/cracked" ) ); //FIXME: rename the pixmap!
// set channel and signal text
if ( signal != -1 )
setText( col_sig, QString::number( signal ) );
if ( channel != -1 )
setText( col_channel, QString::number( channel ) );
setText( col_firstseen, QTime::currentTime().toString() );
//setText( col_lastseen, QTime::currentTime().toString() );
listView()->triggerUpdate();
this->type = type;
_type = type;
_essid = essid;
_macaddr = macaddr;
_channel = channel;
- _beacons = 0;
+ _beacons = 1;
_signal = 0;
}
void MScanListItem::setManufacturer( const QString& manufacturer )
{
setText( col_manuf, manufacturer );
}
void MScanListItem::playSound( const QString& sound ) const
{
#ifdef QWS
if ( sound == "Ignore" ) return;
else if ( sound == "Touch" ) ODevice::inst()->touchSound();
else if ( sound == "Key" ) ODevice::inst()->keySound();
else if ( sound == "Alarm" ) ODevice::inst()->alarmSound();
#endif
}
void MScanListItem::receivedBeacon()
{
_beacons++;
#ifdef DEBUG
qDebug( "MScanListItem %s: received beacon #%d", (const char*) _macaddr, _beacons );
#endif
setText( col_sig, QString::number( _beacons ) );
setText( col_lastseen, QTime::currentTime().toString() );
if ( WellenreiterConfigWindow::instance() )
playSound( WellenreiterConfigWindow::instance()->soundOnBeacon() );
}
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp
index d80a6e6..aa33158 100644
--- a/noncore/net/wellenreiter/gui/wellenreiter.cpp
+++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp
@@ -49,186 +49,189 @@ using namespace Opie;
#include "wellenreiter.h"
#include "scanlist.h"
#include "logwindow.h"
#include "hexwindow.h"
#include "configwindow.h"
#include "manufacturers.h"
Wellenreiter::Wellenreiter( QWidget* parent )
: WellenreiterBase( parent, 0, 0 ),
sniffing( false ), iface( 0 ), manufacturerdb( 0 ), configwindow( 0 )
{
//
// construct manufacturer database
//
QString manufile;
#ifdef QWS
manufile.sprintf( "%s/share/wellenreiter/manufacturers.dat", (const char*) QPEApplication::qpeDir() );
#else
manufile.sprintf( "/usr/local/share/wellenreiter/manufacturers.dat" );
#endif
manufacturerdb = new ManufacturerDB( manufile );
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
// setup GUI
netview->setColumnWidthMode( 1, QListView::Manual );
if ( manufacturerdb )
netview->setManufacturerDB( manufacturerdb );
pcap = new OPacketCapturer();
}
Wellenreiter::~Wellenreiter()
{
// no need to delete child widgets, Qt does it all for us
delete manufacturerdb;
delete pcap;
}
void Wellenreiter::setConfigWindow( WellenreiterConfigWindow* cw )
{
configwindow = cw;
}
void Wellenreiter::receivePacket(OPacket* p)
{
+ hexWindow()->log( p->dump( 8 ) );
+
// check if we received a beacon frame
// static_cast is justified here
OWaveLanManagementPacket* beacon = static_cast<OWaveLanManagementPacket*>( p->child( "802.11 Management" ) );
if ( !beacon ) return;
QString type;
//FIXME: Can stations in ESS mode can be distinguished from APs?
//FIXME: Apparently yes, but not by listening to beacons, because
//FIXME: they simply don't send beacons in infrastructure mode.
//FIXME: so we also have to listen to data packets
if ( beacon->canIBSS() )
type = "adhoc";
else
type = "managed";
OWaveLanManagementSSID* ssid = static_cast<OWaveLanManagementSSID*>( p->child( "802.11 SSID" ) );
QString essid = ssid ? ssid->ID() : QString("<unknown>");
OWaveLanManagementDS* ds = static_cast<OWaveLanManagementDS*>( p->child( "802.11 DS" ) );
int channel = ds ? ds->channel() : -1;
OWaveLanPacket* header = static_cast<OWaveLanPacket*>( p->child( "802.11" ) );
netView()->addNewItem( type, essid, header->macAddress2().toString(), header->usesWep(), channel, 0 );
}
void Wellenreiter::startStopClicked()
{
if ( sniffing )
{
disconnect( SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) );
iface->setChannelHopping(); // stop hopping channels
pcap->close();
sniffing = false;
#ifdef QWS
oApp->setTitle();
#else
qApp->mainWidget()->setCaption( "Wellenreiter II" );
#endif
// get interface name from config window
const QString& interface = configwindow->interfaceName->currentText();
ONetwork* net = ONetwork::instance();
iface = static_cast<OWirelessNetworkInterface*>(net->interface( interface ));
// switch off monitor mode
iface->setMonitorMode( false );
// switch off promisc flag
iface->setPromiscuousMode( false );
system( "cardctl reset; sleep 1" ); //FIXME: Use OProcess
+ logwindow->log( "(i) Stopped Scanning." );
// message the user
QMessageBox::information( this, "Wellenreiter II", "Your wireless card\nshould now be usable again." );
}
else
{
// get configuration from config window
const QString& interface = configwindow->interfaceName->currentText();
const int cardtype = configwindow->daemonDeviceType();
const int interval = configwindow->daemonHopInterval();
if ( ( interface == "" ) || ( cardtype == 0 ) )
{
QMessageBox::information( this, "Wellenreiter II", "Your device is not\nproperly configured. Please reconfigure!" );
return;
}
// configure device
ONetwork* net = ONetwork::instance();
iface = static_cast<OWirelessNetworkInterface*>(net->interface( interface ));
// set monitor mode
switch ( cardtype )
{
case 1: iface->setMonitoring( new OCiscoMonitoringInterface( iface ) ); break;
case 2: iface->setMonitoring( new OWlanNGMonitoringInterface( iface ) ); break;
case 3: iface->setMonitoring( new OHostAPMonitoringInterface( iface ) ); break;
case 4: iface->setMonitoring( new OOrinocoMonitoringInterface( iface ) ); break;
default: assert( 0 ); // shouldn't happen
}
iface->setMonitorMode( true );
if ( !iface->monitorMode() )
{
QMessageBox::warning( this, "Wellenreiter II", "Can't set device into monitor mode." );
return;
}
// open pcap and start sniffing
pcap->open( interface );
if ( !pcap->isOpen() )
{
QMessageBox::warning( this, "Wellenreiter II", "Can't open packet capturer:\n" + QString(strerror( errno ) ));
return;
}
// set capturer to non-blocking mode
pcap->setBlocking( false );
// start channel hopper
iface->setChannelHopping( 1000 ); //use interval from config window
// connect
connect( pcap, SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) );
- logwindow->log( "(i) Daemon has been started." );
+ logwindow->log( "(i) Started Scanning." );
#ifdef QWS
oApp->setTitle( "Scanning ..." );
#else
qApp->mainWidget()->setCaption( "Wellenreiter II / Scanning ..." );
#endif
sniffing = true;
}
}