author | mickeyl <mickeyl> | 2003-04-08 14:17:38 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-04-08 14:17:38 (UTC) |
commit | 0d48ba39224582c83d68c2938e6cbedc4c77ec7d (patch) (side-by-side diff) | |
tree | 654c387625978b5a1f0c0111d0c279cea2edfab9 | |
parent | 1af4ae3d621d63c82f7d78efda05218a3457981f (diff) | |
download | opie-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.
-rw-r--r-- | noncore/net/wellenreiter/gui/scanlist.cpp | 6 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 15 |
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 @@ -271,22 +271,24 @@ OListViewItem* MScanListItem::childFactory() void MScanListItem::serializeTo( QDataStream& s ) const { qDebug( "serializing MScanListItem" ); OListViewItem::serializeTo( s ); s << _type; - s << (Q_UINT8) _wep; + s << (Q_UINT8) ( _wep ? 'y' : 'n' ); } void MScanListItem::serializeFrom( QDataStream& s ) { qDebug( "serializing MScanListItem" ); OListViewItem::serializeFrom( s ); + char wep; s >> _type; - s >> (Q_UINT8) _wep; + s >> (Q_UINT8) wep; + _wep = (wep == 'y'); QString name; name.sprintf( "wellenreiter/%s", (const char*) _type ); setPixmap( col_type, Resource::loadPixmap( name ) ); if ( _wep ) setPixmap( col_wep, Resource::loadPixmap( "wellenreiter/cracked" ) ); //FIXME: rename the pixmap! 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 @@ -111,27 +111,36 @@ void Wellenreiter::setConfigWindow( WellenreiterConfigWindow* cw ) void Wellenreiter::receivePacket(OPacket* p) { hexWindow()->log( p->dump( 8 ) ); // check if we received a beacon frame OWaveLanManagementPacket* beacon = static_cast<OWaveLanManagementPacket*>( p->child( "802.11 Management" ) ); - if ( beacon ) + if ( beacon && beacon->managementType() == "Beacon" ) { QString type; if ( beacon->canIBSS() ) + { type = "adhoc"; - else + } + else if ( beacon->canESS() ) + { type = "managed"; + } + else + { + qDebug( "Wellenreiter::invalid frame detected: '%s'", (const char*) p->dump( 16 ) ); + return; + } OWaveLanManagementSSID* ssid = static_cast<OWaveLanManagementSSID*>( p->child( "802.11 SSID" ) ); 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 ); + netView()->addNewItem( type, essid, header->macAddress2().toString(), beacon->canPrivacy(), channel, 0 ); return; } // check for a data frame OWaveLanDataPacket* data = static_cast<OWaveLanDataPacket*>( p->child( "802.11 Data" ) ); if ( data ) |