-rw-r--r-- | libopie2/opienet/opcap.h | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/libopie2/opienet/opcap.h b/libopie2/opienet/opcap.h index 04d22ff..ddef278 100644 --- a/libopie2/opienet/opcap.h +++ b/libopie2/opienet/opcap.h | |||
@@ -50,55 +50,53 @@ extern "C" // work around a bpf/pcap conflict in recent headers | |||
50 | #include <qobject.h> | 50 | #include <qobject.h> |
51 | #include <qstring.h> | 51 | #include <qstring.h> |
52 | 52 | ||
53 | /* OPIE */ | 53 | /* OPIE */ |
54 | #include <opie2/onetutils.h> | 54 | #include <opie2/onetutils.h> |
55 | #include "802_11_user.h" | 55 | #include "802_11_user.h" |
56 | 56 | ||
57 | /* TYPEDEFS */ | 57 | /* TYPEDEFS */ |
58 | typedef struct timeval timevalstruct; | 58 | typedef struct timeval timevalstruct; |
59 | typedef struct pcap_pkthdr packetheaderstruct; | 59 | typedef struct pcap_pkthdr packetheaderstruct; |
60 | 60 | ||
61 | /* FORWARDS */ | 61 | /* FORWARDS */ |
62 | class OPacketCapturer; | 62 | class OPacketCapturer; |
63 | class QSocketNotifier; | 63 | class QSocketNotifier; |
64 | 64 | ||
65 | /*====================================================================================== | 65 | /*====================================================================================== |
66 | * OPacket - A frame on the wire | 66 | * OPacket - A frame on the wire |
67 | *======================================================================================*/ | 67 | *======================================================================================*/ |
68 | 68 | ||
69 | class OPacket : public QObject | 69 | class OPacket : public QObject |
70 | { | 70 | { |
71 | Q_OBJECT | 71 | Q_OBJECT |
72 | 72 | ||
73 | public: | 73 | public: |
74 | OPacket( packetheaderstruct, const unsigned char*, QObject* parent ); | 74 | OPacket( int datalink, packetheaderstruct, const unsigned char*, QObject* parent ); |
75 | virtual ~OPacket(); | 75 | virtual ~OPacket(); |
76 | 76 | ||
77 | timevalstruct timeval() const; | 77 | timevalstruct timeval() const; |
78 | 78 | ||
79 | OPacketCapturer* packetCapturer() const; | ||
80 | |||
81 | int caplen() const; | 79 | int caplen() const; |
82 | int len() const; | 80 | int len() const; |
83 | QString dump( int = 32 ) const; | 81 | QString dump( int = 32 ) const; |
84 | 82 | ||
85 | private: | 83 | private: |
86 | const packetheaderstruct _hdr; // pcap packet header | 84 | const packetheaderstruct _hdr; // pcap packet header |
87 | const unsigned char* _data; // pcap packet data | 85 | const unsigned char* _data; // pcap packet data |
88 | const unsigned char* _end; // end of pcap packet data | 86 | const unsigned char* _end; // end of pcap packet data |
89 | }; | 87 | }; |
90 | 88 | ||
91 | /*====================================================================================== | 89 | /*====================================================================================== |
92 | * OEthernetPacket - DLT_EN10MB frame | 90 | * OEthernetPacket - DLT_EN10MB frame |
93 | *======================================================================================*/ | 91 | *======================================================================================*/ |
94 | 92 | ||
95 | class OEthernetPacket : public QObject | 93 | class OEthernetPacket : public QObject |
96 | { | 94 | { |
97 | Q_OBJECT | 95 | Q_OBJECT |
98 | 96 | ||
99 | public: | 97 | public: |
100 | OEthernetPacket( const unsigned char*, const struct ether_header*, QObject* parent = 0 ); | 98 | OEthernetPacket( const unsigned char*, const struct ether_header*, QObject* parent = 0 ); |
101 | virtual ~OEthernetPacket(); | 99 | virtual ~OEthernetPacket(); |
102 | 100 | ||
103 | OMacAddress sourceAddress() const; | 101 | OMacAddress sourceAddress() const; |
104 | OMacAddress destinationAddress() const; | 102 | OMacAddress destinationAddress() const; |
@@ -130,48 +128,50 @@ class OWaveLanPacket : public QObject | |||
130 | virtual OMacAddress macAddress4() const; | 128 | virtual OMacAddress macAddress4() const; |
131 | bool usesPowerManagement() const; | 129 | bool usesPowerManagement() const; |
132 | int type() const; | 130 | int type() const; |
133 | int subType() const; | 131 | int subType() const; |
134 | int version() const; | 132 | int version() const; |
135 | bool usesWep() const; | 133 | bool usesWep() const; |
136 | 134 | ||
137 | private: | 135 | private: |
138 | const struct ieee_802_11_header* _wlanhdr; | 136 | const struct ieee_802_11_header* _wlanhdr; |
139 | }; | 137 | }; |
140 | 138 | ||
141 | 139 | ||
142 | /*====================================================================================== | 140 | /*====================================================================================== |
143 | * OWaveLanManagementPacket - type: management (T_MGMT) | 141 | * OWaveLanManagementPacket - type: management (T_MGMT) |
144 | *======================================================================================*/ | 142 | *======================================================================================*/ |
145 | 143 | ||
146 | class OWaveLanManagementPacket : public QObject | 144 | class OWaveLanManagementPacket : public QObject |
147 | { | 145 | { |
148 | Q_OBJECT | 146 | Q_OBJECT |
149 | 147 | ||
150 | public: | 148 | public: |
151 | OWaveLanManagementPacket( const unsigned char*, const struct ieee_802_11_mgmt_header*, OWaveLanPacket* parent = 0 ); | 149 | OWaveLanManagementPacket( const unsigned char*, const struct ieee_802_11_mgmt_header*, OWaveLanPacket* parent = 0 ); |
152 | virtual ~OWaveLanManagementPacket(); | 150 | virtual ~OWaveLanManagementPacket(); |
153 | 151 | ||
152 | QString managementType() const; | ||
153 | |||
154 | int beaconInterval() const; | 154 | int beaconInterval() const; |
155 | int capabilities() const; // generic | 155 | int capabilities() const; // generic |
156 | 156 | ||
157 | bool canESS() const; | 157 | bool canESS() const; |
158 | bool canIBSS() const; | 158 | bool canIBSS() const; |
159 | bool canCFP() const; | 159 | bool canCFP() const; |
160 | bool canCFP_REQ() const; | 160 | bool canCFP_REQ() const; |
161 | bool canPrivacy() const; | 161 | bool canPrivacy() const; |
162 | 162 | ||
163 | private: | 163 | private: |
164 | const struct ieee_802_11_mgmt_header* _header; | 164 | const struct ieee_802_11_mgmt_header* _header; |
165 | const struct ieee_802_11_mgmt_body* _body; | 165 | const struct ieee_802_11_mgmt_body* _body; |
166 | }; | 166 | }; |
167 | 167 | ||
168 | 168 | ||
169 | /*====================================================================================== | 169 | /*====================================================================================== |
170 | * OWaveLanManagementSSID | 170 | * OWaveLanManagementSSID |
171 | *======================================================================================*/ | 171 | *======================================================================================*/ |
172 | 172 | ||
173 | class OWaveLanManagementSSID : public QObject | 173 | class OWaveLanManagementSSID : public QObject |
174 | { | 174 | { |
175 | Q_OBJECT | 175 | Q_OBJECT |
176 | 176 | ||
177 | public: | 177 | public: |
@@ -294,48 +294,64 @@ class OWaveLanManagementChallenge : public QObject | |||
294 | OWaveLanManagementChallenge( const unsigned char*, const struct challenge_t*, QObject* parent = 0 ); | 294 | OWaveLanManagementChallenge( const unsigned char*, const struct challenge_t*, QObject* parent = 0 ); |
295 | virtual ~OWaveLanManagementChallenge(); | 295 | virtual ~OWaveLanManagementChallenge(); |
296 | 296 | ||
297 | private: | 297 | private: |
298 | const struct challenge_t* _data; | 298 | const struct challenge_t* _data; |
299 | }; | 299 | }; |
300 | 300 | ||
301 | /*====================================================================================== | 301 | /*====================================================================================== |
302 | * OWaveLanDataPacket - type: data (T_DATA) | 302 | * OWaveLanDataPacket - type: data (T_DATA) |
303 | *======================================================================================*/ | 303 | *======================================================================================*/ |
304 | 304 | ||
305 | class OWaveLanDataPacket : public QObject | 305 | class OWaveLanDataPacket : public QObject |
306 | { | 306 | { |
307 | Q_OBJECT | 307 | Q_OBJECT |
308 | 308 | ||
309 | public: | 309 | public: |
310 | OWaveLanDataPacket( const unsigned char*, const struct ieee_802_11_data_header*, OWaveLanPacket* parent = 0 ); | 310 | OWaveLanDataPacket( const unsigned char*, const struct ieee_802_11_data_header*, OWaveLanPacket* parent = 0 ); |
311 | virtual ~OWaveLanDataPacket(); | 311 | virtual ~OWaveLanDataPacket(); |
312 | 312 | ||
313 | private: | 313 | private: |
314 | const struct ieee_802_11_data_header* _header; | 314 | const struct ieee_802_11_data_header* _header; |
315 | }; | 315 | }; |
316 | 316 | ||
317 | /*====================================================================================== | 317 | /*====================================================================================== |
318 | * OWaveLanControlPacket - type: control (T_CTRL) | ||
319 | *======================================================================================*/ | ||
320 | |||
321 | class OWaveLanControlPacket : public QObject | ||
322 | { | ||
323 | Q_OBJECT | ||
324 | |||
325 | public: | ||
326 | OWaveLanControlPacket( const unsigned char*, const struct ieee_802_11_control_header*, OWaveLanPacket* parent = 0 ); | ||
327 | virtual ~OWaveLanControlPacket(); | ||
328 | |||
329 | private: | ||
330 | const struct ieee_802_11_control_header* _header; | ||
331 | }; | ||
332 | |||
333 | /*====================================================================================== | ||
318 | * OLLCPacket - IEEE 802.2 Link Level Control | 334 | * OLLCPacket - IEEE 802.2 Link Level Control |
319 | *======================================================================================*/ | 335 | *======================================================================================*/ |
320 | 336 | ||
321 | class OLLCPacket : public QObject | 337 | class OLLCPacket : public QObject |
322 | { | 338 | { |
323 | Q_OBJECT | 339 | Q_OBJECT |
324 | 340 | ||
325 | public: | 341 | public: |
326 | OLLCPacket( const unsigned char*, const struct ieee_802_11_802_2_header* data, QObject* parent = 0 ); | 342 | OLLCPacket( const unsigned char*, const struct ieee_802_11_802_2_header* data, QObject* parent = 0 ); |
327 | virtual ~OLLCPacket(); | 343 | virtual ~OLLCPacket(); |
328 | 344 | ||
329 | private: | 345 | private: |
330 | const struct ieee_802_11_802_2_header* _header; | 346 | const struct ieee_802_11_802_2_header* _header; |
331 | }; | 347 | }; |
332 | 348 | ||
333 | /*====================================================================================== | 349 | /*====================================================================================== |
334 | * OIPPacket | 350 | * OIPPacket |
335 | *======================================================================================*/ | 351 | *======================================================================================*/ |
336 | 352 | ||
337 | class OIPPacket : public QObject | 353 | class OIPPacket : public QObject |
338 | { | 354 | { |
339 | Q_OBJECT | 355 | Q_OBJECT |
340 | 356 | ||
341 | public: | 357 | public: |