summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/gui-x11.pro4
-rw-r--r--noncore/net/wellenreiter/gui/gui.pro4
-rw-r--r--noncore/net/wellenreiter/gui/manufacturers.cpp58
-rw-r--r--noncore/net/wellenreiter/gui/manufacturers.h37
-rw-r--r--noncore/net/wellenreiter/gui/scanlistitem.h22
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiter.cpp16
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiter.h3
7 files changed, 140 insertions, 4 deletions
diff --git a/noncore/net/wellenreiter/gui/gui-x11.pro b/noncore/net/wellenreiter/gui/gui-x11.pro
index 523bf15..c2a4394 100644
--- a/noncore/net/wellenreiter/gui/gui-x11.pro
+++ b/noncore/net/wellenreiter/gui/gui-x11.pro
@@ -4,4 +4,4 @@ CONFIG = qt warn_on debug
#CONFIG = qt warn_on release
-HEADERS = wellenreiterbase.h wellenreiter.h scanlistitem.h scanlist.h logwindow.h hexwindow.h configwindow.h resource.h wlan.h cardconfig.h
-SOURCES = main.cpp wellenreiterbase.cpp wellenreiter.cpp scanlistitem.cpp scanlist.cpp logwindow.cpp hexwindow.cpp configwindow.cpp resource.cpp wlan.cpp cardconfig.cpp
+HEADERS = wellenreiterbase.h wellenreiter.h scanlistitem.h scanlist.h logwindow.h hexwindow.h configwindow.h resource.h wlan.h cardconfig.h manufacturers.h
+SOURCES = main.cpp wellenreiterbase.cpp wellenreiter.cpp scanlistitem.cpp scanlist.cpp logwindow.cpp hexwindow.cpp configwindow.cpp resource.cpp wlan.cpp cardconfig.cpp manufacturers.cpp
INCLUDEPATH += ../
diff --git a/noncore/net/wellenreiter/gui/gui.pro b/noncore/net/wellenreiter/gui/gui.pro
index ce1c387..52ed8c6 100644
--- a/noncore/net/wellenreiter/gui/gui.pro
+++ b/noncore/net/wellenreiter/gui/gui.pro
@@ -4,4 +4,4 @@ CONFIG = qt warn_on debug
#CONFIG = qt warn_on release
-HEADERS = wellenreiterbase.h wellenreiter.h scanlistitem.h scanlist.h logwindow.h hexwindow.h configwindow.h wlan.h cardconfig.h
-SOURCES = main.cpp wellenreiterbase.cpp wellenreiter.cpp scanlistitem.cpp scanlist.cpp logwindow.cpp hexwindow.cpp configwindow.cpp wlan.cpp cardconfig.cpp
+HEADERS = wellenreiterbase.h wellenreiter.h scanlistitem.h scanlist.h logwindow.h hexwindow.h configwindow.h wlan.h cardconfig.h manufacturers.h
+SOURCES = main.cpp wellenreiterbase.cpp wellenreiter.cpp scanlistitem.cpp scanlist.cpp logwindow.cpp hexwindow.cpp configwindow.cpp wlan.cpp cardconfig.cpp manufacturers.h
INCLUDEPATH += $(OPIEDIR)/include ../
diff --git a/noncore/net/wellenreiter/gui/manufacturers.cpp b/noncore/net/wellenreiter/gui/manufacturers.cpp
new file mode 100644
index 0000000..d235989
--- a/dev/null
+++ b/noncore/net/wellenreiter/gui/manufacturers.cpp
@@ -0,0 +1,58 @@
+/**********************************************************************
+** 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();
+ qDebug( "ManufacturerDB: read pair %s, %s", (const char*) addr, (const char*) manu );
+ manufacturers.insert( addr, manu );
+
+ }
+ }
+
+}
+
+ManufacturerDB::~ManufacturerDB()
+{
+}
+
+QString ManufacturerDB::lookup( const QString& macaddr )
+{
+ return manufacturers[macaddr.upper().left(8)];
+}
diff --git a/noncore/net/wellenreiter/gui/manufacturers.h b/noncore/net/wellenreiter/gui/manufacturers.h
new file mode 100644
index 0000000..d69977a
--- a/dev/null
+++ b/noncore/net/wellenreiter/gui/manufacturers.h
@@ -0,0 +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 );
+
+ private:
+
+ QMap<QString, QString> manufacturers;
+
+};
+
+#endif
+
diff --git a/noncore/net/wellenreiter/gui/scanlistitem.h b/noncore/net/wellenreiter/gui/scanlistitem.h
index cd9d883..47a5a4e 100644
--- a/noncore/net/wellenreiter/gui/scanlistitem.h
+++ b/noncore/net/wellenreiter/gui/scanlistitem.h
@@ -51,2 +51,24 @@ class MScanListItem: public QListViewItem
+ 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; };
+
+ void setSignal( int signal ) { /* TODO */ };
+ void incReceived() { _received++; };
+
+ private:
+ QString _type;
+ QString _essid;
+ QString _macaddr;
+ bool _wep;
+ int _channel;
+ int _signal;
+ int _received;
+
};
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp
index 2d9bbee..9068e3a 100644
--- a/noncore/net/wellenreiter/gui/wellenreiter.cpp
+++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp
@@ -55,2 +55,4 @@ using namespace Opie;
+#include "manufacturers.h"
+
#include <libwellenreiter/source/wl_sock.hh>
@@ -63,2 +65,14 @@ Wellenreiter::Wellenreiter( QWidget* parent, const char* name, WFlags fl )
+ //
+ // construct manufacturer database
+ //
+
+ QString manufile;
+ #ifdef QWS
+ manufile.sprintf( "%s/share/wellenreiter/manufacturers.dat", (const char*) qApp.qpeDir() );
+ #else
+ manufile.sprintf( "/home/mickey/work/opie/share/wellenreiter/manufacturers.dat" );
+ #endif
+ manufacturerdb = new ManufacturerDB( manufile );
+
logwindow->log( "(i) Wellenreiter has been started." );
@@ -105,2 +119,4 @@ Wellenreiter::~Wellenreiter()
// no need to delete child widgets, Qt does it all for us
+
+ delete manufacturerdb;
}
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.h b/noncore/net/wellenreiter/gui/wellenreiter.h
index 2296892..9715983 100644
--- a/noncore/net/wellenreiter/gui/wellenreiter.h
+++ b/noncore/net/wellenreiter/gui/wellenreiter.h
@@ -27,2 +27,3 @@ class QTimerEvent;
class QPixmap;
+class ManufacturerDB;
@@ -51,2 +52,4 @@ private:
+ ManufacturerDB* manufacturerdb;
+
//void readConfig();