summaryrefslogtreecommitdiff
Side-by-side diff
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 @@
<class>QGroupBox</class>
<property stdset="1">
<name>name</name>
<cstring>GroupBox1</cstring>
</property>
<property stdset="1">
+ <name>enabled</name>
+ <bool>false</bool>
+ </property>
+ <property stdset="1">
<name>title</name>
<string>Scan on channel</string>
</property>
<property>
<name>layoutMargin</name>
</property>
@@ -456,12 +460,16 @@
<class>QCheckBox</class>
<property stdset="1">
<name>name</name>
<cstring>adaptiveHopping</cstring>
</property>
<property stdset="1">
+ <name>enabled</name>
+ <bool>false</bool>
+ </property>
+ <property stdset="1">
<name>text</name>
<string>Use Adaptive(TM) Hop Scheme</string>
</property>
</widget>
</grid>
</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 )
#endif
WellenreiterMainWindow* w = new WellenreiterMainWindow();
#ifdef QWS
a.showMainWidget( w );
#else
a.setMainWidget( w );
+ w->setCaption( "Wellenreiter II" );
w->show();
#endif
a.processEvents(); // show the window before doing the safety checks
int result = -1;
@@ -62,12 +63,14 @@ int main( int argc, char **argv )
if ( result == QMessageBox::No ) return -1;
}
// dhcp check - NOT HERE! This really belongs as a static member to OProcess
// and I want to call it like that: if ( OProcess::isRunning( QString& ) ) ...
+ static int killed = false;
+
QString line;
QDir d = QDir( "/proc" );
QStringList dirs = d.entryList( QDir::Dirs );
QStringList::Iterator it;
for ( it = dirs.begin(); it != dirs.end(); ++it )
{
@@ -86,14 +89,26 @@ int main( int argc, char **argv )
result = QMessageBox::warning( w, " - Wellenreiter II - (dhcp)", QObject::tr( "You have a dhcp client running.\n"
"This can severly limit scanning!\nShould I kill it for you?" ),
QMessageBox::Yes, QMessageBox::No );
if ( result == QMessageBox::Yes )
{
if ( -1 == ::kill( (*it).toInt(), SIGTERM ) )
- qWarning( "Wellenreiter: can't kill process (%s)", result, strerror( errno ) );
+ qWarning( "Wellenreiter: can't kill process #%d (%s)", result, strerror( errno ) );
+ else
+ killed = true;
}
}
a.exec();
+
+ if ( killed )
+ {
+ result = QMessageBox::warning( w, " - Wellenreiter II - (dhcp)", QObject::tr( "Restart your dhcp client?" ), QMessageBox::Yes, QMessageBox::No );
+ if ( result == QMessageBox::Yes )
+ {
+ system( QString().sprintf( "dhclient &; udhcpcd &; dhcpcd &" ) );
+ }
+ }
+
delete w;
return 0;
}
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
demo->insertItem( tr( "&Add something" ), this, SLOT( demoAddStations() ) );
id = mb->insertItem( tr( "&File" ), file );
//id = mb->insertItem( tr( "&View" ), view );
//mb->setItemEnabled( id, false );
id = mb->insertItem( tr( "&Sniffer" ), sniffer );
- //id = mb->insertItem( tr( "&Demo" ), demo );
- //mb->setItemEnabled( id, true );
+
+ id = mb->insertItem( tr( "&Demo" ), demo );
+ mb->setItemEnabled( id, true );
#ifdef QWS
mb->insertItem( startButton );
mb->insertItem( stopButton );
mb->insertItem( c );
mb->insertItem( d );
@@ -212,12 +213,14 @@ WellenreiterMainWindow::~WellenreiterMainWindow()
delete startIconSet;
delete stopIconSet;
};
void WellenreiterMainWindow::demoAddStations()
{
+ mw = 0;
+
mw->netView()->addNewItem( "managed", "Vanille", "00:00:20:EF:A6:43", true, 6, 80 );
mw->netView()->addNewItem( "managed", "Vanille", "00:30:6D:EF:A6:23", true, 11, 10 );
mw->netView()->addNewItem( "adhoc", "ELAN", "00:A0:F8:E7:16:22", false, 3, 10 );
mw->netView()->addNewItem( "adhoc", "ELAN", "00:AA:01:E7:56:62", false, 3, 15 );
mw->netView()->addNewItem( "adhoc", "ELAN", "00:B0:8E:E7:56:E2", false, 3, 20 );
}
@@ -356,6 +359,8 @@ void WellenreiterMainWindow::closeEvent( QCloseEvent* e )
}
else
{
QMainWindow::closeEvent( e );
}
}
+
+
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 )
if ( parse )
{
QComboBox* combo = new QComboBox( hbox, (const char*) name );
#ifdef QWS
combo->setFixedWidth( 75 );
#endif
- combo->insertItem( "Ignore" );
+ combo->insertItem( "Pass" );
combo->insertItem( "Discard!" );
combo->insertItem( "TouchSound" );
combo->insertItem( "AlarmSound" );
combo->insertItem( "KeySound" );
combo->insertItem( "LedOn" );
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()
QMessageBox::information( this, "Wellenreiter II",
tr( "Your device is not\nproperly configured. Please reconfigure!" ) );
return;
}
// configure device
-
ONetwork* net = ONetwork::instance();
iface = static_cast<OWirelessNetworkInterface*>(net->interface( interface ));
- // set monitor mode
+ // bring device UP
+ iface->setUp( true );
+ if ( !iface->isUp() )
+ {
+ QMessageBox::warning( this, "Wellenreiter II",
+ tr( "Can't bring interface '%1' up:\n" ).arg( iface->name() ) + strerror( errno ) );
+ return;
+ }
+ // set monitor mode
bool usePrism = configwindow->usePrismHeader();
switch ( cardtype )
{
case DEVTYPE_CISCO: iface->setMonitoring( new OCiscoMonitoringInterface( iface, usePrism ) ); break;
case DEVTYPE_WLAN_NG: iface->setMonitoring( new OWlanNGMonitoringInterface( iface, usePrism ) ); break;
@@ -427,13 +434,13 @@ void Wellenreiter::startClicked()
{
if ( cardtype != DEVTYPE_MANUAL )
iface->setMonitorMode( true );
if ( !iface->monitorMode() )
{
QMessageBox::warning( this, "Wellenreiter II",
- tr( "Can't set device into monitor mode." ) );
+ tr( "Can't set interface '%1' into monitor mode:\n" ).arg( iface->name() ) + strerror( errno ) );
return;
}
}
// open pcap and start sniffing
if ( cardtype != DEVTYPE_FILE )
@@ -458,13 +465,13 @@ void Wellenreiter::startClicked()
pcap->open( QFile( interface ) );
}
if ( !pcap->isOpen() )
{
QMessageBox::warning( this, "Wellenreiter II",
- tr( "Can't open packet capturer:\n" ) + QString(strerror( errno ) ));
+ tr( "Can't open packet capturer for '%1':\n" ).arg( iface->name() ) + QString(strerror( errno ) ));
return;
}
// set capturer to non-blocking mode
pcap->setBlocking( false );
@@ -527,6 +534,7 @@ void Wellenreiter::doAction( const QString& action, const QString& protocol, OPa
else if ( action == "LogMessage" )
logwindow->log( QString().sprintf( "Got packet with protocol '%s'", (const char*) protocol ) );
else if ( action == "MessageBox" )
QMessageBox::information ( this, "Notification!",
QString().sprintf( "Got packet with protocol '%s'", (const char*) protocol ) );
}
+
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 {
void setConfigWindow( WellenreiterConfigWindow* cw );
MScanListView* netView() const { return netview; };
MLogWindow* logWindow() const { return logwindow; };
MHexWindow* hexWindow() const { return hexwindow; };
bool isDaemonRunning() const { return sniffing; };
+ public:
bool sniffing;
protected:
virtual void timerEvent( QTimerEvent* );
public slots: