summaryrefslogtreecommitdiff
path: root/libopie2/opienet
Unidiff
Diffstat (limited to 'libopie2/opienet') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opienet/omanufacturerdb.h1
-rw-r--r--libopie2/opienet/onetutils.h3
-rw-r--r--libopie2/opienet/onetwork.cpp2
-rw-r--r--libopie2/opienet/onetwork.h4
-rw-r--r--libopie2/opienet/opcap.h28
5 files changed, 27 insertions, 11 deletions
diff --git a/libopie2/opienet/omanufacturerdb.h b/libopie2/opienet/omanufacturerdb.h
index 5e66c37..cb0b6c8 100644
--- a/libopie2/opienet/omanufacturerdb.h
+++ b/libopie2/opienet/omanufacturerdb.h
@@ -18,12 +18,13 @@
18 18
19#include <qmap.h> 19#include <qmap.h>
20 20
21class OManufacturerDB 21class OManufacturerDB
22{ 22{
23 public: 23 public:
24 //FIXME make us consistent -zecke I use self(), sandman inst() you use instance() so we need to chose one!
24 static OManufacturerDB* instance(); 25 static OManufacturerDB* instance();
25 const QString& lookup( const QString& macaddr ) const; 26 const QString& lookup( const QString& macaddr ) const;
26 27
27 protected: 28 protected:
28 OManufacturerDB(); 29 OManufacturerDB();
29 virtual ~OManufacturerDB(); 30 virtual ~OManufacturerDB();
diff --git a/libopie2/opienet/onetutils.h b/libopie2/opienet/onetutils.h
index bedea63..9611518 100644
--- a/libopie2/opienet/onetutils.h
+++ b/libopie2/opienet/onetutils.h
@@ -47,21 +47,23 @@ class OWirelessNetworkInterface;
47 * OMacAddress 47 * OMacAddress
48 *======================================================================================*/ 48 *======================================================================================*/
49 49
50class OMacAddress 50class OMacAddress
51{ 51{
52 public: 52 public:
53 // QString c'tor? -zecke
53 OMacAddress( unsigned char* ); 54 OMacAddress( unsigned char* );
54 OMacAddress( const unsigned char* ); 55 OMacAddress( const unsigned char* );
55 OMacAddress( struct ifreq& ); 56 OMacAddress( struct ifreq& );
56 ~OMacAddress(); 57 ~OMacAddress();
57 58
58 QString manufacturer() const; 59 QString manufacturer() const;
59 QString toString( bool substitute = false ) const; 60 QString toString( bool substitute = false ) const;
60 const unsigned char* native() const; 61 const unsigned char* native() const;
61 62
63 // no c'tor but this one why not make it a c'tor. it could also replace the others or is this the problem?
62 static OMacAddress fromString( const QString& ); 64 static OMacAddress fromString( const QString& );
63 65
64 public: 66 public:
65 static const OMacAddress& broadcast; // ff:ff:ff:ff:ff:ff 67 static const OMacAddress& broadcast; // ff:ff:ff:ff:ff:ff
66 static const OMacAddress& unknown; // 44:44:44:44:44:44 68 static const OMacAddress& unknown; // 44:44:44:44:44:44
67 69
@@ -99,12 +101,13 @@ class OPrivateIOCTL : public QObject
99 101
100 int numberGetArgs() const; 102 int numberGetArgs() const;
101 int typeGetArgs() const; 103 int typeGetArgs() const;
102 int numberSetArgs() const; 104 int numberSetArgs() const;
103 int typeSetArgs() const; 105 int typeSetArgs() const;
104 106
107 // FIXME return int? as ::ioctl does? -zecke
105 void invoke() const; 108 void invoke() const;
106 void setParameter( int, u_int32_t ); 109 void setParameter( int, u_int32_t );
107 110
108 private: 111 private:
109 u_int32_t _ioctl; 112 u_int32_t _ioctl;
110 u_int16_t _getargs; 113 u_int16_t _getargs;
diff --git a/libopie2/opienet/onetwork.cpp b/libopie2/opienet/onetwork.cpp
index 73b543b..f0094c7 100644
--- a/libopie2/opienet/onetwork.cpp
+++ b/libopie2/opienet/onetwork.cpp
@@ -105,13 +105,13 @@ void ONetwork::synchronize()
105 _interfaces.insert( str, iface ); 105 _interfaces.insert( str, iface );
106 s.readLine(); 106 s.readLine();
107 } 107 }
108} 108}
109 109
110 110
111ONetworkInterface* ONetwork::interface( QString iface ) const 111ONetworkInterface* ONetwork::interface( const QString& iface ) const
112{ 112{
113 return _interfaces[iface]; 113 return _interfaces[iface];
114} 114}
115 115
116 116
117ONetwork* ONetwork::instance() 117ONetwork* ONetwork::instance()
diff --git a/libopie2/opienet/onetwork.h b/libopie2/opienet/onetwork.h
index d2cc25d..db8e702 100644
--- a/libopie2/opienet/onetwork.h
+++ b/libopie2/opienet/onetwork.h
@@ -95,18 +95,20 @@ class ONetwork : public QObject
95 * @returns an iterator usable for iterating through all network interfaces. 95 * @returns an iterator usable for iterating through all network interfaces.
96 */ 96 */
97 InterfaceIterator iterator() const; 97 InterfaceIterator iterator() const;
98 /** 98 /**
99 * @returns true, if the @p interface supports the wireless extension protocol. 99 * @returns true, if the @p interface supports the wireless extension protocol.
100 */ 100 */
101 // FIXME QString? -zecke
101 bool isWirelessInterface( const char* interface ) const; 102 bool isWirelessInterface( const char* interface ) const;
102 /** 103 /**
103 * @returns a pointer to the @ref ONetworkInterface object for the specified @p interface or 0, if not found 104 * @returns a pointer to the @ref ONetworkInterface object for the specified @p interface or 0, if not found
104 * @see ONetworkInterface 105 * @see ONetworkInterface
105 */ 106 */
106 ONetworkInterface* interface( QString interface ) const; 107 // FIXME: const QString& is prefered over QString!!! -zecke
108 ONetworkInterface* interface( const QString& interface ) const;
107 109
108 protected: 110 protected:
109 ONetwork(); 111 ONetwork();
110 void synchronize(); 112 void synchronize();
111 113
112 private: 114 private:
diff --git a/libopie2/opienet/opcap.h b/libopie2/opienet/opcap.h
index 99631ba..6bf7416 100644
--- a/libopie2/opienet/opcap.h
+++ b/libopie2/opienet/opcap.h
@@ -65,13 +65,13 @@ typedef struct pcap_pkthdr packetheaderstruct;
65class OPacketCapturer; 65class OPacketCapturer;
66class QSocketNotifier; 66class QSocketNotifier;
67 67
68/*====================================================================================== 68/*======================================================================================
69 * OPacket - A frame on the wire 69 * OPacket - A frame on the wire
70 *======================================================================================*/ 70 *======================================================================================*/
71 71// FIXME how many OPackets do we've at a time? QObject seams to be a big for that usage
72class OPacket : public QObject 72class OPacket : public QObject
73{ 73{
74 Q_OBJECT 74 Q_OBJECT
75 75
76 public: 76 public:
77 OPacket( int datalink, packetheaderstruct, const unsigned char*, QObject* parent ); 77 OPacket( int datalink, packetheaderstruct, const unsigned char*, QObject* parent );
@@ -92,12 +92,13 @@ class OPacket : public QObject
92}; 92};
93 93
94/*====================================================================================== 94/*======================================================================================
95 * OEthernetPacket - DLT_EN10MB frame 95 * OEthernetPacket - DLT_EN10MB frame
96 *======================================================================================*/ 96 *======================================================================================*/
97 97
98//FIXME same critic as above -zecke
98class OEthernetPacket : public QObject 99class OEthernetPacket : public QObject
99{ 100{
100 Q_OBJECT 101 Q_OBJECT
101 102
102 public: 103 public:
103 OEthernetPacket( const unsigned char*, const struct ether_header*, QObject* parent = 0 ); 104 OEthernetPacket( const unsigned char*, const struct ether_header*, QObject* parent = 0 );
@@ -112,13 +113,13 @@ class OEthernetPacket : public QObject
112}; 113};
113 114
114 115
115/*====================================================================================== 116/*======================================================================================
116 * OWaveLanPacket - DLT_IEEE802_11 frame 117 * OWaveLanPacket - DLT_IEEE802_11 frame
117 *======================================================================================*/ 118 *======================================================================================*/
118 119//FIXME same
119class OWaveLanPacket : public QObject 120class OWaveLanPacket : public QObject
120{ 121{
121 Q_OBJECT 122 Q_OBJECT
122 123
123 public: 124 public:
124 OWaveLanPacket( const unsigned char*, const struct ieee_802_11_header*, QObject* parent = 0 ); 125 OWaveLanPacket( const unsigned char*, const struct ieee_802_11_header*, QObject* parent = 0 );
@@ -142,13 +143,13 @@ class OWaveLanPacket : public QObject
142}; 143};
143 144
144 145
145/*====================================================================================== 146/*======================================================================================
146 * OWaveLanManagementPacket - type: management (T_MGMT) 147 * OWaveLanManagementPacket - type: management (T_MGMT)
147 *======================================================================================*/ 148 *======================================================================================*/
148 149//FIXME same as above -zecke
149class OWaveLanManagementPacket : public QObject 150class OWaveLanManagementPacket : public QObject
150{ 151{
151 Q_OBJECT 152 Q_OBJECT
152 153
153 public: 154 public:
154 OWaveLanManagementPacket( const unsigned char*, const struct ieee_802_11_mgmt_header*, OWaveLanPacket* parent = 0 ); 155 OWaveLanManagementPacket( const unsigned char*, const struct ieee_802_11_mgmt_header*, OWaveLanPacket* parent = 0 );
@@ -171,13 +172,13 @@ class OWaveLanManagementPacket : public QObject
171}; 172};
172 173
173 174
174/*====================================================================================== 175/*======================================================================================
175 * OWaveLanManagementSSID 176 * OWaveLanManagementSSID
176 *======================================================================================*/ 177 *======================================================================================*/
177 178//FIXME is QObject necessary? -zecke
178class OWaveLanManagementSSID : public QObject 179class OWaveLanManagementSSID : public QObject
179{ 180{
180 Q_OBJECT 181 Q_OBJECT
181 182
182 public: 183 public:
183 OWaveLanManagementSSID( const unsigned char*, const struct ssid_t*, QObject* parent = 0 ); 184 OWaveLanManagementSSID( const unsigned char*, const struct ssid_t*, QObject* parent = 0 );
@@ -189,13 +190,13 @@ class OWaveLanManagementSSID : public QObject
189 const struct ssid_t* _data; 190 const struct ssid_t* _data;
190}; 191};
191 192
192/*====================================================================================== 193/*======================================================================================
193 * OWaveLanManagementRates 194 * OWaveLanManagementRates
194 *======================================================================================*/ 195 *======================================================================================*/
195 196// FIXME same as above -zecke
196class OWaveLanManagementRates : public QObject 197class OWaveLanManagementRates : public QObject
197{ 198{
198 Q_OBJECT 199 Q_OBJECT
199 200
200 public: 201 public:
201 OWaveLanManagementRates( const unsigned char*, const struct rates_t*, QObject* parent = 0 ); 202 OWaveLanManagementRates( const unsigned char*, const struct rates_t*, QObject* parent = 0 );
@@ -206,12 +207,13 @@ class OWaveLanManagementRates : public QObject
206}; 207};
207 208
208/*====================================================================================== 209/*======================================================================================
209 * OWaveLanManagementCF 210 * OWaveLanManagementCF
210 *======================================================================================*/ 211 *======================================================================================*/
211 212
213//FIXME same....
212class OWaveLanManagementCF : public QObject 214class OWaveLanManagementCF : public QObject
213{ 215{
214 Q_OBJECT 216 Q_OBJECT
215 217
216 public: 218 public:
217 OWaveLanManagementCF( const unsigned char*, const struct cf_t*, QObject* parent = 0 ); 219 OWaveLanManagementCF( const unsigned char*, const struct cf_t*, QObject* parent = 0 );
@@ -222,12 +224,13 @@ class OWaveLanManagementCF : public QObject
222}; 224};
223 225
224/*====================================================================================== 226/*======================================================================================
225 * OWaveLanManagementFH 227 * OWaveLanManagementFH
226 *======================================================================================*/ 228 *======================================================================================*/
227 229
230//FIXME same
228class OWaveLanManagementFH : public QObject 231class OWaveLanManagementFH : public QObject
229{ 232{
230 Q_OBJECT 233 Q_OBJECT
231 234
232 public: 235 public:
233 OWaveLanManagementFH( const unsigned char*, const struct fh_t*, QObject* parent = 0 ); 236 OWaveLanManagementFH( const unsigned char*, const struct fh_t*, QObject* parent = 0 );
@@ -237,13 +240,13 @@ class OWaveLanManagementFH : public QObject
237 const struct fh_t* _data; 240 const struct fh_t* _data;
238}; 241};
239 242
240/*====================================================================================== 243/*======================================================================================
241 * OWaveLanManagementDS 244 * OWaveLanManagementDS
242 *======================================================================================*/ 245 *======================================================================================*/
243 246//FIXME same
244class OWaveLanManagementDS : public QObject 247class OWaveLanManagementDS : public QObject
245{ 248{
246 Q_OBJECT 249 Q_OBJECT
247 250
248 public: 251 public:
249 OWaveLanManagementDS( const unsigned char*, const struct ds_t*, QObject* parent = 0 ); 252 OWaveLanManagementDS( const unsigned char*, const struct ds_t*, QObject* parent = 0 );
@@ -256,12 +259,13 @@ class OWaveLanManagementDS : public QObject
256}; 259};
257 260
258/*====================================================================================== 261/*======================================================================================
259 * OWaveLanManagementTim 262 * OWaveLanManagementTim
260 *======================================================================================*/ 263 *======================================================================================*/
261 264
265//FIXME guess what?
262class OWaveLanManagementTim : public QObject 266class OWaveLanManagementTim : public QObject
263{ 267{
264 Q_OBJECT 268 Q_OBJECT
265 269
266 public: 270 public:
267 OWaveLanManagementTim( const unsigned char*, const struct tim_t*, QObject* parent = 0 ); 271 OWaveLanManagementTim( const unsigned char*, const struct tim_t*, QObject* parent = 0 );
@@ -272,12 +276,13 @@ class OWaveLanManagementTim : public QObject
272}; 276};
273 277
274/*====================================================================================== 278/*======================================================================================
275 * OWaveLanManagementIBSS 279 * OWaveLanManagementIBSS
276 *======================================================================================*/ 280 *======================================================================================*/
277 281
282//FIXME same as above ( Qobject )
278class OWaveLanManagementIBSS : public QObject 283class OWaveLanManagementIBSS : public QObject
279{ 284{
280 Q_OBJECT 285 Q_OBJECT
281 286
282 public: 287 public:
283 OWaveLanManagementIBSS( const unsigned char*, const struct ibss_t*, QObject* parent = 0 ); 288 OWaveLanManagementIBSS( const unsigned char*, const struct ibss_t*, QObject* parent = 0 );
@@ -288,12 +293,13 @@ class OWaveLanManagementIBSS : public QObject
288}; 293};
289 294
290/*====================================================================================== 295/*======================================================================================
291 * OWaveLanManagementChallenge 296 * OWaveLanManagementChallenge
292 *======================================================================================*/ 297 *======================================================================================*/
293 298
299// Qobject do we need that??
294class OWaveLanManagementChallenge : public QObject 300class OWaveLanManagementChallenge : public QObject
295{ 301{
296 Q_OBJECT 302 Q_OBJECT
297 303
298 public: 304 public:
299 OWaveLanManagementChallenge( const unsigned char*, const struct challenge_t*, QObject* parent = 0 ); 305 OWaveLanManagementChallenge( const unsigned char*, const struct challenge_t*, QObject* parent = 0 );
@@ -303,13 +309,13 @@ class OWaveLanManagementChallenge : public QObject
303 const struct challenge_t* _data; 309 const struct challenge_t* _data;
304}; 310};
305 311
306/*====================================================================================== 312/*======================================================================================
307 * OWaveLanDataPacket - type: data (T_DATA) 313 * OWaveLanDataPacket - type: data (T_DATA)
308 *======================================================================================*/ 314 *======================================================================================*/
309 315// Qobject?
310class OWaveLanDataPacket : public QObject 316class OWaveLanDataPacket : public QObject
311{ 317{
312 Q_OBJECT 318 Q_OBJECT
313 319
314 public: 320 public:
315 OWaveLanDataPacket( const unsigned char*, const struct ieee_802_11_data_header*, OWaveLanPacket* parent = 0 ); 321 OWaveLanDataPacket( const unsigned char*, const struct ieee_802_11_data_header*, OWaveLanPacket* parent = 0 );
@@ -319,13 +325,13 @@ class OWaveLanDataPacket : public QObject
319 const struct ieee_802_11_data_header* _header; 325 const struct ieee_802_11_data_header* _header;
320}; 326};
321 327
322/*====================================================================================== 328/*======================================================================================
323 * OWaveLanControlPacket - type: control (T_CTRL) 329 * OWaveLanControlPacket - type: control (T_CTRL)
324 *======================================================================================*/ 330 *======================================================================================*/
325 331// Qobject needed?
326class OWaveLanControlPacket : public QObject 332class OWaveLanControlPacket : public QObject
327{ 333{
328 Q_OBJECT 334 Q_OBJECT
329 335
330 public: 336 public:
331 OWaveLanControlPacket( const unsigned char*, const struct ieee_802_11_control_header*, OWaveLanPacket* parent = 0 ); 337 OWaveLanControlPacket( const unsigned char*, const struct ieee_802_11_control_header*, OWaveLanPacket* parent = 0 );
@@ -336,28 +342,31 @@ class OWaveLanControlPacket : public QObject
336}; 342};
337 343
338/*====================================================================================== 344/*======================================================================================
339 * OLLCPacket - IEEE 802.2 Link Level Control 345 * OLLCPacket - IEEE 802.2 Link Level Control
340 *======================================================================================*/ 346 *======================================================================================*/
341 347
348// QObject needed?
342class OLLCPacket : public QObject 349class OLLCPacket : public QObject
343{ 350{
344 Q_OBJECT 351 Q_OBJECT
345 352
346 public: 353 public:
347 OLLCPacket( const unsigned char*, const struct ieee_802_11_802_2_header* data, QObject* parent = 0 ); 354 OLLCPacket( const unsigned char*, const struct ieee_802_11_802_2_header* data, QObject* parent = 0 );
348 virtual ~OLLCPacket(); 355 virtual ~OLLCPacket();
349 356
350 private: 357 private:
358 //FIXME how to get that header?
351 const struct ieee_802_11_802_2_header* _header; 359 const struct ieee_802_11_802_2_header* _header;
352}; 360};
353 361
354/*====================================================================================== 362/*======================================================================================
355 * OIPPacket 363 * OIPPacket
356 *======================================================================================*/ 364 *======================================================================================*/
357 365
366// Qobject as baseclass?
358class OIPPacket : public QObject 367class OIPPacket : public QObject
359{ 368{
360 Q_OBJECT 369 Q_OBJECT
361 370
362 public: 371 public:
363 OIPPacket( const unsigned char*, const struct iphdr*, QObject* parent = 0 ); 372 OIPPacket( const unsigned char*, const struct iphdr*, QObject* parent = 0 );
@@ -378,13 +387,13 @@ class OIPPacket : public QObject
378 const struct iphdr* _iphdr; 387 const struct iphdr* _iphdr;
379}; 388};
380 389
381/*====================================================================================== 390/*======================================================================================
382 * OUDPPacket 391 * OUDPPacket
383 *======================================================================================*/ 392 *======================================================================================*/
384 393// QObject?
385class OUDPPacket : public QObject 394class OUDPPacket : public QObject
386{ 395{
387 Q_OBJECT 396 Q_OBJECT
388 397
389 public: 398 public:
390 OUDPPacket( const unsigned char*, const struct udphdr*, QObject* parent = 0 ); 399 OUDPPacket( const unsigned char*, const struct udphdr*, QObject* parent = 0 );
@@ -398,12 +407,13 @@ class OUDPPacket : public QObject
398}; 407};
399 408
400/*====================================================================================== 409/*======================================================================================
401 * OTCPPacket 410 * OTCPPacket
402 *======================================================================================*/ 411 *======================================================================================*/
403 412
413// Qobect needed?
404class OTCPPacket : public QObject 414class OTCPPacket : public QObject
405{ 415{
406 Q_OBJECT 416 Q_OBJECT
407 417
408 public: 418 public:
409 OTCPPacket( const unsigned char*, const struct tcphdr*, QObject* parent = 0 ); 419 OTCPPacket( const unsigned char*, const struct tcphdr*, QObject* parent = 0 );