Diffstat (limited to 'noncore/net/wellenreiter/gui') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/gui/cardconfig.cpp | 29 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/cardconfig.h | 58 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/configbase.ui | 48 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/configwindow.cpp | 16 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/gui.pro | 10 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/main.cpp | 30 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/scanlist.h | 2 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 228 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.h | 31 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wlan.cpp | 57 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wlan.h | 38 |
11 files changed, 127 insertions, 420 deletions
diff --git a/noncore/net/wellenreiter/gui/cardconfig.cpp b/noncore/net/wellenreiter/gui/cardconfig.cpp deleted file mode 100644 index 1ca1d27..0000000 --- a/noncore/net/wellenreiter/gui/cardconfig.cpp +++ b/dev/null @@ -1,29 +0,0 @@ -/********************************************************************** -** 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 "cardconfig.h" - -#include <qstring.h> - -CardConfig::CardConfig( const QString& interface, Type type, int hopinterval ) - :_interface( interface ), _type( type ), _hopinterval( hopinterval ) -{ - -} - -CardConfig::~CardConfig() -{ -} - diff --git a/noncore/net/wellenreiter/gui/cardconfig.h b/noncore/net/wellenreiter/gui/cardconfig.h deleted file mode 100644 index f54ebac..0000000 --- a/noncore/net/wellenreiter/gui/cardconfig.h +++ b/dev/null @@ -1,58 +0,0 @@ -/********************************************************************** -** 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 CARDCONFIG_H -#define CARDCONFIG_H - -#include <qstring.h> - -#ifdef QWS -#include <opie/odevice.h> -using namespace Opie; -#endif - -class CardConfig -{ - public: - - typedef enum { Prism, Orinoco, HostAP, Manual } Type; - - public: - - CardConfig( const QString& interface, Type type = Manual, int hopinterval = 100 ); - virtual ~CardConfig(); - - const QString& interface() { return _interface; }; - int hopinterval() { return _hopinterval; }; - Type type() { return _type; }; - - #ifdef QWS - OSystem system() { return _system; }; - #endif - - private: - - QString _interface; - Type _type; - int _hopinterval; - - #ifdef QWS - OSystem _system; - #endif - -}; - -#endif - diff --git a/noncore/net/wellenreiter/gui/configbase.ui b/noncore/net/wellenreiter/gui/configbase.ui index 398118f..fa727f9 100644 --- a/noncore/net/wellenreiter/gui/configbase.ui +++ b/noncore/net/wellenreiter/gui/configbase.ui @@ -2,25 +2,25 @@ <class>WellenreiterConfigBase</class> <widget> <class>QDialog</class> <property stdset="1"> <name>name</name> <cstring>WellenreiterConfigBase</cstring> </property> <property stdset="1"> <name>geometry</name> <rect> <x>0</x> <y>0</y> - <width>220</width> + <width>212</width> <height>267</height> </rect> </property> <property stdset="1"> <name>caption</name> <string>Form1</string> </property> <property> <name>layoutMargin</name> </property> <property> <name>layoutSpacing</name> @@ -94,66 +94,24 @@ </property> <grid> <property stdset="1"> <name>margin</name> <number>0</number> </property> <property stdset="1"> <name>spacing</name> <number>2</number> </property> <widget row="0" column="0" > <class>QComboBox</class> - <item> - <property> - <name>text</name> - <string><select></string> - </property> - </item> - <item> - <property> - <name>text</name> - <string>eth0</string> - </property> - </item> - <item> - <property> - <name>text</name> - <string>eth1</string> - </property> - </item> - <item> - <property> - <name>text</name> - <string>wlan0</string> - </property> - </item> - <item> - <property> - <name>text</name> - <string>wlan1</string> - </property> - </item> - <item> - <property> - <name>text</name> - <string>wifi0</string> - </property> - </item> - <item> - <property> - <name>text</name> - <string>wifi1</string> - </property> - </item> <property stdset="1"> <name>name</name> <cstring>interfaceName</cstring> </property> <property stdset="1"> <name>enabled</name> <bool>true</bool> </property> <property> <name>whatsThis</name> <string>Choose the interface used for sniffing.</string> </property> @@ -412,24 +370,28 @@ <property stdset="1"> <name>text</name> <string>Enable Activity Display</string> </property> </widget> <widget> <class>QCheckBox</class> <property stdset="1"> <name>name</name> <cstring>beepOnFound</cstring> </property> <property stdset="1"> + <name>enabled</name> + <bool>false</bool> + </property> + <property stdset="1"> <name>text</name> <string>Beep on new network</string> </property> </widget> </vbox> </widget> <spacer> <property> <name>name</name> <cstring>Spacer2</cstring> </property> <property stdset="1"> diff --git a/noncore/net/wellenreiter/gui/configwindow.cpp b/noncore/net/wellenreiter/gui/configwindow.cpp index f86b109..6dd862f 100644 --- a/noncore/net/wellenreiter/gui/configwindow.cpp +++ b/noncore/net/wellenreiter/gui/configwindow.cpp @@ -4,40 +4,56 @@ ** 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. ** **********************************************************************/ +/* LOCAL */ #include "configwindow.h" + +/* QT */ #include <qmap.h> #include <qcombobox.h> #include <qpushbutton.h> #include <qspinbox.h> #include <qlayout.h> +/* OPIE */ +#include <opie2/onetwork.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; + // gather possible interface names from ONetwork + ONetwork* net = ONetwork::instance(); + ONetwork::InterfaceIterator it = net->iterator(); + while ( it.current() ) + { + if ( it.current()->isWireless() ) + interfaceName->insertItem( it.current()->name() ); + ++it; + } + #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 ) ) diff --git a/noncore/net/wellenreiter/gui/gui.pro b/noncore/net/wellenreiter/gui/gui.pro index 8861a50..200bfc1 100644 --- a/noncore/net/wellenreiter/gui/gui.pro +++ b/noncore/net/wellenreiter/gui/gui.pro @@ -2,43 +2,39 @@ MOC_DIR = ./tmp OBJECTS_DIR = ./tmp DESTDIR = $(OPIEDIR)/bin TEMPLATE = app CONFIG = qt warn_on debug HEADERS = wellenreiterbase.h \ mainwindow.h \ wellenreiter.h \ scanlist.h \ logwindow.h \ hexwindow.h \ configwindow.h \ - wlan.h \ - cardconfig.h \ manufacturers.h SOURCES = main.cpp \ mainwindow.cpp \ wellenreiterbase.cpp \ wellenreiter.cpp \ scanlist.cpp \ logwindow.cpp \ hexwindow.cpp \ configwindow.cpp \ - wlan.cpp \ - cardconfig.cpp \ manufacturers.cpp -INCLUDEPATH += $(OPIEDIR)/include ../ -DEPENDPATH += $(OPIEDIR)/include ../ -LIBS += -L. -lwellenreiter -lcornucopia +INCLUDEPATH += $(OPIEDIR)/include +DEPENDPATH += $(OPIEDIR)/include +LIBS += -L. -lwellenreiter -lopiecore2 -lopieui2 -lopienet2 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 diff --git a/noncore/net/wellenreiter/gui/main.cpp b/noncore/net/wellenreiter/gui/main.cpp index 270ce06..96a8c1c 100644 --- a/noncore/net/wellenreiter/gui/main.cpp +++ b/noncore/net/wellenreiter/gui/main.cpp @@ -5,39 +5,23 @@ ** ** 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 "mainwindow.h" - -#ifdef QWS -#include <qpe/qpeapplication.h> -#else -#include <qapplication.h> -#endif +#include <opie2/oapplication.h> int main( int argc, char **argv ) { -#ifdef QWS - QPEApplication a( argc, argv ); -#else - QApplication a( argc, argv ); -#endif - - WellenreiterMainWindow w; - - w.setCaption( "Wellenreiter/Opie" ); -#ifdef QWS - a.showMainWidget(&w); -#else - a.setMainWidget(&w); - w.show(); -#endif - - return a.exec(); + OApplication a( argc, argv, "Wellenreiter II" ); + WellenreiterMainWindow* w = new WellenreiterMainWindow(); + a.showMainWidget( w ); + a.exec(); + delete w; + return 0; } diff --git a/noncore/net/wellenreiter/gui/scanlist.h b/noncore/net/wellenreiter/gui/scanlist.h index 222217c..da9369f 100644 --- a/noncore/net/wellenreiter/gui/scanlist.h +++ b/noncore/net/wellenreiter/gui/scanlist.h @@ -7,25 +7,25 @@ ** 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 <cornucopia/olistview.h> +#include <opie2/olistview.h> #include <qtextstream.h> class QString; class ManufacturerDB; class MScanListView: public OListView { Q_OBJECT public: MScanListView( QWidget* parent = 0, const char* name = 0 ); diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp index 09a44e6..5bdc1b3 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp @@ -12,67 +12,57 @@ ** 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 +#include <opie2/oapplication.h> +#include <opie2/onetwork.h> +#include <opie2/opcap.h> + // 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 ) + 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 @@ -82,201 +72,157 @@ Wellenreiter::Wellenreiter( QWidget* parent ) // // 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, this ); - connect( sn, SIGNAL( activated( int ) ), this, SLOT( dataReceived() ) ); - } - // 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; - - if ( daemon_fd != -1 ) - { - qDebug( "closing comm socket" ); - ::shutdown( daemon_fd, 0 ); - ::close( daemon_fd ); - qDebug( "comm socket closed." ); - } + delete pcap; } void Wellenreiter::setConfigWindow( WellenreiterConfigWindow* cw ) { configwindow = cw; } -void Wellenreiter::handleMessage() +void Wellenreiter::receivePacket(OPacket* p) { - // FIXME: receive message and handle it - - qDebug( "received message from daemon." ); - - /*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"; + logwindow->log( "(d) Received data from daemon" ); + //TODO - netview->addNewItem( type, n.bssid, QString( (const char*) &n.mac ), n.wep, n.channel, 0 ); + // 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"; - { - qDebug( "unknown sniffer command." ); - } + OWaveLanManagementSSID* ssid = static_cast<OWaveLanManagementSSID*>( p->child( "802.11 SSID" ) ); + QString essid = ssid ? ssid->ID() : "<unknown>"; + OWaveLanManagementDS* ds = static_cast<OWaveLanManagementDS*>( p->child( "802.11 DS" ) ); + int channel = ds ? ds->channel() : -1; -} - -void Wellenreiter::dataReceived() -{ - logwindow->log( "(d) Received data from daemon" ); - handleMessage(); + OWaveLanPacket* header = static_cast<OWaveLanPacket*>( p->child( "802.11" ) ); + netView()->addNewItem( type, essid, header->macAddress2().toString(), header->usesWep(), channel, 0 ); } void Wellenreiter::startStopClicked() { - if ( daemonRunning ) + if ( sniffing ) { - daemonRunning = false; + disconnect( SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) ); - logwindow->log( "(i) Daemon has been stopped." ); - setCaption( tr( "Wellenreiter/Opie" ) ); + iface->setChannelHopping(); // stop hopping channels + pcap->close(); + sniffing = false; + oApp->setTitle(); - // Stop daemon - ugly for now... later better + // get interface name from config window + const QString& interface = configwindow->interfaceName->currentText(); + ONetwork* net = ONetwork::instance(); + iface = static_cast<OWirelessNetworkInterface*>(net->interface( interface )); - system( "killall wellenreiterd" ); + // switch off monitor mode + iface->setMonitorMode( false ); + // switch off promisc flag + iface->setPromiscuousMode( false ); - // get configuration from config window + //TODO: Display "please wait..." (use owait?) - const QString& interface = configwindow->interfaceName->currentText(); - - // reset the interface trying to get it into a usable state again + /* QString cmdline; - cmdline.sprintf( "iwpriv %s monitor 0; ifdown %s; ifup %s", (const char*) interface, (const char*) interface, (const char*) interface ); - system( cmdline ); + cmdline.sprintf( "ifdown %s; sleep 1; ifup %s", (const char*) interface, (const char*) interface, (const char*) interface ); + system( cmdline ); //FIXME: Use OProcess + + */ // message the user - QMessageBox::information( this, "Wellenreiter/Opie", "Your wireless card\nshould now be usable again." ); + //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 == "<select>" ) || ( cardtype == 0 ) ) + if ( ( interface == "" ) || ( cardtype == 0 ) ) { - QMessageBox::information( this, "Wellenreiter/Opie", "Your device is not\nptoperly configured. Please reconfigure!" ); + QMessageBox::information( this, "Wellenreiter II", "Your device is not\nproperly configured. Please reconfigure!" ); return; } - // start wellenreiterd + // configure device - QString cmdline; - cmdline.sprintf( "wellenreiterd %s %d &", (const char*) interface, cardtype ); + 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 ); + + // 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 - qDebug( "about to execute '%s' ...", (const char*) cmdline ); - system( cmdline ); - qDebug( "done!" ); + // connect + connect( pcap, SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) ); logwindow->log( "(i) Daemon has been started." ); - daemonRunning = true; - setCaption( tr( "Scanning ..." ) ); + oApp->setTitle( "Scanning ..." ); + sniffing = true; } } diff --git a/noncore/net/wellenreiter/gui/wellenreiter.h b/noncore/net/wellenreiter/gui/wellenreiter.h index ee9dca9..3ec4021 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.h +++ b/noncore/net/wellenreiter/gui/wellenreiter.h @@ -14,69 +14,54 @@ **********************************************************************/ #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 OPacket; +class OPacketCapturer; +class OWirelessNetworkInterface; class ManufacturerDB; class WellenreiterConfigWindow; 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; }; - bool isDaemonRunning() const { return daemonRunning; }; - - protected: - bool daemonRunning; + bool isDaemonRunning() const { return sniffing; }; public slots: - void dataReceived(); + void receivePacket(OPacket*); void startStopClicked(); private: - int daemon_fd; // socket filedescriptor for udp communication socket #ifdef QWS OSystem _system; // Opie Operating System identifier #endif - void handleMessage(); + bool sniffing; + OWirelessNetworkInterface* iface; + OPacketCapturer* pcap; ManufacturerDB* manufacturerdb; WellenreiterConfigWindow* configwindow; - struct sockaddr_in sockaddr; //void readConfig(); //void writeConfig(); }; #endif diff --git a/noncore/net/wellenreiter/gui/wlan.cpp b/noncore/net/wellenreiter/gui/wlan.cpp deleted file mode 100644 index b046cc8..0000000 --- a/noncore/net/wellenreiter/gui/wlan.cpp +++ b/dev/null @@ -1,57 +0,0 @@ -/********************************************************************** -** 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 "wlan.h" -#include "cardconfig.h" - -// Qt -#include <qstring.h> - -// Qtopia -#ifdef QWS -#include <opie/odevice.h> -using namespace Opie; -#endif - -WLAN::WLAN( const QString& interface ) -{ - _configuration = new CardConfig( interface ); -} - -WLAN::WLAN( const CardConfig* configuration ) -{ - _configuration = configuration; - -} - -WLAN::~WLAN() -{ - delete _configuration; - -} - -void WLAN::setMonitorMode( bool enabled ) -{ - - /* - - if ( _configuration->system() == System_OpenZaurus && _configuration->type() == CardConfig::Prism ) - { - } - - */ - -} - diff --git a/noncore/net/wellenreiter/gui/wlan.h b/noncore/net/wellenreiter/gui/wlan.h deleted file mode 100644 index 139e218..0000000 --- a/noncore/net/wellenreiter/gui/wlan.h +++ b/dev/null @@ -1,38 +0,0 @@ -/********************************************************************** -** 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 WLAN_H -#define WLAN_H - -class QString; -class CardConfig; - -class WLAN -{ - public: - - WLAN( const QString& interface ); - WLAN( const CardConfig* ); - virtual ~WLAN(); - void setMonitorMode( bool enabled ); - - private: - - const CardConfig* _configuration; - -}; - -#endif - |