summaryrefslogtreecommitdiff
path: root/noncore
Unidiff
Diffstat (limited to 'noncore') (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 @@
2 2
3 * Added parsing of named ProbeRequests. Display only-probed-yet SSIDs in a different network color.
3 * Rewrote the simple actions on new {Network, Client, Station}. Besides playing a sound or 4 * Rewrote the simple actions on new {Network, Client, Station}. Besides playing a sound or
4 blinking a LED, a user customizable script can now be executed, if something has been 5 blinking a LED, a user customizable script can now be executed, if something has been
5 detected. This opens up many possibilities, i.e. a qcop to qpegps or exec'ing Flite. 6 detected. This opens up many possibilities, i.e. a qcop to qpegps or exec'ing flite (speech).
6 * Added decloaking of cloaked ESSIDs (length != 0, but essid[0] == \0) 7 * Added decloaking of cloaked ESSIDs (length != 0, but essid[0] == \0)
7 * Hided the 'Parse' Tab in the configuration window. Not functional now and may come later 8 * Hided the 'Parse' Tab in the configuration window. Not functional now and may come later
8 * Added parsing of control frames. Display stations sending them SSID "???" for now. 9 * Added parsing of control frames. Display stations sending them SSID "<unknown>" for now.
9 * Added command line option "-nocheck" to skip non-root and dhcp tests 10 * 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,
122 int signal, 122 int signal,
123 const GpsLocation& loc ) 123 const GpsLocation& loc,
124 bool probe )
124{ 125{
@@ -175,3 +176,3 @@ void MScanListView::addNewItem( const QString& type,
175 MLogWindow::logwindow()->log( s ); 176 MLogWindow::logwindow()->log( s );
176 network = new MScanListItem( this, "network", essid, QString::null, 0, 0, 0 ); 177 network = new MScanListItem( this, "network", essid, QString::null, 0, 0, 0, probe );
177 } 178 }
@@ -199,3 +200,2 @@ void MScanListView::addNewItem( const QString& type,
199 MLogWindow::logwindow()->log( s ); 200 MLogWindow::logwindow()->log( s );
200
201} 201}
@@ -412,3 +412,3 @@ void MScanListView::contextMenuRequested( QListViewItem* item, const QPoint&, in
412MScanListItem::MScanListItem( QListView* parent, const QString& type, const QString& essid, const QString& macaddr, 412MScanListItem::MScanListItem( QListView* parent, const QString& type, const QString& essid, const QString& macaddr,
413 bool wep, int channel, int signal ) 413 bool wep, int channel, int signal, bool probed )
414 :OListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ), 414 :OListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ),
@@ -424,3 +424,3 @@ MScanListItem::MScanListItem( QListView* parent, const QString& type, const QStr
424 424
425 decorateItem( type, essid, macaddr, wep, channel, signal ); 425 decorateItem( type, essid, macaddr, wep, channel, signal, probed );
426} 426}
@@ -434,3 +434,3 @@ MScanListItem::MScanListItem( QListViewItem* parent, const QString& type, const
434 #endif 434 #endif
435 decorateItem( type, essid, macaddr, wep, channel, signal ); 435 decorateItem( type, essid, macaddr, wep, channel, signal, false );
436} 436}
@@ -481,3 +481,3 @@ void MScanListItem::serializeFrom( QDataStream& s )
481 481
482void MScanListItem::decorateItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal ) 482void MScanListItem::decorateItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal, bool probed )
483{ 483{
@@ -496,2 +496,8 @@ void MScanListItem::decorateItem( QString type, QString essid, QString macaddr,
496 496
497 // special case for probed networks FIXME: This is ugly at present
498 if ( type == "network" && probed )
499 {
500 setPixmap( col_type, Resource::loadPixmap( "wellenreiter/network-probed.png" ) );
501 }
502
497 // set icon for wep (wireless encryption protocol) 503 // 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
43 public slots: 43 public slots:
44 void addNewItem( const QString& type, const QString& essid, const OMacAddress& macaddr, bool wep, int channel, int signal, const GpsLocation& location ); 44 void addNewItem( const QString& type, const QString&, const OMacAddress&, bool, int, int, const GpsLocation&, bool = false );
45 void addService( const QString& name, const OMacAddress& macaddr, const QString& ip ); 45 void addService( const QString& name, const OMacAddress& macaddr, const QString& ip );
@@ -75,3 +75,4 @@ class MScanListItem: public OListViewItem
75 int channel = 0, 75 int channel = 0,
76 int signal = 0 ); 76 int signal = 0,
77 bool probed = false );
77 78
@@ -87,3 +88,3 @@ class MScanListItem: public OListViewItem
87 protected: 88 protected:
88 virtual void decorateItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal ); 89 virtual void decorateItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal, bool probed );
89 90
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*
163{ 163{
164 if ( manage->managementType() != "Beacon" ) return; // only handling beacons at that time 164 if ( manage->managementType() == "Beacon" ) handleManagementFrameBeacon( p, manage );
165 else if ( manage->managementType() == "ProbeRequest" ) handleManagementFrameProbeRequest( p, manage );
166 else if ( manage->managementType() == "ProbeResponse" ) handleManagementFrameProbeResponse( p, manage );
167 else qWarning( "Wellenreiter::handleManagementFrame(): '%s' - please handle me!", (const char*) manage->managementType() );
168}
165 169
166 OWaveLanManagementPacket* beacon = manage;
167 170
171void Wellenreiter::handleManagementFrameProbeRequest( OPacket* p, OWaveLanManagementPacket* request )
172{
173 OWaveLanManagementSSID* ssid = static_cast<OWaveLanManagementSSID*>( p->child( "802.11 SSID" ) );
174 QString essid = ssid ? ssid->ID( true /* decloak */ ) : QString("<unknown>");
175 OWaveLanManagementDS* ds = static_cast<OWaveLanManagementDS*>( p->child( "802.11 DS" ) );
176 int channel = ds ? ds->channel() : -1;
177 OWaveLanPacket* header = static_cast<OWaveLanPacket*>( p->child( "802.11" ) );
178
179 GpsLocation loc( -111, -111 );
180 if ( configwindow->enableGPS->isChecked() )
181 {
182 // TODO: add check if GPS is working!?
183 qDebug( "Wellenreiter::gathering GPS data..." );
184 loc = gps->position();
185 qDebug( "Wellenreiter::GPS data received is ( %f , %f ) - dms string = '%s'", loc.latitude(), loc.longitude(), loc.dmsPosition().latin1() );
186 }
187
188 if ( essid.length() )
189 netView()->addNewItem( "adhoc", essid, header->macAddress2(), false /* should check FrameControl field */, -1, 0, loc, true /* only probed */ );
190 qDebug( "Wellenreiter::invalid frame [possibly noise] detected!" );
191}
192
193
194void Wellenreiter::handleManagementFrameProbeResponse( OPacket* p, OWaveLanManagementPacket* response )
195{
196}
197
198
199void Wellenreiter::handleManagementFrameBeacon( OPacket* p, OWaveLanManagementPacket* beacon )
200{
168 QString type; 201 QString type;
@@ -218,3 +251,3 @@ void Wellenreiter::handleControlFrame( OPacket* p, OWaveLanControlPacket* contro
218 { 251 {
219 netView()->addNewItem( "adhoc", "???", header->macAddress1(), false, -1, 0, GpsLocation( -111, -111 ) ); 252 netView()->addNewItem( "adhoc", "<unknown>", header->macAddress1(), false, -1, 0, GpsLocation( -111, -111 ) );
220 } 253 }
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 {
77 private: 77 private:
78 void handleManagementFrame( OPacket* p, OWaveLanManagementPacket* manage ); 78 void handleManagementFrame( OPacket* p, OWaveLanManagementPacket* );
79 void handleManagementFrameBeacon( OPacket* p, OWaveLanManagementPacket* );
80 void handleManagementFrameProbeRequest( OPacket* p, OWaveLanManagementPacket* );
81 void handleManagementFrameProbeResponse( OPacket* p, OWaveLanManagementPacket* );
79 void handleControlFrame( OPacket* p, OWaveLanControlPacket* control ); 82 void handleControlFrame( OPacket* p, OWaveLanControlPacket* control );