summaryrefslogtreecommitdiff
path: root/libopie2
authormickeyl <mickeyl>2004-01-07 20:30:21 (UTC)
committer mickeyl <mickeyl>2004-01-07 20:30:21 (UTC)
commit49ae69c0f1d3a839492eb93e25bf83b7c7dc58a5 (patch) (unidiff)
tree78981f89d8e9d93766f9d04154ce1d485fbf975c /libopie2
parentf1a1b0e56e676c655e9728d97cdf68d63df7f5d5 (diff)
downloadopie-49ae69c0f1d3a839492eb93e25bf83b7c7dc58a5.zip
opie-49ae69c0f1d3a839492eb93e25bf83b7c7dc58a5.tar.gz
opie-49ae69c0f1d3a839492eb93e25bf83b7c7dc58a5.tar.bz2
OWaveLanManagementSSID::ID() now can decloak SSIDs (caution:API change)
Diffstat (limited to 'libopie2') (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
@@ -828,14 +828,23 @@ OWaveLanManagementSSID::~OWaveLanManagementSSID()
828} 828}
829 829
830 830
831QString OWaveLanManagementSSID::ID() const 831QString OWaveLanManagementSSID::ID( bool decloak ) const
832{ 832{
833 int length = _data->length; 833 int length = _data->length;
834 if ( length > 32 ) length = 32; 834 if ( length > 32 ) length = 32;
835 char essid[length+1]; 835 char essid[length+1];
836 memcpy( &essid, &_data->ssid, length ); 836 memcpy( &essid, &_data->ssid, length );
837 essid[length] = 0x0; 837 essid[length] = 0x0;
838 return essid; 838 if ( !decloak || length < 2 || essid[0] != '\0' ) return essid;
839 odebug << "OWaveLanManagementSSID:ID(): SSID is cloaked - decloaking..." << oendl;
840
841 QString decloakedID;
842 for ( int i = 1; i < length; ++i )
843 {
844 if ( essid[i] >= 32 && essid[i] <= 126 ) decloakedID.append( essid[i] );
845 else decloakedID.append( '.' );
846 }
847 return decloakedID;
839} 848}
840 849
841 850
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
@@ -249,7 +249,7 @@ class OWaveLanManagementSSID : public QObject
249 OWaveLanManagementSSID( const unsigned char*, const struct ssid_t*, QObject* parent = 0 ); 249 OWaveLanManagementSSID( const unsigned char*, const struct ssid_t*, QObject* parent = 0 );
250 virtual ~OWaveLanManagementSSID(); 250 virtual ~OWaveLanManagementSSID();
251 251
252 QString ID() const; 252 QString ID( bool decloak = false ) const;
253 253
254 private: 254 private:
255 const struct ssid_t* _data; 255 const struct ssid_t* _data;
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
@@ -19,7 +19,7 @@ SOURCES = odebugmapper.cpp \
19 ostation.cpp 19 ostation.cpp
20INTERFACES = 20INTERFACES =
21TARGET = opienet2 21TARGET = opienet2
22VERSION = 1.8.2 22VERSION = 1.8.3
23INCLUDEPATH += $(OPIEDIR)/include 23INCLUDEPATH += $(OPIEDIR)/include
24DEPENDPATH += $(OPIEDIR)/include 24DEPENDPATH += $(OPIEDIR)/include
25LIBS += -lpcap 25LIBS += -lpcap