summaryrefslogtreecommitdiff
authormickeyl <mickeyl>2004-01-07 20:30:21 (UTC)
committer mickeyl <mickeyl>2004-01-07 20:30:21 (UTC)
commit49ae69c0f1d3a839492eb93e25bf83b7c7dc58a5 (patch) (side-by-side diff)
tree78981f89d8e9d93766f9d04154ce1d485fbf975c
parentf1a1b0e56e676c655e9728d97cdf68d63df7f5d5 (diff)
downloadopie-49ae69c0f1d3a839492eb93e25bf83b7c7dc58a5.zip
opie-49ae69c0f1d3a839492eb93e25bf83b7c7dc58a5.tar.gz
opie-49ae69c0f1d3a839492eb93e25bf83b7c7dc58a5.tar.bz2
OWaveLanManagementSSID::ID() now can decloak SSIDs (caution:API change)
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opienet/opcap.cpp13
-rw-r--r--libopie2/opienet/opcap.h2
-rw-r--r--libopie2/opienet/opienet.pro2
3 files changed, 13 insertions, 4 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
@@ -823,24 +823,33 @@ OWaveLanManagementSSID::OWaveLanManagementSSID( const unsigned char* end, const
}
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;
}
/*======================================================================================
* OWaveLanManagementRates
*======================================================================================*/
OWaveLanManagementRates::OWaveLanManagementRates( const unsigned char* end, const struct rates_t* data, QObject* parent )
diff --git a/libopie2/opienet/opcap.h b/libopie2/opienet/opcap.h
index b373c56..f5dc5c0 100644
--- a/libopie2/opienet/opcap.h
+++ b/libopie2/opienet/opcap.h
@@ -244,17 +244,17 @@ class OWaveLanManagementPacket : public QObject
class OWaveLanManagementSSID : public QObject
{
Q_OBJECT
public:
OWaveLanManagementSSID( const unsigned char*, const struct ssid_t*, QObject* parent = 0 );
virtual ~OWaveLanManagementSSID();
- QString ID() const;
+ QString ID( bool decloak = false ) const;
private:
const struct ssid_t* _data;
};
/*======================================================================================
* OWaveLanManagementRates
*======================================================================================*/
diff --git a/libopie2/opienet/opienet.pro b/libopie2/opienet/opienet.pro
index 2027481..cab6da6 100644
--- a/libopie2/opienet/opienet.pro
+++ b/libopie2/opienet/opienet.pro
@@ -14,17 +14,17 @@ HEADERS = 802_11_user.h \
SOURCES = odebugmapper.cpp \
omanufacturerdb.cpp \
onetutils.cpp \
onetwork.cpp \
opcap.cpp \
ostation.cpp
INTERFACES =
TARGET = opienet2
-VERSION = 1.8.2
+VERSION = 1.8.3
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
LIBS += -lpcap
!contains( platform, x11 ) {
include ( $(OPIEDIR)/include.pro )
}