summaryrefslogtreecommitdiff
path: root/noncore/net/wellenreiter/gui
Unidiff
Diffstat (limited to 'noncore/net/wellenreiter/gui') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/configwindow.cpp30
-rw-r--r--noncore/net/wellenreiter/gui/gps.cpp12
-rw-r--r--noncore/net/wellenreiter/gui/logwindow.cpp8
-rw-r--r--noncore/net/wellenreiter/gui/main.cpp15
-rw-r--r--noncore/net/wellenreiter/gui/mainwindow.cpp57
-rw-r--r--noncore/net/wellenreiter/gui/packetview.cpp2
-rw-r--r--noncore/net/wellenreiter/gui/resource.cpp4
-rw-r--r--noncore/net/wellenreiter/gui/scanlist.cpp77
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiter.cpp74
9 files changed, 140 insertions, 139 deletions
diff --git a/noncore/net/wellenreiter/gui/configwindow.cpp b/noncore/net/wellenreiter/gui/configwindow.cpp
index da39113..bfdb20a 100644
--- a/noncore/net/wellenreiter/gui/configwindow.cpp
+++ b/noncore/net/wellenreiter/gui/configwindow.cpp
@@ -23,7 +23,9 @@
23#include <opie2/oapplication.h> 23#include <opie2/oapplication.h>
24#include <opie2/oconfig.h> 24#include <opie2/oconfig.h>
25#include <opie2/odevice.h> 25#include <opie2/odevice.h>
26using namespace Opie; 26#include <opie2/odebug.h>
27using namespace Opie::Core;
28using namespace Opie::Net;
27#endif 29#endif
28 30
29/* QT */ 31/* QT */
@@ -40,15 +42,9 @@ using namespace Opie;
40#include <qspinbox.h> 42#include <qspinbox.h>
41#include <qtextstream.h> 43#include <qtextstream.h>
42 44
43/* POSIX */ 45/* STD */
44#include <assert.h> 46#include <assert.h>
45 47
46using namespace Opie::Core;
47using namespace Opie::Net;
48using namespace Opie::Core;
49using namespace Opie::Net;
50using namespace Opie::Core;
51using namespace Opie::Net;
52WellenreiterConfigWindow* WellenreiterConfigWindow::_instance = 0; 48WellenreiterConfigWindow* WellenreiterConfigWindow::_instance = 0;
53 49
54WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char * name, WFlags f ) 50WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char * name, WFlags f )
@@ -116,7 +112,7 @@ void WellenreiterConfigWindow::performAutodetection()
116 // and sleep a second, so that it looks 112 // and sleep a second, so that it looks
117 // like we're actually doing something fancy... ;-) 113 // like we're actually doing something fancy... ;-)
118 114
119 qDebug( "WellenreiterConfigWindow::performAutodetection()" ); 115 odebug << "WellenreiterConfigWindow::performAutodetection()" << oendl;
120 116
121 // try to guess device type 117 // try to guess device type
122 QFile m( "/proc/modules" ); 118 QFile m( "/proc/modules" );
@@ -137,7 +133,7 @@ void WellenreiterConfigWindow::performAutodetection()
137 { 133 {
138 deviceType->setCurrentItem( devicetype ); 134 deviceType->setCurrentItem( devicetype );
139 _guess = devicetype; 135 _guess = devicetype;
140 qDebug( "Wellenreiter: guessed device type to be #%d", devicetype ); 136 odebug << "Wellenreiter: guessed device type to be #" << devicetype << "" << oendl;
141 } 137 }
142 } 138 }
143} 139}
@@ -241,7 +237,7 @@ void WellenreiterConfigWindow::changedStationAction(int t)
241void WellenreiterConfigWindow::getCaptureFileNameClicked() 237void WellenreiterConfigWindow::getCaptureFileNameClicked()
242{ 238{
243 QString name = ( (WellenreiterMainWindow*) qApp->mainWidget() )->getFileName(true); 239 QString name = ( (WellenreiterMainWindow*) qApp->mainWidget() )->getFileName(true);
244 qDebug( "name = %s", (const char*) name ); 240 odebug << "name = " << (const char*) name << "" << oendl;
245 if ( !name.isEmpty() ) 241 if ( !name.isEmpty() )
246 { 242 {
247 captureFileName->setText( name ); 243 captureFileName->setText( name );
@@ -316,11 +312,11 @@ void WellenreiterConfigWindow::performAction( const QString& type,
316 } 312 }
317 else 313 else
318 { 314 {
319 qWarning( "WellenreiterConfigWindow::performAction(): unknown type '%s'", (const char*) type ); 315 owarn << "WellenreiterConfigWindow::performAction(): unknown type '" << (const char*) type << "'" << oendl;
320 return; 316 return;
321 } 317 }
322 318
323 qDebug( "for event '%s' I'm going to perform action %d (script='%s')", (const char*) type, action, (const char*) script ); 319 odebug << "for event '" << (const char*) type << "' I'm going to perform action " << action << " (script='" << (const char*) script << "')" << oendl;
324 320
325 switch( action ) 321 switch( action )
326 { 322 {
@@ -345,9 +341,9 @@ void WellenreiterConfigWindow::performAction( const QString& type,
345 script = script.replace( QRegExp( "$WEP" ), wep ? QString( "true" ) : QString( "false" ) ); 341 script = script.replace( QRegExp( "$WEP" ), wep ? QString( "true" ) : QString( "false" ) );
346 script = script.replace( QRegExp( "$CHAN" ), QString::number( channel ) ); 342 script = script.replace( QRegExp( "$CHAN" ), QString::number( channel ) );
347 343
348 qDebug( "going to call script '%s'", (const char*) script ); 344 odebug << "going to call script '" << (const char*) script << "'" << oendl;
349 ::system( script ); 345 ::system( script );
350 qDebug( "script returned." ); 346 odebug << "script returned." << oendl;
351 return; 347 return;
352 } 348 }
353 default: assert( false ); 349 default: assert( false );
@@ -361,7 +357,7 @@ void WellenreiterConfigWindow::load()
361 #warning Persistent Configuration not yet implemented for standalone X11 build 357 #warning Persistent Configuration not yet implemented for standalone X11 build
362 performAutodetection(); 358 performAutodetection();
363#else 359#else
364 qDebug( "loading configuration settings..." ); 360 odebug << "loading configuration settings..." << oendl;
365 361
366 /* This is dumb monkey typing stuff... We _need_ to do this automatically! */ 362 /* This is dumb monkey typing stuff... We _need_ to do this automatically! */
367 363
@@ -439,7 +435,7 @@ void WellenreiterConfigWindow::save()
439#ifdef Q_WS_X11 435#ifdef Q_WS_X11
440 #warning Persistent Configuration not yet implemented for standalone X11 build 436 #warning Persistent Configuration not yet implemented for standalone X11 build
441#else 437#else
442 qDebug( "saving configuration settings..." ); 438 odebug << "saving configuration settings..." << oendl;
443 439
444 /* This is dumb monkey typing stuff... We _need_ to do this automatically! */ 440 /* This is dumb monkey typing stuff... We _need_ to do this automatically! */
445 441
diff --git a/noncore/net/wellenreiter/gui/gps.cpp b/noncore/net/wellenreiter/gui/gps.cpp
index a47b4ec..bd91e35 100644
--- a/noncore/net/wellenreiter/gui/gps.cpp
+++ b/noncore/net/wellenreiter/gui/gps.cpp
@@ -15,6 +15,10 @@
15 15
16#include "gps.h" 16#include "gps.h"
17 17
18/* OPIE */
19#include <opie2/odebug.h>
20using namespace Opie::Core;
21
18/* QT */ 22/* QT */
19#include <qtextstream.h> 23#include <qtextstream.h>
20 24
@@ -25,14 +29,14 @@
25GPS::GPS( QObject* parent, const char * name ) 29GPS::GPS( QObject* parent, const char * name )
26 :QObject( parent, name ) 30 :QObject( parent, name )
27{ 31{
28 qDebug( "GPS::GPS()" ); 32 odebug << "GPS::GPS()" << oendl;
29 _socket = new QSocket( this, "gpsd commsock" ); 33 _socket = new QSocket( this, "gpsd commsock" );
30} 34}
31 35
32 36
33GPS::~GPS() 37GPS::~GPS()
34{ 38{
35 qDebug( "GPS::~GPS()" ); 39 odebug << "GPS::~GPS()" << oendl;
36} 40}
37 41
38 42
@@ -53,7 +57,7 @@ GpsLocation GPS::position() const
53 if ( result ) 57 if ( result )
54 { 58 {
55 int numAvail = _socket->bytesAvailable(); 59 int numAvail = _socket->bytesAvailable();
56 qDebug( "GPS write succeeded, %d bytes available for reading...", numAvail ); 60 odebug << "GPS write succeeded, " << numAvail << " bytes available for reading..." << oendl;
57 if ( numAvail ) 61 if ( numAvail )
58 { 62 {
59 int numRead = _socket->readBlock( &buf[0], sizeof buf ); 63 int numRead = _socket->readBlock( &buf[0], sizeof buf );
@@ -61,7 +65,7 @@ GpsLocation GPS::position() const
61 65
62 if ( numRead < 7 || numScan != 2 ) 66 if ( numRead < 7 || numScan != 2 )
63 { 67 {
64 qDebug( "GPS read %d bytes succeeded, invalid response: '%s'", numRead, &buf[0] ); 68 odebug << "GPS read " << numRead << " bytes succeeded, invalid response: '" << &buf[0] << "'" << oendl;
65 return GpsLocation( -111, -111 ); 69 return GpsLocation( -111, -111 );
66 } 70 }
67 else 71 else
diff --git a/noncore/net/wellenreiter/gui/logwindow.cpp b/noncore/net/wellenreiter/gui/logwindow.cpp
index 1c72cf4..714a9a9 100644
--- a/noncore/net/wellenreiter/gui/logwindow.cpp
+++ b/noncore/net/wellenreiter/gui/logwindow.cpp
@@ -14,6 +14,12 @@
14**********************************************************************/ 14**********************************************************************/
15 15
16#include "logwindow.h" 16#include "logwindow.h"
17
18/* OPIE */
19#include <opie2/odebug.h>
20using namespace Opie::Core;
21
22/* QT */
17#include <qmultilineedit.h> 23#include <qmultilineedit.h>
18#include <qdatetime.h> 24#include <qdatetime.h>
19 25
@@ -38,7 +44,7 @@ void MLogWindow::log( QString text )
38 int row; 44 int row;
39 ledit->getCursorPosition( &col, &row ); 45 ledit->getCursorPosition( &col, &row );
40 ledit->insertAt( line, col, row ); 46 ledit->insertAt( line, col, row );
41 qDebug( line ); 47 odebug << line << oendl;
42} 48}
43 49
44 50
diff --git a/noncore/net/wellenreiter/gui/main.cpp b/noncore/net/wellenreiter/gui/main.cpp
index 6bbc39b..62db967 100644
--- a/noncore/net/wellenreiter/gui/main.cpp
+++ b/noncore/net/wellenreiter/gui/main.cpp
@@ -14,24 +14,27 @@
14**********************************************************************/ 14**********************************************************************/
15 15
16#include "mainwindow.h" 16#include "mainwindow.h"
17
17#ifdef QWS 18#ifdef QWS
19#include <opie2/odebug.h>
18#include <opie2/oapplication.h> 20#include <opie2/oapplication.h>
19#include <opie2/oprocess.h> 21#include <opie2/oprocess.h>
20#else 22#else
21#include <qapplication.h> 23#include <qapplication.h>
22#endif 24#endif
23 25
26/* QT */
24#include <qmessagebox.h> 27#include <qmessagebox.h>
25#include <qstringlist.h> 28#include <qstringlist.h>
26 29
30/* STD */
27#include <errno.h> 31#include <errno.h>
28#include <signal.h> 32#include <signal.h>
29#include <string.h> 33#include <string.h>
30#include <unistd.h> 34#include <unistd.h>
31 35
32using namespace Opie::Core; 36using namespace Opie::Core;
33using namespace Opie::Core; 37
34using namespace Opie::Core;
35int main( int argc, char **argv ) 38int main( int argc, char **argv )
36{ 39{
37 #ifdef QWS 40 #ifdef QWS
@@ -55,10 +58,10 @@ int main( int argc, char **argv )
55 bool check = true; 58 bool check = true;
56 for ( int i = 1; i < argc; ++i ) 59 for ( int i = 1; i < argc; ++i )
57 { 60 {
58 qDebug( "Wellenreiter::main() parsing argument %d = '%s'", i, argv[i] ); 61 odebug << "Wellenreiter::main() parsing argument " << i << " = '" << argv[i] << "'" << oendl;
59 if ( !strcmp( "-nocheck", argv[i] ) ) 62 if ( !strcmp( "-nocheck", argv[i] ) )
60 { 63 {
61 qDebug( "-nocheck found" ); 64 odebug << "-nocheck found" << oendl;
62 check = false; 65 check = false;
63 break; 66 break;
64 } 67 }
@@ -69,7 +72,7 @@ int main( int argc, char **argv )
69 // root check 72 // root check
70 if ( getuid() ) 73 if ( getuid() )
71 { 74 {
72 qWarning( QObject::tr( "Wellenreiter: trying to run as non-root!" ) ); 75 owarn << QObject::tr( "Wellenreiter: trying to run as non-root!" ) << oendl;
73 result = QMessageBox::warning( w, " - Wellenreiter II - (non-root)", QObject::tr( "You have started Wellenreiter II\n" 76 result = QMessageBox::warning( w, " - Wellenreiter II - (non-root)", QObject::tr( "You have started Wellenreiter II\n"
74 "as non-root. You will have\nonly limited functionality.\nProceed anyway?" ), 77 "as non-root. You will have\nonly limited functionality.\nProceed anyway?" ),
75 QMessageBox::Yes, QMessageBox::No ); 78 QMessageBox::Yes, QMessageBox::No );
@@ -86,7 +89,7 @@ int main( int argc, char **argv )
86 if ( result == QMessageBox::Yes ) 89 if ( result == QMessageBox::Yes )
87 { 90 {
88 if ( -1 == ::kill( dhcpid, SIGTERM ) ) 91 if ( -1 == ::kill( dhcpid, SIGTERM ) )
89 qWarning( "Wellenreiter: can't kill process #%d (%s)", result, strerror( errno ) ); 92 owarn << "Wellenreiter: can't kill process #" << result << " (" << strerror( errno ) << ")" << oendl;
90 else 93 else
91 killed = true; 94 killed = true;
92 } 95 }
diff --git a/noncore/net/wellenreiter/gui/mainwindow.cpp b/noncore/net/wellenreiter/gui/mainwindow.cpp
index 7add6cd..a4b8839 100644
--- a/noncore/net/wellenreiter/gui/mainwindow.cpp
+++ b/noncore/net/wellenreiter/gui/mainwindow.cpp
@@ -21,6 +21,21 @@
21#include "wellenreiter.h" 21#include "wellenreiter.h"
22#include "scanlist.h" 22#include "scanlist.h"
23 23
24/* OPIE */
25#ifdef QWS
26#include <qpe/resource.h>
27#include <opie2/odebug.h>
28#include <opie2/ofiledialog.h>
29#else
30#include "resource.h"
31#include <qapplication.h>
32#include <qfiledialog.h>
33#endif
34using namespace Opie::Core;
35using namespace Opie::Net;
36using namespace Opie::Ui;
37
38/* QT */
24#include <qcombobox.h> 39#include <qcombobox.h>
25#include <qdatastream.h> 40#include <qdatastream.h>
26#include <qfile.h> 41#include <qfile.h>
@@ -39,23 +54,9 @@
39#include <qtoolbutton.h> 54#include <qtoolbutton.h>
40#include <qwhatsthis.h> 55#include <qwhatsthis.h>
41 56
42#ifdef QWS 57/* STD */
43#include <qpe/resource.h>
44#include <opie2/ofiledialog.h>
45using namespace Opie;
46#else
47#include "resource.h"
48#include <qapplication.h>
49#include <qfiledialog.h>
50#endif
51
52#include <unistd.h> 58#include <unistd.h>
53 59
54using namespace Opie::Ui;
55using namespace Opie::Net;
56using namespace Opie::Ui;
57using namespace Opie::Net;
58using namespace Opie::Net;
59WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * name, WFlags f ) 60WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * name, WFlags f )
60 :QMainWindow( parent, name, f ) 61 :QMainWindow( parent, name, f )
61{ 62{
@@ -188,7 +189,7 @@ WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * n
188 189
189void WellenreiterMainWindow::showConfigure() 190void WellenreiterMainWindow::showConfigure()
190{ 191{
191 qDebug( "show configure..." ); 192 odebug << "show configure..." << oendl;
192 cw->setCaption( tr( "Configure" ) ); 193 cw->setCaption( tr( "Configure" ) );
193 int result = QPEApplication::execDialog( cw ); 194 int result = QPEApplication::execDialog( cw );
194 195
@@ -231,7 +232,7 @@ void WellenreiterMainWindow::changedSniffingState()
231 232
232WellenreiterMainWindow::~WellenreiterMainWindow() 233WellenreiterMainWindow::~WellenreiterMainWindow()
233{ 234{
234 qDebug( "Wellenreiter: bye." ); 235 odebug << "Wellenreiter: bye." << oendl;
235}; 236};
236 237
237 238
@@ -251,7 +252,7 @@ void WellenreiterMainWindow::demoReadFromGps()
251{ 252{
252 WellenreiterConfigWindow* configwindow = WellenreiterConfigWindow::instance(); 253 WellenreiterConfigWindow* configwindow = WellenreiterConfigWindow::instance();
253 GPS* gps = new GPS( this ); 254 GPS* gps = new GPS( this );
254 qDebug( "Wellenreiter::demoReadFromGps(): url=gps://%s:%d/", (const char*) configwindow->gpsdHost->currentText(), configwindow->gpsdPort->value() ); 255 odebug << "Wellenreiter::demoReadFromGps(): url=gps://" << (const char*) configwindow->gpsdHost->currentText() << ":" << configwindow->gpsdPort->value() << "/" << oendl;
255 gps->open( configwindow->gpsdHost->currentText(), configwindow->gpsdPort->value() ); 256 gps->open( configwindow->gpsdHost->currentText(), configwindow->gpsdPort->value() );
256 GpsLocation loc = gps->position(); 257 GpsLocation loc = gps->position();
257 QMessageBox::information( this, "Wellenreiter/Opie", tr( "GPS said:\n%1" ).arg( loc.dmsPosition() ) ); 258 QMessageBox::information( this, "Wellenreiter/Opie", tr( "GPS said:\n%1" ).arg( loc.dmsPosition() ) );
@@ -305,11 +306,11 @@ void WellenreiterMainWindow::fileSaveLog()
305 QTextStream t( &f ); 306 QTextStream t( &f );
306 t << mw->logWindow()->getLog(); 307 t << mw->logWindow()->getLog();
307 f.close(); 308 f.close();
308 qDebug( "Saved log to file '%s'", (const char*) fname ); 309 odebug << "Saved log to file '" << (const char*) fname << "'" << oendl;
309 } 310 }
310 else 311 else
311 { 312 {
312 qDebug( "Problem saving log to file '%s'", (const char*) fname ); 313 odebug << "Problem saving log to file '" << (const char*) fname << "'" << oendl;
313 } 314 }
314 } 315 }
315} 316}
@@ -326,11 +327,11 @@ void WellenreiterMainWindow::fileSaveSession()
326 QDataStream t( &f ); 327 QDataStream t( &f );
327 t << *mw->netView(); 328 t << *mw->netView();
328 f.close(); 329 f.close();
329 qDebug( "Saved session to file '%s'", (const char*) fname ); 330 odebug << "Saved session to file '" << (const char*) fname << "'" << oendl;
330 } 331 }
331 else 332 else
332 { 333 {
333 qDebug( "Problem saving session to file '%s'", (const char*) fname ); 334 odebug << "Problem saving session to file '" << (const char*) fname << "'" << oendl;
334 } 335 }
335 } 336 }
336} 337}
@@ -348,11 +349,11 @@ void WellenreiterMainWindow::fileSaveHex()
348 QTextStream t( &f ); 349 QTextStream t( &f );
349 t << mw->hexWindow()->getLog(); 350 t << mw->hexWindow()->getLog();
350 f.close(); 351 f.close();
351 qDebug( "Saved hex log to file '%s'", (const char*) fname ); 352 odebug << "Saved hex log to file '" << (const char*) fname << "'" << oendl;
352 } 353 }
353 else 354 else
354 { 355 {
355 qDebug( "Problem saving hex log to file '%s'", (const char*) fname ); 356 odebug << "Problem saving hex log to file '" << (const char*) fname << "'" << oendl;
356 } 357 }
357 } 358 }
358 */ 359 */
@@ -369,11 +370,11 @@ void WellenreiterMainWindow::fileLoadSession()
369 QDataStream t( &f ); 370 QDataStream t( &f );
370 t >> *mw->netView(); 371 t >> *mw->netView();
371 f.close(); 372 f.close();
372 qDebug( "Loaded session from file '%s'", (const char*) fname ); 373 odebug << "Loaded session from file '" << (const char*) fname << "'" << oendl;
373 } 374 }
374 else 375 else
375 { 376 {
376 qDebug( "Problem loading session from file '%s'", (const char*) fname ); 377 odebug << "Problem loading session from file '" << (const char*) fname << "'" << oendl;
377 } 378 }
378 } 379 }
379} 380}
@@ -438,11 +439,11 @@ void WellenreiterMainWindow::uploadSession()
438 439
439 if ( !result ) 440 if ( !result )
440 { 441 {
441 qDebug( "Session upload cancelled :(" ); 442 odebug << "Session upload cancelled :(" << oendl;
442 return; 443 return;
443 } 444 }
444 445
445 qDebug( "Starting upload..." ); 446 odebug << "Starting upload..." << oendl;
446 447
447 struct sockaddr_in raddr; 448 struct sockaddr_in raddr;
448 struct hostent *rhost_info; 449 struct hostent *rhost_info;
diff --git a/noncore/net/wellenreiter/gui/packetview.cpp b/noncore/net/wellenreiter/gui/packetview.cpp
index 3d3aa18..4df01da 100644
--- a/noncore/net/wellenreiter/gui/packetview.cpp
+++ b/noncore/net/wellenreiter/gui/packetview.cpp
@@ -84,7 +84,7 @@ void PacketView::showPacket( int number )
84 } 84 }
85 else 85 else
86 { 86 {
87 qDebug( "D'oh! No packet!" ); 87 odebug << "D'oh! No packet!" << oendl;
88 } 88 }
89} 89}
90 90
diff --git a/noncore/net/wellenreiter/gui/resource.cpp b/noncore/net/wellenreiter/gui/resource.cpp
index d98ef0b..cb17f51 100644
--- a/noncore/net/wellenreiter/gui/resource.cpp
+++ b/noncore/net/wellenreiter/gui/resource.cpp
@@ -29,7 +29,7 @@ QPixmap loadPixmap( const QString& pix )
29 QPixmap pixmap( filename ); 29 QPixmap pixmap( filename );
30 if ( pixmap.isNull() ) 30 if ( pixmap.isNull() )
31 { 31 {
32 qDebug( "Wellenreiter::Resource: can't find pixmap " + filename ); 32 odebug << "Wellenreiter::Resource: can't find pixmap " + filename << oendl;
33 } 33 }
34 return pixmap; 34 return pixmap;
35}; 35};
@@ -41,7 +41,7 @@ QIconSet loadIconSet( const QString& pix )
41 QPixmap pixmap( filename ); 41 QPixmap pixmap( filename );
42 if ( pixmap.isNull() ) 42 if ( pixmap.isNull() )
43 { 43 {
44 qDebug( "Wellenreiter::Resource: can't find pixmap " + filename ); 44 odebug << "Wellenreiter::Resource: can't find pixmap " + filename << oendl;
45 } 45 }
46 return QIconSet( pixmap ); 46 return QIconSet( pixmap );
47}; 47};
diff --git a/noncore/net/wellenreiter/gui/scanlist.cpp b/noncore/net/wellenreiter/gui/scanlist.cpp
index 3b7120a..a2be782 100644
--- a/noncore/net/wellenreiter/gui/scanlist.cpp
+++ b/noncore/net/wellenreiter/gui/scanlist.cpp
@@ -17,21 +17,26 @@
17#include "configwindow.h" 17#include "configwindow.h"
18#include "logwindow.h" 18#include "logwindow.h"
19 19
20#include <assert.h> 20/* OPIE */
21#include <qcursor.h>
22#include <qdatetime.h>
23#include <qpopupmenu.h>
24#include <qcheckbox.h>
25
26#ifdef QWS 21#ifdef QWS
22#include <opie2/odebug.h>
27#include <qpe/qpeapplication.h> 23#include <qpe/qpeapplication.h>
28#endif
29
30#ifdef QWS
31#include <qpe/resource.h> 24#include <qpe/resource.h>
32#else 25#else
33#include "resource.h" 26#include "resource.h"
34#endif 27#endif
28using namespace Opie::Core;
29using namespace Opie::Ui;
30using namespace Opie::Net;
31
32/* QT */
33#include <qcursor.h>
34#include <qdatetime.h>
35#include <qpopupmenu.h>
36#include <qcheckbox.h>
37
38/* STD */
39#include <assert.h>
35 40
36const int col_type = 0; 41const int col_type = 0;
37const int col_essid = 0; 42const int col_essid = 0;
@@ -46,12 +51,6 @@ const int col_firstseen = 8;
46const int col_lastseen = 9; 51const int col_lastseen = 9;
47const int col_location = 10; 52const int col_location = 10;
48 53
49using namespace Opie::Net;
50using namespace Opie::Ui;
51using namespace Opie::Net;
52using namespace Opie::Ui;
53using namespace Opie::Ui;
54using namespace Opie::Net;
55MScanListView::MScanListView( QWidget* parent, const char* name ) 54MScanListView::MScanListView( QWidget* parent, const char* name )
56 :OListView( parent, name ) 55 :OListView( parent, name )
57{ 56{
@@ -106,14 +105,14 @@ OListViewItem* MScanListView::childFactory()
106 105
107void MScanListView::serializeTo( QDataStream& s) const 106void MScanListView::serializeTo( QDataStream& s) const
108{ 107{
109 qDebug( "serializing MScanListView" ); 108 odebug << "serializing MScanListView" << oendl;
110 OListView::serializeTo( s ); 109 OListView::serializeTo( s );
111} 110}
112 111
113 112
114void MScanListView::serializeFrom( QDataStream& s) 113void MScanListView::serializeFrom( QDataStream& s)
115{ 114{
116 qDebug( "serializing MScanListView" ); 115 odebug << "serializing MScanListView" << oendl;
117 OListView::serializeFrom( s ); 116 OListView::serializeFrom( s );
118} 117}
119 118
@@ -143,7 +142,7 @@ void MScanListView::addNewItem( const QString& type,
143 while ( item && ( item->text( col_essid ) != essid ) ) 142 while ( item && ( item->text( col_essid ) != essid ) )
144 { 143 {
145 #ifdef DEBUG 144 #ifdef DEBUG
146 qDebug( "itemtext: %s", (const char*) item->text( col_essid ) ); 145 odebug << "itemtext: " << (const char*) item->text( col_essid ) << "" << oendl;
147 #endif 146 #endif
148 item = static_cast<MScanListItem*> ( item->nextSibling() ); 147 item = static_cast<MScanListItem*> ( item->nextSibling() );
149 } 148 }
@@ -159,7 +158,7 @@ void MScanListView::addNewItem( const QString& type,
159 while ( item && ( item->text( col_ap ) != macaddr ) ) 158 while ( item && ( item->text( col_ap ) != macaddr ) )
160 { 159 {
161 #ifdef DEBUG 160 #ifdef DEBUG
162 qDebug( "subitemtext: %s", (const char*) item->text( col_ap ) ); 161 odebug << "subitemtext: " << (const char*) item->text( col_ap ) << "" << oendl;
163 #endif 162 #endif
164 item = static_cast<MScanListItem*> ( item->nextSibling() ); 163 item = static_cast<MScanListItem*> ( item->nextSibling() );
165 } 164 }
@@ -168,7 +167,7 @@ void MScanListView::addNewItem( const QString& type,
168 { 167 {
169 // we have already seen this item, it's a dupe 168 // we have already seen this item, it's a dupe
170 #ifdef DEBUG 169 #ifdef DEBUG
171 qDebug( "%s is a dupe - ignoring...", (const char*) macaddr ); 170 odebug << "" << (const char*) macaddr << " is a dupe - ignoring..." << oendl;
172 #endif 171 #endif
173 item->receivedBeacon(); 172 item->receivedBeacon();
174 return; 173 return;
@@ -186,7 +185,7 @@ void MScanListView::addNewItem( const QString& type,
186 // no essid to reduce clutter, maybe later we have a nick or stationname to display!? 185 // no essid to reduce clutter, maybe later we have a nick or stationname to display!?
187 186
188 #ifdef DEBUG 187 #ifdef DEBUG
189 qDebug( "inserting new station %s", (const char*) macaddr ); 188 odebug << "inserting new station " << (const char*) macaddr << "" << oendl;
190 #endif 189 #endif
191 190
192 MScanListItem* station = new MScanListItem( network, type, "", macaddr, wep, channel, signal ); 191 MScanListItem* station = new MScanListItem( network, type, "", macaddr, wep, channel, signal );
@@ -212,7 +211,7 @@ void MScanListView::addIfNotExisting( MScanListItem* network, const OMacAddress&
212 while ( subitem && ( subitem->text( col_ap ) != addr.toString(true) ) ) 211 while ( subitem && ( subitem->text( col_ap ) != addr.toString(true) ) )
213 { 212 {
214 #ifdef DEBUG 213 #ifdef DEBUG
215 qDebug( "subitemtext: %s", (const char*) subitem->text( col_ap ) ); 214 odebug << "subitemtext: " << (const char*) subitem->text( col_ap ) << "" << oendl;
216 #endif 215 #endif
217 subitem = static_cast<MScanListItem*> ( subitem->nextSibling() ); 216 subitem = static_cast<MScanListItem*> ( subitem->nextSibling() );
218 } 217 }
@@ -221,7 +220,7 @@ void MScanListView::addIfNotExisting( MScanListItem* network, const OMacAddress&
221 { 220 {
222 // we have already seen this item, it's a dupe 221 // we have already seen this item, it's a dupe
223 #ifdef DEBUG 222 #ifdef DEBUG
224 qDebug( "%s is a dupe - ignoring...", (const char*) addr.toString(true) ); 223 odebug << "" << (const char*) addr.toString(true) << " is a dupe - ignoring..." << oendl;
225 #endif 224 #endif
226 subitem->receivedBeacon(); //FIXME: sent data bit 225 subitem->receivedBeacon(); //FIXME: sent data bit
227 return; 226 return;
@@ -246,7 +245,7 @@ void MScanListView::addIfNotExisting( MScanListItem* network, const OMacAddress&
246 245
247void MScanListView::WDStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& viaFrom, const OMacAddress& viaTo ) 246void MScanListView::WDStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& viaFrom, const OMacAddress& viaTo )
248{ 247{
249 qDebug( "WDSTraffic: %s and %s seem to form a WDS", (const char*) viaFrom.toString(), (const char*) viaTo.toString() ); 248 odebug << "WDSTraffic: " << (const char*) viaFrom.toString() << " and " << (const char*) viaTo.toString() << " seem to form a WDS" << oendl;
250 QString s; 249 QString s;
251 MScanListItem* network; 250 MScanListItem* network;
252 251
@@ -264,7 +263,7 @@ void MScanListView::WDStraffic( const OMacAddress& from, const OMacAddress& to,
264 } 263 }
265 else 264 else
266 { 265 {
267 qDebug( "D'Oh! Stations without AP... ignoring for now... will handle this in 1.1 version :-D" ); 266 odebug << "D'Oh! Stations without AP... ignoring for now... will handle this in 1.1 version :-D" << oendl;
268 MLogWindow::logwindow()->log( "WARNING: Unhandled WSD traffic!" ); 267 MLogWindow::logwindow()->log( "WARNING: Unhandled WSD traffic!" );
269 } 268 }
270} 269}
@@ -286,7 +285,7 @@ void MScanListView::toDStraffic( const OMacAddress& from, const OMacAddress& to,
286 } 285 }
287 else 286 else
288 { 287 {
289 qDebug( "D'Oh! Station without AP... ignoring for now... will handle this in 1.1 :-D" ); 288 odebug << "D'Oh! Station without AP... ignoring for now... will handle this in 1.1 :-D" << oendl;
290 MLogWindow::logwindow()->log( "WARNING: Unhandled toDS traffic!" ); 289 MLogWindow::logwindow()->log( "WARNING: Unhandled toDS traffic!" );
291 290
292 } 291 }
@@ -309,7 +308,7 @@ void MScanListView::fromDStraffic( const OMacAddress& from, const OMacAddress& t
309 } 308 }
310 else 309 else
311 { 310 {
312 qDebug( "D'Oh! Station without AP... ignoring for now... will handle this in 1.1 :-D" ); 311 odebug << "D'Oh! Station without AP... ignoring for now... will handle this in 1.1 :-D" << oendl;
313 MLogWindow::logwindow()->log( "WARNING: Unhandled fromDS traffic!" ); 312 MLogWindow::logwindow()->log( "WARNING: Unhandled fromDS traffic!" );
314 } 313 }
315} 314}
@@ -317,14 +316,14 @@ void MScanListView::fromDStraffic( const OMacAddress& from, const OMacAddress& t
317 316
318void MScanListView::IBSStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& via ) 317void MScanListView::IBSStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& via )
319{ 318{
320 qWarning( "D'oh! Not yet implemented..." ); 319 owarn << "D'oh! Not yet implemented..." << oendl;
321 MLogWindow::logwindow()->log( "WARNING: Unhandled IBSS traffic!" ); 320 MLogWindow::logwindow()->log( "WARNING: Unhandled IBSS traffic!" );
322} 321}
323 322
324 323
325void MScanListView::identify( const OMacAddress& macaddr, const QString& ip ) 324void MScanListView::identify( const OMacAddress& macaddr, const QString& ip )
326{ 325{
327 qDebug( "identify %s = %s", (const char*) macaddr.toString(), (const char*) ip ); 326 odebug << "identify " << (const char*) macaddr.toString() << " = " << (const char*) ip << "" << oendl;
328 327
329 QListViewItemIterator it( this ); 328 QListViewItemIterator it( this );
330 for ( ; it.current(); ++it ) 329 for ( ; it.current(); ++it )
@@ -335,7 +334,7 @@ void MScanListView::identify( const OMacAddress& macaddr, const QString& ip )
335 return; 334 return;
336 } 335 }
337 } 336 }
338 qDebug( "D'oh! Received identification, but item not yet in list... ==> Handle this!" ); 337 odebug << "D'oh! Received identification, but item not yet in list... ==> Handle this!" << oendl;
339 MLogWindow::logwindow()->log( QString().sprintf( "WARNING: Unhandled identification %s = %s!", 338 MLogWindow::logwindow()->log( QString().sprintf( "WARNING: Unhandled identification %s = %s!",
340 (const char*) macaddr.toString(), (const char*) ip ) ); 339 (const char*) macaddr.toString(), (const char*) ip ) );
341} 340}
@@ -343,7 +342,7 @@ void MScanListView::identify( const OMacAddress& macaddr, const QString& ip )
343 342
344void MScanListView::addService( const QString& name, const OMacAddress& macaddr, const QString& ip ) 343void MScanListView::addService( const QString& name, const OMacAddress& macaddr, const QString& ip )
345{ 344{
346 qDebug( "addService '%s', Server = %s = %s", (const char*) name, (const char*) macaddr.toString(), (const char*) ip ); 345 odebug << "addService '" << (const char*) name << "', Server = " << (const char*) macaddr.toString() << " = " << (const char*) ip << "" << oendl;
347 346
348 //TODO: Refactor that out, we need it all over the place. 347 //TODO: Refactor that out, we need it all over the place.
349 // Best to do it in a more comfortable abstraction in OListView 348 // Best to do it in a more comfortable abstraction in OListView
@@ -360,7 +359,7 @@ void MScanListView::addService( const QString& name, const OMacAddress& macaddr,
360 while ( subitem && ( subitem->text( col_essid ) != name ) ) 359 while ( subitem && ( subitem->text( col_essid ) != name ) )
361 { 360 {
362 #ifdef DEBUG 361 #ifdef DEBUG
363 qDebug( "subitemtext: %s", (const char*) subitem->text( col_essid ) ); 362 odebug << "subitemtext: " << (const char*) subitem->text( col_essid ) << "" << oendl;
364 #endif 363 #endif
365 subitem = static_cast<MScanListItem*> ( subitem->nextSibling() ); 364 subitem = static_cast<MScanListItem*> ( subitem->nextSibling() );
366 } 365 }
@@ -369,7 +368,7 @@ void MScanListView::addService( const QString& name, const OMacAddress& macaddr,
369 { 368 {
370 // we have already seen this item, it's a dupe 369 // we have already seen this item, it's a dupe
371 #ifdef DEBUG 370 #ifdef DEBUG
372 qDebug( "%s is a dupe - ignoring...", (const char*) name ); 371 odebug << "" << (const char*) name << " is a dupe - ignoring..." << oendl;
373 #endif 372 #endif
374 subitem->receivedBeacon(); //FIXME: sent data bit 373 subitem->receivedBeacon(); //FIXME: sent data bit
375 return; 374 return;
@@ -383,7 +382,7 @@ void MScanListView::addService( const QString& name, const OMacAddress& macaddr,
383 return; 382 return;
384 } 383 }
385 } 384 }
386 qDebug( "D'oh! Received identification, but item not yet in list... ==> Handle this!" ); 385 odebug << "D'oh! Received identification, but item not yet in list... ==> Handle this!" << oendl;
387 MLogWindow::logwindow()->log( QString().sprintf( "WARNING: Unhandled service addition %s = %s!", 386 MLogWindow::logwindow()->log( QString().sprintf( "WARNING: Unhandled service addition %s = %s!",
388 (const char*) macaddr.toString(), (const char*) ip ) ); 387 (const char*) macaddr.toString(), (const char*) ip ) );
389} 388}
@@ -421,7 +420,7 @@ MScanListItem::MScanListItem( QListView* parent, const QString& type, const QStr
421 _channel( channel ), _signal( signal ), _beacons( 1 ) 420 _channel( channel ), _signal( signal ), _beacons( 1 )
422{ 421{
423 #ifdef DEBUG 422 #ifdef DEBUG
424 qDebug( "creating scanlist item" ); 423 odebug << "creating scanlist item" << oendl;
425 #endif 424 #endif
426 425
427 if ( WellenreiterConfigWindow::instance() ) 426 if ( WellenreiterConfigWindow::instance() )
@@ -435,7 +434,7 @@ MScanListItem::MScanListItem( QListViewItem* parent, const QString& type, const
435 :OListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ) 434 :OListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null )
436{ 435{
437 #ifdef DEBUG 436 #ifdef DEBUG
438 qDebug( "creating scanlist item" ); 437 odebug << "creating scanlist item" << oendl;
439 #endif 438 #endif
440 if ( WellenreiterConfigWindow::instance() ) 439 if ( WellenreiterConfigWindow::instance() )
441 WellenreiterConfigWindow::instance()->performAction( type, essid, macaddr, wep, channel, signal ); // better use signal/slot combination here 440 WellenreiterConfigWindow::instance()->performAction( type, essid, macaddr, wep, channel, signal ); // better use signal/slot combination here
@@ -459,7 +458,7 @@ OListViewItem* MScanListItem::childFactory()
459void MScanListItem::serializeTo( QDataStream& s ) const 458void MScanListItem::serializeTo( QDataStream& s ) const
460{ 459{
461 #ifdef DEBUG 460 #ifdef DEBUG
462 qDebug( "serializing MScanListItem" ); 461 odebug << "serializing MScanListItem" << oendl;
463 #endif 462 #endif
464 OListViewItem::serializeTo( s ); 463 OListViewItem::serializeTo( s );
465 464
@@ -470,7 +469,7 @@ void MScanListItem::serializeTo( QDataStream& s ) const
470void MScanListItem::serializeFrom( QDataStream& s ) 469void MScanListItem::serializeFrom( QDataStream& s )
471{ 470{
472 #ifdef DEBUG 471 #ifdef DEBUG
473 qDebug( "serializing MScanListItem" ); 472 odebug << "serializing MScanListItem" << oendl;
474 #endif 473 #endif
475 OListViewItem::serializeFrom( s ); 474 OListViewItem::serializeFrom( s );
476 475
@@ -556,7 +555,7 @@ void MScanListItem::receivedBeacon()
556{ 555{
557 _beacons++; 556 _beacons++;
558 #ifdef DEBUG 557 #ifdef DEBUG
559 qDebug( "MScanListItem %s: received beacon #%d", (const char*) _macaddr, _beacons ); 558 odebug << "MScanListItem " << (const char*) _macaddr << ": received beacon #" << _beacons << "" << oendl;
560 #endif 559 #endif
561 setText( col_sig, QString::number( _beacons ) ); 560 setText( col_sig, QString::number( _beacons ) );
562 setText( col_lastseen, QTime::currentTime().toString() ); 561 setText( col_lastseen, QTime::currentTime().toString() );
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp
index fff7c35..fad6efd 100644
--- a/noncore/net/wellenreiter/gui/wellenreiter.cpp
+++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp
@@ -11,8 +11,6 @@
11** 11**
12***********************************************************************/ 12***********************************************************************/
13 13
14// Local
15
16#include "gps.h" 14#include "gps.h"
17#include "wellenreiter.h" 15#include "wellenreiter.h"
18#include "scanlist.h" 16#include "scanlist.h"
@@ -23,10 +21,10 @@
23#include "graphwindow.h" 21#include "graphwindow.h"
24#include "protolistview.h" 22#include "protolistview.h"
25 23
26// Opie 24/* OPIE */
27
28#ifdef QWS 25#ifdef QWS
29#include <opie2/oapplication.h> 26#include <opie2/oapplication.h>
27#include <opie2/odebug.h>
30#include <opie2/odevice.h> 28#include <opie2/odevice.h>
31#else 29#else
32#include <qapplication.h> 30#include <qapplication.h>
@@ -35,10 +33,11 @@
35#include <opie2/onetwork.h> 33#include <opie2/onetwork.h>
36#include <opie2/opcap.h> 34#include <opie2/opcap.h>
37#include <qpe/qcopenvelope_qws.h> 35#include <qpe/qcopenvelope_qws.h>
38using namespace Opie; 36using namespace Opie::Core;
39 37using namespace Opie::Net;
40// Qt 38using namespace Opie::Ui;
41 39
40/* QT */
42#include <qcheckbox.h> 41#include <qcheckbox.h>
43#include <qcombobox.h> 42#include <qcombobox.h>
44#include <qdatetime.h> 43#include <qdatetime.h>
@@ -52,8 +51,7 @@ using namespace Opie;
52#include <qtoolbutton.h> 51#include <qtoolbutton.h>
53#include <qmainwindow.h> 52#include <qmainwindow.h>
54 53
55// Standard 54/* STD */
56
57#include <assert.h> 55#include <assert.h>
58#include <errno.h> 56#include <errno.h>
59#include <unistd.h> 57#include <unistd.h>
@@ -61,12 +59,6 @@ using namespace Opie;
61#include <sys/types.h> 59#include <sys/types.h>
62#include <stdlib.h> 60#include <stdlib.h>
63 61
64using namespace Opie::Core;
65using namespace Opie::Net;
66using namespace Opie::Net;
67using namespace Opie::Core;
68using namespace Opie::Net;
69using namespace Opie::Core;
70Wellenreiter::Wellenreiter( QWidget* parent ) 62Wellenreiter::Wellenreiter( QWidget* parent )
71 : WellenreiterBase( parent, 0, 0 ), 63 : WellenreiterBase( parent, 0, 0 ),
72 sniffing( false ), iface( 0 ), configwindow( 0 ) 64 sniffing( false ), iface( 0 ), configwindow( 0 )
@@ -106,7 +98,7 @@ Wellenreiter::~Wellenreiter()
106 98
107void Wellenreiter::initialTimer() 99void Wellenreiter::initialTimer()
108{ 100{
109 qDebug( "Wellenreiter::preloading manufacturer database..." ); 101 odebug << "Wellenreiter::preloading manufacturer database..." << oendl;
110 OManufacturerDB::instance(); 102 OManufacturerDB::instance();
111} 103}
112 104
@@ -149,12 +141,12 @@ void Wellenreiter::handleNotification( OPacket* p )
149 if ( configwindow->parsePackets->isProtocolChecked( name ) ) 141 if ( configwindow->parsePackets->isProtocolChecked( name ) )
150 { 142 {
151 QString action = configwindow->parsePackets->protocolAction( name ); 143 QString action = configwindow->parsePackets->protocolAction( name );
152 qDebug( "parsePacket-action for '%s' seems to be '%s'", (const char*) name, (const char*) action ); 144 odebug << "parsePacket-action for '" << (const char*) name << "' seems to be '" << (const char*) action << "'" << oendl;
153 doAction( action, name, p ); 145 doAction( action, name, p );
154 } 146 }
155 else 147 else
156 { 148 {
157 qDebug( "protocol '%s' not checked in parsePackets.", (const char*) name ); 149 odebug << "protocol '" << (const char*) name << "' not checked in parsePackets." << oendl;
158 } 150 }
159 ++it; 151 ++it;
160 } 152 }
@@ -166,7 +158,7 @@ void Wellenreiter::handleManagementFrame( OPacket* p, OWaveLanManagementPacket*
166 if ( manage->managementType() == "Beacon" ) handleManagementFrameBeacon( p, manage ); 158 if ( manage->managementType() == "Beacon" ) handleManagementFrameBeacon( p, manage );
167 else if ( manage->managementType() == "ProbeRequest" ) handleManagementFrameProbeRequest( p, manage ); 159 else if ( manage->managementType() == "ProbeRequest" ) handleManagementFrameProbeRequest( p, manage );
168 else if ( manage->managementType() == "ProbeResponse" ) handleManagementFrameProbeResponse( p, manage ); 160 else if ( manage->managementType() == "ProbeResponse" ) handleManagementFrameProbeResponse( p, manage );
169 else qWarning( "Wellenreiter::handleManagementFrame(): '%s' - please handle me!", (const char*) manage->managementType() ); 161 else owarn << "Wellenreiter::handleManagementFrame(): '" << (const char*) manage->managementType() << "' - please handle me!" << oendl;
170} 162}
171 163
172 164
@@ -182,14 +174,14 @@ void Wellenreiter::handleManagementFrameProbeRequest( OPacket* p, OWaveLanManage
182 if ( configwindow->enableGPS->isChecked() ) 174 if ( configwindow->enableGPS->isChecked() )
183 { 175 {
184 // TODO: add check if GPS is working!? 176 // TODO: add check if GPS is working!?
185 qDebug( "Wellenreiter::gathering GPS data..." ); 177 odebug << "Wellenreiter::gathering GPS data..." << oendl;
186 loc = gps->position(); 178 loc = gps->position();
187 qDebug( "Wellenreiter::GPS data received is ( %f , %f ) - dms string = '%s'", loc.latitude(), loc.longitude(), loc.dmsPosition().latin1() ); 179 odebug << "Wellenreiter::GPS data received is ( " << loc.latitude() << " , " << loc.longitude() << " ) - dms string = '" << loc.dmsPosition().latin1() << "'" << oendl;
188 } 180 }
189 181
190 if ( essid.length() ) 182 if ( essid.length() )
191 netView()->addNewItem( "adhoc", essid, header->macAddress2(), false /* should check FrameControl field */, -1, 0, loc, true /* only probed */ ); 183 netView()->addNewItem( "adhoc", essid, header->macAddress2(), false /* should check FrameControl field */, -1, 0, loc, true /* only probed */ );
192 qDebug( "Wellenreiter::invalid frame [possibly noise] detected!" ); 184 odebug << "Wellenreiter::invalid frame [possibly noise] detected!" << oendl;
193} 185}
194 186
195 187
@@ -211,7 +203,7 @@ void Wellenreiter::handleManagementFrameBeacon( OPacket* p, OWaveLanManagementPa
211 } 203 }
212 else 204 else
213 { 205 {
214 qWarning( "Wellenreiter::invalid frame [possibly noise] detected!" ); 206 owarn << "Wellenreiter::invalid frame [possibly noise] detected!" << oendl;
215 return; 207 return;
216 } 208 }
217 209
@@ -226,9 +218,9 @@ void Wellenreiter::handleManagementFrameBeacon( OPacket* p, OWaveLanManagementPa
226 if ( configwindow->enableGPS->isChecked() ) 218 if ( configwindow->enableGPS->isChecked() )
227 { 219 {
228 // TODO: add check if GPS is working!? 220 // TODO: add check if GPS is working!?
229 qDebug( "Wellenreiter::gathering GPS data..." ); 221 odebug << "Wellenreiter::gathering GPS data..." << oendl;
230 loc = gps->position(); 222 loc = gps->position();
231 qDebug( "Wellenreiter::GPS data received is ( %f , %f ) - dms string = '%s'", loc.latitude(), loc.longitude(), loc.dmsPosition().latin1() ); 223 odebug << "Wellenreiter::GPS data received is ( " << loc.latitude() << " , " << loc.longitude() << " ) - dms string = '" << loc.dmsPosition().latin1() << "'" << oendl;
232 } 224 }
233 225
234 netView()->addNewItem( type, essid, header->macAddress2(), beacon->canPrivacy(), channel, 0, loc ); 226 netView()->addNewItem( type, essid, header->macAddress2(), beacon->canPrivacy(), channel, 0, loc );
@@ -255,7 +247,7 @@ void Wellenreiter::handleControlFrame( OPacket* p, OWaveLanControlPacket* contro
255 } 247 }
256 else 248 else
257 { 249 {
258 qDebug( "Wellenreiter::handleControlFrame - please handle %s in a future version! :D", (const char*) control->controlType() ); 250 odebug << "Wellenreiter::handleControlFrame - please handle " << (const char*) control->controlType() << " in a future version! :D" << oendl;
259 } 251 }
260} 252}
261 253
@@ -304,7 +296,7 @@ void Wellenreiter::handleARPData( OPacket* p, OARPPacket*, OMacAddress& source,
304 OARPPacket* arp = (OARPPacket*) p->child( "ARP" ); 296 OARPPacket* arp = (OARPPacket*) p->child( "ARP" );
305 if ( arp ) 297 if ( arp )
306 { 298 {
307 qDebug( "Received ARP traffic (type '%s'): ", (const char*) arp->type() ); 299 odebug << "Received ARP traffic (type '" << (const char*) arp->type() << "'): " << oendl;
308 if ( arp->type() == "REQUEST" ) 300 if ( arp->type() == "REQUEST" )
309 { 301 {
310 netView()->identify( arp->senderMacAddress(), arp->senderIPV4Address().toString() ); 302 netView()->identify( arp->senderMacAddress(), arp->senderIPV4Address().toString() );
@@ -325,16 +317,16 @@ void Wellenreiter::handleIPData( OPacket* p, OIPPacket* ip, OMacAddress& source,
325 ODHCPPacket* dhcp = (ODHCPPacket*) p->child( "DHCP" ); 317 ODHCPPacket* dhcp = (ODHCPPacket*) p->child( "DHCP" );
326 if ( dhcp ) 318 if ( dhcp )
327 { 319 {
328 qDebug( "Received DHCP '%s' packet", (const char*) dhcp->type() ); 320 odebug << "Received DHCP '" << (const char*) dhcp->type() << "' packet" << oendl;
329 if ( dhcp->type() == "OFFER" ) 321 if ( dhcp->type() == "OFFER" )
330 { 322 {
331 qDebug( "DHCP: '%s' ('%s') seems to be a DHCP server.", (const char*) source.toString(), (const char*) dhcp->serverAddress().toString() ); 323 odebug << "DHCP: '" << (const char*) source.toString() << "' ('" << (const char*) dhcp->serverAddress().toString() << "') seems to be a DHCP server." << oendl;
332 netView()->identify( source, dhcp->serverAddress().toString() ); 324 netView()->identify( source, dhcp->serverAddress().toString() );
333 netView()->addService( "DHCP", source, dhcp->serverAddress().toString() ); 325 netView()->addService( "DHCP", source, dhcp->serverAddress().toString() );
334 } 326 }
335 else if ( dhcp->type() == "ACK" ) 327 else if ( dhcp->type() == "ACK" )
336 { 328 {
337 qDebug( "DHCP: '%s' ('%s') accepted the offered DHCP address.", (const char*) dhcp->clientMacAddress().toString(), (const char*) dhcp->yourAddress().toString() ); 329 odebug << "DHCP: '" << (const char*) dhcp->clientMacAddress().toString() << "' ('" << (const char*) dhcp->yourAddress().toString() << "') accepted the offered DHCP address." << oendl;
338 netView()->identify( dhcp->clientMacAddress(), dhcp->yourAddress().toString() ); 330 netView()->identify( dhcp->clientMacAddress(), dhcp->yourAddress().toString() );
339 } 331 }
340 } 332 }
@@ -368,7 +360,7 @@ bool Wellenreiter::checkDumpPacket( OPacket* p )
368 if ( configwindow->capturePackets->isProtocolChecked( name ) ) 360 if ( configwindow->capturePackets->isProtocolChecked( name ) )
369 { 361 {
370 QString action = configwindow->capturePackets->protocolAction( name ); 362 QString action = configwindow->capturePackets->protocolAction( name );
371 qDebug( "capturePackets-action for '%s' seems to be '%s'", (const char*) name, (const char*) action ); 363 odebug << "capturePackets-action for '" << (const char*) name << "' seems to be '" << (const char*) action << "'" << oendl;
372 if ( action == "Discard" ) 364 if ( action == "Discard" )
373 { 365 {
374 logwindow->log( QString().sprintf( "(i) dump-discarding of '%s' packet requested.", (const char*) name ) ); 366 logwindow->log( QString().sprintf( "(i) dump-discarding of '%s' packet requested.", (const char*) name ) );
@@ -377,7 +369,7 @@ bool Wellenreiter::checkDumpPacket( OPacket* p )
377 } 369 }
378 else 370 else
379 { 371 {
380 qDebug( "protocol '%s' not checked in capturePackets.", (const char*) name ); 372 odebug << "protocol '" << (const char*) name << "' not checked in capturePackets." << oendl;
381 } 373 }
382 ++it; 374 ++it;
383 } 375 }
@@ -551,7 +543,7 @@ void Wellenreiter::startClicked()
551 case DEVTYPE_HOSTAP: iface->setMonitoring( new OHostAPMonitoringInterface( iface, usePrism ) ); break; 543 case DEVTYPE_HOSTAP: iface->setMonitoring( new OHostAPMonitoringInterface( iface, usePrism ) ); break;
552 case DEVTYPE_ORINOCO: iface->setMonitoring( new OOrinocoMonitoringInterface( iface, usePrism ) ); break; 544 case DEVTYPE_ORINOCO: iface->setMonitoring( new OOrinocoMonitoringInterface( iface, usePrism ) ); break;
553 case DEVTYPE_MANUAL: QMessageBox::information( this, "Wellenreiter II", tr( "Bring your device into\nmonitor mode now." ) ); break; 545 case DEVTYPE_MANUAL: QMessageBox::information( this, "Wellenreiter II", tr( "Bring your device into\nmonitor mode now." ) ); break;
554 case DEVTYPE_FILE: qDebug( "Wellenreiter: Capturing from file '%s'", (const char*) interface ); break; 546 case DEVTYPE_FILE: odebug << "Wellenreiter: Capturing from file '" << (const char*) interface << "'" << oendl; break;
555 default: assert( 0 ); // shouldn't reach this 547 default: assert( 0 ); // shouldn't reach this
556 } 548 }
557 549
@@ -572,7 +564,7 @@ void Wellenreiter::startClicked()
572 // open GPS device 564 // open GPS device
573 if ( configwindow->enableGPS->isChecked() ) 565 if ( configwindow->enableGPS->isChecked() )
574 { 566 {
575 qDebug( "Wellenreiter:GPS enabled @ %s:%d", (const char*) configwindow->gpsdHost->currentText(), configwindow->gpsdPort->value() ); 567 odebug << "Wellenreiter:GPS enabled @ " << (const char*) configwindow->gpsdHost->currentText() << ":" << configwindow->gpsdPort->value() << "" << oendl;
576 gps->open( configwindow->gpsdHost->currentText(), configwindow->gpsdPort->value() ); 568 gps->open( configwindow->gpsdHost->currentText(), configwindow->gpsdPort->value() );
577 } 569 }
578 570
@@ -596,7 +588,7 @@ void Wellenreiter::startClicked()
596 else 588 else
597 pcap->open( QFile( interface ) ); 589 pcap->open( QFile( interface ) );
598 590
599 qDebug( "Wellenreiter:: dumping to %s", (const char*) dumpname ); 591 odebug << "Wellenreiter:: dumping to " << (const char*) dumpname << "" << oendl;
600 pcap->openDumpFile( dumpname ); 592 pcap->openDumpFile( dumpname );
601 593
602 if ( !pcap->isOpen() ) 594 if ( !pcap->isOpen() )
@@ -652,7 +644,7 @@ void Wellenreiter::startClicked()
652 644
653void Wellenreiter::timerEvent( QTimerEvent* ) 645void Wellenreiter::timerEvent( QTimerEvent* )
654{ 646{
655 qDebug( "Wellenreiter::timerEvent()" ); 647 odebug << "Wellenreiter::timerEvent()" << oendl;
656 OPacket* p = pcap->next(); 648 OPacket* p = pcap->next();
657 if ( !p ) // no more packets available 649 if ( !p ) // no more packets available
658 { 650 {
@@ -715,15 +707,15 @@ void Wellenreiter::joinNetwork(const QString& type, const QString& essid, int ch
715 707
716 QCopEnvelope msg( "QPE/Application/networksettings", "wlan(QString,QString,QString)" ); 708 QCopEnvelope msg( "QPE/Application/networksettings", "wlan(QString,QString,QString)" );
717 int count = 3; 709 int count = 3;
718 qDebug("sending %d messages",count); 710 odebug << "sending " << count << " messages" << oendl;
719 msg << QString("count") << QString::number(count); 711 msg << QString("count") << QString::number(count);
720 qDebug("msg >%s< Mode >%s<", iface->name(),type.latin1() ); 712 odebug << "msg >" << iface->name() << "< Mode >" << type.latin1() << "<" << oendl;
721 msg << QString(iface->name()) << QString("Mode") << type; 713 msg << QString(iface->name()) << QString("Mode") << type;
722 qDebug("msg >%s< essid >%s<", iface->name(),essid.latin1()); 714 odebug << "msg >" << iface->name() << "< essid >" << essid.latin1() << "<" << oendl;
723 msg << QString(iface->name()) << QString("ESSID") << essid; 715 msg << QString(iface->name()) << QString("ESSID") << essid;
724 qDebug("msg >%s< channel >%d<", iface->name(),channel); 716 odebug << "msg >" << iface->name() << "< channel >" << channel << "<" << oendl;
725 msg << QString(iface->name()) << QString("Channel") << channel; 717 msg << QString(iface->name()) << QString("Channel") << channel;
726// qDebug("msg >%s< mac >%s<", iface->name(),macaddr); 718// odebug << "msg >" << iface->name() << "< mac >" << macaddr << "<" << oendl;
727// msg << QString(iface->name()) << QString("MacAddr") << macaddr; 719// msg << QString(iface->name()) << QString("MacAddr") << macaddr;
728 #else 720 #else
729 QMessageBox::warning( this, tr( "Can't do that!" ), tr( "Function only available on Embedded build" ) ); 721 QMessageBox::warning( this, tr( "Can't do that!" ), tr( "Function only available on Embedded build" ) );