summaryrefslogtreecommitdiff
authormickeyl <mickeyl>2002-12-16 23:38:55 (UTC)
committer mickeyl <mickeyl>2002-12-16 23:38:55 (UTC)
commit3f28b7e0edb6115699b19f9db37b55f775b91dc7 (patch) (unidiff)
tree6cfcd1e3175c5a2e02e00851803a24280bc1ac32
parent9cb9007f211c22349e3183ba20bb7f817d811005 (diff)
downloadopie-3f28b7e0edb6115699b19f9db37b55f775b91dc7.zip
opie-3f28b7e0edb6115699b19f9db37b55f775b91dc7.tar.gz
opie-3f28b7e0edb6115699b19f9db37b55f775b91dc7.tar.bz2
- updates to the config window
- GUI now starts channelhopper and sniffer using the command line interface
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/configbase.ui80
-rw-r--r--noncore/net/wellenreiter/gui/configwindow.h1
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiter.cpp98
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiter.h2
4 files changed, 151 insertions, 30 deletions
diff --git a/noncore/net/wellenreiter/gui/configbase.ui b/noncore/net/wellenreiter/gui/configbase.ui
index 57ffd2a..e2f734a 100644
--- a/noncore/net/wellenreiter/gui/configbase.ui
+++ b/noncore/net/wellenreiter/gui/configbase.ui
@@ -1,385 +1,435 @@
1<!DOCTYPE UI><UI> 1<!DOCTYPE UI><UI>
2<class>WellenreiterConfigBase</class> 2<class>WellenreiterConfigBase</class>
3<widget> 3<widget>
4 <class>QWidget</class> 4 <class>QWidget</class>
5 <property stdset="1"> 5 <property stdset="1">
6 <name>name</name> 6 <name>name</name>
7 <cstring>WellenreiterConfigBase</cstring> 7 <cstring>WellenreiterConfigBase</cstring>
8 </property> 8 </property>
9 <property stdset="1"> 9 <property stdset="1">
10 <name>geometry</name> 10 <name>geometry</name>
11 <rect> 11 <rect>
12 <x>0</x> 12 <x>0</x>
13 <y>0</y> 13 <y>0</y>
14 <width>240</width> 14 <width>232</width>
15 <height>276</height> 15 <height>267</height>
16 </rect> 16 </rect>
17 </property> 17 </property>
18 <property stdset="1"> 18 <property stdset="1">
19 <name>caption</name> 19 <name>caption</name>
20 <string>Form1</string> 20 <string>Form1</string>
21 </property> 21 </property>
22 <property>
23 <name>layoutMargin</name>
24 </property>
25 <property>
26 <name>layoutSpacing</name>
27 </property>
22 <vbox> 28 <vbox>
23 <property stdset="1"> 29 <property stdset="1">
24 <name>margin</name> 30 <name>margin</name>
25 <number>11</number> 31 <number>4</number>
26 </property> 32 </property>
27 <property stdset="1"> 33 <property stdset="1">
28 <name>spacing</name> 34 <name>spacing</name>
29 <number>6</number> 35 <number>0</number>
30 </property> 36 </property>
31 <widget> 37 <widget>
32 <class>QLayoutWidget</class> 38 <class>QLayoutWidget</class>
33 <property stdset="1"> 39 <property stdset="1">
34 <name>name</name> 40 <name>name</name>
35 <cstring>Layout5</cstring> 41 <cstring>Layout5</cstring>
36 </property> 42 </property>
43 <property>
44 <name>layoutSpacing</name>
45 </property>
37 <hbox> 46 <hbox>
38 <property stdset="1"> 47 <property stdset="1">
39 <name>margin</name> 48 <name>margin</name>
40 <number>0</number> 49 <number>0</number>
41 </property> 50 </property>
42 <property stdset="1"> 51 <property stdset="1">
43 <name>spacing</name> 52 <name>spacing</name>
44 <number>6</number> 53 <number>2</number>
45 </property> 54 </property>
46 <widget> 55 <widget>
47 <class>QLabel</class> 56 <class>QLabel</class>
48 <property stdset="1"> 57 <property stdset="1">
49 <name>name</name> 58 <name>name</name>
50 <cstring>TextLabel3_2</cstring> 59 <cstring>TextLabel3_2</cstring>
51 </property> 60 </property>
52 <property stdset="1"> 61 <property stdset="1">
53 <name>sizePolicy</name> 62 <name>sizePolicy</name>
54 <sizepolicy> 63 <sizepolicy>
55 <hsizetype>4</hsizetype> 64 <hsizetype>4</hsizetype>
56 <vsizetype>1</vsizetype> 65 <vsizetype>1</vsizetype>
57 </sizepolicy> 66 </sizepolicy>
58 </property> 67 </property>
59 <property stdset="1"> 68 <property stdset="1">
60 <name>text</name> 69 <name>text</name>
61 <string>Sniffer</string> 70 <string>Sniffer</string>
62 </property> 71 </property>
63 </widget> 72 </widget>
64 <widget> 73 <widget>
65 <class>Line</class> 74 <class>Line</class>
66 <property stdset="1"> 75 <property stdset="1">
67 <name>name</name> 76 <name>name</name>
68 <cstring>Line9</cstring> 77 <cstring>Line9</cstring>
69 </property> 78 </property>
70 <property stdset="1"> 79 <property stdset="1">
71 <name>orientation</name> 80 <name>orientation</name>
72 <enum>Horizontal</enum> 81 <enum>Horizontal</enum>
73 </property> 82 </property>
74 </widget> 83 </widget>
75 </hbox> 84 </hbox>
76 </widget> 85 </widget>
77 <widget> 86 <widget>
78 <class>QLayoutWidget</class> 87 <class>QLayoutWidget</class>
79 <property stdset="1"> 88 <property stdset="1">
80 <name>name</name> 89 <name>name</name>
81 <cstring>Layout7</cstring> 90 <cstring>Layout7</cstring>
82 </property> 91 </property>
92 <property>
93 <name>layoutSpacing</name>
94 </property>
83 <grid> 95 <grid>
84 <property stdset="1"> 96 <property stdset="1">
85 <name>margin</name> 97 <name>margin</name>
86 <number>0</number> 98 <number>0</number>
87 </property> 99 </property>
88 <property stdset="1"> 100 <property stdset="1">
89 <name>spacing</name> 101 <name>spacing</name>
90 <number>6</number> 102 <number>2</number>
91 </property> 103 </property>
92 <widget row="0" column="0" > 104 <widget row="0" column="0" >
93 <class>QComboBox</class> 105 <class>QComboBox</class>
94 <item> 106 <item>
95 <property> 107 <property>
96 <name>text</name> 108 <name>text</name>
97 <string>&lt;select&gt;</string> 109 <string>&lt;select&gt;</string>
98 </property> 110 </property>
99 </item> 111 </item>
100 <item> 112 <item>
101 <property> 113 <property>
102 <name>text</name> 114 <name>text</name>
103 <string>eth0</string> 115 <string>eth0</string>
104 </property> 116 </property>
105 </item> 117 </item>
106 <item> 118 <item>
107 <property> 119 <property>
108 <name>text</name> 120 <name>text</name>
109 <string>eth1</string> 121 <string>eth1</string>
110 </property> 122 </property>
111 </item> 123 </item>
112 <item> 124 <item>
113 <property> 125 <property>
114 <name>text</name> 126 <name>text</name>
115 <string>wlan0</string> 127 <string>wlan0</string>
116 </property> 128 </property>
117 </item> 129 </item>
118 <item> 130 <item>
119 <property> 131 <property>
120 <name>text</name> 132 <name>text</name>
121 <string>wlan1</string> 133 <string>wlan1</string>
122 </property> 134 </property>
123 </item> 135 </item>
124 <item> 136 <item>
125 <property> 137 <property>
126 <name>text</name> 138 <name>text</name>
127 <string>wifi0</string> 139 <string>wifi0</string>
128 </property> 140 </property>
129 </item> 141 </item>
130 <item> 142 <item>
131 <property> 143 <property>
132 <name>text</name> 144 <name>text</name>
133 <string>wifi1</string> 145 <string>wifi1</string>
134 </property> 146 </property>
135 </item> 147 </item>
136 <property stdset="1"> 148 <property stdset="1">
137 <name>name</name> 149 <name>name</name>
138 <cstring>interfaceName</cstring> 150 <cstring>interfaceName</cstring>
139 </property> 151 </property>
140 <property stdset="1"> 152 <property stdset="1">
141 <name>enabled</name> 153 <name>enabled</name>
142 <bool>false</bool> 154 <bool>true</bool>
143 </property> 155 </property>
144 </widget> 156 </widget>
145 <widget row="4" column="0" rowspan="1" colspan="2" > 157 <widget row="4" column="0" rowspan="1" colspan="2" >
146 <class>QCheckBox</class> 158 <class>QCheckBox</class>
147 <property stdset="1"> 159 <property stdset="1">
148 <name>name</name> 160 <name>name</name>
149 <cstring>activeScanning</cstring> 161 <cstring>activeScanning</cstring>
150 </property> 162 </property>
151 <property stdset="1"> 163 <property stdset="1">
152 <name>enabled</name> 164 <name>enabled</name>
153 <bool>false</bool> 165 <bool>false</bool>
154 </property> 166 </property>
155 <property stdset="1"> 167 <property stdset="1">
156 <name>text</name> 168 <name>text</name>
157 <string>Active Scanning (caution!)</string> 169 <string>Active Scanning (caution!)</string>
158 </property> 170 </property>
159 </widget> 171 </widget>
160 <widget row="1" column="0" > 172 <widget row="1" column="0" >
161 <class>QComboBox</class> 173 <class>QComboBox</class>
162 <item> 174 <item>
163 <property> 175 <property>
164 <name>text</name> 176 <name>text</name>
165 <string>&lt;select&gt;</string> 177 <string>&lt;select&gt;</string>
166 </property> 178 </property>
167 </item> 179 </item>
168 <item> 180 <item>
169 <property> 181 <property>
170 <name>text</name> 182 <name>text</name>
171 <string>cisco</string> 183 <string>cisco</string>
172 </property> 184 </property>
173 </item> 185 </item>
174 <item> 186 <item>
175 <property> 187 <property>
176 <name>text</name> 188 <name>text</name>
177 <string>orinoco</string> 189 <string>orinoco</string>
178 </property> 190 </property>
179 </item> 191 </item>
180 <item> 192 <item>
181 <property> 193 <property>
182 <name>text</name> 194 <name>text</name>
183 <string>prism</string> 195 <string>prism</string>
184 </property> 196 </property>
185 </item> 197 </item>
186 <item> 198 <item>
187 <property> 199 <property>
188 <name>text</name> 200 <name>text</name>
189 <string>&lt;manual&gt;</string> 201 <string>&lt;manual&gt;</string>
190 </property> 202 </property>
191 </item> 203 </item>
192 <property stdset="1"> 204 <property stdset="1">
193 <name>name</name> 205 <name>name</name>
194 <cstring>deviceType</cstring> 206 <cstring>deviceType</cstring>
195 </property> 207 </property>
196 <property stdset="1"> 208 <property stdset="1">
197 <name>enabled</name> 209 <name>enabled</name>
198 <bool>false</bool> 210 <bool>true</bool>
199 </property> 211 </property>
200 </widget> 212 </widget>
201 <widget row="3" column="0" rowspan="1" colspan="2" > 213 <widget row="3" column="0" rowspan="1" colspan="2" >
202 <class>QCheckBox</class> 214 <class>QCheckBox</class>
203 <property stdset="1"> 215 <property stdset="1">
204 <name>name</name> 216 <name>name</name>
205 <cstring>additionalInfo</cstring> 217 <cstring>additionalInfo</cstring>
206 </property> 218 </property>
207 <property stdset="1"> 219 <property stdset="1">
208 <name>enabled</name> 220 <name>enabled</name>
209 <bool>false</bool> 221 <bool>false</bool>
210 </property> 222 </property>
211 <property stdset="1"> 223 <property stdset="1">
212 <name>text</name> 224 <name>text</name>
213 <string>Gather Additional Info</string> 225 <string>Gather Additional Info</string>
214 </property> 226 </property>
215 </widget> 227 </widget>
216 <widget row="2" column="0" > 228 <widget row="2" column="0" >
217 <class>QSpinBox</class> 229 <class>QSpinBox</class>
218 <property stdset="1"> 230 <property stdset="1">
219 <name>name</name> 231 <name>name</name>
220 <cstring>hopInterval</cstring> 232 <cstring>hopInterval</cstring>
221 </property> 233 </property>
222 <property stdset="1"> 234 <property stdset="1">
223 <name>enabled</name> 235 <name>enabled</name>
224 <bool>false</bool> 236 <bool>true</bool>
225 </property> 237 </property>
226 <property stdset="1"> 238 <property stdset="1">
227 <name>suffix</name> 239 <name>suffix</name>
228 <string> ms</string> 240 <string> ms</string>
229 </property> 241 </property>
230 <property stdset="1"> 242 <property stdset="1">
231 <name>maxValue</name> 243 <name>maxValue</name>
232 <number>2000</number> 244 <number>2000</number>
233 </property> 245 </property>
234 <property stdset="1"> 246 <property stdset="1">
235 <name>minValue</name> 247 <name>minValue</name>
236 <number>100</number> 248 <number>100</number>
237 </property> 249 </property>
238 <property stdset="1"> 250 <property stdset="1">
239 <name>lineStep</name> 251 <name>lineStep</name>
240 <number>100</number> 252 <number>100</number>
241 </property> 253 </property>
242 </widget> 254 </widget>
243 <widget row="2" column="1" > 255 <widget row="2" column="1" >
244 <class>QLabel</class> 256 <class>QLabel</class>
245 <property stdset="1"> 257 <property stdset="1">
246 <name>name</name> 258 <name>name</name>
247 <cstring>TextLabel3_3</cstring> 259 <cstring>TextLabel3_3</cstring>
248 </property> 260 </property>
249 <property stdset="1"> 261 <property stdset="1">
250 <name>enabled</name> 262 <name>enabled</name>
251 <bool>false</bool> 263 <bool>true</bool>
252 </property> 264 </property>
253 <property stdset="1"> 265 <property stdset="1">
254 <name>text</name> 266 <name>text</name>
255 <string>Hop Interval</string> 267 <string>Hop Interval</string>
256 </property> 268 </property>
257 </widget> 269 </widget>
258 <widget row="1" column="1" > 270 <widget row="1" column="1" >
259 <class>QLabel</class> 271 <class>QLabel</class>
260 <property stdset="1"> 272 <property stdset="1">
261 <name>name</name> 273 <name>name</name>
262 <cstring>TextLabel2_3</cstring> 274 <cstring>TextLabel2_3</cstring>
263 </property> 275 </property>
264 <property stdset="1"> 276 <property stdset="1">
265 <name>enabled</name> 277 <name>enabled</name>
266 <bool>false</bool> 278 <bool>true</bool>
267 </property> 279 </property>
268 <property stdset="1"> 280 <property stdset="1">
269 <name>text</name> 281 <name>text</name>
270 <string>Device Type</string> 282 <string>Device Type</string>
271 </property> 283 </property>
272 </widget> 284 </widget>
273 <widget row="0" column="1" > 285 <widget row="0" column="1" >
274 <class>QLabel</class> 286 <class>QLabel</class>
275 <property stdset="1"> 287 <property stdset="1">
276 <name>name</name> 288 <name>name</name>
277 <cstring>TextLabel1_2</cstring> 289 <cstring>TextLabel1_2</cstring>
278 </property> 290 </property>
279 <property stdset="1"> 291 <property stdset="1">
280 <name>enabled</name> 292 <name>enabled</name>
281 <bool>false</bool> 293 <bool>true</bool>
282 </property> 294 </property>
283 <property stdset="1"> 295 <property stdset="1">
284 <name>text</name> 296 <name>text</name>
285 <string>Interface Name</string> 297 <string>Interface Name</string>
286 </property> 298 </property>
287 </widget> 299 </widget>
288 </grid> 300 </grid>
289 </widget> 301 </widget>
290 <widget> 302 <widget>
291 <class>QLayoutWidget</class> 303 <class>QLayoutWidget</class>
292 <property stdset="1"> 304 <property stdset="1">
293 <name>name</name> 305 <name>name</name>
294 <cstring>Layout6</cstring> 306 <cstring>Layout6</cstring>
295 </property> 307 </property>
308 <property>
309 <name>layoutSpacing</name>
310 </property>
296 <hbox> 311 <hbox>
297 <property stdset="1"> 312 <property stdset="1">
298 <name>margin</name> 313 <name>margin</name>
299 <number>0</number> 314 <number>0</number>
300 </property> 315 </property>
301 <property stdset="1"> 316 <property stdset="1">
302 <name>spacing</name> 317 <name>spacing</name>
303 <number>6</number> 318 <number>2</number>
304 </property> 319 </property>
305 <widget> 320 <widget>
306 <class>QLabel</class> 321 <class>QLabel</class>
307 <property stdset="1"> 322 <property stdset="1">
308 <name>name</name> 323 <name>name</name>
309 <cstring>TextLabel3_2_2</cstring> 324 <cstring>TextLabel3_2_2</cstring>
310 </property> 325 </property>
311 <property stdset="1"> 326 <property stdset="1">
312 <name>sizePolicy</name> 327 <name>sizePolicy</name>
313 <sizepolicy> 328 <sizepolicy>
314 <hsizetype>4</hsizetype> 329 <hsizetype>4</hsizetype>
315 <vsizetype>1</vsizetype> 330 <vsizetype>1</vsizetype>
316 </sizepolicy> 331 </sizepolicy>
317 </property> 332 </property>
318 <property stdset="1"> 333 <property stdset="1">
319 <name>text</name> 334 <name>text</name>
320 <string>GUI</string> 335 <string>GUI</string>
321 </property> 336 </property>
322 </widget> 337 </widget>
323 <widget> 338 <widget>
324 <class>Line</class> 339 <class>Line</class>
325 <property stdset="1"> 340 <property stdset="1">
326 <name>name</name> 341 <name>name</name>
327 <cstring>Line9_2</cstring> 342 <cstring>Line9_2</cstring>
328 </property> 343 </property>
329 <property stdset="1"> 344 <property stdset="1">
330 <name>orientation</name> 345 <name>orientation</name>
331 <enum>Horizontal</enum> 346 <enum>Horizontal</enum>
332 </property> 347 </property>
333 </widget> 348 </widget>
334 </hbox> 349 </hbox>
335 </widget> 350 </widget>
336 <widget> 351 <widget>
337 <class>QLayoutWidget</class> 352 <class>QLayoutWidget</class>
338 <property stdset="1"> 353 <property stdset="1">
339 <name>name</name> 354 <name>name</name>
340 <cstring>Layout8</cstring> 355 <cstring>Layout5</cstring>
356 </property>
357 <property>
358 <name>layoutSpacing</name>
341 </property> 359 </property>
342 <vbox> 360 <vbox>
343 <property stdset="1"> 361 <property stdset="1">
344 <name>margin</name> 362 <name>margin</name>
345 <number>0</number> 363 <number>0</number>
346 </property> 364 </property>
347 <property stdset="1"> 365 <property stdset="1">
348 <name>spacing</name> 366 <name>spacing</name>
349 <number>6</number> 367 <number>-1</number>
350 </property> 368 </property>
351 <widget> 369 <widget>
352 <class>QCheckBox</class> 370 <class>QCheckBox</class>
353 <property stdset="1"> 371 <property stdset="1">
354 <name>name</name> 372 <name>name</name>
355 <cstring>groupNetworks</cstring> 373 <cstring>groupNetworks</cstring>
356 </property> 374 </property>
357 <property stdset="1"> 375 <property stdset="1">
358 <name>enabled</name> 376 <name>enabled</name>
359 <bool>false</bool> 377 <bool>false</bool>
360 </property> 378 </property>
361 <property stdset="1"> 379 <property stdset="1">
362 <name>text</name> 380 <name>text</name>
363 <string>Group Detected Networks</string> 381 <string>Group Detected Networks</string>
364 </property> 382 </property>
365 </widget> 383 </widget>
366 <widget> 384 <widget>
367 <class>QCheckBox</class> 385 <class>QCheckBox</class>
368 <property stdset="1"> 386 <property stdset="1">
369 <name>name</name> 387 <name>name</name>
370 <cstring>enableActivity</cstring> 388 <cstring>enableActivity</cstring>
371 </property> 389 </property>
372 <property stdset="1"> 390 <property stdset="1">
373 <name>enabled</name> 391 <name>enabled</name>
374 <bool>false</bool> 392 <bool>false</bool>
375 </property> 393 </property>
376 <property stdset="1"> 394 <property stdset="1">
377 <name>text</name> 395 <name>text</name>
378 <string>Enable Activity Display</string> 396 <string>Enable Activity Display</string>
379 </property> 397 </property>
380 </widget> 398 </widget>
399 <widget>
400 <class>QCheckBox</class>
401 <property stdset="1">
402 <name>name</name>
403 <cstring>beepOnFound</cstring>
404 </property>
405 <property stdset="1">
406 <name>text</name>
407 <string>Beep on new network</string>
408 </property>
409 </widget>
381 </vbox> 410 </vbox>
382 </widget> 411 </widget>
412 <spacer>
413 <property>
414 <name>name</name>
415 <cstring>Spacer2</cstring>
416 </property>
417 <property stdset="1">
418 <name>orientation</name>
419 <enum>Vertical</enum>
420 </property>
421 <property stdset="1">
422 <name>sizeType</name>
423 <enum>Expanding</enum>
424 </property>
425 <property>
426 <name>sizeHint</name>
427 <size>
428 <width>20</width>
429 <height>20</height>
430 </size>
431 </property>
432 </spacer>
383 </vbox> 433 </vbox>
384</widget> 434</widget>
385</UI> 435</UI>
diff --git a/noncore/net/wellenreiter/gui/configwindow.h b/noncore/net/wellenreiter/gui/configwindow.h
index 759d46d..c2db283 100644
--- a/noncore/net/wellenreiter/gui/configwindow.h
+++ b/noncore/net/wellenreiter/gui/configwindow.h
@@ -1,30 +1,31 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. 2** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved.
3** 3**
4** This file is part of Opie Environment. 4** This file is part of Opie Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14**********************************************************************/ 14**********************************************************************/
15 15
16#ifndef WELLENREITERCONFIGWINDOW_H 16#ifndef WELLENREITERCONFIGWINDOW_H
17#define WELLENREITERCONFIGWINDOW_H 17#define WELLENREITERCONFIGWINDOW_H
18 18
19#include "configbase.h" 19#include "configbase.h"
20 20
21class WellenreiterConfigWindow : public WellenreiterConfigBase 21class WellenreiterConfigWindow : public WellenreiterConfigBase
22{ 22{
23 23
24 public: 24 public:
25 WellenreiterConfigWindow( QWidget * parent = 0, const char * name = "WellenreiterConfigWindow", WFlags f = 0 ); 25 WellenreiterConfigWindow( QWidget * parent = 0, const char * name = "WellenreiterConfigWindow", WFlags f = 0 );
26 26
27
27}; 28};
28 29
29#endif 30#endif
30 31
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp
index 5808e9c..764ef34 100644
--- a/noncore/net/wellenreiter/gui/wellenreiter.cpp
+++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp
@@ -1,257 +1,325 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. 2** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved.
3** 3**
4** This file is part of Opie Environment. 4** This file is part of Opie Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14***********************************************************************/ 14***********************************************************************/
15 15
16// Qt 16// Qt
17 17
18#include <qpushbutton.h> 18#include <qpushbutton.h>
19#include <qmessagebox.h>
20#include <qcombobox.h>
21#include <qspinbox.h>
22
23// Qtopia
24
25#ifdef QWS
26#include <qpe/global.h>
27#endif
19 28
20// Standard 29// Standard
21 30
22#include <assert.h> 31#include <assert.h>
23#include <errno.h> 32#include <errno.h>
24#include <unistd.h> 33#include <unistd.h>
25#include <string.h> 34#include <string.h>
26#include <sys/types.h> 35#include <sys/types.h>
36#include <stdlib.h>
27 37
28// Local 38// Local
29 39
30#include "wellenreiter.h" 40#include "wellenreiter.h"
31#include "scanlistitem.h" 41#include "scanlistitem.h"
32#include "logwindow.h" 42#include "logwindow.h"
33#include "hexwindow.h" 43#include "hexwindow.h"
44#include "configwindow.h"
34 45
35#include "../libwellenreiter/source/sock.hh" // <--- ugly path, FIX THIS! 46#include "../libwellenreiter/source/sock.hh" // <--- ugly path, FIX THIS!
36#include "../libwellenreiter/source/proto.hh" // <--- ugly path, FIX THIS! 47#include "../libwellenreiter/source/proto.hh" // <--- ugly path, FIX THIS!
37#include "../daemon/source/config.hh" // <--- ugly path, FIX THIS! 48#include "../daemon/source/config.hh" // <--- ugly path, FIX THIS!
38 49
39Wellenreiter::Wellenreiter( QWidget* parent, const char* name, WFlags fl ) 50Wellenreiter::Wellenreiter( QWidget* parent, const char* name, WFlags fl )
40 : WellenreiterBase( parent, name, fl ) 51 : WellenreiterBase( parent, name, fl ), daemonRunning( false )
41{ 52{
42 53
43 logwindow->log( "(i) Wellenreiter has been started." ); 54 logwindow->log( "(i) Wellenreiter has been started." );
44 55
45 connect( button, SIGNAL( clicked() ), this, SLOT( buttonClicked() ) ); 56 connect( button, SIGNAL( clicked() ), this, SLOT( buttonClicked() ) );
46 netview->setColumnWidthMode( 1, QListView::Manual ); 57 netview->setColumnWidthMode( 1, QListView::Manual );
47 58
48 // 59 //
49 // setup socket for daemon communication and start poller 60 // setup socket for daemon communication and start poller
50 // 61 //
51 62
52 daemon_fd = commsock( GUIADDR, GUIPORT ); 63 daemon_fd = commsock( GUIADDR, GUIPORT );
53 if ( daemon_fd == -1 ) 64 if ( daemon_fd == -1 )
54 { 65 {
55 logwindow->log( "(E) Couldn't get file descriptor for commsocket." ); 66 logwindow->log( "(E) Couldn't get file descriptor for commsocket." );
56 qDebug( "D'oh! Could not get file descriptor for daemon-->gui communication socket." ); 67 qDebug( "D'oh! Could not get file descriptor for daemon-->gui communication socket." );
57 } 68 }
58 else 69 else
59 startTimer( 700 ); 70 startTimer( 700 );
60 71
61} 72}
62 73
63Wellenreiter::~Wellenreiter() 74Wellenreiter::~Wellenreiter()
64{ 75{
65 // no need to delete child widgets, Qt does it all for us 76 // no need to delete child widgets, Qt does it all for us
66} 77}
67 78
68void Wellenreiter::handleMessage() 79void Wellenreiter::handleMessage()
69{ 80{
70 // FIXME: receive message and handle it 81 // FIXME: receive message and handle it
71 82
72 qDebug( "received message from daemon." ); 83 qDebug( "received message from daemon." );
73 84
74 char buffer[128]; 85 char buffer[128];
75 86
76 int result = recvcomm( &daemon_fd, (char*) &buffer, sizeof(buffer) ); 87 int result = recvcomm( &daemon_fd, (char*) &buffer, sizeof(buffer) );
77 qDebug( "received %d from recvcomm", result ); 88 qDebug( "received %d from recvcomm", result );
78 89
79/* 90/*
80typedef struct { 91typedef struct {
81 int net_type; 1 = Accesspoint ; 2 = Ad-Hoc 92 int net_type; 1 = Accesspoint ; 2 = Ad-Hoc
82 int ssid_len; Length of SSID 93 int ssid_len; Length of SSID
83 int channel; Channel 94 int channel; Channel
84 int wep; 1 = WEP enabled ; 0 = disabled 95 int wep; 1 = WEP enabled ; 0 = disabled
85 char mac[64]; MAC address of Accesspoint 96 char mac[64]; MAC address of Accesspoint
86 char bssid[128]; BSSID of Accesspoint 97 char bssid[128]; BSSID of Accesspoint
87} wl_network_t; 98} wl_network_t;
88*/ 99*/
89 100
90 // qDebug( "Sniffer sent: '%s'", (const char*) buffer ); 101 // qDebug( "Sniffer sent: '%s'", (const char*) buffer );
91 hexwindow->log( (const char*) &buffer ); 102 hexwindow->log( (const char*) &buffer );
92 103
93 if ( result == NETFOUND ) /* new network found */ 104 if ( result == NETFOUND ) /* new network found */
94 { 105 {
95 qDebug( "Sniffer said: new network found." ); 106 qDebug( "Sniffer said: new network found." );
96 wl_network_t n; 107 wl_network_t n;
97 get_network_found( &n, (char*) &buffer ); 108 get_network_found( &n, (char*) &buffer );
98 109
99 qDebug( "Sniffer said: net_type is %d.", n.net_type ); 110 qDebug( "Sniffer said: net_type is %d.", n.net_type );
100 qDebug( "Sniffer said: MAC is %s", (const char*) &n.mac ); 111 qDebug( "Sniffer said: MAC is %s", (const char*) &n.mac );
101 112
102 //n.bssid[n.ssid_len] = "\0"; 113 //n.bssid[n.ssid_len] = "\0";
103 114
104 QString type; 115 QString type;
105 116
106 if ( n.net_type == 1 ) 117 if ( n.net_type == 1 )
107 type = "managed"; 118 type = "managed";
108 else 119 else
109 type = "adhoc"; 120 type = "adhoc";
110 121
111 addNewItem( type, n.bssid, QString( (const char*) &n.mac ), n.wep, n.channel, 0 ); 122 addNewItem( type, n.bssid, QString( (const char*) &n.mac ), n.wep, n.channel, 0 );
112 123
113 } 124 }
114 125
115 else 126 else
116 127
117 { 128 {
118 qDebug( "unknown sniffer command." ); 129 qDebug( "unknown sniffer command." );
119 } 130 }
120 131
121} 132}
122 133
123 134
124bool Wellenreiter::hasMessage() 135bool Wellenreiter::hasMessage()
125{ 136{
126 137
127 // FIXME: do this in libwellenreiter, not here!!! 138 // FIXME: do this in libwellenreiter, not here!!!
128 139
129 fd_set rfds; 140 fd_set rfds;
130 FD_ZERO( &rfds ); 141 FD_ZERO( &rfds );
131 FD_SET( daemon_fd, &rfds ); 142 FD_SET( daemon_fd, &rfds );
132 struct timeval tv; 143 struct timeval tv;
133 tv.tv_sec = 0; 144 tv.tv_sec = 0;
134 tv.tv_usec = 10; 145 tv.tv_usec = 10;
135 int result = select( daemon_fd+1, &rfds, NULL, NULL, &tv ); 146 int result = select( daemon_fd+1, &rfds, NULL, NULL, &tv );
136 147
137 if ( result == 0 ) 148 if ( result == 0 )
138 { 149 {
139 return false; 150 return false;
140 } 151 }
141 else if ( result == -1 ) 152 else if ( result == -1 )
142 { 153 {
143 qDebug( "selected returned: %s", strerror( errno ) ); 154 qDebug( "selected returned: %s", strerror( errno ) );
144 return false; 155 return false;
145 } 156 }
146 else 157 else
147 return true; //FD_ISSET( daemon_fd, &rfds ); gibbet 'eh nur einen Deskriptor 158 return true; //FD_ISSET( daemon_fd, &rfds ); gibbet 'eh nur einen Deskriptor
148} 159}
149 160
150void Wellenreiter::timerEvent( QTimerEvent* e ) 161void Wellenreiter::timerEvent( QTimerEvent* e )
151{ 162{
152 qDebug( "checking for message..." ); 163 //qDebug( "checking for message..." );
153 if ( hasMessage() ) 164 if ( hasMessage() )
154 { 165 {
155 qDebug( "got message" ); 166 //qDebug( "got message from daemon" );
156 handleMessage(); 167 handleMessage();
157 } 168 }
158 else 169 else
159 { 170 {
160 qDebug( "no message..." ); 171 //qDebug( "no message..." );
161 } 172 }
162} 173}
163 174
164void Wellenreiter::addNewItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal ) 175void Wellenreiter::addNewItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal )
165{ 176{
166 // FIXME: this code belongs in customized QListView, not into this class 177 // FIXME: this code belongs in customized QListView, not into this class
167 // FIXME: scanlistitem needs a proper encapsulation and not such a damn dealing with text(...) 178 // FIXME: scanlistitem needs a proper encapsulation and not such a damn dealing with text(...)
168 179
169 qDebug( "Wellenreiter::addNewItem( %s / %s / %s [%d]", 180 qDebug( "Wellenreiter::addNewItem( %s / %s / %s [%d]",
170 (const char*) type, 181 (const char*) type,
171 (const char*) essid, 182 (const char*) essid,
172 (const char*) macaddr, 183 (const char*) macaddr,
173 channel ); 184 channel );
174 185
175 // search, if we already have seen this net 186 // search, if we already have seen this net
176 187
177 QString s; 188 QString s;
178 MScanListItem* network; 189 MScanListItem* network;
179 MScanListItem* item = static_cast<MScanListItem*> ( netview->firstChild() ); 190 MScanListItem* item = static_cast<MScanListItem*> ( netview->firstChild() );
180 191
181 while ( item && ( item->text( 0 ) != essid ) ) 192 while ( item && ( item->text( 0 ) != essid ) )
182 { 193 {
183 qDebug( "itemtext: %s", (const char*) item->text( 0 ) ); 194 qDebug( "itemtext: %s", (const char*) item->text( 0 ) );
184 item = static_cast<MScanListItem*> ( item->itemBelow() ); 195 item = static_cast<MScanListItem*> ( item->itemBelow() );
185 } 196 }
186 if ( item ) 197 if ( item )
187 { 198 {
188 // we have already seen this net, check all childs if MAC exists 199 // we have already seen this net, check all childs if MAC exists
189 200
190 network = item; 201 network = item;
191 202
192 item = static_cast<MScanListItem*> ( item->firstChild() ); 203 item = static_cast<MScanListItem*> ( item->firstChild() );
193 assert( item ); // this shouldn't fail 204 assert( item ); // this shouldn't fail
194 205
195 while ( item && ( item->text( 2 ) != macaddr ) ) 206 while ( item && ( item->text( 2 ) != macaddr ) )
196 { 207 {
197 qDebug( "subitemtext: %s", (const char*) item->text( 2 ) ); 208 qDebug( "subitemtext: %s", (const char*) item->text( 2 ) );
198 item = static_cast<MScanListItem*> ( item->itemBelow() ); 209 item = static_cast<MScanListItem*> ( item->itemBelow() );
199 } 210 }
200 211
201 if ( item ) 212 if ( item )
202 { 213 {
203 // we have already seen this item, it's a dupe 214 // we have already seen this item, it's a dupe
204 qDebug( "%s is a dupe - ignoring...", (const char*) macaddr ); 215 qDebug( "%s is a dupe - ignoring...", (const char*) macaddr );
205 return; 216 return;
206 } 217 }
207 } 218 }
208 else 219 else
209 { 220 {
210 s.sprintf( "(i) new network: '%s'", (const char*) essid ); 221 s.sprintf( "(i) new network: '%s'", (const char*) essid );
211 logwindow->log( s ); 222 logwindow->log( s );
212 223
213 network = new MScanListItem( netview, "networks", essid, QString::null, 0, 0, 0 ); 224 network = new MScanListItem( netview, "networks", essid, QString::null, 0, 0, 0 );
214 } 225 }
215 226
216 227
217 // insert new station as child from network 228 // insert new station as child from network
218 229
219 // no essid to reduce clutter, maybe later we have a nick or stationname to display!? 230 // no essid to reduce clutter, maybe later we have a nick or stationname to display!?
220 231
221 qDebug( "inserting new station %s", (const char*) macaddr ); 232 qDebug( "inserting new station %s", (const char*) macaddr );
222 233
223 new MScanListItem( network, type, "", macaddr, wep, channel, signal ); 234 new MScanListItem( network, type, "", macaddr, wep, channel, signal );
224 235
225 if ( type == "managed" ) 236 if ( type == "managed" )
226 { 237 {
227 s.sprintf( "(i) new AP in '%s' [%d]", (const char*) essid, channel ); 238 s.sprintf( "(i) new AP in '%s' [%d]", (const char*) essid, channel );
228 } 239 }
229 else 240 else
230 { 241 {
231 s.sprintf( "(i) new adhoc station in '%s' [%d]", (const char*) essid, channel ); 242 s.sprintf( "(i) new adhoc station in '%s' [%d]", (const char*) essid, channel );
232 } 243 }
233 244
234 logwindow->log( s ); 245 logwindow->log( s );
235 246
236} 247}
237 248
238void Wellenreiter::buttonClicked() 249void Wellenreiter::buttonClicked()
239{ 250{
251 if ( daemonRunning )
252 {
253 logwindow->log( "(i) Daemon has been stopped." );
254 button->setText( "Start Scanning" );
255
256 // Stop daemon
257
258 // find out pids of wellenreiterd and orinoco_hopper
259
260 }
261
262 else
263 {
264
265 // get configuration from config window
266
267 const QString& interface = configwindow->interfaceName->currentText();
268 const QString& cardtype = configwindow->deviceType->currentText();
269 const QString& interval = configwindow->hopInterval->cleanText();
270
271 if ( ( interface == "<select>" ) || ( cardtype == "<select>" ) )
272 {
273 QMessageBox::information( this, "Wellenreiter/Opie", "You must configure your\ndevice before scanning." );
274 return;
275 }
276
277 logwindow->log( "(i) Daemon has been started." );
278 button->setText( "Stop Scanning" );
279
280#ifdef QWS
281
282 // set interface into monitor mode
283
284 QString cmdline;
285
286 cmdline.sprintf( "iwpriv %s monitor 2", (const char*) interface );
287 system( cmdline );
288 cmdline.sprintf( "iwpriv %s monitor 2 1", (const char*) interface );
289 system( cmdline );
290
291 // start channel hopper
292
293 cmdline = "orinoco_hopper ";
294 cmdline += interface;
295 cmdline += " -i ";
296 cmdline += interval;
297 //qDebug( "execute: %s", (const char*) cmdline );
298 Global::execute( cmdline );
299
300 // start daemon
301
302 cmdline = "wellenreiterd ";
303 cmdline += interface;
304 cmdline += " 3";
305 //qDebug( "execute: %s", (const char*) cmdline );
306 Global::execute( cmdline );
307#endif
240 308
241 // FIXME: communicate with daemon and set button text according to state 309 /*
242 310
243 button->setText( "Stop Scanning" ); 311 // add some test stations, so that we can see if the GUI part works
244 312
245 // add some test stations, so that we can see if the GUI part works 313 addNewItem( "managed", "Vanille", "04:00:20:EF:A6:43", true, 6, 80 );
314 addNewItem( "managed", "Vanille", "04:00:20:EF:A6:23", true, 11, 10 );
315 addNewItem( "adhoc", "ELAN", "40:03:43:E7:16:22", false, 3, 10 );
316 addNewItem( "adhoc", "ELAN", "40:03:53:E7:56:62", false, 3, 15 );
317 addNewItem( "adhoc", "ELAN", "40:03:63:E7:56:E2", false, 3, 20 );
246 318
247 addNewItem( "managed", "Vanille", "04:00:20:EF:A6:43", true, 6, 80 ); 319 QString command ("98");
248 addNewItem( "managed", "Vanille", "04:00:20:EF:A6:23", true, 11, 10 );
249 addNewItem( "adhoc", "ELAN", "40:03:43:E7:16:22", false, 3, 10 );
250 addNewItem( "adhoc", "ELAN", "40:03:53:E7:56:62", false, 3, 15 );
251 addNewItem( "adhoc", "ELAN", "40:03:63:E7:56:E2", false, 3, 20 );
252
253 QString command ("98");
254 320
255 //sendcomm( DAEMONADDR, DAEMONPORT, (const char*) command ); 321 //sendcomm( DAEMONADDR, DAEMONPORT, (const char*) command );
256 322
323 */
324 }
257} 325}
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.h b/noncore/net/wellenreiter/gui/wellenreiter.h
index 61f7503..052a242 100644
--- a/noncore/net/wellenreiter/gui/wellenreiter.h
+++ b/noncore/net/wellenreiter/gui/wellenreiter.h
@@ -1,48 +1,50 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. 2** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved.
3** 3**
4** This file is part of Opie Environment. 4** This file is part of Opie Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14**********************************************************************/ 14**********************************************************************/
15 15
16#ifndef WELLENREITER_H 16#ifndef WELLENREITER_H
17#define WELLENREITER_H 17#define WELLENREITER_H
18 18
19#include "wellenreiterbase.h" 19#include "wellenreiterbase.h"
20 20
21class QTimerEvent; 21class QTimerEvent;
22 22
23class Wellenreiter : public WellenreiterBase { 23class Wellenreiter : public WellenreiterBase {
24 Q_OBJECT 24 Q_OBJECT
25 25
26public: 26public:
27 27
28 Wellenreiter( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); 28 Wellenreiter( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
29 ~Wellenreiter(); 29 ~Wellenreiter();
30 30
31protected: 31protected:
32 virtual void timerEvent( QTimerEvent* ); 32 virtual void timerEvent( QTimerEvent* );
33
34 bool daemonRunning;
33 35
34public slots: 36public slots:
35 void buttonClicked(); 37 void buttonClicked();
36 void addNewItem( QString type, QString essid, QString ap, bool wep, int channel, int signal ); 38 void addNewItem( QString type, QString essid, QString ap, bool wep, int channel, int signal );
37 39
38private: 40private:
39 int daemon_fd; // socket filedescriptor for udp communication socket 41 int daemon_fd; // socket filedescriptor for udp communication socket
40 42
41 bool hasMessage(); 43 bool hasMessage();
42 void handleMessage(); 44 void handleMessage();
43 45
44 //void readConfig(); 46 //void readConfig();
45 //void writeConfig(); 47 //void writeConfig();
46}; 48};
47 49
48#endif 50#endif