summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/configbase.ui8
-rw-r--r--noncore/net/wellenreiter/gui/main.cpp17
-rw-r--r--noncore/net/wellenreiter/gui/mainwindow.cpp9
-rw-r--r--noncore/net/wellenreiter/gui/protolistview.cpp2
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiter.cpp16
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiter.h1
6 files changed, 45 insertions, 8 deletions
diff --git a/noncore/net/wellenreiter/gui/configbase.ui b/noncore/net/wellenreiter/gui/configbase.ui
index 422826a..590ca92 100644
--- a/noncore/net/wellenreiter/gui/configbase.ui
+++ b/noncore/net/wellenreiter/gui/configbase.ui
@@ -110,12 +110,16 @@
110 <class>QGroupBox</class> 110 <class>QGroupBox</class>
111 <property stdset="1"> 111 <property stdset="1">
112 <name>name</name> 112 <name>name</name>
113 <cstring>GroupBox1</cstring> 113 <cstring>GroupBox1</cstring>
114 </property> 114 </property>
115 <property stdset="1"> 115 <property stdset="1">
116 <name>enabled</name>
117 <bool>false</bool>
118 </property>
119 <property stdset="1">
116 <name>title</name> 120 <name>title</name>
117 <string>Scan on channel</string> 121 <string>Scan on channel</string>
118 </property> 122 </property>
119 <property> 123 <property>
120 <name>layoutMargin</name> 124 <name>layoutMargin</name>
121 </property> 125 </property>
@@ -456,12 +460,16 @@
456 <class>QCheckBox</class> 460 <class>QCheckBox</class>
457 <property stdset="1"> 461 <property stdset="1">
458 <name>name</name> 462 <name>name</name>
459 <cstring>adaptiveHopping</cstring> 463 <cstring>adaptiveHopping</cstring>
460 </property> 464 </property>
461 <property stdset="1"> 465 <property stdset="1">
466 <name>enabled</name>
467 <bool>false</bool>
468 </property>
469 <property stdset="1">
462 <name>text</name> 470 <name>text</name>
463 <string>Use Adaptive(TM) Hop Scheme</string> 471 <string>Use Adaptive(TM) Hop Scheme</string>
464 </property> 472 </property>
465 </widget> 473 </widget>
466 </grid> 474 </grid>
467 </widget> 475 </widget>
diff --git a/noncore/net/wellenreiter/gui/main.cpp b/noncore/net/wellenreiter/gui/main.cpp
index 96ebb3f..55a5260 100644
--- a/noncore/net/wellenreiter/gui/main.cpp
+++ b/noncore/net/wellenreiter/gui/main.cpp
@@ -43,12 +43,13 @@ int main( int argc, char **argv )
43 #endif 43 #endif
44 WellenreiterMainWindow* w = new WellenreiterMainWindow(); 44 WellenreiterMainWindow* w = new WellenreiterMainWindow();
45 #ifdef QWS 45 #ifdef QWS
46 a.showMainWidget( w ); 46 a.showMainWidget( w );
47 #else 47 #else
48 a.setMainWidget( w ); 48 a.setMainWidget( w );
49 w->setCaption( "Wellenreiter II" );
49 w->show(); 50 w->show();
50 #endif 51 #endif
51 52
52 a.processEvents(); // show the window before doing the safety checks 53 a.processEvents(); // show the window before doing the safety checks
53 int result = -1; 54 int result = -1;
54 55
@@ -62,12 +63,14 @@ int main( int argc, char **argv )
62 if ( result == QMessageBox::No ) return -1; 63 if ( result == QMessageBox::No ) return -1;
63 } 64 }
64 65
65 // dhcp check - NOT HERE! This really belongs as a static member to OProcess 66 // dhcp check - NOT HERE! This really belongs as a static member to OProcess
66 // and I want to call it like that: if ( OProcess::isRunning( QString& ) ) ... 67 // and I want to call it like that: if ( OProcess::isRunning( QString& ) ) ...
67 68
69 static int killed = false;
70
68 QString line; 71 QString line;
69 QDir d = QDir( "/proc" ); 72 QDir d = QDir( "/proc" );
70 QStringList dirs = d.entryList( QDir::Dirs ); 73 QStringList dirs = d.entryList( QDir::Dirs );
71 QStringList::Iterator it; 74 QStringList::Iterator it;
72 for ( it = dirs.begin(); it != dirs.end(); ++it ) 75 for ( it = dirs.begin(); it != dirs.end(); ++it )
73 { 76 {
@@ -86,14 +89,26 @@ int main( int argc, char **argv )
86 result = QMessageBox::warning( w, " - Wellenreiter II - (dhcp)", QObject::tr( "You have a dhcp client running.\n" 89 result = QMessageBox::warning( w, " - Wellenreiter II - (dhcp)", QObject::tr( "You have a dhcp client running.\n"
87 "This can severly limit scanning!\nShould I kill it for you?" ), 90 "This can severly limit scanning!\nShould I kill it for you?" ),
88 QMessageBox::Yes, QMessageBox::No ); 91 QMessageBox::Yes, QMessageBox::No );
89 if ( result == QMessageBox::Yes ) 92 if ( result == QMessageBox::Yes )
90 { 93 {
91 if ( -1 == ::kill( (*it).toInt(), SIGTERM ) ) 94 if ( -1 == ::kill( (*it).toInt(), SIGTERM ) )
92 qWarning( "Wellenreiter: can't kill process (%s)", result, strerror( errno ) ); 95 qWarning( "Wellenreiter: can't kill process #%d (%s)", result, strerror( errno ) );
96 else
97 killed = true;
93 } 98 }
94 } 99 }
95 100
96 a.exec(); 101 a.exec();
102
103 if ( killed )
104 {
105 result = QMessageBox::warning( w, " - Wellenreiter II - (dhcp)", QObject::tr( "Restart your dhcp client?" ), QMessageBox::Yes, QMessageBox::No );
106 if ( result == QMessageBox::Yes )
107 {
108 system( QString().sprintf( "dhclient &; udhcpcd &; dhcpcd &" ) );
109 }
110 }
111
97 delete w; 112 delete w;
98 return 0; 113 return 0;
99} 114}
diff --git a/noncore/net/wellenreiter/gui/mainwindow.cpp b/noncore/net/wellenreiter/gui/mainwindow.cpp
index 7241f7a..3e36f5b 100644
--- a/noncore/net/wellenreiter/gui/mainwindow.cpp
+++ b/noncore/net/wellenreiter/gui/mainwindow.cpp
@@ -132,14 +132,15 @@ WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * n
132 demo->insertItem( tr( "&Add something" ), this, SLOT( demoAddStations() ) ); 132 demo->insertItem( tr( "&Add something" ), this, SLOT( demoAddStations() ) );
133 133
134 id = mb->insertItem( tr( "&File" ), file ); 134 id = mb->insertItem( tr( "&File" ), file );
135 //id = mb->insertItem( tr( "&View" ), view ); 135 //id = mb->insertItem( tr( "&View" ), view );
136 //mb->setItemEnabled( id, false ); 136 //mb->setItemEnabled( id, false );
137 id = mb->insertItem( tr( "&Sniffer" ), sniffer ); 137 id = mb->insertItem( tr( "&Sniffer" ), sniffer );
138 //id = mb->insertItem( tr( "&Demo" ), demo ); 138
139 //mb->setItemEnabled( id, true ); 139 id = mb->insertItem( tr( "&Demo" ), demo );
140 mb->setItemEnabled( id, true );
140 141
141 #ifdef QWS 142 #ifdef QWS
142 mb->insertItem( startButton ); 143 mb->insertItem( startButton );
143 mb->insertItem( stopButton ); 144 mb->insertItem( stopButton );
144 mb->insertItem( c ); 145 mb->insertItem( c );
145 mb->insertItem( d ); 146 mb->insertItem( d );
@@ -212,12 +213,14 @@ WellenreiterMainWindow::~WellenreiterMainWindow()
212 delete startIconSet; 213 delete startIconSet;
213 delete stopIconSet; 214 delete stopIconSet;
214}; 215};
215 216
216void WellenreiterMainWindow::demoAddStations() 217void WellenreiterMainWindow::demoAddStations()
217{ 218{
219 mw = 0;
220
218 mw->netView()->addNewItem( "managed", "Vanille", "00:00:20:EF:A6:43", true, 6, 80 ); 221 mw->netView()->addNewItem( "managed", "Vanille", "00:00:20:EF:A6:43", true, 6, 80 );
219 mw->netView()->addNewItem( "managed", "Vanille", "00:30:6D:EF:A6:23", true, 11, 10 ); 222 mw->netView()->addNewItem( "managed", "Vanille", "00:30:6D:EF:A6:23", true, 11, 10 );
220 mw->netView()->addNewItem( "adhoc", "ELAN", "00:A0:F8:E7:16:22", false, 3, 10 ); 223 mw->netView()->addNewItem( "adhoc", "ELAN", "00:A0:F8:E7:16:22", false, 3, 10 );
221 mw->netView()->addNewItem( "adhoc", "ELAN", "00:AA:01:E7:56:62", false, 3, 15 ); 224 mw->netView()->addNewItem( "adhoc", "ELAN", "00:AA:01:E7:56:62", false, 3, 15 );
222 mw->netView()->addNewItem( "adhoc", "ELAN", "00:B0:8E:E7:56:E2", false, 3, 20 ); 225 mw->netView()->addNewItem( "adhoc", "ELAN", "00:B0:8E:E7:56:E2", false, 3, 20 );
223} 226}
@@ -356,6 +359,8 @@ void WellenreiterMainWindow::closeEvent( QCloseEvent* e )
356 } 359 }
357 else 360 else
358 { 361 {
359 QMainWindow::closeEvent( e ); 362 QMainWindow::closeEvent( e );
360 } 363 }
361} 364}
365
366
diff --git a/noncore/net/wellenreiter/gui/protolistview.cpp b/noncore/net/wellenreiter/gui/protolistview.cpp
index f4b45d0..daca095 100644
--- a/noncore/net/wellenreiter/gui/protolistview.cpp
+++ b/noncore/net/wellenreiter/gui/protolistview.cpp
@@ -81,13 +81,13 @@ void ProtocolListView::addProtocol( const QString& name )
81 if ( parse ) 81 if ( parse )
82 { 82 {
83 QComboBox* combo = new QComboBox( hbox, (const char*) name ); 83 QComboBox* combo = new QComboBox( hbox, (const char*) name );
84 #ifdef QWS 84 #ifdef QWS
85 combo->setFixedWidth( 75 ); 85 combo->setFixedWidth( 75 );
86 #endif 86 #endif
87 combo->insertItem( "Ignore" ); 87 combo->insertItem( "Pass" );
88 combo->insertItem( "Discard!" ); 88 combo->insertItem( "Discard!" );
89 combo->insertItem( "TouchSound" ); 89 combo->insertItem( "TouchSound" );
90 combo->insertItem( "AlarmSound" ); 90 combo->insertItem( "AlarmSound" );
91 combo->insertItem( "KeySound" ); 91 combo->insertItem( "KeySound" );
92 combo->insertItem( "LedOn" ); 92 combo->insertItem( "LedOn" );
93 combo->insertItem( "LedOff" ); 93 combo->insertItem( "LedOff" );
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp
index 965f6b0..4257be1 100644
--- a/noncore/net/wellenreiter/gui/wellenreiter.cpp
+++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp
@@ -400,18 +400,25 @@ void Wellenreiter::startClicked()
400 QMessageBox::information( this, "Wellenreiter II", 400 QMessageBox::information( this, "Wellenreiter II",
401 tr( "Your device is not\nproperly configured. Please reconfigure!" ) ); 401 tr( "Your device is not\nproperly configured. Please reconfigure!" ) );
402 return; 402 return;
403 } 403 }
404 404
405 // configure device 405 // configure device
406
407 ONetwork* net = ONetwork::instance(); 406 ONetwork* net = ONetwork::instance();
408 iface = static_cast<OWirelessNetworkInterface*>(net->interface( interface )); 407 iface = static_cast<OWirelessNetworkInterface*>(net->interface( interface ));
409 408
410 // set monitor mode 409 // bring device UP
410 iface->setUp( true );
411 if ( !iface->isUp() )
412 {
413 QMessageBox::warning( this, "Wellenreiter II",
414 tr( "Can't bring interface '%1' up:\n" ).arg( iface->name() ) + strerror( errno ) );
415 return;
416 }
411 417
418 // set monitor mode
412 bool usePrism = configwindow->usePrismHeader(); 419 bool usePrism = configwindow->usePrismHeader();
413 420
414 switch ( cardtype ) 421 switch ( cardtype )
415 { 422 {
416 case DEVTYPE_CISCO: iface->setMonitoring( new OCiscoMonitoringInterface( iface, usePrism ) ); break; 423 case DEVTYPE_CISCO: iface->setMonitoring( new OCiscoMonitoringInterface( iface, usePrism ) ); break;
417 case DEVTYPE_WLAN_NG: iface->setMonitoring( new OWlanNGMonitoringInterface( iface, usePrism ) ); break; 424 case DEVTYPE_WLAN_NG: iface->setMonitoring( new OWlanNGMonitoringInterface( iface, usePrism ) ); break;
@@ -427,13 +434,13 @@ void Wellenreiter::startClicked()
427 { 434 {
428 if ( cardtype != DEVTYPE_MANUAL ) 435 if ( cardtype != DEVTYPE_MANUAL )
429 iface->setMonitorMode( true ); 436 iface->setMonitorMode( true );
430 if ( !iface->monitorMode() ) 437 if ( !iface->monitorMode() )
431 { 438 {
432 QMessageBox::warning( this, "Wellenreiter II", 439 QMessageBox::warning( this, "Wellenreiter II",
433 tr( "Can't set device into monitor mode." ) ); 440 tr( "Can't set interface '%1' into monitor mode:\n" ).arg( iface->name() ) + strerror( errno ) );
434 return; 441 return;
435 } 442 }
436 } 443 }
437 444
438 // open pcap and start sniffing 445 // open pcap and start sniffing
439 if ( cardtype != DEVTYPE_FILE ) 446 if ( cardtype != DEVTYPE_FILE )
@@ -458,13 +465,13 @@ void Wellenreiter::startClicked()
458 pcap->open( QFile( interface ) ); 465 pcap->open( QFile( interface ) );
459 } 466 }
460 467
461 if ( !pcap->isOpen() ) 468 if ( !pcap->isOpen() )
462 { 469 {
463 QMessageBox::warning( this, "Wellenreiter II", 470 QMessageBox::warning( this, "Wellenreiter II",
464 tr( "Can't open packet capturer:\n" ) + QString(strerror( errno ) )); 471 tr( "Can't open packet capturer for '%1':\n" ).arg( iface->name() ) + QString(strerror( errno ) ));
465 return; 472 return;
466 } 473 }
467 474
468 // set capturer to non-blocking mode 475 // set capturer to non-blocking mode
469 pcap->setBlocking( false ); 476 pcap->setBlocking( false );
470 477
@@ -527,6 +534,7 @@ void Wellenreiter::doAction( const QString& action, const QString& protocol, OPa
527 else if ( action == "LogMessage" ) 534 else if ( action == "LogMessage" )
528 logwindow->log( QString().sprintf( "Got packet with protocol '%s'", (const char*) protocol ) ); 535 logwindow->log( QString().sprintf( "Got packet with protocol '%s'", (const char*) protocol ) );
529 else if ( action == "MessageBox" ) 536 else if ( action == "MessageBox" )
530 QMessageBox::information ( this, "Notification!", 537 QMessageBox::information ( this, "Notification!",
531 QString().sprintf( "Got packet with protocol '%s'", (const char*) protocol ) ); 538 QString().sprintf( "Got packet with protocol '%s'", (const char*) protocol ) );
532} 539}
540
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.h b/noncore/net/wellenreiter/gui/wellenreiter.h
index 37e692c..d776492 100644
--- a/noncore/net/wellenreiter/gui/wellenreiter.h
+++ b/noncore/net/wellenreiter/gui/wellenreiter.h
@@ -45,12 +45,13 @@ class Wellenreiter : public WellenreiterBase {
45 void setConfigWindow( WellenreiterConfigWindow* cw ); 45 void setConfigWindow( WellenreiterConfigWindow* cw );
46 MScanListView* netView() const { return netview; }; 46 MScanListView* netView() const { return netview; };
47 MLogWindow* logWindow() const { return logwindow; }; 47 MLogWindow* logWindow() const { return logwindow; };
48 MHexWindow* hexWindow() const { return hexwindow; }; 48 MHexWindow* hexWindow() const { return hexwindow; };
49 bool isDaemonRunning() const { return sniffing; }; 49 bool isDaemonRunning() const { return sniffing; };
50 50
51 public:
51 bool sniffing; 52 bool sniffing;
52 53
53 protected: 54 protected:
54 virtual void timerEvent( QTimerEvent* ); 55 virtual void timerEvent( QTimerEvent* );
55 56
56 public slots: 57 public slots: