summaryrefslogtreecommitdiff
authormickeyl <mickeyl>2003-02-19 10:40:55 (UTC)
committer mickeyl <mickeyl>2003-02-19 10:40:55 (UTC)
commitbd6e39ba0c38070d07c76b67a98d2e3ab3f84cb8 (patch) (unidiff)
treeddb3efba1b42674d3ba892ecd611554c04540392
parent2fdd5a12c624b5203b11d54eb9ffe529101f5470 (diff)
downloadopie-bd6e39ba0c38070d07c76b67a98d2e3ab3f84cb8.zip
opie-bd6e39ba0c38070d07c76b67a98d2e3ab3f84cb8.tar.gz
opie-bd6e39ba0c38070d07c76b67a98d2e3ab3f84cb8.tar.bz2
minor bugfixes - major overhaul coming after public alpha
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/resource.cpp2
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiter.cpp6
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiterbase.cpp8
-rw-r--r--noncore/net/wellenreiter/libwellenreiter/source/cardmode.hh21
4 files changed, 24 insertions, 13 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
@@ -6,25 +6,25 @@
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14**********************************************************************/ 14**********************************************************************/
15 15
16#include "resource.h" 16#include "resource.h"
17 17
18#define PIXMAPPATH "/home/mickey/work/opie/pics" 18#define PIXMAPPATH "/usr/share/wellenreiter/pics/"
19 19
20namespace Resource 20namespace Resource
21{ 21{
22 22
23QPixmap loadPixmap( const QString& pix ) 23QPixmap loadPixmap( const QString& pix )
24{ 24{
25 QString filename; 25 QString filename;
26 filename.sprintf( "%s/%s.png", (const char*) PIXMAPPATH, (const char*) pix ); 26 filename.sprintf( "%s/%s.png", (const char*) PIXMAPPATH, (const char*) pix );
27 QPixmap pixmap( filename ); 27 QPixmap pixmap( filename );
28 if ( pixmap.isNull() ) 28 if ( pixmap.isNull() )
29 { 29 {
30 qDebug( "Wellenreiter::Resource: can't find pixmap " + filename ); 30 qDebug( "Wellenreiter::Resource: can't find pixmap " + filename );
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
@@ -220,38 +220,38 @@ void Wellenreiter::buttonClicked()
220 addNewItem( "adhoc", "ELAN", "40:03:43:E7:16:22", false, 3, 10 ); 220 addNewItem( "adhoc", "ELAN", "40:03:43:E7:16:22", false, 3, 10 );
221 addNewItem( "adhoc", "ELAN", "40:03:53:E7:56:62", false, 3, 15 ); 221 addNewItem( "adhoc", "ELAN", "40:03:53:E7:56:62", false, 3, 15 );
222 addNewItem( "adhoc", "ELAN", "40:03:63:E7:56:E2", false, 3, 20 ); 222 addNewItem( "adhoc", "ELAN", "40:03:63:E7:56:E2", false, 3, 20 );
223 */ 223 */
224 224
225 225
226 if ( daemonRunning ) 226 if ( daemonRunning )
227 { 227 {
228 daemonRunning = false; 228 daemonRunning = false;
229 229
230 logwindow->log( "(i) Daemon has been stopped." ); 230 logwindow->log( "(i) Daemon has been stopped." );
231 button->setText( tr( "Start Scanning" ) ); 231 button->setText( tr( "Start Scanning" ) );
232 setCaption( tr( "Scanning in progress..." ) ); 232 setCaption( tr( "Wellenreiter/Opie" ) );
233 233
234 // Stop daemon - ugly for now... later better 234 // Stop daemon - ugly for now... later better
235 235
236 system( "killall wellenreiterd" ); 236 system( "killall wellenreiterd" );
237 237
238 // get configuration from config window 238 // get configuration from config window
239 239
240 const QString& interface = configwindow->interfaceName->currentText(); 240 const QString& interface = configwindow->interfaceName->currentText();
241 241
242 // reset the interface trying to get it into a usable state again 242 // reset the interface trying to get it into a usable state again
243 243
244 QString cmdline; 244 QString cmdline;
245 cmdline.sprintf( "ifdown %s; ifup %s", (const char*) interface, (const char*) interface ); 245 cmdline.sprintf( "iwpriv %s monitor 0; ifdown %s; ifup %s", (const char*) interface, (const char*) interface, (const char*) interface );
246 system( cmdline ); 246 system( cmdline );
247 247
248 // message the user 248 // message the user
249 249
250 QMessageBox::information( this, "Wellenreiter/Opie", "Your wireless card\nshould now be usable again." ); 250 QMessageBox::information( this, "Wellenreiter/Opie", "Your wireless card\nshould now be usable again." );
251 } 251 }
252 252
253 else 253 else
254 { 254 {
255 255
256 // get configuration from config window 256 // get configuration from config window
257 257
@@ -268,16 +268,16 @@ void Wellenreiter::buttonClicked()
268 // start wellenreiterd 268 // start wellenreiterd
269 269
270 QString cmdline; 270 QString cmdline;
271 cmdline.sprintf( "wellenreiterd %s %d &", (const char*) interface, cardtype ); 271 cmdline.sprintf( "wellenreiterd %s %d &", (const char*) interface, cardtype );
272 272
273 qDebug( "about to execute '%s' ...", (const char*) cmdline ); 273 qDebug( "about to execute '%s' ...", (const char*) cmdline );
274 system( cmdline ); 274 system( cmdline );
275 qDebug( "done!" ); 275 qDebug( "done!" );
276 276
277 logwindow->log( "(i) Daemon has been started." ); 277 logwindow->log( "(i) Daemon has been started." );
278 daemonRunning = true; 278 daemonRunning = true;
279 button->setText( tr( "Stop Scanning" ) ); 279 button->setText( tr( "Stop Scanning" ) );
280 setCaption( tr( "Wellenreiter/Opie" ) ); 280 setCaption( tr( "Scanning ..." ) );
281 281
282 } 282 }
283} 283}
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
@@ -39,28 +39,28 @@
39#include "resource.h" 39#include "resource.h"
40#include <qtabwidget.h> 40#include <qtabwidget.h>
41#endif 41#endif
42 42
43 43
44/* 44/*
45 * Constructs a WellenreiterBase which is a child of 'parent', with the 45 * Constructs a WellenreiterBase which is a child of 'parent', with the
46 * name 'name' and widget flags set to 'f' 46 * name 'name' and widget flags set to 'f'
47 */ 47 */
48WellenreiterBase::WellenreiterBase( QWidget* parent, const char* name, WFlags fl ) 48WellenreiterBase::WellenreiterBase( QWidget* parent, const char* name, WFlags fl )
49 : QWidget( parent, name, fl ) 49 : QWidget( parent, name, fl )
50{ 50{
51 ani1 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot0" ) ); 51 //ani1 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot0" ) );
52 ani2 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot90" ) ); 52 //ani2 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot90" ) );
53 ani3 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot180" ) ); 53 //ani3 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot180" ) );
54 ani4 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot270" ) ); 54 //ani4 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot270" ) );
55 55
56 if ( !name ) 56 if ( !name )
57 setName( "WellenreiterBase" ); 57 setName( "WellenreiterBase" );
58 resize( 191, 294 ); 58 resize( 191, 294 );
59 setCaption( tr( "Wellenreiter" ) ); 59 setCaption( tr( "Wellenreiter" ) );
60 WellenreiterBaseLayout = new QVBoxLayout( this ); 60 WellenreiterBaseLayout = new QVBoxLayout( this );
61 WellenreiterBaseLayout->setSpacing( 2 ); 61 WellenreiterBaseLayout->setSpacing( 2 );
62 WellenreiterBaseLayout->setMargin( 0 ); 62 WellenreiterBaseLayout->setMargin( 0 );
63#ifdef QWS 63#ifdef QWS
64 TabWidget = new OTabWidget( this, "TabWidget", OTabWidget::Global ); 64 TabWidget = new OTabWidget( this, "TabWidget", OTabWidget::Global );
65#else 65#else
66 TabWidget = new QTabWidget( this, "TabWidget" ); 66 TabWidget = new QTabWidget( this, "TabWidget" );
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
@@ -5,44 +5,55 @@
5 5
6#include <string.h> 6#include <string.h>
7#include <stdlib.h> 7#include <stdlib.h>
8#include <errno.h> 8#include <errno.h>
9#include <sys/types.h> 9#include <sys/types.h>
10#include <sys/time.h> 10#include <sys/time.h>
11#include <sys/socket.h> 11#include <sys/socket.h>
12#include <netinet/in.h> 12#include <netinet/in.h>
13#include <arpa/inet.h> 13#include <arpa/inet.h>
14#include <sys/ioctl.h> 14#include <sys/ioctl.h>
15#include <unistd.h> 15#include <unistd.h>
16#include <linux/if.h> 16#include <linux/if.h>
17
18/* Following typedefs are needed here, because linux/wireless.h
19 includes linux/ethertool.h which is using them */
20typedef signed char s8;
21typedef unsigned char u8;
22typedef signed short s16;
23typedef unsigned short u16;
24typedef signed int s32;
25typedef unsigned int u32;
26typedef signed long long s64;
27typedef unsigned long long u64;
28
17#include <linux/wireless.h> 29#include <linux/wireless.h>
18 30
19#ifndef SIOCIWFIRSTPRIV 31#ifndef SIOCIWFIRSTPRIV
20#define SIOCIWFIRSTPRIV SIOCDEVPRIVATE 32#define SIOCIWFIRSTPRIV SIOCDEVPRIVATE
21#endif 33#endif
22 34
23
24extern "C" 35extern "C"
25{ 36{
26#include <net/bpf.h> 37#include <net/bpf.h>
27#include <pcap.h> 38#include <pcap.h>
28} 39}
29 40
30/* Defines, used for the card setup */ 41/* Defines, used for the card setup */
31#define DEFAULT_PATH "/proc/driver/aironet/%s/Config" 42#define DEFAULT_PATH "/proc/driver/aironet/%s/Config"
32#define CISCO_STATUS "/proc/driver/aironet/%s/Status" 43#define CISCO_STATUS "/proc/driver/aironet/%s/Status"
33 #define CARD_TYPE_CISCO 1 44#define CARD_TYPE_CISCO 1
34 #define CARD_TYPE_NG 2 45#define CARD_TYPE_NG 2
35 #define CARD_TYPE_HOSTAP3 46#define CARD_TYPE_HOSTAP 3
36#define CARD_TYPE_ORINOCCO 4 47#define CARD_TYPE_ORINOCCO 4
37 48
38/* Some usefull constants for frequencies */ 49/* Some usefull constants for frequencies */
39#define KILO 1e3 50#define KILO 1e3
40#define MEGA 1e6 51#define MEGA 1e6
41#define GIGA 1e9 52#define GIGA 1e9
42 53
43 54
44/* only for now, until we have the daemon running */ 55/* only for now, until we have the daemon running */
45/*the config file should provide these information */ 56/*the config file should provide these information */
46#define CARD_TYPE CARD_TYPE_HOSTAP 57#define CARD_TYPE CARD_TYPE_HOSTAP
47 58
48/* Prototypes */ 59/* Prototypes */