author | mickeyl <mickeyl> | 2004-01-07 20:30:21 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-01-07 20:30:21 (UTC) |
commit | 49ae69c0f1d3a839492eb93e25bf83b7c7dc58a5 (patch) (side-by-side diff) | |
tree | 78981f89d8e9d93766f9d04154ce1d485fbf975c | |
parent | f1a1b0e56e676c655e9728d97cdf68d63df7f5d5 (diff) | |
download | opie-49ae69c0f1d3a839492eb93e25bf83b7c7dc58a5.zip opie-49ae69c0f1d3a839492eb93e25bf83b7c7dc58a5.tar.gz opie-49ae69c0f1d3a839492eb93e25bf83b7c7dc58a5.tar.bz2 |
OWaveLanManagementSSID::ID() now can decloak SSIDs (caution:API change)
-rw-r--r-- | libopie2/opienet/opcap.cpp | 13 | ||||
-rw-r--r-- | libopie2/opienet/opcap.h | 2 | ||||
-rw-r--r-- | libopie2/opienet/opienet.pro | 2 |
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 @@ -783,104 +783,113 @@ int OWaveLanManagementPacket::capabilities() const bool OWaveLanManagementPacket::canESS() const { return CAPABILITY_ESS( EXTRACT_LE_16BITS( &_body->capability_info ) ); } bool OWaveLanManagementPacket::canIBSS() const { return CAPABILITY_IBSS( EXTRACT_LE_16BITS( &_body->capability_info ) ); } bool OWaveLanManagementPacket::canCFP() const { return CAPABILITY_CFP( EXTRACT_LE_16BITS( &_body->capability_info ) ); } bool OWaveLanManagementPacket::canCFP_REQ() const { return CAPABILITY_CFP_REQ( EXTRACT_LE_16BITS( &_body->capability_info ) ); } bool OWaveLanManagementPacket::canPrivacy() const { return CAPABILITY_PRIVACY( EXTRACT_LE_16BITS( &_body->capability_info ) ); } /*====================================================================================== * OWaveLanManagementSSID *======================================================================================*/ OWaveLanManagementSSID::OWaveLanManagementSSID( const unsigned char* end, const struct ssid_t* data, QObject* parent ) :QObject( parent, "802.11 SSID" ), _data( data ) { odebug << "OWaveLanManagementSSID()" << oendl; } 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 ) :QObject( parent, "802.11 Rates" ), _data( data ) { odebug << "OWaveLanManagementRates()" << oendl; } OWaveLanManagementRates::~OWaveLanManagementRates() { } /*====================================================================================== * OWaveLanManagementCF *======================================================================================*/ OWaveLanManagementCF::OWaveLanManagementCF( const unsigned char* end, const struct cf_t* data, QObject* parent ) :QObject( parent, "802.11 CF" ), _data( data ) { odebug << "OWaveLanManagementCF()" << oendl; } OWaveLanManagementCF::~OWaveLanManagementCF() { } /*====================================================================================== * OWaveLanManagementFH *======================================================================================*/ OWaveLanManagementFH::OWaveLanManagementFH( const unsigned char* end, const struct fh_t* data, QObject* parent ) :QObject( parent, "802.11 FH" ), _data( data ) { odebug << "OWaveLanManagementFH()" << oendl; } OWaveLanManagementFH::~OWaveLanManagementFH() { } 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 @@ -204,97 +204,97 @@ class OWaveLanPacket : public QObject bool usesWep() const; private: const struct ieee_802_11_header* _wlanhdr; }; /*====================================================================================== * OWaveLanManagementPacket - type: management (T_MGMT) *======================================================================================*/ class OWaveLanManagementPacket : public QObject { Q_OBJECT public: OWaveLanManagementPacket( const unsigned char*, const struct ieee_802_11_mgmt_header*, OWaveLanPacket* parent = 0 ); virtual ~OWaveLanManagementPacket(); QString managementType() const; int beaconInterval() const; int capabilities() const; // generic bool canESS() const; bool canIBSS() const; bool canCFP() const; bool canCFP_REQ() const; bool canPrivacy() const; private: const struct ieee_802_11_mgmt_header* _header; const struct ieee_802_11_mgmt_body* _body; }; /*====================================================================================== * OWaveLanManagementSSID *======================================================================================*/ 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 *======================================================================================*/ class OWaveLanManagementRates : public QObject { Q_OBJECT public: OWaveLanManagementRates( const unsigned char*, const struct rates_t*, QObject* parent = 0 ); virtual ~OWaveLanManagementRates(); private: const struct rates_t* _data; }; /*====================================================================================== * OWaveLanManagementCF *======================================================================================*/ class OWaveLanManagementCF : public QObject { Q_OBJECT public: OWaveLanManagementCF( const unsigned char*, const struct cf_t*, QObject* parent = 0 ); virtual ~OWaveLanManagementCF(); private: const struct cf_t* _data; }; /*====================================================================================== * OWaveLanManagementFH *======================================================================================*/ class OWaveLanManagementFH : public QObject { Q_OBJECT public: OWaveLanManagementFH( const unsigned char*, const struct fh_t*, QObject* parent = 0 ); virtual ~OWaveLanManagementFH(); 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 @@ -1,34 +1,34 @@ TEMPLATE = lib CONFIG += qt warn_on debug DESTDIR = $(OPIEDIR)/lib HEADERS = 802_11_user.h \ dhcp.h \ udp_ports.h \ wireless.h \ odebugmapper.h \ omanufacturerdb.h \ onetutils.h \ onetwork.h \ opcap.h \ ostation.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 ) } contains( platform, x11 ) { LIBS += -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib } |