summaryrefslogtreecommitdiff
path: root/libopie2/opienet/opcap.cpp
Side-by-side diff
Diffstat (limited to 'libopie2/opienet/opcap.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opienet/opcap.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/libopie2/opienet/opcap.cpp b/libopie2/opienet/opcap.cpp
index 012c0a3..4d786f5 100644
--- a/libopie2/opienet/opcap.cpp
+++ b/libopie2/opienet/opcap.cpp
@@ -828,14 +828,23 @@ OWaveLanManagementSSID::~OWaveLanManagementSSID()
}
-QString OWaveLanManagementSSID::ID() const
+QString OWaveLanManagementSSID::ID( bool decloak ) const
{
int length = _data->length;
if ( length > 32 ) length = 32;
char essid[length+1];
memcpy( &essid, &_data->ssid, length );
essid[length] = 0x0;
- return essid;
+ if ( !decloak || length < 2 || essid[0] != '\0' ) return essid;
+ odebug << "OWaveLanManagementSSID:ID(): SSID is cloaked - decloaking..." << oendl;
+
+ QString decloakedID;
+ for ( int i = 1; i < length; ++i )
+ {
+ if ( essid[i] >= 32 && essid[i] <= 126 ) decloakedID.append( essid[i] );
+ else decloakedID.append( '.' );
+ }
+ return decloakedID;
}