-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 | |||
@@ -273,18 +273,20 @@ void MScanListItem::serializeTo( QDataStream& s ) const | |||
273 | qDebug( "serializing MScanListItem" ); | 273 | qDebug( "serializing MScanListItem" ); |
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 | ||
280 | void MScanListItem::serializeFrom( QDataStream& s ) | 280 | void MScanListItem::serializeFrom( QDataStream& s ) |
281 | { | 281 | { |
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 ); |
290 | setPixmap( col_type, Resource::loadPixmap( name ) ); | 292 | setPixmap( col_type, Resource::loadPixmap( name ) ); |
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 | |||
@@ -113,23 +113,32 @@ void Wellenreiter::receivePacket(OPacket* p) | |||
113 | hexWindow()->log( p->dump( 8 ) ); | 113 | hexWindow()->log( p->dump( 8 ) ); |
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>"); |
127 | OWaveLanManagementDS* ds = static_cast<OWaveLanManagementDS*>( p->child( "802.11 DS" ) ); | 136 | OWaveLanManagementDS* ds = static_cast<OWaveLanManagementDS*>( p->child( "802.11 DS" ) ); |
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 | ||
135 | // check for a data frame | 144 | // check for a data frame |