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
@@ -113,6 +113,10 @@
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>
@@ -459,6 +463,10 @@
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>
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
@@ -46,6 +46,7 @@ int main( int argc, char **argv )
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
@@ -65,6 +66,8 @@ int main( int argc, char **argv )
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 );
@@ -89,11 +92,23 @@ int main( int argc, char **argv )
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
@@ -135,8 +135,9 @@ WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * n
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 );
@@ -215,6 +216,8 @@ WellenreiterMainWindow::~WellenreiterMainWindow()
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 );
@@ -359,3 +362,5 @@ void WellenreiterMainWindow::closeEvent( QCloseEvent* e )
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
@@ -84,7 +84,7 @@ void ProtocolListView::addProtocol( const QString& 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" );
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
@@ -403,12 +403,19 @@ void Wellenreiter::startClicked()
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 )
@@ -430,7 +437,7 @@ void Wellenreiter::startClicked()
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 }
@@ -461,7 +468,7 @@ void Wellenreiter::startClicked()
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
@@ -530,3 +537,4 @@ void Wellenreiter::doAction( const QString& action, const QString& protocol, OPa
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
@@ -48,6 +48,7 @@ class Wellenreiter : public WellenreiterBase {
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: