-rw-r--r-- | noncore/net/wellenreiter/README | 11 | ||||
-rw-r--r-- | noncore/net/wellenreiter/daemon/daemon.pro | 6 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/configwindow.cpp | 9 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/gui-x11.pro | 15 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/gui.pro | 13 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/mainwindow.cpp | 27 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/mainwindow.h | 1 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/resource.cpp | 2 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 2 | ||||
-rw-r--r-- | noncore/net/wellenreiter/libwellenreiter/libwellenreiter.pro | 7 | ||||
-rw-r--r-- | noncore/net/wellenreiter/wellenreiter.pro | 10 |
11 files changed, 68 insertions, 35 deletions
diff --git a/noncore/net/wellenreiter/README b/noncore/net/wellenreiter/README index ada9321..7de6a33 100644 --- a/noncore/net/wellenreiter/README +++ b/noncore/net/wellenreiter/README @@ -1,102 +1,101 @@ /*************************************************************************/ /* W e l l e n r e i t e r I I */ /* =============================== */ /* */ /* Version: Opie-ALPHA-January */ /*************************************************************************/ -------------------------------------------------- Release Notes for Opie-ALPHA Version January 2002 -------------------------------------------------- ===================== = Supported Devices = ===================== * low-level orinoco_cs-based (including prism2 and spectrum_cs) ===================== = Build = ===================== (I) Opie Build Environment To compile Wellenreiter within the Opie build environment, add the following directories to $OPIEDIR/Makefile, e.g. to 'NONAPPS=' noncore/net/wellenreiter/libwellenreiter \ noncore/net/wellenreiter/daemon \ noncore/net/wellenreiter/contrib/orinoco_hopper \ noncore/net/wellenreiter/gui ./configure and rebuild. Note that you need libpcap in your toolchain. (II) OpenZaurus Build Environment To compile Wellenreiter within the OZ build environment, add the following lines to $OPIEDIR/packages: CONFIG_WELLENREITER noncore/net/wellenreiter/libwellenreiter libwellenreiter.pro CONFIG_WELLENREITER noncore/net/wellenreiter/daemon daemon.pro CONFIG_WELLENREITER noncore/net/wellenreiter/gui gui.pro CONFIG_WELLENREITER noncore/net/wellenreiter/contrib/orinoco_hopper orinoco_hopper.pro make -f Makefile.test clean-configs cd <BUILDROOT> make SUBDIRS=packages/opie package (III) To compile a standalone Wellenreiter for X11, you need Qt3 and the development -packages for Qt3, e.g. libqt3-devel. Assuming, $OPIEDIR and $QTDIR is set to Opie resp. -Qt (e.g. /usr/lib/qt3), do the following: -export QMAKESPEC=$OPIEDIR/mkspecs/linux-g++ -cd $OPIEDIR/noncore/net/wellenreiter -qmake -makefile wellenreiter.pro -make qmake +packages for Qt3, e.g. libqt3-devel. Assuming, $QTDIR is set to your Qt-Director +(e.g. /usr/lib/qt3), set $OPIEDIR to your installation prefix, e.g. /usr/local, then +export QMAKESPEC=$QTDIR/mkspecs/linux-g++ +qmake "platform=x11" wellenreiter.pro make +make install ===================== = Install = ===================== Alternatively, you can use our precompiled ipk. Get it from http://opie.net.wox.org/wellenreiter/. This also includes a recent libpcap. ===================== = Run = ===================== There are two possible modes: <Manual> and <Automatic>. I suggest, you start with the <Automatic> Mode. This works just using the "Start" and "Stop" Pushbuttons in the Wellenreiter GUI. If this doesn't work, then use the following strategy: 1. Place card in monitor mode. This is device dependent. Caution: Don't do this while you're logged in via ssh or otherwise using the wireless interface - your connection will freeze: The card can't be used normally when sniffing! For most orinoco-based cards this can be done using either 'iwpriv <interface> 2' or 'iwpriv <interface> 2 1'. You can check if this works, by calling 'ifconfig <interface>'. If you see 'Protocol: UNSPEC' and an unusual long MAC-Address, then your card has been successfully set to the monitor mode. 2. Start a channel hopper. A wireless card has several channels (e.g. radio frequencies) here it can listen for beacons. Beacons are management data frames from other stations. Remember, this is radio transmission, so the card has to be "tuned" to a certain channel to be able to receive the beacons. In order to scan the complete frequency spectrum and thus be able to detect all available stations, you have to 'hop' through the channels frequently. You can do this manually (e.g. with 'iwconfig') [hahaha] or you can use a channel hopper. For convenience, the current Wellenreiter Alpha comes with a channel hopper for Orinoco-based cards. Start this via orinoco_hopper <interface>. 3. Start the Wellenreiter sniffing daemon: wellenreiterd. 4. Start the Wellenreiter GUI and sniff like hell. Don't press the button diff --git a/noncore/net/wellenreiter/daemon/daemon.pro b/noncore/net/wellenreiter/daemon/daemon.pro index 8943db7..33a6bb9 100644 --- a/noncore/net/wellenreiter/daemon/daemon.pro +++ b/noncore/net/wellenreiter/daemon/daemon.pro @@ -1,16 +1,16 @@ DESTDIR = $(OPIEDIR)/bin TEMPLATE = app CONFIG = warn_on debug #CONFIG = warn_on release HEADERS = source/config.hh source/daemon.hh SOURCES = source/daemon.cc INCLUDEPATH += ../ DEPENDPATH += $(OPIEDIR)/include LIBS += -lpcap -lpthread -L$(OPIEDIR)/lib -lwellenreiter INTERFACES = TARGET = wellenreiterd DEFINES += DEBUG - - -include ( $(OPIEDIR)/include.pro ) +!contains( platform, x11 ) { + include ( $(OPIEDIR)/include.pro ) +} diff --git a/noncore/net/wellenreiter/gui/configwindow.cpp b/noncore/net/wellenreiter/gui/configwindow.cpp index 6ea6f02..f86b109 100644 --- a/noncore/net/wellenreiter/gui/configwindow.cpp +++ b/noncore/net/wellenreiter/gui/configwindow.cpp @@ -1,47 +1,56 @@ /********************************************************************** ** 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 "configwindow.h" #include <qmap.h> #include <qcombobox.h> +#include <qpushbutton.h> #include <qspinbox.h> +#include <qlayout.h> WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char * name, WFlags f ) :WellenreiterConfigBase( parent, name, true, f ) { _devicetype[ "cisco" ] = 1; _devicetype[ "wlan-ng" ] = 2; _devicetype[ "hostap" ] = 3; _devicetype[ "orinoco" ] = 4; _devicetype[ "<manual>" ] = 5; + + #ifdef Q_WS_X11 // We're on X11: adding an Ok-Button for the Dialog here + QPushButton* okButton = new QPushButton( "ok", this ); + okButton->show(); + Layout5_2->addWidget( okButton ); //FIXME: rename this in configbase.ui + connect( okButton, SIGNAL( clicked() ), this, SLOT( accept() ) ); + #endif }; int WellenreiterConfigWindow::daemonDeviceType() { QString name = deviceType->currentText(); if ( _devicetype.contains( name ) ) { return _devicetype[name]; } else { return 0; } }; int WellenreiterConfigWindow::daemonHopInterval() { return hopInterval->cleanText().toInt(); } diff --git a/noncore/net/wellenreiter/gui/gui-x11.pro b/noncore/net/wellenreiter/gui/gui-x11.pro deleted file mode 100644 index 25185fb..0000000 --- a/noncore/net/wellenreiter/gui/gui-x11.pro +++ b/dev/null @@ -1,15 +0,0 @@ -DESTDIR = . -TEMPLATE = app -CONFIG = qt warn_on debug -#CONFIG = qt warn_on release -HEADERS = mainwindow.h 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 mainwindow.cpp wellenreiterbase.cpp wellenreiter.cpp scanlistitem.cpp scanlist.cpp logwindow.cpp hexwindow.cpp configwindow.cpp resource.cpp wlan.cpp cardconfig.cpp manufacturers.cpp -INCLUDEPATH += ../ -DEPENDPATH += ../ -LIBS += -L. -lwellenreiter -INTERFACES = configbase.ui -TARGET = wellenreiter - - - -include ( $(OPIEDIR)/include.pro ) diff --git a/noncore/net/wellenreiter/gui/gui.pro b/noncore/net/wellenreiter/gui/gui.pro index 95e9f22..822b0db 100644 --- a/noncore/net/wellenreiter/gui/gui.pro +++ b/noncore/net/wellenreiter/gui/gui.pro @@ -1,40 +1,49 @@ MOC_DIR = ./tmp OBJECTS_DIR = ./tmp DESTDIR = $(OPIEDIR)/bin TEMPLATE = app CONFIG = qt warn_on debug HEADERS = wellenreiterbase.h \ mainwindow.h \ wellenreiter.h \ scanlistitem.h \ scanlist.h \ logwindow.h \ hexwindow.h \ configwindow.h \ wlan.h \ cardconfig.h \ manufacturers.h SOURCES = main.cpp \ mainwindow.cpp \ wellenreiterbase.cpp \ wellenreiter.cpp \ scanlistitem.cpp \ scanlist.cpp \ logwindow.cpp \ hexwindow.cpp \ configwindow.cpp \ wlan.cpp \ cardconfig.cpp \ manufacturers.cpp INCLUDEPATH += $(OPIEDIR)/include ../ DEPENDPATH += $(OPIEDIR)/include ../ -LIBS += -lqpe -lopie -L. -lwellenreiter +LIBS += -L. -lwellenreiter INTERFACES = configbase.ui TARGET = wellenreiter +!contains( platform, x11 ) { + message( qws ) + include ( $(OPIEDIR)/include.pro ) + LIBS += -lqpe -lopie +} +contains( platform, x11 ) { + LIBS += -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib + SOURCES += resource.cpp + HEADERS += resource.h +} -include ( $(OPIEDIR)/include.pro ) diff --git a/noncore/net/wellenreiter/gui/mainwindow.cpp b/noncore/net/wellenreiter/gui/mainwindow.cpp index b67376c..b2d3a71 100644 --- a/noncore/net/wellenreiter/gui/mainwindow.cpp +++ b/noncore/net/wellenreiter/gui/mainwindow.cpp @@ -1,140 +1,161 @@ /********************************************************************** ** 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 "configwindow.h" #include "mainwindow.h" #include "wellenreiter.h" #include <qcombobox.h> #include <qiconset.h> #include <qmenubar.h> #include <qpopupmenu.h> #include <qstatusbar.h> #include <qtoolbutton.h> #ifdef QWS #include <qpe/resource.h> #else #include "resource.h" #endif 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 icon sets - searchIconSet = new QIconSet( Resource::loadPixmap( "wellenreiter/SearchIcon" ) ); 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 ); startStopButton->setAutoRaise( true ); + #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 ); c->setAutoRaise( true ); c->setIconSet( *infoIconSet ); c->setEnabled( false ); QToolButton* d = new QToolButton( 0 ); d->setAutoRaise( true ); d->setIconSet( *settingsIconSet ); connect( d, SIGNAL( clicked() ), this, SLOT( showConfigure() ) ); // setup menu bar QMenuBar* mb = menuBar(); QPopupMenu* file = new QPopupMenu( mb ); file->insertItem( "&Load" ); file->insertItem( "&Save" ); QPopupMenu* view = new QPopupMenu( mb ); view->insertItem( "&Configure" ); QPopupMenu* sniffer = new QPopupMenu( mb ); sniffer->insertItem( "&Configure" ); sniffer->insertSeparator(); int id; id = mb->insertItem( "&File", file ); mb->setItemEnabled( id, false ); id = mb->insertItem( "&View", view ); mb->setItemEnabled( id, false ); id = mb->insertItem( "&Sniffer", sniffer ); mb->setItemEnabled( id, false ); + #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(); if ( ( interface != "<select>" ) && ( cardtype != 0 ) ) startStopButton->setEnabled( true ); //TODO ... else startStopButton->setEnabled( false ); //TODO ... } } WellenreiterMainWindow::~WellenreiterMainWindow() { - delete searchIconSet; delete infoIconSet; delete settingsIconSet; + #ifdef QWS + delete searchIconSet; delete cancelIconSet; - + #else + delete startStopIconSet; + #endif }; diff --git a/noncore/net/wellenreiter/gui/mainwindow.h b/noncore/net/wellenreiter/gui/mainwindow.h index 7d772a8..c21841a 100644 --- a/noncore/net/wellenreiter/gui/mainwindow.h +++ b/noncore/net/wellenreiter/gui/mainwindow.h @@ -1,49 +1,50 @@ /********************************************************************** ** 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; public slots: void showConfigure(); }; #endif diff --git a/noncore/net/wellenreiter/gui/resource.cpp b/noncore/net/wellenreiter/gui/resource.cpp index fb0966a..7683329 100644 --- a/noncore/net/wellenreiter/gui/resource.cpp +++ b/noncore/net/wellenreiter/gui/resource.cpp @@ -1,35 +1,35 @@ /********************************************************************** ** 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 "resource.h" -#define PIXMAPPATH "/usr/share/wellenreiter/pics/" +#define PIXMAPPATH "/usr/local/share" namespace Resource { QPixmap loadPixmap( const QString& pix ) { QString filename; filename.sprintf( "%s/%s.png", (const char*) PIXMAPPATH, (const char*) pix ); QPixmap pixmap( filename ); if ( pixmap.isNull() ) { qDebug( "Wellenreiter::Resource: can't find pixmap " + filename ); } return pixmap; }; }; diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp index db7063b..c599bb4 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp @@ -29,97 +29,97 @@ #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> Wellenreiter::Wellenreiter( QWidget* parent ) : WellenreiterBase( parent, 0, 0 ), daemonRunning( false ), 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( "/home/mickey/work/opie/share/wellenreiter/manufacturers.dat" ); + 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 socket for daemon communication, register socket notifier // // 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 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; diff --git a/noncore/net/wellenreiter/libwellenreiter/libwellenreiter.pro b/noncore/net/wellenreiter/libwellenreiter/libwellenreiter.pro index 58da0c1..5930c60 100644 --- a/noncore/net/wellenreiter/libwellenreiter/libwellenreiter.pro +++ b/noncore/net/wellenreiter/libwellenreiter/libwellenreiter.pro @@ -1,15 +1,16 @@ +DESTDIR = $(OPIEDIR)/lib 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 source/wl_types.hh SOURCES = source/cardmode.cc source/wl_log.cc source/wl_proto.cc source/sniff.cc source/wl_sock.cc LIBS = -lpcap TMAKE_CFLAGS += -D__UNIX__ DEFINES += DEBUG -DESTDIR = $(OPIEDIR)/lib TARGET = wellenreiter +!contains( platform, x11 ) { + include ( $(OPIEDIR)/include.pro ) +} - -include ( $(OPIEDIR)/include.pro ) diff --git a/noncore/net/wellenreiter/wellenreiter.pro b/noncore/net/wellenreiter/wellenreiter.pro index dd75c8c..17d0e31 100644 --- a/noncore/net/wellenreiter/wellenreiter.pro +++ b/noncore/net/wellenreiter/wellenreiter.pro @@ -1,6 +1,14 @@ TEMPLATE = subdirs unix:SUBDIRS = libwellenreiter daemon gui +!contains( platform, x11 ) { + message( Configuring Wellenreiter for build on Opie ) + include ( $(OPIEDIR)/include.pro ) +} + +contains( platform, x11 ) { + message( Configuring Wellenreiter for build on Qt/X11 ) + system( mkdir -p $OPIEDIR/lib $OPIEDIR/bin $OPIEDIR/share/pics ) +} -include ( $(OPIEDIR)/include.pro ) |