summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp
index 5bdc1b3..3bff7c4 100644
--- a/noncore/net/wellenreiter/gui/wellenreiter.cpp
+++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp
@@ -81,97 +81,97 @@ Wellenreiter::Wellenreiter( QWidget* parent )
logwindow->log( sys );
#endif
// setup GUI
netview->setColumnWidthMode( 1, QListView::Manual );
if ( manufacturerdb )
netview->setManufacturerDB( manufacturerdb );
pcap = new OPacketCapturer();
}
Wellenreiter::~Wellenreiter()
{
// no need to delete child widgets, Qt does it all for us
delete manufacturerdb;
delete pcap;
}
void Wellenreiter::setConfigWindow( WellenreiterConfigWindow* cw )
{
configwindow = cw;
}
void Wellenreiter::receivePacket(OPacket* p)
{
logwindow->log( "(d) Received data from daemon" );
//TODO
// check if we received a beacon frame
// static_cast is justified here
OWaveLanManagementPacket* beacon = static_cast<OWaveLanManagementPacket*>( p->child( "802.11 Management" ) );
if ( !beacon ) return;
QString type;
//FIXME: Can stations in ESS mode can be distinguished from APs?
//FIXME: Apparently yes, but not by listening to beacons, because
//FIXME: they simply don't send beacons in infrastructure mode.
//FIXME: so we also have to listen to data packets
if ( beacon->canIBSS() )
type = "adhoc";
else
type = "managed";
OWaveLanManagementSSID* ssid = static_cast<OWaveLanManagementSSID*>( p->child( "802.11 SSID" ) );
- QString essid = ssid ? ssid->ID() : "<unknown>";
+ QString essid = ssid ? ssid->ID() : QString("<unknown>");
OWaveLanManagementDS* ds = static_cast<OWaveLanManagementDS*>( p->child( "802.11 DS" ) );
int channel = ds ? ds->channel() : -1;
OWaveLanPacket* header = static_cast<OWaveLanPacket*>( p->child( "802.11" ) );
netView()->addNewItem( type, essid, header->macAddress2().toString(), header->usesWep(), channel, 0 );
}
void Wellenreiter::startStopClicked()
{
if ( sniffing )
{
disconnect( SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) );
iface->setChannelHopping(); // stop hopping channels
pcap->close();
sniffing = false;
oApp->setTitle();
// get interface name from config window
const QString& interface = configwindow->interfaceName->currentText();
ONetwork* net = ONetwork::instance();
iface = static_cast<OWirelessNetworkInterface*>(net->interface( interface ));
// switch off monitor mode
iface->setMonitorMode( false );
// switch off promisc flag
iface->setPromiscuousMode( false );
//TODO: Display "please wait..." (use owait?)
/*
QString cmdline;
cmdline.sprintf( "ifdown %s; sleep 1; ifup %s", (const char*) interface, (const char*) interface, (const char*) interface );
system( cmdline ); //FIXME: Use OProcess
*/
// message the user
//QMessageBox::information( this, "Wellenreiter II", "Your wireless card\nshould now be usable again." );
}
else
{
// get configuration from config window
const QString& interface = configwindow->interfaceName->currentText();