author | mickeyl <mickeyl> | 2003-02-19 10:40:55 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-02-19 10:40:55 (UTC) |
commit | bd6e39ba0c38070d07c76b67a98d2e3ab3f84cb8 (patch) (side-by-side diff) | |
tree | ddb3efba1b42674d3ba892ecd611554c04540392 | |
parent | 2fdd5a12c624b5203b11d54eb9ffe529101f5470 (diff) | |
download | opie-bd6e39ba0c38070d07c76b67a98d2e3ab3f84cb8.zip opie-bd6e39ba0c38070d07c76b67a98d2e3ab3f84cb8.tar.gz opie-bd6e39ba0c38070d07c76b67a98d2e3ab3f84cb8.tar.bz2 |
minor bugfixes - major overhaul coming after public alpha
4 files changed, 20 insertions, 9 deletions
diff --git a/noncore/net/wellenreiter/gui/resource.cpp b/noncore/net/wellenreiter/gui/resource.cpp index 58c6bed..fb0966a 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 "/home/mickey/work/opie/pics" +#define PIXMAPPATH "/usr/share/wellenreiter/pics/" 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 c1aae86..4c53028 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp @@ -168,116 +168,116 @@ typedef struct { 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 ); addNewItem( "managed", "Vanille", "04:00:20:EF:A6:23", true, 11, 10 ); addNewItem( "adhoc", "ELAN", "40:03:43:E7:16:22", false, 3, 10 ); addNewItem( "adhoc", "ELAN", "40:03:53:E7:56:62", false, 3, 15 ); addNewItem( "adhoc", "ELAN", "40:03:63:E7:56:E2", false, 3, 20 ); */ if ( daemonRunning ) { daemonRunning = false; logwindow->log( "(i) Daemon has been stopped." ); button->setText( tr( "Start Scanning" ) ); - setCaption( tr( "Scanning in progress..." ) ); + setCaption( tr( "Wellenreiter/Opie" ) ); // Stop daemon - ugly for now... later better system( "killall wellenreiterd" ); // get configuration from config window const QString& interface = configwindow->interfaceName->currentText(); // reset the interface trying to get it into a usable state again QString cmdline; - cmdline.sprintf( "ifdown %s; ifup %s", (const char*) interface, (const char*) interface ); + cmdline.sprintf( "iwpriv %s monitor 0; ifdown %s; ifup %s", (const char*) interface, (const char*) interface, (const char*) interface ); system( cmdline ); // message the user QMessageBox::information( this, "Wellenreiter/Opie", "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 ) ) { QMessageBox::information( this, "Wellenreiter/Opie", "You must configure your\ndevice before scanning." ); return; } // start wellenreiterd QString cmdline; cmdline.sprintf( "wellenreiterd %s %d &", (const char*) interface, cardtype ); qDebug( "about to execute '%s' ...", (const char*) cmdline ); system( cmdline ); qDebug( "done!" ); logwindow->log( "(i) Daemon has been started." ); daemonRunning = true; button->setText( tr( "Stop Scanning" ) ); - setCaption( tr( "Wellenreiter/Opie" ) ); + setCaption( tr( "Scanning ..." ) ); } } diff --git a/noncore/net/wellenreiter/gui/wellenreiterbase.cpp b/noncore/net/wellenreiter/gui/wellenreiterbase.cpp index a93c684..da12f2b 100644 --- a/noncore/net/wellenreiter/gui/wellenreiterbase.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiterbase.cpp @@ -1,118 +1,118 @@ /********************************************************************** ** 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 "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" ) ); + //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 ); 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" diff --git a/noncore/net/wellenreiter/libwellenreiter/source/cardmode.hh b/noncore/net/wellenreiter/libwellenreiter/source/cardmode.hh index 652b3ed..58e99ac 100644 --- a/noncore/net/wellenreiter/libwellenreiter/source/cardmode.hh +++ b/noncore/net/wellenreiter/libwellenreiter/source/cardmode.hh @@ -1,87 +1,98 @@ /* $Id$ */ #ifndef CARDMODE_HH #define CARDMODE_HH #include <string.h> #include <stdlib.h> #include <errno.h> #include <sys/types.h> #include <sys/time.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <sys/ioctl.h> #include <unistd.h> #include <linux/if.h> + +/* Following typedefs are needed here, because linux/wireless.h + includes linux/ethertool.h which is using them */ +typedef signed char s8; +typedef unsigned char u8; +typedef signed short s16; +typedef unsigned short u16; +typedef signed int s32; +typedef unsigned int u32; +typedef signed long long s64; +typedef unsigned long long u64; + #include <linux/wireless.h> #ifndef SIOCIWFIRSTPRIV #define SIOCIWFIRSTPRIV SIOCDEVPRIVATE #endif - extern "C" { #include <net/bpf.h> #include <pcap.h> } /* Defines, used for the card setup */ #define DEFAULT_PATH "/proc/driver/aironet/%s/Config" #define CISCO_STATUS "/proc/driver/aironet/%s/Status" #define CARD_TYPE_CISCO 1 #define CARD_TYPE_NG 2 #define CARD_TYPE_HOSTAP 3 #define CARD_TYPE_ORINOCCO 4 /* Some usefull constants for frequencies */ #define KILO 1e3 #define MEGA 1e6 #define GIGA 1e9 /* only for now, until we have the daemon running */ /*the config file should provide these information */ #define CARD_TYPE CARD_TYPE_HOSTAP /* Prototypes */ int card_check_rfmon_datalink (const char *device); int card_into_monitormode (pcap_t **, const char *, int); int card_set_promisc_up (const char *device); int card_remove_promisc (const char *device); int card_set_channel (const char *device, int channel,int cardtype); int iw_get_range_info(int skfd, const char * ifname, struct iw_range * range); double iw_freq2float(iw_freq * in); void iw_float2freq(double in, iw_freq * out); int card_detect_channels (char * device); /*------------------------------------------------------------------*/ /* * Wrapper to push some Wireless Parameter in the driver */ static inline int iw_set_ext(int skfd, /* Socket to the kernel */ char * ifname, /* Device name */ int request, /* WE ID */ struct iwreq * pwrq) /* Fixed part of the request */ { /* Set device name */ strncpy(pwrq->ifr_name, ifname, IFNAMSIZ); /* Do the request */ return(ioctl(skfd, request, pwrq)); } /*------------------------------------------------------------------*/ /* * Wrapper to extract some Wireless Parameter out of the driver */ static inline int iw_get_ext(int skfd, /* Socket to the kernel */ char * ifname, /* Device name */ int request, /* WE ID */ struct iwreq * pwrq) /* Fixed part of the request */ { /* Set device name */ strncpy(pwrq->ifr_name, ifname, IFNAMSIZ); |