summaryrefslogtreecommitdiff
authormickeyl <mickeyl>2003-04-30 18:42:07 (UTC)
committer mickeyl <mickeyl>2003-04-30 18:42:07 (UTC)
commit027458b66cffbfaf07c394a1a622a1f01970e11c (patch) (unidiff)
tree9cfbbfcebf60c2515719c0e9e2957cc18271dbe5
parent30aac378ab13a7dffbd3b6a0978cabc0372cd530 (diff)
downloadopie-027458b66cffbfaf07c394a1a622a1f01970e11c.zip
opie-027458b66cffbfaf07c394a1a622a1f01970e11c.tar.gz
opie-027458b66cffbfaf07c394a1a622a1f01970e11c.tar.bz2
add some more documentation
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.cpp4
-rw-r--r--libopie2/opienet/onetwork.h30
-rw-r--r--libopie2/opienet/opcap.h5
-rw-r--r--libopie2/opieui/opieui.pro4
4 files changed, 32 insertions, 11 deletions
diff --git a/libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.cpp b/libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.cpp
index f800336..34d32d2 100644
--- a/libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.cpp
+++ b/libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.cpp
@@ -91,64 +91,64 @@ public:
91 if ( !wiface->promiscuousMode() ) 91 if ( !wiface->promiscuousMode() )
92 { 92 {
93 printf( "failed (%s). Exiting.\n", strerror( errno ) ); 93 printf( "failed (%s). Exiting.\n", strerror( errno ) );
94 exit( -1 ); 94 exit( -1 );
95 } 95 }
96 else 96 else
97 { 97 {
98 printf( "ok.\n" ); 98 printf( "ok.\n" );
99 } 99 }
100 } 100 }
101 else 101 else
102 printf( "Interface status is already promisc - good.\n" ); 102 printf( "Interface status is already promisc - good.\n" );
103 103
104 // connect a monitoring strategy to the interface 104 // connect a monitoring strategy to the interface
105 if ( driver == "orinoco" ) 105 if ( driver == "orinoco" )
106 new OOrinocoMonitoringInterface( wiface ); 106 new OOrinocoMonitoringInterface( wiface );
107 else 107 else
108 { 108 {
109 printf( "Unknown driver. Exiting\n" ); 109 printf( "Unknown driver. Exiting\n" );
110 exit( -1 ); 110 exit( -1 );
111 } 111 }
112 112
113 // enable monitoring mode 113 // enable monitoring mode
114 printf( "Enabling monitor mode...\n" ); 114 printf( "Enabling monitor mode...\n" );
115 wiface->setMonitorMode( true ); 115 //wiface->setMonitorMode( true );
116 116
117 // open a packet capturer 117 // open a packet capturer
118 cap = new OPacketCapturer(); 118 cap = new OPacketCapturer();
119 cap->open( interface ); 119 cap->open( interface );
120 if ( !cap->isOpen() ) 120 if ( !cap->isOpen() )
121 { 121 {
122 printf( "Unable to open libpcap (%s). Exiting.\n", strerror( errno ) ); 122 printf( "Unable to open libpcap (%s). Exiting.\n", strerror( errno ) );
123 exit( -1 ); 123 exit( -1 );
124 } 124 }
125 125
126 // set capturer to non-blocking mode 126 // set capturer to non-blocking mode
127 cap->setBlocking( false ); 127 cap->setBlocking( false );
128 128
129 // start channel hopper 129 // start channel hopper
130 wiface->setChannelHopping( 1000 ); 130 //wiface->setChannelHopping( 1000 );
131 131
132 // connect 132 // connect
133 connect( cap, SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) ); 133 connect( cap, SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) );
134 134
135 } 135 }
136 136
137 ~Wellenreiter() {}; 137 ~Wellenreiter() {};
138 138
139public slots: 139public slots:
140 void receivePacket(OPacket* p) 140 void receivePacket(OPacket* p)
141 { 141 {
142 if (!p) 142 if (!p)
143 { 143 {
144 printf( "(empty packet received)\n" ); 144 printf( "(empty packet received)\n" );
145 return; 145 return;
146 } 146 }
147 147
148 OWaveLanManagementPacket* beacon = (OWaveLanManagementPacket*) p->child( "802.11 Management" ); 148 OWaveLanManagementPacket* beacon = (OWaveLanManagementPacket*) p->child( "802.11 Management" );
149 if ( beacon ) 149 if ( beacon )
150 { 150 {
151 OWaveLanManagementSSID* ssid = static_cast<OWaveLanManagementSSID*>( p->child( "802.11 SSID" ) ); 151 OWaveLanManagementSSID* ssid = static_cast<OWaveLanManagementSSID*>( p->child( "802.11 SSID" ) );
152 QString essid = ssid ? ssid->ID() : "<unknown>"; 152 QString essid = ssid ? ssid->ID() : "<unknown>";
153 153
154 if ( stations.find( essid ) ) 154 if ( stations.find( essid ) )
diff --git a/libopie2/opienet/onetwork.h b/libopie2/opienet/onetwork.h
index 2348bbc..f052317 100644
--- a/libopie2/opienet/onetwork.h
+++ b/libopie2/opienet/onetwork.h
@@ -92,49 +92,49 @@ class ONetwork : public QObject
92 */ 92 */
93 int count() const; 93 int count() const;
94 /** 94 /**
95 * @returns a pointer to the (one and only) @ref ONetwork instance. 95 * @returns a pointer to the (one and only) @ref ONetwork instance.
96 */ 96 */
97 static ONetwork* instance(); 97 static ONetwork* instance();
98 /** 98 /**
99 * @returns an iterator usable for iterating through all network interfaces. 99 * @returns an iterator usable for iterating through all network interfaces.
100 */ 100 */
101 InterfaceIterator iterator() const; 101 InterfaceIterator iterator() const;
102 /** 102 /**
103 * @returns true, if the @p interface supports the wireless extension protocol. 103 * @returns true, if the @p interface supports the wireless extension protocol.
104 */ 104 */
105 // FIXME QString? -zecke 105 // FIXME QString? -zecke
106 bool isWirelessInterface( const char* interface ) const; 106 bool isWirelessInterface( const char* interface ) const;
107 /** 107 /**
108 * @returns a pointer to the @ref ONetworkInterface object for the specified @p interface or 0, if not found 108 * @returns a pointer to the @ref ONetworkInterface object for the specified @p interface or 0, if not found
109 * @see ONetworkInterface 109 * @see ONetworkInterface
110 */ 110 */
111 // FIXME: const QString& is prefered over QString!!! -zecke 111 // FIXME: const QString& is prefered over QString!!! -zecke
112 ONetworkInterface* interface( const QString& interface ) const; 112 ONetworkInterface* interface( const QString& interface ) const;
113 /** 113 /**
114 * @internal Rebuild the internal interface database 114 * @internal Rebuild the internal interface database
115 * @note Sometimes it might be useful to call this from client code, 115 * @note Sometimes it might be useful to call this from client code,
116 * e.g. after cardctl insert 116 * e.g. after issuing a cardctl insert
117 */ 117 */
118 void synchronize(); 118 void synchronize();
119 119
120 protected: 120 protected:
121 ONetwork(); 121 ONetwork();
122 122
123 private: 123 private:
124 static ONetwork* _instance; 124 static ONetwork* _instance;
125 InterfaceMap _interfaces; 125 InterfaceMap _interfaces;
126}; 126};
127 127
128 128
129/*====================================================================================== 129/*======================================================================================
130 * ONetworkInterface 130 * ONetworkInterface
131 *======================================================================================*/ 131 *======================================================================================*/
132 132
133/** 133/**
134 * @brief A network interface wrapper. 134 * @brief A network interface wrapper.
135 * 135 *
136 * This class provides a wrapper for a network interface. All the cumbersume details of 136 * This class provides a wrapper for a network interface. All the cumbersume details of
137 * Linux ioctls are hidden under a convenient high-level interface. 137 * Linux ioctls are hidden under a convenient high-level interface.
138 * @warning Most of the setting methods contained in this class require the appropriate 138 * @warning Most of the setting methods contained in this class require the appropriate
139 * process permissions to work. 139 * process permissions to work.
140 * @author Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> 140 * @author Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de>
@@ -232,59 +232,83 @@ class ONetworkInterface : public QObject
232 struct ifreq& ifr() const; 232 struct ifreq& ifr() const;
233 virtual void init(); 233 virtual void init();
234 bool ioctl( int call ) const; 234 bool ioctl( int call ) const;
235 bool ioctl( int call, struct ifreq& ) const; 235 bool ioctl( int call, struct ifreq& ) const;
236}; 236};
237 237
238/*====================================================================================== 238/*======================================================================================
239 * OChannelHopper 239 * OChannelHopper
240 *======================================================================================*/ 240 *======================================================================================*/
241 241
242/** 242/**
243 * @brief A radio frequency channel hopper. 243 * @brief A radio frequency channel hopper.
244 * 244 *
245 * This class provides a channel hopper for radio frequencies. A channel hopper frequently 245 * This class provides a channel hopper for radio frequencies. A channel hopper frequently
246 * changes the radio frequency channel of its associated @ref OWirelessNetworkInterface. 246 * changes the radio frequency channel of its associated @ref OWirelessNetworkInterface.
247 * This is necessary when in monitoring mode and scanning for other devices, because 247 * This is necessary when in monitoring mode and scanning for other devices, because
248 * the radio frequency hardware can only detect packets sent on the same frequency. 248 * the radio frequency hardware can only detect packets sent on the same frequency.
249 * @author Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> 249 * @author Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de>
250 */ 250 */
251class OChannelHopper : public QObject 251class OChannelHopper : public QObject
252{ 252{
253 Q_OBJECT 253 Q_OBJECT
254 254
255 public: 255 public:
256 /**
257 * Constructor.
258 */
256 OChannelHopper( OWirelessNetworkInterface* ); 259 OChannelHopper( OWirelessNetworkInterface* );
260 /**
261 * Destructor.
262 */
257 virtual ~OChannelHopper(); 263 virtual ~OChannelHopper();
264 /**
265 * @returns true, if the channel hopper is hopping channels
266 */
258 bool isActive() const; 267 bool isActive() const;
268 /**
269 * @returns the last hopped channel
270 */
259 int channel() const; 271 int channel() const;
260 virtual void timerEvent( QTimerEvent* ); 272 /**
261 void setInterval( int ); 273 * Set the channel hopping @a interval.
274 * An interval of 0 deactivates the channel hopper.
275 */
276 void setInterval( int interval );
277 /**
278 * @returns the channel hopping interval
279 */
262 int interval() const; 280 int interval() const;
263 281
264 signals: 282 signals:
283 /**
284 * This signal is emitted right after the channel hopper performed a hop
285 */
265 void hopped( int ); 286 void hopped( int );
266 287
288 protected:
289 virtual void timerEvent( QTimerEvent* );
290
267 private: 291 private:
268 OWirelessNetworkInterface* _iface; 292 OWirelessNetworkInterface* _iface;
269 int _interval; 293 int _interval;
270 int _tid; 294 int _tid;
271 QValueList<int> _channels; 295 QValueList<int> _channels;
272 QValueList<int>::Iterator _channel; 296 QValueList<int>::Iterator _channel;
273}; 297};
274 298
275 299
276/*====================================================================================== 300/*======================================================================================
277 * OWirelessNetworkInterface 301 * OWirelessNetworkInterface
278 *======================================================================================*/ 302 *======================================================================================*/
279 303
280/** 304/**
281 * @brief A network interface wrapper for interfaces supporting the wireless extensions protocol. 305 * @brief A network interface wrapper for interfaces supporting the wireless extensions protocol.
282 * 306 *
283 * This class provides a high-level encapsulation of the Linux wireless extension API. 307 * This class provides a high-level encapsulation of the Linux wireless extension API.
284 */ 308 */
285class OWirelessNetworkInterface : public ONetworkInterface 309class OWirelessNetworkInterface : public ONetworkInterface
286{ 310{
287 friend class OMonitoringInterface; 311 friend class OMonitoringInterface;
288 friend class OCiscoMonitoringInterface; 312 friend class OCiscoMonitoringInterface;
289 friend class OWlanNGMonitoringInterface; 313 friend class OWlanNGMonitoringInterface;
290 friend class OHostAPMonitoringInterface; 314 friend class OHostAPMonitoringInterface;
diff --git a/libopie2/opienet/opcap.h b/libopie2/opienet/opcap.h
index 83f7115..bee0ca0 100644
--- a/libopie2/opienet/opcap.h
+++ b/libopie2/opienet/opcap.h
@@ -132,68 +132,66 @@ class OPacket : public QObject
132 const unsigned char* _data; // pcap packet data 132 const unsigned char* _data; // pcap packet data
133 const unsigned char* _end; // end of pcap packet data 133 const unsigned char* _end; // end of pcap packet data
134}; 134};
135 135
136/*====================================================================================== 136/*======================================================================================
137 * OEthernetPacket - DLT_EN10MB frame 137 * OEthernetPacket - DLT_EN10MB frame
138 *======================================================================================*/ 138 *======================================================================================*/
139 139
140class OEthernetPacket : public QObject 140class OEthernetPacket : public QObject
141{ 141{
142 Q_OBJECT 142 Q_OBJECT
143 143
144 public: 144 public:
145 OEthernetPacket( const unsigned char*, const struct ether_header*, QObject* parent = 0 ); 145 OEthernetPacket( const unsigned char*, const struct ether_header*, QObject* parent = 0 );
146 virtual ~OEthernetPacket(); 146 virtual ~OEthernetPacket();
147 147
148 OMacAddress sourceAddress() const; 148 OMacAddress sourceAddress() const;
149 OMacAddress destinationAddress() const; 149 OMacAddress destinationAddress() const;
150 int type() const; 150 int type() const;
151 151
152 private: 152 private:
153 const struct ether_header* _ether; 153 const struct ether_header* _ether;
154}; 154};
155 155
156
157/*====================================================================================== 156/*======================================================================================
158 * OPrismHeaderPacket - DLT_PRISM_HEADER frame 157 * OPrismHeaderPacket - DLT_PRISM_HEADER frame
159 *======================================================================================*/ 158 *======================================================================================*/
160 159
161class OPrismHeaderPacket : public QObject 160class OPrismHeaderPacket : public QObject
162{ 161{
163 Q_OBJECT 162 Q_OBJECT
164 163
165 public: 164 public:
166 OPrismHeaderPacket( const unsigned char*, const struct prism_hdr*, QObject* parent = 0 ); 165 OPrismHeaderPacket( const unsigned char*, const struct prism_hdr*, QObject* parent = 0 );
167 virtual ~OPrismHeaderPacket(); 166 virtual ~OPrismHeaderPacket();
168 167
169 unsigned int signalStrength() const; 168 unsigned int signalStrength() const;
170 169
171 private: 170 private:
172 const struct prism_hdr* _header; 171 const struct prism_hdr* _header;
173}; 172};
174 173
175
176/*====================================================================================== 174/*======================================================================================
177 * OWaveLanPacket - DLT_IEEE802_11 frame 175 * OWaveLanPacket - DLT_IEEE802_11 frame
178 *======================================================================================*/ 176 *======================================================================================*/
179 177
180class OWaveLanPacket : public QObject 178class OWaveLanPacket : public QObject
181{ 179{
182 Q_OBJECT 180 Q_OBJECT
183 181
184 public: 182 public:
185 OWaveLanPacket( const unsigned char*, const struct ieee_802_11_header*, QObject* parent = 0 ); 183 OWaveLanPacket( const unsigned char*, const struct ieee_802_11_header*, QObject* parent = 0 );
186 virtual ~OWaveLanPacket(); 184 virtual ~OWaveLanPacket();
187 185
188 int duration() const; 186 int duration() const;
189 bool fromDS() const; 187 bool fromDS() const;
190 bool toDS() const; 188 bool toDS() const;
191 virtual OMacAddress macAddress1() const; 189 virtual OMacAddress macAddress1() const;
192 virtual OMacAddress macAddress2() const; 190 virtual OMacAddress macAddress2() const;
193 virtual OMacAddress macAddress3() const; 191 virtual OMacAddress macAddress3() const;
194 virtual OMacAddress macAddress4() const; 192 virtual OMacAddress macAddress4() const;
195 bool usesPowerManagement() const; 193 bool usesPowerManagement() const;
196 int type() const; 194 int type() const;
197 int subType() const; 195 int subType() const;
198 int version() const; 196 int version() const;
199 bool usesWep() const; 197 bool usesWep() const;
@@ -331,65 +329,64 @@ class OWaveLanManagementTim : public QObject
331 private: 329 private:
332 const struct tim_t* _data; 330 const struct tim_t* _data;
333}; 331};
334 332
335/*====================================================================================== 333/*======================================================================================
336 * OWaveLanManagementIBSS 334 * OWaveLanManagementIBSS
337 *======================================================================================*/ 335 *======================================================================================*/
338 336
339class OWaveLanManagementIBSS : public QObject 337class OWaveLanManagementIBSS : public QObject
340{ 338{
341 Q_OBJECT 339 Q_OBJECT
342 340
343 public: 341 public:
344 OWaveLanManagementIBSS( const unsigned char*, const struct ibss_t*, QObject* parent = 0 ); 342 OWaveLanManagementIBSS( const unsigned char*, const struct ibss_t*, QObject* parent = 0 );
345 virtual ~OWaveLanManagementIBSS(); 343 virtual ~OWaveLanManagementIBSS();
346 344
347 private: 345 private:
348 const struct ibss_t* _data; 346 const struct ibss_t* _data;
349}; 347};
350 348
351/*====================================================================================== 349/*======================================================================================
352 * OWaveLanManagementChallenge 350 * OWaveLanManagementChallenge
353 *======================================================================================*/ 351 *======================================================================================*/
354 352
355// Qobject do we need that??
356class OWaveLanManagementChallenge : public QObject 353class OWaveLanManagementChallenge : public QObject
357{ 354{
358 Q_OBJECT 355 Q_OBJECT
359 356
360 public: 357 public:
361 OWaveLanManagementChallenge( const unsigned char*, const struct challenge_t*, QObject* parent = 0 ); 358 OWaveLanManagementChallenge( const unsigned char*, const struct challenge_t*, QObject* parent = 0 );
362 virtual ~OWaveLanManagementChallenge(); 359 virtual ~OWaveLanManagementChallenge();
363 360
364 private: 361 private:
365 const struct challenge_t* _data; 362 const struct challenge_t* _data;
366}; 363};
367 364
368/*====================================================================================== 365/*======================================================================================
369 * OWaveLanDataPacket - type: data (T_DATA) 366 * OWaveLanDataPacket - type: data (T_DATA)
370 *======================================================================================*/ 367 *======================================================================================*/
371// Qobject? 368
372class OWaveLanDataPacket : public QObject 369class OWaveLanDataPacket : public QObject
373{ 370{
374 Q_OBJECT 371 Q_OBJECT
375 372
376 public: 373 public:
377 OWaveLanDataPacket( const unsigned char*, const struct ieee_802_11_data_header*, OWaveLanPacket* parent = 0 ); 374 OWaveLanDataPacket( const unsigned char*, const struct ieee_802_11_data_header*, OWaveLanPacket* parent = 0 );
378 virtual ~OWaveLanDataPacket(); 375 virtual ~OWaveLanDataPacket();
379 376
380 private: 377 private:
381 const struct ieee_802_11_data_header* _header; 378 const struct ieee_802_11_data_header* _header;
382}; 379};
383 380
384/*====================================================================================== 381/*======================================================================================
385 * OWaveLanControlPacket - type: control (T_CTRL) 382 * OWaveLanControlPacket - type: control (T_CTRL)
386 *======================================================================================*/ 383 *======================================================================================*/
387 384
388class OWaveLanControlPacket : public QObject 385class OWaveLanControlPacket : public QObject
389{ 386{
390 Q_OBJECT 387 Q_OBJECT
391 388
392 public: 389 public:
393 OWaveLanControlPacket( const unsigned char*, const struct ieee_802_11_control_header*, OWaveLanPacket* parent = 0 ); 390 OWaveLanControlPacket( const unsigned char*, const struct ieee_802_11_control_header*, OWaveLanPacket* parent = 0 );
394 virtual ~OWaveLanControlPacket(); 391 virtual ~OWaveLanControlPacket();
395 392
diff --git a/libopie2/opieui/opieui.pro b/libopie2/opieui/opieui.pro
index 996e1a0..aa85955 100644
--- a/libopie2/opieui/opieui.pro
+++ b/libopie2/opieui/opieui.pro
@@ -1,48 +1,48 @@
1TEMPLATE = lib 1TEMPLATE = lib
2CONFIG += qt warn_on debug 2CONFIG += qt warn_on debug
3DESTDIR = $(OPIEDIR)/lib 3DESTDIR = $(OPIEDIR)/lib
4HEADERS = ocompletionbox.h \ 4HEADERS = ocompletionbox.h \
5 ocombobox.h \ 5 ocombobox.h \
6 oeditlistbox.h \ 6 oeditlistbox.h \
7 olineedit.h \ 7 olineedit.h \
8 olistview.h \ 8 olistview.h \
9 oimageeffect.h \ 9 oimageeffect.h \
10 opixmapeffect.h \ 10 opixmapeffect.h \
11 opopupmenu.h \ 11 opopupmenu.h \
12 opixmapprovider.h \ 12 opixmapprovider.h \
13 oselector.h \ 13 oselector.h \
14 oversatileview.h \ 14 oversatileview.h \
15 oversatileviewitem.h \ 15 oversatileviewitem.h \
16 #ojanuswidget.h \ 16 #ojanuswidget.h \
17 odialog.h \ 17 odialog.h \
18 oseparator.h \ 18 oseparator.h \
19 otaskbarapplet.h 19 otaskbarapplet.h
20 20
21SOURCES = ocompletionbox.cpp \ 21SOURCES = ocompletionbox.cpp \
22 ocombobox.cpp \ 22 ocombobox.cpp \
23 oeditlistbox.cpp \ 23 oeditlistbox.cpp \
24 olineedit.cpp \ 24 olineedit.cpp \
25 olistview.cpp \ 25 olistview.cpp \
26 oimageeffect.cpp \ 26 oimageeffect.cpp \
27 opixmapeffect.cpp \ 27 opixmapeffect.cpp \
28 opopupmenu.cpp \ 28 opopupmenu.cpp \
29 opixmapprovider.cpp \ 29 opixmapprovider.cpp \
30 oselector.cpp \ 30 oselector.cpp \
31 oversatileview.cpp \ 31 oversatileview.cpp \
32 oversatileviewitem.cpp \ 32 oversatileviewitem.cpp \
33 #ojanuswidget.cpp \ 33 #ojanuswidget.cpp \
34 odialog.cpp \ 34 odialog.cpp \
35 oseparator.cpp \ 35 oseparator.cpp \
36 otaskbarapplet.cpp 36 otaskbarapplet.cpp
37 37
38INTERFACES = 38INTERFACES =
39TARGET = opieui2 39TARGET = opieui2
40VERSION = 1.8.1 40VERSION = 1.8.1
41INCLUDEPATH += $(OPIEDIR)/include 41INCLUDEPATH += $(OPIEDIR)/include
42DEPENDPATH += $(OPIEDIR)/include 42DEPENDPATH += $(OPIEDIR)/include
43LIBS += -lopiecore2 43LIBS += -lopiecore2
44MOC_DIR = moc 44MOC_DIR = moc
45OBJECTS_DIR = obj 45OBJECTS_DIR = obj
46 46
47include ( $(OPIEDIR)/include.pro ) 47include ( $(OPIEDIR)/include.pro )
48 48