summaryrefslogtreecommitdiff
authormickeyl <mickeyl>2003-04-08 14:17:38 (UTC)
committer mickeyl <mickeyl>2003-04-08 14:17:38 (UTC)
commit0d48ba39224582c83d68c2938e6cbedc4c77ec7d (patch) (unidiff)
tree654c387625978b5a1f0c0111d0c279cea2edfab9
parent1af4ae3d621d63c82f7d78efda05218a3457981f (diff)
downloadopie-0d48ba39224582c83d68c2938e6cbedc4c77ec7d.zip
opie-0d48ba39224582c83d68c2938e6cbedc4c77ec7d.tar.gz
opie-0d48ba39224582c83d68c2938e6cbedc4c77ec7d.tar.bz2
- fix <unknown> entries bug caused by interpretating not-yet-handled 802.11 management frames
This thing gets complicated... I really should implement a state machine for the beta.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/scanlist.cpp6
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiter.cpp15
2 files changed, 16 insertions, 5 deletions
diff --git a/noncore/net/wellenreiter/gui/scanlist.cpp b/noncore/net/wellenreiter/gui/scanlist.cpp
index 1525934..1ef24d2 100644
--- a/noncore/net/wellenreiter/gui/scanlist.cpp
+++ b/noncore/net/wellenreiter/gui/scanlist.cpp
@@ -274,7 +274,7 @@ void MScanListItem::serializeTo( QDataStream& s ) const
274 OListViewItem::serializeTo( s ); 274 OListViewItem::serializeTo( s );
275 275
276 s << _type; 276 s << _type;
277 s << (Q_UINT8) _wep; 277 s << (Q_UINT8) ( _wep ? 'y' : 'n' );
278} 278}
279 279
280void MScanListItem::serializeFrom( QDataStream& s ) 280void MScanListItem::serializeFrom( QDataStream& s )
@@ -282,8 +282,10 @@ void MScanListItem::serializeFrom( QDataStream& s )
282 qDebug( "serializing MScanListItem" ); 282 qDebug( "serializing MScanListItem" );
283 OListViewItem::serializeFrom( s ); 283 OListViewItem::serializeFrom( s );
284 284
285 char wep;
285 s >> _type; 286 s >> _type;
286 s >> (Q_UINT8) _wep; 287 s >> (Q_UINT8) wep;
288 _wep = (wep == 'y');
287 289
288 QString name; 290 QString name;
289 name.sprintf( "wellenreiter/%s", (const char*) _type ); 291 name.sprintf( "wellenreiter/%s", (const char*) _type );
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp
index 8d18f73..8c2c315 100644
--- a/noncore/net/wellenreiter/gui/wellenreiter.cpp
+++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp
@@ -114,13 +114,22 @@ void Wellenreiter::receivePacket(OPacket* p)
114 114
115 // check if we received a beacon frame 115 // check if we received a beacon frame
116 OWaveLanManagementPacket* beacon = static_cast<OWaveLanManagementPacket*>( p->child( "802.11 Management" ) ); 116 OWaveLanManagementPacket* beacon = static_cast<OWaveLanManagementPacket*>( p->child( "802.11 Management" ) );
117 if ( beacon ) 117 if ( beacon && beacon->managementType() == "Beacon" )
118 { 118 {
119 QString type; 119 QString type;
120 if ( beacon->canIBSS() ) 120 if ( beacon->canIBSS() )
121 {
121 type = "adhoc"; 122 type = "adhoc";
122 else 123 }
124 else if ( beacon->canESS() )
125 {
123 type = "managed"; 126 type = "managed";
127 }
128 else
129 {
130 qDebug( "Wellenreiter::invalid frame detected: '%s'", (const char*) p->dump( 16 ) );
131 return;
132 }
124 133
125 OWaveLanManagementSSID* ssid = static_cast<OWaveLanManagementSSID*>( p->child( "802.11 SSID" ) ); 134 OWaveLanManagementSSID* ssid = static_cast<OWaveLanManagementSSID*>( p->child( "802.11 SSID" ) );
126 QString essid = ssid ? ssid->ID() : QString("<unknown>"); 135 QString essid = ssid ? ssid->ID() : QString("<unknown>");
@@ -128,7 +137,7 @@ void Wellenreiter::receivePacket(OPacket* p)
128 int channel = ds ? ds->channel() : -1; 137 int channel = ds ? ds->channel() : -1;
129 138
130 OWaveLanPacket* header = static_cast<OWaveLanPacket*>( p->child( "802.11" ) ); 139 OWaveLanPacket* header = static_cast<OWaveLanPacket*>( p->child( "802.11" ) );
131 netView()->addNewItem( type, essid, header->macAddress2().toString(), header->usesWep(), channel, 0 ); 140 netView()->addNewItem( type, essid, header->macAddress2().toString(), beacon->canPrivacy(), channel, 0 );
132 return; 141 return;
133 } 142 }
134 143