summaryrefslogtreecommitdiff
authormickeyl <mickeyl>2004-01-08 17:26:01 (UTC)
committer mickeyl <mickeyl>2004-01-08 17:26:01 (UTC)
commitc0a0d53fb92f8a1723c57580a5fd0ade66574ec4 (patch) (side-by-side diff)
tree0d1cb64ad905b81a04bd8c45cada4feda3c122f6
parent9634c11f8ea28af19a4afc6821c68cdc2b3e7c8a (diff)
downloadopie-c0a0d53fb92f8a1723c57580a5fd0ade66574ec4.zip
opie-c0a0d53fb92f8a1723c57580a5fd0ade66574ec4.tar.gz
opie-c0a0d53fb92f8a1723c57580a5fd0ade66574ec4.tar.bz2
Display stations sending out named ProbeRequests.
Wellenreiter II reaches a critical point in its lifetime, i.e. the scanlist and wellenreiter classes are the mainly still as they were during the early prototype phrase. It's time to rewrite the major UI core and start with giving it something like a design (D'Oh!)...
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/ChangeLog5
-rw-r--r--noncore/net/wellenreiter/gui/scanlist.cpp20
-rw-r--r--noncore/net/wellenreiter/gui/scanlist.h7
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiter.cpp39
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiter.h5
5 files changed, 60 insertions, 16 deletions
diff --git a/noncore/net/wellenreiter/ChangeLog b/noncore/net/wellenreiter/ChangeLog
index d4dca9f..f183d80 100644
--- a/noncore/net/wellenreiter/ChangeLog
+++ b/noncore/net/wellenreiter/ChangeLog
@@ -2,8 +2,9 @@
+ * Added parsing of named ProbeRequests. Display only-probed-yet SSIDs in a different network color.
* Rewrote the simple actions on new {Network, Client, Station}. Besides playing a sound or
blinking a LED, a user customizable script can now be executed, if something has been
- detected. This opens up many possibilities, i.e. a qcop to qpegps or exec'ing Flite.
+ detected. This opens up many possibilities, i.e. a qcop to qpegps or exec'ing flite (speech).
* Added decloaking of cloaked ESSIDs (length != 0, but essid[0] == \0)
* Hided the 'Parse' Tab in the configuration window. Not functional now and may come later
- * Added parsing of control frames. Display stations sending them SSID "???" for now.
+ * Added parsing of control frames. Display stations sending them SSID "<unknown>" for now.
* Added command line option "-nocheck" to skip non-root and dhcp tests
diff --git a/noncore/net/wellenreiter/gui/scanlist.cpp b/noncore/net/wellenreiter/gui/scanlist.cpp
index aea7eb6..fd88b63 100644
--- a/noncore/net/wellenreiter/gui/scanlist.cpp
+++ b/noncore/net/wellenreiter/gui/scanlist.cpp
@@ -122,3 +122,4 @@ void MScanListView::addNewItem( const QString& type,
int signal,
- const GpsLocation& loc )
+ const GpsLocation& loc,
+ bool probe )
{
@@ -175,3 +176,3 @@ void MScanListView::addNewItem( const QString& type,
MLogWindow::logwindow()->log( s );
- network = new MScanListItem( this, "network", essid, QString::null, 0, 0, 0 );
+ network = new MScanListItem( this, "network", essid, QString::null, 0, 0, 0, probe );
}
@@ -199,3 +200,2 @@ void MScanListView::addNewItem( const QString& type,
MLogWindow::logwindow()->log( s );
-
}
@@ -412,3 +412,3 @@ void MScanListView::contextMenuRequested( QListViewItem* item, const QPoint&, in
MScanListItem::MScanListItem( QListView* parent, const QString& type, const QString& essid, const QString& macaddr,
- bool wep, int channel, int signal )
+ bool wep, int channel, int signal, bool probed )
:OListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ),
@@ -424,3 +424,3 @@ MScanListItem::MScanListItem( QListView* parent, const QString& type, const QStr
- decorateItem( type, essid, macaddr, wep, channel, signal );
+ decorateItem( type, essid, macaddr, wep, channel, signal, probed );
}
@@ -434,3 +434,3 @@ MScanListItem::MScanListItem( QListViewItem* parent, const QString& type, const
#endif
- decorateItem( type, essid, macaddr, wep, channel, signal );
+ decorateItem( type, essid, macaddr, wep, channel, signal, false );
}
@@ -481,3 +481,3 @@ void MScanListItem::serializeFrom( QDataStream& s )
-void MScanListItem::decorateItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal )
+void MScanListItem::decorateItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal, bool probed )
{
@@ -496,2 +496,8 @@ void MScanListItem::decorateItem( QString type, QString essid, QString macaddr,
+ // special case for probed networks FIXME: This is ugly at present
+ if ( type == "network" && probed )
+ {
+ setPixmap( col_type, Resource::loadPixmap( "wellenreiter/network-probed.png" ) );
+ }
+
// set icon for wep (wireless encryption protocol)
diff --git a/noncore/net/wellenreiter/gui/scanlist.h b/noncore/net/wellenreiter/gui/scanlist.h
index e8d48c3..cbacdee 100644
--- a/noncore/net/wellenreiter/gui/scanlist.h
+++ b/noncore/net/wellenreiter/gui/scanlist.h
@@ -43,3 +43,3 @@ class MScanListView: public OListView
public slots:
- void addNewItem( const QString& type, const QString& essid, const OMacAddress& macaddr, bool wep, int channel, int signal, const GpsLocation& location );
+ void addNewItem( const QString& type, const QString&, const OMacAddress&, bool, int, int, const GpsLocation&, bool = false );
void addService( const QString& name, const OMacAddress& macaddr, const QString& ip );
@@ -75,3 +75,4 @@ class MScanListItem: public OListViewItem
int channel = 0,
- int signal = 0 );
+ int signal = 0,
+ bool probed = false );
@@ -87,3 +88,3 @@ class MScanListItem: public OListViewItem
protected:
- virtual void decorateItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal );
+ virtual void decorateItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal, bool probed );
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp
index 25632f3..cd74bed 100644
--- a/noncore/net/wellenreiter/gui/wellenreiter.cpp
+++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp
@@ -163,6 +163,39 @@ void Wellenreiter::handleManagementFrame( OPacket* p, OWaveLanManagementPacket*
{
- if ( manage->managementType() != "Beacon" ) return; // only handling beacons at that time
+ if ( manage->managementType() == "Beacon" ) handleManagementFrameBeacon( p, manage );
+ else if ( manage->managementType() == "ProbeRequest" ) handleManagementFrameProbeRequest( p, manage );
+ else if ( manage->managementType() == "ProbeResponse" ) handleManagementFrameProbeResponse( p, manage );
+ else qWarning( "Wellenreiter::handleManagementFrame(): '%s' - please handle me!", (const char*) manage->managementType() );
+}
- OWaveLanManagementPacket* beacon = manage;
+void Wellenreiter::handleManagementFrameProbeRequest( OPacket* p, OWaveLanManagementPacket* request )
+{
+ OWaveLanManagementSSID* ssid = static_cast<OWaveLanManagementSSID*>( p->child( "802.11 SSID" ) );
+ QString essid = ssid ? ssid->ID( true /* decloak */ ) : 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" ) );
+
+ GpsLocation loc( -111, -111 );
+ if ( configwindow->enableGPS->isChecked() )
+ {
+ // TODO: add check if GPS is working!?
+ qDebug( "Wellenreiter::gathering GPS data..." );
+ loc = gps->position();
+ qDebug( "Wellenreiter::GPS data received is ( %f , %f ) - dms string = '%s'", loc.latitude(), loc.longitude(), loc.dmsPosition().latin1() );
+ }
+
+ if ( essid.length() )
+ netView()->addNewItem( "adhoc", essid, header->macAddress2(), false /* should check FrameControl field */, -1, 0, loc, true /* only probed */ );
+ qDebug( "Wellenreiter::invalid frame [possibly noise] detected!" );
+}
+
+
+void Wellenreiter::handleManagementFrameProbeResponse( OPacket* p, OWaveLanManagementPacket* response )
+{
+}
+
+
+void Wellenreiter::handleManagementFrameBeacon( OPacket* p, OWaveLanManagementPacket* beacon )
+{
QString type;
@@ -218,3 +251,3 @@ void Wellenreiter::handleControlFrame( OPacket* p, OWaveLanControlPacket* contro
{
- netView()->addNewItem( "adhoc", "???", header->macAddress1(), false, -1, 0, GpsLocation( -111, -111 ) );
+ netView()->addNewItem( "adhoc", "<unknown>", header->macAddress1(), false, -1, 0, GpsLocation( -111, -111 ) );
}
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.h b/noncore/net/wellenreiter/gui/wellenreiter.h
index 5414fda..a28740b 100644
--- a/noncore/net/wellenreiter/gui/wellenreiter.h
+++ b/noncore/net/wellenreiter/gui/wellenreiter.h
@@ -77,3 +77,6 @@ class Wellenreiter : public WellenreiterBase {
private:
- void handleManagementFrame( OPacket* p, OWaveLanManagementPacket* manage );
+ void handleManagementFrame( OPacket* p, OWaveLanManagementPacket* );
+ void handleManagementFrameBeacon( OPacket* p, OWaveLanManagementPacket* );
+ void handleManagementFrameProbeRequest( OPacket* p, OWaveLanManagementPacket* );
+ void handleManagementFrameProbeResponse( OPacket* p, OWaveLanManagementPacket* );
void handleControlFrame( OPacket* p, OWaveLanControlPacket* control );