summaryrefslogtreecommitdiff
Unidiff
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
@@ -271,22 +271,24 @@ OListViewItem* MScanListItem::childFactory()
271void MScanListItem::serializeTo( QDataStream& s ) const 271void MScanListItem::serializeTo( QDataStream& s ) const
272{ 272{
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
280void MScanListItem::serializeFrom( QDataStream& s ) 280void 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 ) );
291 if ( _wep ) 293 if ( _wep )
292 setPixmap( col_wep, Resource::loadPixmap( "wellenreiter/cracked" ) ); //FIXME: rename the pixmap! 294 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 )
111void Wellenreiter::receivePacket(OPacket* p) 111void Wellenreiter::receivePacket(OPacket* p)
112{ 112{
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
136 OWaveLanDataPacket* data = static_cast<OWaveLanDataPacket*>( p->child( "802.11 Data" ) ); 145 OWaveLanDataPacket* data = static_cast<OWaveLanDataPacket*>( p->child( "802.11 Data" ) );
137 if ( data ) 146 if ( data )