author | mickeyl <mickeyl> | 2004-01-07 20:30:21 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-01-07 20:30:21 (UTC) |
commit | 49ae69c0f1d3a839492eb93e25bf83b7c7dc58a5 (patch) (unidiff) | |
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 | |||
783 | 783 | ||
784 | 784 | ||
785 | bool OWaveLanManagementPacket::canESS() const | 785 | bool OWaveLanManagementPacket::canESS() const |
786 | { | 786 | { |
787 | return CAPABILITY_ESS( EXTRACT_LE_16BITS( &_body->capability_info ) ); | 787 | return CAPABILITY_ESS( EXTRACT_LE_16BITS( &_body->capability_info ) ); |
788 | } | 788 | } |
789 | 789 | ||
790 | 790 | ||
791 | bool OWaveLanManagementPacket::canIBSS() const | 791 | bool OWaveLanManagementPacket::canIBSS() const |
792 | { | 792 | { |
793 | return CAPABILITY_IBSS( EXTRACT_LE_16BITS( &_body->capability_info ) ); | 793 | return CAPABILITY_IBSS( EXTRACT_LE_16BITS( &_body->capability_info ) ); |
794 | } | 794 | } |
795 | 795 | ||
796 | 796 | ||
797 | bool OWaveLanManagementPacket::canCFP() const | 797 | bool OWaveLanManagementPacket::canCFP() const |
798 | { | 798 | { |
799 | return CAPABILITY_CFP( EXTRACT_LE_16BITS( &_body->capability_info ) ); | 799 | return CAPABILITY_CFP( EXTRACT_LE_16BITS( &_body->capability_info ) ); |
800 | } | 800 | } |
801 | 801 | ||
802 | 802 | ||
803 | bool OWaveLanManagementPacket::canCFP_REQ() const | 803 | bool OWaveLanManagementPacket::canCFP_REQ() const |
804 | { | 804 | { |
805 | return CAPABILITY_CFP_REQ( EXTRACT_LE_16BITS( &_body->capability_info ) ); | 805 | return CAPABILITY_CFP_REQ( EXTRACT_LE_16BITS( &_body->capability_info ) ); |
806 | } | 806 | } |
807 | 807 | ||
808 | 808 | ||
809 | bool OWaveLanManagementPacket::canPrivacy() const | 809 | bool OWaveLanManagementPacket::canPrivacy() const |
810 | { | 810 | { |
811 | return CAPABILITY_PRIVACY( EXTRACT_LE_16BITS( &_body->capability_info ) ); | 811 | return CAPABILITY_PRIVACY( EXTRACT_LE_16BITS( &_body->capability_info ) ); |
812 | } | 812 | } |
813 | 813 | ||
814 | 814 | ||
815 | /*====================================================================================== | 815 | /*====================================================================================== |
816 | * OWaveLanManagementSSID | 816 | * OWaveLanManagementSSID |
817 | *======================================================================================*/ | 817 | *======================================================================================*/ |
818 | 818 | ||
819 | OWaveLanManagementSSID::OWaveLanManagementSSID( const unsigned char* end, const struct ssid_t* data, QObject* parent ) | 819 | OWaveLanManagementSSID::OWaveLanManagementSSID( const unsigned char* end, const struct ssid_t* data, QObject* parent ) |
820 | :QObject( parent, "802.11 SSID" ), _data( data ) | 820 | :QObject( parent, "802.11 SSID" ), _data( data ) |
821 | { | 821 | { |
822 | odebug << "OWaveLanManagementSSID()" << oendl; | 822 | odebug << "OWaveLanManagementSSID()" << oendl; |
823 | } | 823 | } |
824 | 824 | ||
825 | 825 | ||
826 | OWaveLanManagementSSID::~OWaveLanManagementSSID() | 826 | OWaveLanManagementSSID::~OWaveLanManagementSSID() |
827 | { | 827 | { |
828 | } | 828 | } |
829 | 829 | ||
830 | 830 | ||
831 | QString OWaveLanManagementSSID::ID() const | 831 | QString 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 | ||
842 | /*====================================================================================== | 851 | /*====================================================================================== |
843 | * OWaveLanManagementRates | 852 | * OWaveLanManagementRates |
844 | *======================================================================================*/ | 853 | *======================================================================================*/ |
845 | 854 | ||
846 | OWaveLanManagementRates::OWaveLanManagementRates( const unsigned char* end, const struct rates_t* data, QObject* parent ) | 855 | OWaveLanManagementRates::OWaveLanManagementRates( const unsigned char* end, const struct rates_t* data, QObject* parent ) |
847 | :QObject( parent, "802.11 Rates" ), _data( data ) | 856 | :QObject( parent, "802.11 Rates" ), _data( data ) |
848 | { | 857 | { |
849 | odebug << "OWaveLanManagementRates()" << oendl; | 858 | odebug << "OWaveLanManagementRates()" << oendl; |
850 | } | 859 | } |
851 | 860 | ||
852 | 861 | ||
853 | OWaveLanManagementRates::~OWaveLanManagementRates() | 862 | OWaveLanManagementRates::~OWaveLanManagementRates() |
854 | { | 863 | { |
855 | } | 864 | } |
856 | 865 | ||
857 | /*====================================================================================== | 866 | /*====================================================================================== |
858 | * OWaveLanManagementCF | 867 | * OWaveLanManagementCF |
859 | *======================================================================================*/ | 868 | *======================================================================================*/ |
860 | 869 | ||
861 | OWaveLanManagementCF::OWaveLanManagementCF( const unsigned char* end, const struct cf_t* data, QObject* parent ) | 870 | OWaveLanManagementCF::OWaveLanManagementCF( const unsigned char* end, const struct cf_t* data, QObject* parent ) |
862 | :QObject( parent, "802.11 CF" ), _data( data ) | 871 | :QObject( parent, "802.11 CF" ), _data( data ) |
863 | { | 872 | { |
864 | odebug << "OWaveLanManagementCF()" << oendl; | 873 | odebug << "OWaveLanManagementCF()" << oendl; |
865 | } | 874 | } |
866 | 875 | ||
867 | 876 | ||
868 | OWaveLanManagementCF::~OWaveLanManagementCF() | 877 | OWaveLanManagementCF::~OWaveLanManagementCF() |
869 | { | 878 | { |
870 | } | 879 | } |
871 | 880 | ||
872 | /*====================================================================================== | 881 | /*====================================================================================== |
873 | * OWaveLanManagementFH | 882 | * OWaveLanManagementFH |
874 | *======================================================================================*/ | 883 | *======================================================================================*/ |
875 | 884 | ||
876 | OWaveLanManagementFH::OWaveLanManagementFH( const unsigned char* end, const struct fh_t* data, QObject* parent ) | 885 | OWaveLanManagementFH::OWaveLanManagementFH( const unsigned char* end, const struct fh_t* data, QObject* parent ) |
877 | :QObject( parent, "802.11 FH" ), _data( data ) | 886 | :QObject( parent, "802.11 FH" ), _data( data ) |
878 | { | 887 | { |
879 | odebug << "OWaveLanManagementFH()" << oendl; | 888 | odebug << "OWaveLanManagementFH()" << oendl; |
880 | } | 889 | } |
881 | 890 | ||
882 | 891 | ||
883 | OWaveLanManagementFH::~OWaveLanManagementFH() | 892 | OWaveLanManagementFH::~OWaveLanManagementFH() |
884 | { | 893 | { |
885 | } | 894 | } |
886 | 895 | ||
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 | |||
204 | bool usesWep() const; | 204 | bool usesWep() const; |
205 | 205 | ||
206 | private: | 206 | private: |
207 | const struct ieee_802_11_header* _wlanhdr; | 207 | const struct ieee_802_11_header* _wlanhdr; |
208 | }; | 208 | }; |
209 | 209 | ||
210 | 210 | ||
211 | /*====================================================================================== | 211 | /*====================================================================================== |
212 | * OWaveLanManagementPacket - type: management (T_MGMT) | 212 | * OWaveLanManagementPacket - type: management (T_MGMT) |
213 | *======================================================================================*/ | 213 | *======================================================================================*/ |
214 | 214 | ||
215 | class OWaveLanManagementPacket : public QObject | 215 | class OWaveLanManagementPacket : public QObject |
216 | { | 216 | { |
217 | Q_OBJECT | 217 | Q_OBJECT |
218 | 218 | ||
219 | public: | 219 | public: |
220 | OWaveLanManagementPacket( const unsigned char*, const struct ieee_802_11_mgmt_header*, OWaveLanPacket* parent = 0 ); | 220 | OWaveLanManagementPacket( const unsigned char*, const struct ieee_802_11_mgmt_header*, OWaveLanPacket* parent = 0 ); |
221 | virtual ~OWaveLanManagementPacket(); | 221 | virtual ~OWaveLanManagementPacket(); |
222 | 222 | ||
223 | QString managementType() const; | 223 | QString managementType() const; |
224 | 224 | ||
225 | int beaconInterval() const; | 225 | int beaconInterval() const; |
226 | int capabilities() const; // generic | 226 | int capabilities() const; // generic |
227 | 227 | ||
228 | bool canESS() const; | 228 | bool canESS() const; |
229 | bool canIBSS() const; | 229 | bool canIBSS() const; |
230 | bool canCFP() const; | 230 | bool canCFP() const; |
231 | bool canCFP_REQ() const; | 231 | bool canCFP_REQ() const; |
232 | bool canPrivacy() const; | 232 | bool canPrivacy() const; |
233 | 233 | ||
234 | private: | 234 | private: |
235 | const struct ieee_802_11_mgmt_header* _header; | 235 | const struct ieee_802_11_mgmt_header* _header; |
236 | const struct ieee_802_11_mgmt_body* _body; | 236 | const struct ieee_802_11_mgmt_body* _body; |
237 | }; | 237 | }; |
238 | 238 | ||
239 | 239 | ||
240 | /*====================================================================================== | 240 | /*====================================================================================== |
241 | * OWaveLanManagementSSID | 241 | * OWaveLanManagementSSID |
242 | *======================================================================================*/ | 242 | *======================================================================================*/ |
243 | 243 | ||
244 | class OWaveLanManagementSSID : public QObject | 244 | class OWaveLanManagementSSID : public QObject |
245 | { | 245 | { |
246 | Q_OBJECT | 246 | Q_OBJECT |
247 | 247 | ||
248 | public: | 248 | public: |
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; |
256 | }; | 256 | }; |
257 | 257 | ||
258 | /*====================================================================================== | 258 | /*====================================================================================== |
259 | * OWaveLanManagementRates | 259 | * OWaveLanManagementRates |
260 | *======================================================================================*/ | 260 | *======================================================================================*/ |
261 | 261 | ||
262 | class OWaveLanManagementRates : public QObject | 262 | class OWaveLanManagementRates : public QObject |
263 | { | 263 | { |
264 | Q_OBJECT | 264 | Q_OBJECT |
265 | 265 | ||
266 | public: | 266 | public: |
267 | OWaveLanManagementRates( const unsigned char*, const struct rates_t*, QObject* parent = 0 ); | 267 | OWaveLanManagementRates( const unsigned char*, const struct rates_t*, QObject* parent = 0 ); |
268 | virtual ~OWaveLanManagementRates(); | 268 | virtual ~OWaveLanManagementRates(); |
269 | 269 | ||
270 | private: | 270 | private: |
271 | const struct rates_t* _data; | 271 | const struct rates_t* _data; |
272 | }; | 272 | }; |
273 | 273 | ||
274 | /*====================================================================================== | 274 | /*====================================================================================== |
275 | * OWaveLanManagementCF | 275 | * OWaveLanManagementCF |
276 | *======================================================================================*/ | 276 | *======================================================================================*/ |
277 | 277 | ||
278 | class OWaveLanManagementCF : public QObject | 278 | class OWaveLanManagementCF : public QObject |
279 | { | 279 | { |
280 | Q_OBJECT | 280 | Q_OBJECT |
281 | 281 | ||
282 | public: | 282 | public: |
283 | OWaveLanManagementCF( const unsigned char*, const struct cf_t*, QObject* parent = 0 ); | 283 | OWaveLanManagementCF( const unsigned char*, const struct cf_t*, QObject* parent = 0 ); |
284 | virtual ~OWaveLanManagementCF(); | 284 | virtual ~OWaveLanManagementCF(); |
285 | 285 | ||
286 | private: | 286 | private: |
287 | const struct cf_t* _data; | 287 | const struct cf_t* _data; |
288 | }; | 288 | }; |
289 | 289 | ||
290 | /*====================================================================================== | 290 | /*====================================================================================== |
291 | * OWaveLanManagementFH | 291 | * OWaveLanManagementFH |
292 | *======================================================================================*/ | 292 | *======================================================================================*/ |
293 | 293 | ||
294 | class OWaveLanManagementFH : public QObject | 294 | class OWaveLanManagementFH : public QObject |
295 | { | 295 | { |
296 | Q_OBJECT | 296 | Q_OBJECT |
297 | 297 | ||
298 | public: | 298 | public: |
299 | OWaveLanManagementFH( const unsigned char*, const struct fh_t*, QObject* parent = 0 ); | 299 | OWaveLanManagementFH( const unsigned char*, const struct fh_t*, QObject* parent = 0 ); |
300 | virtual ~OWaveLanManagementFH(); | 300 | 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 @@ | |||
1 | TEMPLATE = lib | 1 | TEMPLATE = lib |
2 | CONFIG += qt warn_on debug | 2 | CONFIG += qt warn_on debug |
3 | DESTDIR = $(OPIEDIR)/lib | 3 | DESTDIR = $(OPIEDIR)/lib |
4 | HEADERS = 802_11_user.h \ | 4 | HEADERS = 802_11_user.h \ |
5 | dhcp.h \ | 5 | dhcp.h \ |
6 | udp_ports.h \ | 6 | udp_ports.h \ |
7 | wireless.h \ | 7 | wireless.h \ |
8 | odebugmapper.h \ | 8 | odebugmapper.h \ |
9 | omanufacturerdb.h \ | 9 | omanufacturerdb.h \ |
10 | onetutils.h \ | 10 | onetutils.h \ |
11 | onetwork.h \ | 11 | onetwork.h \ |
12 | opcap.h \ | 12 | opcap.h \ |
13 | ostation.h | 13 | ostation.h |
14 | SOURCES = odebugmapper.cpp \ | 14 | SOURCES = odebugmapper.cpp \ |
15 | omanufacturerdb.cpp \ | 15 | omanufacturerdb.cpp \ |
16 | onetutils.cpp \ | 16 | onetutils.cpp \ |
17 | onetwork.cpp \ | 17 | onetwork.cpp \ |
18 | opcap.cpp \ | 18 | opcap.cpp \ |
19 | ostation.cpp | 19 | ostation.cpp |
20 | INTERFACES = | 20 | INTERFACES = |
21 | TARGET = opienet2 | 21 | TARGET = opienet2 |
22 | VERSION = 1.8.2 | 22 | VERSION = 1.8.3 |
23 | INCLUDEPATH += $(OPIEDIR)/include | 23 | INCLUDEPATH += $(OPIEDIR)/include |
24 | DEPENDPATH += $(OPIEDIR)/include | 24 | DEPENDPATH += $(OPIEDIR)/include |
25 | LIBS += -lpcap | 25 | LIBS += -lpcap |
26 | 26 | ||
27 | 27 | ||
28 | !contains( platform, x11 ) { | 28 | !contains( platform, x11 ) { |
29 | include ( $(OPIEDIR)/include.pro ) | 29 | include ( $(OPIEDIR)/include.pro ) |
30 | } | 30 | } |
31 | 31 | ||
32 | contains( platform, x11 ) { | 32 | contains( platform, x11 ) { |
33 | LIBS += -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib | 33 | LIBS += -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib |
34 | } | 34 | } |