author | mickeyl <mickeyl> | 2002-12-31 14:59:35 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2002-12-31 14:59:35 (UTC) |
commit | 76ec681931f01609969b92e75908418d9e8e92d5 (patch) (side-by-side diff) | |
tree | 8230634998f17c66ebb4eb1acd82112cdb77c944 | |
parent | 3f35e5918b5f508139e189d2428d01d6c2933a50 (diff) | |
download | opie-76ec681931f01609969b92e75908418d9e8e92d5.zip opie-76ec681931f01609969b92e75908418d9e8e92d5.tar.gz opie-76ec681931f01609969b92e75908418d9e8e92d5.tar.bz2 |
- catch with latest changes in libwellenreiter
- GUI now identifies and displays device manufacturers
- GUI now displays the number of received beacons for each device
-rw-r--r-- | noncore/net/wellenreiter/gui/manufacturers.cpp | 4 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/manufacturers.h | 2 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/scanlist.cpp | 36 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/scanlist.h | 7 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/scanlistitem.cpp | 19 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/scanlistitem.h | 8 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 27 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.h | 19 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiterbase.cpp | 16 | ||||
-rw-r--r-- | noncore/net/wellenreiter/libwellenreiter/libwellenreiter.pro | 2 |
10 files changed, 108 insertions, 32 deletions
diff --git a/noncore/net/wellenreiter/gui/manufacturers.cpp b/noncore/net/wellenreiter/gui/manufacturers.cpp index d235989..dad2753 100644 --- a/noncore/net/wellenreiter/gui/manufacturers.cpp +++ b/noncore/net/wellenreiter/gui/manufacturers.cpp @@ -1,58 +1,60 @@ /********************************************************************** ** 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 "manufacturers.h" // Qt #include <qstring.h> #include <qfile.h> #include <qtextstream.h> ManufacturerDB::ManufacturerDB( const QString& filename ) { QFile file( filename ); bool hasFile = file.open( IO_ReadOnly ); if (!hasFile) { qDebug( "ManufacturerDB: D'oh! Manufacturer list '%s' not found!", (const char*) filename ); } else { qDebug( "ManufacturerDB: reading manufacturer list from '%s'...", (const char*) filename ); QTextStream s( &file ); QString addr; QString manu; while (!s.atEnd()) { s >> addr; s.skipWhiteSpace(); manu = s.readLine(); + #ifdef DEBUG qDebug( "ManufacturerDB: read pair %s, %s", (const char*) addr, (const char*) manu ); + #endif manufacturers.insert( addr, manu ); } } } ManufacturerDB::~ManufacturerDB() { } -QString ManufacturerDB::lookup( const QString& macaddr ) +const QString& ManufacturerDB::lookup( const QString& macaddr ) const { return manufacturers[macaddr.upper().left(8)]; } diff --git a/noncore/net/wellenreiter/gui/manufacturers.h b/noncore/net/wellenreiter/gui/manufacturers.h index d69977a..67afe21 100644 --- a/noncore/net/wellenreiter/gui/manufacturers.h +++ b/noncore/net/wellenreiter/gui/manufacturers.h @@ -1,37 +1,37 @@ /********************************************************************** ** 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 MANUFACTURERS_H #define MANUFACTURERS_H #include <qmap.h> #include <string.h> class ManufacturerDB { public: ManufacturerDB( const QString& filename ); virtual ~ManufacturerDB(); - QString lookup( const QString& macaddr ); + const QString& lookup( const QString& macaddr ) const; private: QMap<QString, QString> manufacturers; }; #endif diff --git a/noncore/net/wellenreiter/gui/scanlist.cpp b/noncore/net/wellenreiter/gui/scanlist.cpp index 6d032aa..ab19701 100644 --- a/noncore/net/wellenreiter/gui/scanlist.cpp +++ b/noncore/net/wellenreiter/gui/scanlist.cpp @@ -1,117 +1,149 @@ /********************************************************************** ** 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 "scanlist.h" #include "scanlistitem.h" #include <assert.h> +#include "manufacturers.h" + MScanListView::MScanListView( QWidget* parent, const char* name ) - :QListView( parent, name ) + :QListView( parent, name ), _manufacturerdb( 0 ) { + + setFrameShape( QListView::StyledPanel ); + setFrameShadow( QListView::Sunken ); + + addColumn( tr( "Net/Station" ) ); + setColumnAlignment( 0, AlignLeft || AlignVCenter ); + addColumn( tr( "B" ) ); + setColumnAlignment( 1, AlignCenter ); + addColumn( tr( "AP" ) ); + setColumnAlignment( 2, AlignCenter ); + addColumn( tr( "Chn" ) ); + setColumnAlignment( 3, AlignCenter ); + addColumn( tr( "W" ) ); + setColumnAlignment( 4, AlignCenter ); + addColumn( tr( "T" ) ); + setColumnAlignment( 5, AlignCenter ); + addColumn( tr( "Manufacturer" ) ); + setColumnAlignment( 6, AlignCenter ); + setRootIsDecorated( true ); + setAllColumnsShowFocus( true ); }; MScanListView::~MScanListView() { }; +void MScanListView::setManufacturerDB( ManufacturerDB* manufacturerdb ) +{ + _manufacturerdb = manufacturerdb; +} + void MScanListView::addNewItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal ) { // FIXME: scanlistitem needs a proper encapsulation and not such a damn dealing with text(...) qDebug( "MScanList::addNewItem( %s / %s / %s [%d]", (const char*) type, (const char*) essid, (const char*) macaddr, channel ); // search, if we already have seen this net QString s; MScanListItem* network; MScanListItem* item = static_cast<MScanListItem*> ( firstChild() ); while ( item && ( item->text( 0 ) != essid ) ) { qDebug( "itemtext: %s", (const char*) item->text( 0 ) ); item = static_cast<MScanListItem*> ( item->itemBelow() ); } if ( item ) { // animate the item /* const QPixmap* pixmap = item->pixmap( 0 ); const QPixmap* nextpixmap = ani2; if ( pixmap == ani1 ) nextpixmap = ani2; else if ( pixmap == ani2 ) nextpixmap = ani3; else if ( pixmap == ani3 ) nextpixmap = ani4; else if ( pixmap == ani4 ) nextpixmap = ani1; item->setPixmap( 0, *nextpixmap ); */ //qDebug( "current pixmap %d, next %d", pixmap, nextpixmap ); // we have already seen this net, check all childs if MAC exists network = item; item = static_cast<MScanListItem*> ( item->firstChild() ); assert( item ); // this shouldn't fail while ( item && ( item->text( 2 ) != macaddr ) ) { 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 ); - new MScanListItem( network, type, "", macaddr, wep, channel, signal ); + 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 ); } } diff --git a/noncore/net/wellenreiter/gui/scanlist.h b/noncore/net/wellenreiter/gui/scanlist.h index 6fe6930..9a35a82 100644 --- a/noncore/net/wellenreiter/gui/scanlist.h +++ b/noncore/net/wellenreiter/gui/scanlist.h @@ -1,37 +1,44 @@ /********************************************************************** ** 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 SCANLIST_H #define SCANLIST_H #include <qlistview.h> class QString; +class ManufacturerDB; + class MScanListView: public QListView { Q_OBJECT public: MScanListView( QWidget* parent = 0, const char* name = 0 ); virtual ~MScanListView(); + void setManufacturerDB( ManufacturerDB* manufacturerdb ); + public slots: void addNewItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal ); + private: + ManufacturerDB* _manufacturerdb; + }; #endif diff --git a/noncore/net/wellenreiter/gui/scanlistitem.cpp b/noncore/net/wellenreiter/gui/scanlistitem.cpp index f4b43a6..15aef0c 100644 --- a/noncore/net/wellenreiter/gui/scanlistitem.cpp +++ b/noncore/net/wellenreiter/gui/scanlistitem.cpp @@ -1,79 +1,96 @@ /********************************************************************** ** 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 "scanlistitem.h" #include <assert.h> #include <qpixmap.h> #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; MScanListItem::MScanListItem( QListView* parent, QString type, QString essid, QString macaddr, bool wep, int channel, int signal ) - :QListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ) + :QListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ), + _type( type ), _essid( essid ), _macaddr( macaddr ), _wep( wep ), + _channel( channel ), _signal( signal ), _beacons( 0 ) { qDebug( "creating scanlist item" ); decorateItem( type, essid, macaddr, wep, channel, signal ); } MScanListItem::MScanListItem( QListViewItem* parent, QString type, QString essid, QString macaddr, bool wep, int channel, int signal ) :QListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ) { qDebug( "creating scanlist item" ); decorateItem( type, essid, macaddr, wep, channel, signal ); } 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" ) ); // 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 ) ); listView()->triggerUpdate(); this->type = type; } +void MScanListItem::setManufacturer( const QString& manufacturer ) +{ + setText( col_manuf, manufacturer ); +} + +void MScanListItem::receivedBeacon() +{ + _beacons++; + #ifdef DEBUG + qDebug( "MScanListItem %s: received beacon #%d", (const char*) _macaddr, _beacons ); + #endif + setText( col_sig, QString::number( _beacons ) ); +} + diff --git a/noncore/net/wellenreiter/gui/scanlistitem.h b/noncore/net/wellenreiter/gui/scanlistitem.h index 47a5a4e..c3c6255 100644 --- a/noncore/net/wellenreiter/gui/scanlistitem.h +++ b/noncore/net/wellenreiter/gui/scanlistitem.h @@ -1,77 +1,79 @@ /********************************************************************** ** 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 SCANLISTITEM_H #define SCANLISTITEM_H #include <qlistview.h> class QString; class MScanListItem: public QListViewItem { public: MScanListItem::MScanListItem( QListView* parent, QString type, QString essid, QString macaddr, bool wep, int channel, int signal ); MScanListItem::MScanListItem( QListViewItem* parent, QString type, QString essid, QString macaddr, bool wep, int channel, int signal ); protected: virtual void decorateItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal ); public: QString type; public: //const QString& type() { return _type; }; const QString& essid() { return _essid; }; const QString& macaddr() { return _macaddr; }; bool wep() { return _wep; }; int channel() { return _channel; }; int signal() { return _signal; }; - int received() { return _received; }; + int beacons() { return _beacons; }; void setSignal( int signal ) { /* TODO */ }; - void incReceived() { _received++; }; + void receivedBeacon(); + + void setManufacturer( const QString& manufacturer ); private: QString _type; QString _essid; QString _macaddr; bool _wep; int _channel; int _signal; - int _received; + int _beacons; }; #endif diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp index 9068e3a..b22c5cc 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp @@ -1,205 +1,218 @@ /********************************************************************** ** 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. ** ***********************************************************************/ // Qt #include <qpushbutton.h> #include <qmessagebox.h> #include <qcombobox.h> #include <qspinbox.h> #include <qsocketnotifier.h> // Qtopia #ifdef QWS +#include <qpe/qpeapplication.h> #include <qpe/global.h> #endif // Opie #ifdef QWS #include <opie/odevice.h> using namespace Opie; #endif // Standard #include <assert.h> #include <errno.h> #include <unistd.h> #include <string.h> #include <sys/types.h> #include <sys/socket.h> #include <stdlib.h> #include <fcntl.h> // Local #include "wellenreiter.h" #include "scanlist.h" #include "logwindow.h" #include "hexwindow.h" #include "configwindow.h" #include "manufacturers.h" +#include <daemon/source/config.hh> +#include <libwellenreiter/source/wl_types.hh> #include <libwellenreiter/source/wl_sock.hh> #include <libwellenreiter/source/wl_proto.hh> -#include <daemon/source/config.hh> Wellenreiter::Wellenreiter( QWidget* parent, const char* name, WFlags fl ) - : WellenreiterBase( parent, name, fl ), daemonRunning( false ) + : WellenreiterBase( parent, name, fl ), daemonRunning( false ), manufacturerdb( 0 ) { // // construct manufacturer database // QString manufile; #ifdef QWS - manufile.sprintf( "%s/share/wellenreiter/manufacturers.dat", (const char*) qApp.qpeDir() ); + manufile.sprintf( "%s/share/wellenreiter/manufacturers.dat", (const char*) QPEApplication::qpeDir() ); #else manufile.sprintf( "/home/mickey/work/opie/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 socket for daemon communication, register socket notifier // - daemon_fd = wl_setupsock( GUIADDR, GUIPORT ); + // struct sockaddr_in sockaddr; + daemon_fd = wl_setupsock( GUIADDR, GUIPORT, sockaddr ); if ( daemon_fd == -1 ) { logwindow->log( "(E) Couldn't get file descriptor for commsocket." ); } else { int flags; flags = fcntl( daemon_fd, F_GETFL, 0 ); fcntl( daemon_fd, F_SETFL, flags | O_NONBLOCK ); QSocketNotifier *sn = new QSocketNotifier( daemon_fd, QSocketNotifier::Read, parent ); connect( sn, SIGNAL( activated( int ) ), this, SLOT( dataReceived() ) ); } // setup GUI connect( button, SIGNAL( clicked() ), this, SLOT( buttonClicked() ) ); button->setEnabled( false ); netview->setColumnWidthMode( 1, QListView::Manual ); + if ( manufacturerdb ) + netview->setManufacturerDB( manufacturerdb ); + } Wellenreiter::~Wellenreiter() { // no need to delete child widgets, Qt does it all for us delete manufacturerdb; } void Wellenreiter::handleMessage() { // FIXME: receive message and handle it qDebug( "received message from daemon." ); - char buffer[10000]; - memset( &buffer, 0, sizeof( buffer ) ); + /*char buffer[10000]; + memset( &buffer, 0, sizeof( buffer ) );*/ + + char buffer[WL_SOCKBUF]; // int result = #wl_recv( &daemon_fd, (char*) &buffer, sizeof(buffer) ); + /* + struct sockaddr from; socklen_t len; int result = recvfrom( daemon_fd, &buffer, 8192, MSG_WAITALL, &from, &len ); - qDebug( "received %d from recv [%d bytes]", result, len ); + */ + + int result = wl_recv( &daemon_fd, sockaddr, (char*) &buffer, WL_SOCKBUF ); + if ( result == -1 ) { qDebug( "Warning: %s", strerror( errno ) ); return; } int command = buffer[1] - 48; /* typedef struct { int net_type; 1 = Accesspoint ; 2 = Ad-Hoc int ssid_len; Length of SSID int channel; Channel int wep; 1 = WEP enabled ; 0 = disabled char mac[64]; MAC address of Accesspoint char bssid[128]; BSSID of Accesspoint } wl_network_t; */ qDebug( "Recv result: %d", ( result ) ); qDebug( "Sniffer sent: '%s'", (const char*) buffer ); hexwindow->log( (const char*) &buffer ); if ( command == NETFOUND ) /* new network found */ { qDebug( "Sniffer said: new network found." ); wl_network_t n; get_network_found( &n, (char*) &buffer ); qDebug( "Sniffer said: net_type is %d.", n.net_type ); qDebug( "Sniffer said: MAC is %s", (const char*) &n.mac ); //n.bssid[n.ssid_len] = "\0"; QString type; if ( n.net_type == 1 ) type = "managed"; else type = "adhoc"; netview->addNewItem( type, n.bssid, QString( (const char*) &n.mac ), n.wep, n.channel, 0 ); } else { qDebug( "unknown sniffer command." ); } } void Wellenreiter::dataReceived() { logwindow->log( "(d) Received data from daemon" ); handleMessage(); } void Wellenreiter::buttonClicked() { /* // add some test stations, so that we can see if the GUI part works addNewItem( "managed", "Vanille", "04:00:20:EF:A6:43", true, 6, 80 ); diff --git a/noncore/net/wellenreiter/gui/wellenreiter.h b/noncore/net/wellenreiter/gui/wellenreiter.h index 9715983..0ddc72c 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.h +++ b/noncore/net/wellenreiter/gui/wellenreiter.h @@ -1,59 +1,78 @@ /********************************************************************** ** 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 WELLENREITER_H #define WELLENREITER_H #include "wellenreiterbase.h" #ifdef QWS #include <opie/odevice.h> using namespace Opie; #endif +// ugly... not here! + +#include <assert.h> +#include <errno.h> +#include <unistd.h> +#include <string.h> +#include <sys/types.h> +#include <sys/socket.h> +#include <stdlib.h> +#include <fcntl.h> +#include <daemon/source/config.hh> +#include <libwellenreiter/source/wl_types.hh> +#include <libwellenreiter/source/wl_sock.hh> +#include <libwellenreiter/source/wl_proto.hh> + + class QTimerEvent; class QPixmap; class ManufacturerDB; class Wellenreiter : public WellenreiterBase { Q_OBJECT public: Wellenreiter( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); ~Wellenreiter(); protected: bool daemonRunning; public slots: void buttonClicked(); void dataReceived(); private: int daemon_fd; // socket filedescriptor for udp communication socket #ifdef QWS OSystem _system; // Opie Operating System identifier #endif void handleMessage(); ManufacturerDB* manufacturerdb; + struct sockaddr_in sockaddr; //void readConfig(); //void writeConfig(); }; + + #endif diff --git a/noncore/net/wellenreiter/gui/wellenreiterbase.cpp b/noncore/net/wellenreiter/gui/wellenreiterbase.cpp index d6b9891..a93c684 100644 --- a/noncore/net/wellenreiter/gui/wellenreiterbase.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiterbase.cpp @@ -12,144 +12,128 @@ ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ***********************************************************************/ #include "wellenreiterbase.h" #include <qheader.h> #include <qlabel.h> #include <qlistview.h> #include <qmultilineedit.h> #include <qpushbutton.h> #include <qlayout.h> #include <qvariant.h> #include <qtooltip.h> #include <qwhatsthis.h> #include <qimage.h> #include <qpixmap.h> #include "logwindow.h" #include "hexwindow.h" #include "configwindow.h" #include "scanlist.h" #ifdef QWS #include <qpe/resource.h> #include <opie/otabwidget.h> #else #include "resource.h" #include <qtabwidget.h> #endif /* * Constructs a WellenreiterBase which is a child of 'parent', with the * name 'name' and widget flags set to 'f' */ WellenreiterBase::WellenreiterBase( QWidget* parent, const char* name, WFlags fl ) : QWidget( parent, name, fl ) { ani1 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot0" ) ); 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 ); setCaption( tr( "Wellenreiter" ) ); WellenreiterBaseLayout = new QVBoxLayout( this ); WellenreiterBaseLayout->setSpacing( 2 ); WellenreiterBaseLayout->setMargin( 0 ); #ifdef QWS TabWidget = new OTabWidget( this, "TabWidget", OTabWidget::Global ); #else TabWidget = new QTabWidget( this, "TabWidget" ); #endif ap = new QWidget( TabWidget, "ap" ); apLayout = new QVBoxLayout( ap ); apLayout->setSpacing( 2 ); apLayout->setMargin( 2 ); //--------- NETVIEW TAB -------------- netview = new MScanListView( ap ); - netview->addColumn( tr( "SSID" ) ); - netview->setColumnAlignment( 0, AlignLeft || AlignVCenter ); - netview->addColumn( tr( "Sig" ) ); - netview->setColumnAlignment( 1, AlignCenter ); - netview->addColumn( tr( "AP" ) ); - netview->setColumnAlignment( 2, AlignCenter ); - netview->addColumn( tr( "Chn" ) ); - netview->setColumnAlignment( 3, AlignCenter ); - netview->addColumn( tr( "W" ) ); - netview->setColumnAlignment( 4, AlignCenter ); - netview->addColumn( tr( "T" ) ); - netview->setColumnAlignment( 5, AlignCenter ); - - netview->setFrameShape( QListView::StyledPanel ); - netview->setFrameShadow( QListView::Sunken ); - netview->setRootIsDecorated( TRUE ); apLayout->addWidget( netview ); //--------- LOG TAB -------------- logwindow = new MLogWindow( TabWidget, "Log" ); //--------- HEX TAB -------------- hexwindow = new MHexWindow( TabWidget, "Hex" ); //--------- CONFIG TAB -------------- configwindow = new WellenreiterConfigWindow( TabWidget, "Config" ); //--------- 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 ); PixmapLabel1_3_2->setLineWidth( 2 ); PixmapLabel1_3_2->setMargin( 0 ); PixmapLabel1_3_2->setMidLineWidth( 0 ); PixmapLabel1_3_2->setPixmap( Resource::loadPixmap( "wellenreiter/logo" ) ); PixmapLabel1_3_2->setScaledContents( TRUE ); PixmapLabel1_3_2->setAlignment( int( QLabel::AlignCenter ) ); aboutLayout->addWidget( PixmapLabel1_3_2, 0, 0 ); TextLabel1_4_2 = new QLabel( about, "TextLabel1_4_2" ); QFont TextLabel1_4_2_font( TextLabel1_4_2->font() ); TextLabel1_4_2_font.setFamily( "adobe-helvetica" ); TextLabel1_4_2_font.setPointSize( 10 ); TextLabel1_4_2->setFont( TextLabel1_4_2_font ); TextLabel1_4_2->setText( tr( "<p align=center>\n" "<hr>\n" "Max Moser<br>\n" "Martin J. Muench<br>\n" "Michael Lauer<br><hr>\n" "<b>www.remote-exploit.org</b>\n" "</p>" ) ); TextLabel1_4_2->setAlignment( int( QLabel::AlignCenter ) ); aboutLayout->addWidget( TextLabel1_4_2, 1, 0 ); button = new QPushButton( this, "button" ); button->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, button->sizePolicy().hasHeightForWidth() ) ); button->setText( tr( "Start Scanning" ) ); #ifdef QWS TabWidget->addTab( ap, "wellenreiter/networks", tr( "Networks" ) ); TabWidget->addTab( logwindow, "wellenreiter/log", tr( "Log" ) ); TabWidget->addTab( hexwindow, "wellenreiter/hex", tr( "Hex" ) ); TabWidget->addTab( configwindow, "wellenreiter/config", tr( "Config" ) ); TabWidget->addTab( about, "wellenreiter/about", tr( "About" ) ); #else TabWidget->addTab( ap, /* "wellenreiter/networks", */ tr( "Networks" ) ); diff --git a/noncore/net/wellenreiter/libwellenreiter/libwellenreiter.pro b/noncore/net/wellenreiter/libwellenreiter/libwellenreiter.pro index 9cf717e..8a6ed36 100644 --- a/noncore/net/wellenreiter/libwellenreiter/libwellenreiter.pro +++ b/noncore/net/wellenreiter/libwellenreiter/libwellenreiter.pro @@ -1,11 +1,11 @@ TEMPLATE = lib CONFIG = warn_on debug VERSION = 0.2 -HEADERS = source/cardmode.hh source/wl_log.hh source/wl_proto.hh source/sniff.hh source/wl_sock.hh +HEADERS = source/cardmode.hh source/wl_log.hh source/wl_proto.hh source/sniff.hh source/wl_sock.hh source/wl_types.hh SOURCES = source/cardmode.cc source/wl_log.cc source/wl_proto.cc source/sniff.cc source/wl_sock.cc LIBS = TMAKE_CFLAGS += -D__UNIX__ DESTDIR = $(QTDIR)/lib TARGET = wellenreiter |