-rw-r--r-- | noncore/net/wellenreiter/gui/configbase.ui | 8 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/main.cpp | 17 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/mainwindow.cpp | 9 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/protolistview.cpp | 2 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 16 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.h | 1 |
6 files changed, 45 insertions, 8 deletions
diff --git a/noncore/net/wellenreiter/gui/configbase.ui b/noncore/net/wellenreiter/gui/configbase.ui index 422826a..590ca92 100644 --- a/noncore/net/wellenreiter/gui/configbase.ui +++ b/noncore/net/wellenreiter/gui/configbase.ui | |||
@@ -1,243 +1,247 @@ | |||
1 | <!DOCTYPE UI><UI> | 1 | <!DOCTYPE UI><UI> |
2 | <class>WellenreiterConfigBase</class> | 2 | <class>WellenreiterConfigBase</class> |
3 | <widget> | 3 | <widget> |
4 | <class>QDialog</class> | 4 | <class>QDialog</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>261</width> | 14 | <width>261</width> |
15 | <height>280</height> | 15 | <height>280</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>Wellenreiter II COnfiguration Dialog</string> | 20 | <string>Wellenreiter II COnfiguration Dialog</string> |
21 | </property> | 21 | </property> |
22 | <property> | 22 | <property> |
23 | <name>layoutMargin</name> | 23 | <name>layoutMargin</name> |
24 | </property> | 24 | </property> |
25 | <property> | 25 | <property> |
26 | <name>layoutSpacing</name> | 26 | <name>layoutSpacing</name> |
27 | </property> | 27 | </property> |
28 | <grid> | 28 | <grid> |
29 | <property stdset="1"> | 29 | <property stdset="1"> |
30 | <name>margin</name> | 30 | <name>margin</name> |
31 | <number>2</number> | 31 | <number>2</number> |
32 | </property> | 32 | </property> |
33 | <property stdset="1"> | 33 | <property stdset="1"> |
34 | <name>spacing</name> | 34 | <name>spacing</name> |
35 | <number>3</number> | 35 | <number>3</number> |
36 | </property> | 36 | </property> |
37 | <widget row="0" column="0" > | 37 | <widget row="0" column="0" > |
38 | <class>QTabWidget</class> | 38 | <class>QTabWidget</class> |
39 | <property stdset="1"> | 39 | <property stdset="1"> |
40 | <name>name</name> | 40 | <name>name</name> |
41 | <cstring>tab</cstring> | 41 | <cstring>tab</cstring> |
42 | </property> | 42 | </property> |
43 | <property> | 43 | <property> |
44 | <name>layoutMargin</name> | 44 | <name>layoutMargin</name> |
45 | </property> | 45 | </property> |
46 | <property> | 46 | <property> |
47 | <name>layoutSpacing</name> | 47 | <name>layoutSpacing</name> |
48 | </property> | 48 | </property> |
49 | <widget> | 49 | <widget> |
50 | <class>QWidget</class> | 50 | <class>QWidget</class> |
51 | <property stdset="1"> | 51 | <property stdset="1"> |
52 | <name>name</name> | 52 | <name>name</name> |
53 | <cstring>tab</cstring> | 53 | <cstring>tab</cstring> |
54 | </property> | 54 | </property> |
55 | <attribute> | 55 | <attribute> |
56 | <name>title</name> | 56 | <name>title</name> |
57 | <string>Interface</string> | 57 | <string>Interface</string> |
58 | </attribute> | 58 | </attribute> |
59 | <grid> | 59 | <grid> |
60 | <property stdset="1"> | 60 | <property stdset="1"> |
61 | <name>margin</name> | 61 | <name>margin</name> |
62 | <number>5</number> | 62 | <number>5</number> |
63 | </property> | 63 | </property> |
64 | <property stdset="1"> | 64 | <property stdset="1"> |
65 | <name>spacing</name> | 65 | <name>spacing</name> |
66 | <number>3</number> | 66 | <number>3</number> |
67 | </property> | 67 | </property> |
68 | <widget row="0" column="0" > | 68 | <widget row="0" column="0" > |
69 | <class>QLabel</class> | 69 | <class>QLabel</class> |
70 | <property stdset="1"> | 70 | <property stdset="1"> |
71 | <name>name</name> | 71 | <name>name</name> |
72 | <cstring>TextLabel1_2</cstring> | 72 | <cstring>TextLabel1_2</cstring> |
73 | </property> | 73 | </property> |
74 | <property stdset="1"> | 74 | <property stdset="1"> |
75 | <name>enabled</name> | 75 | <name>enabled</name> |
76 | <bool>true</bool> | 76 | <bool>true</bool> |
77 | </property> | 77 | </property> |
78 | <property stdset="1"> | 78 | <property stdset="1"> |
79 | <name>text</name> | 79 | <name>text</name> |
80 | <string>Name:</string> | 80 | <string>Name:</string> |
81 | </property> | 81 | </property> |
82 | </widget> | 82 | </widget> |
83 | <widget row="1" column="0" > | 83 | <widget row="1" column="0" > |
84 | <class>QLabel</class> | 84 | <class>QLabel</class> |
85 | <property stdset="1"> | 85 | <property stdset="1"> |
86 | <name>name</name> | 86 | <name>name</name> |
87 | <cstring>TextLabel2_3</cstring> | 87 | <cstring>TextLabel2_3</cstring> |
88 | </property> | 88 | </property> |
89 | <property stdset="1"> | 89 | <property stdset="1"> |
90 | <name>enabled</name> | 90 | <name>enabled</name> |
91 | <bool>true</bool> | 91 | <bool>true</bool> |
92 | </property> | 92 | </property> |
93 | <property stdset="1"> | 93 | <property stdset="1"> |
94 | <name>text</name> | 94 | <name>text</name> |
95 | <string>Driver:</string> | 95 | <string>Driver:</string> |
96 | </property> | 96 | </property> |
97 | </widget> | 97 | </widget> |
98 | <widget row="2" column="0" rowspan="1" colspan="4" > | 98 | <widget row="2" column="0" rowspan="1" colspan="4" > |
99 | <class>QCheckBox</class> | 99 | <class>QCheckBox</class> |
100 | <property stdset="1"> | 100 | <property stdset="1"> |
101 | <name>name</name> | 101 | <name>name</name> |
102 | <cstring>prismHeader</cstring> | 102 | <cstring>prismHeader</cstring> |
103 | </property> | 103 | </property> |
104 | <property stdset="1"> | 104 | <property stdset="1"> |
105 | <name>text</name> | 105 | <name>text</name> |
106 | <string>Use additional PRISM header</string> | 106 | <string>Use additional PRISM header</string> |
107 | </property> | 107 | </property> |
108 | </widget> | 108 | </widget> |
109 | <widget row="6" column="0" rowspan="1" colspan="4" > | 109 | <widget row="6" column="0" rowspan="1" colspan="4" > |
110 | <class>QGroupBox</class> | 110 | <class>QGroupBox</class> |
111 | <property stdset="1"> | 111 | <property stdset="1"> |
112 | <name>name</name> | 112 | <name>name</name> |
113 | <cstring>GroupBox1</cstring> | 113 | <cstring>GroupBox1</cstring> |
114 | </property> | 114 | </property> |
115 | <property stdset="1"> | 115 | <property stdset="1"> |
116 | <name>enabled</name> | ||
117 | <bool>false</bool> | ||
118 | </property> | ||
119 | <property stdset="1"> | ||
116 | <name>title</name> | 120 | <name>title</name> |
117 | <string>Scan on channel</string> | 121 | <string>Scan on channel</string> |
118 | </property> | 122 | </property> |
119 | <property> | 123 | <property> |
120 | <name>layoutMargin</name> | 124 | <name>layoutMargin</name> |
121 | </property> | 125 | </property> |
122 | <property> | 126 | <property> |
123 | <name>layoutSpacing</name> | 127 | <name>layoutSpacing</name> |
124 | </property> | 128 | </property> |
125 | <grid> | 129 | <grid> |
126 | <property stdset="1"> | 130 | <property stdset="1"> |
127 | <name>margin</name> | 131 | <name>margin</name> |
128 | <number>4</number> | 132 | <number>4</number> |
129 | </property> | 133 | </property> |
130 | <property stdset="1"> | 134 | <property stdset="1"> |
131 | <name>spacing</name> | 135 | <name>spacing</name> |
132 | <number>2</number> | 136 | <number>2</number> |
133 | </property> | 137 | </property> |
134 | <widget row="1" column="1" > | 138 | <widget row="1" column="1" > |
135 | <class>QCheckBox</class> | 139 | <class>QCheckBox</class> |
136 | <property stdset="1"> | 140 | <property stdset="1"> |
137 | <name>name</name> | 141 | <name>name</name> |
138 | <cstring>channel6</cstring> | 142 | <cstring>channel6</cstring> |
139 | </property> | 143 | </property> |
140 | <property stdset="1"> | 144 | <property stdset="1"> |
141 | <name>text</name> | 145 | <name>text</name> |
142 | <string>6</string> | 146 | <string>6</string> |
143 | </property> | 147 | </property> |
144 | </widget> | 148 | </widget> |
145 | <widget row="1" column="3" > | 149 | <widget row="1" column="3" > |
146 | <class>QCheckBox</class> | 150 | <class>QCheckBox</class> |
147 | <property stdset="1"> | 151 | <property stdset="1"> |
148 | <name>name</name> | 152 | <name>name</name> |
149 | <cstring>channel8</cstring> | 153 | <cstring>channel8</cstring> |
150 | </property> | 154 | </property> |
151 | <property stdset="1"> | 155 | <property stdset="1"> |
152 | <name>text</name> | 156 | <name>text</name> |
153 | <string>8</string> | 157 | <string>8</string> |
154 | </property> | 158 | </property> |
155 | </widget> | 159 | </widget> |
156 | <widget row="0" column="2" > | 160 | <widget row="0" column="2" > |
157 | <class>QCheckBox</class> | 161 | <class>QCheckBox</class> |
158 | <property stdset="1"> | 162 | <property stdset="1"> |
159 | <name>name</name> | 163 | <name>name</name> |
160 | <cstring>channel2</cstring> | 164 | <cstring>channel2</cstring> |
161 | </property> | 165 | </property> |
162 | <property stdset="1"> | 166 | <property stdset="1"> |
163 | <name>text</name> | 167 | <name>text</name> |
164 | <string>2</string> | 168 | <string>2</string> |
165 | </property> | 169 | </property> |
166 | </widget> | 170 | </widget> |
167 | <widget row="1" column="4" > | 171 | <widget row="1" column="4" > |
168 | <class>QCheckBox</class> | 172 | <class>QCheckBox</class> |
169 | <property stdset="1"> | 173 | <property stdset="1"> |
170 | <name>name</name> | 174 | <name>name</name> |
171 | <cstring>channel9</cstring> | 175 | <cstring>channel9</cstring> |
172 | </property> | 176 | </property> |
173 | <property stdset="1"> | 177 | <property stdset="1"> |
174 | <name>text</name> | 178 | <name>text</name> |
175 | <string>9</string> | 179 | <string>9</string> |
176 | </property> | 180 | </property> |
177 | </widget> | 181 | </widget> |
178 | <widget row="0" column="1" > | 182 | <widget row="0" column="1" > |
179 | <class>QCheckBox</class> | 183 | <class>QCheckBox</class> |
180 | <property stdset="1"> | 184 | <property stdset="1"> |
181 | <name>name</name> | 185 | <name>name</name> |
182 | <cstring>channel1</cstring> | 186 | <cstring>channel1</cstring> |
183 | </property> | 187 | </property> |
184 | <property stdset="1"> | 188 | <property stdset="1"> |
185 | <name>text</name> | 189 | <name>text</name> |
186 | <string>1</string> | 190 | <string>1</string> |
187 | </property> | 191 | </property> |
188 | </widget> | 192 | </widget> |
189 | <widget row="0" column="0" > | 193 | <widget row="0" column="0" > |
190 | <class>QCheckBox</class> | 194 | <class>QCheckBox</class> |
191 | <property stdset="1"> | 195 | <property stdset="1"> |
192 | <name>name</name> | 196 | <name>name</name> |
193 | <cstring>channelAll</cstring> | 197 | <cstring>channelAll</cstring> |
194 | </property> | 198 | </property> |
195 | <property stdset="1"> | 199 | <property stdset="1"> |
196 | <name>text</name> | 200 | <name>text</name> |
197 | <string>All</string> | 201 | <string>All</string> |
198 | </property> | 202 | </property> |
199 | </widget> | 203 | </widget> |
200 | <widget row="2" column="1" > | 204 | <widget row="2" column="1" > |
201 | <class>QCheckBox</class> | 205 | <class>QCheckBox</class> |
202 | <property stdset="1"> | 206 | <property stdset="1"> |
203 | <name>name</name> | 207 | <name>name</name> |
204 | <cstring>channel11</cstring> | 208 | <cstring>channel11</cstring> |
205 | </property> | 209 | </property> |
206 | <property stdset="1"> | 210 | <property stdset="1"> |
207 | <name>text</name> | 211 | <name>text</name> |
208 | <string>11</string> | 212 | <string>11</string> |
209 | </property> | 213 | </property> |
210 | </widget> | 214 | </widget> |
211 | <widget row="2" column="0" > | 215 | <widget row="2" column="0" > |
212 | <class>QCheckBox</class> | 216 | <class>QCheckBox</class> |
213 | <property stdset="1"> | 217 | <property stdset="1"> |
214 | <name>name</name> | 218 | <name>name</name> |
215 | <cstring>channel10</cstring> | 219 | <cstring>channel10</cstring> |
216 | </property> | 220 | </property> |
217 | <property stdset="1"> | 221 | <property stdset="1"> |
218 | <name>text</name> | 222 | <name>text</name> |
219 | <string>10</string> | 223 | <string>10</string> |
220 | </property> | 224 | </property> |
221 | </widget> | 225 | </widget> |
222 | <widget row="1" column="2" > | 226 | <widget row="1" column="2" > |
223 | <class>QCheckBox</class> | 227 | <class>QCheckBox</class> |
224 | <property stdset="1"> | 228 | <property stdset="1"> |
225 | <name>name</name> | 229 | <name>name</name> |
226 | <cstring>channel7</cstring> | 230 | <cstring>channel7</cstring> |
227 | </property> | 231 | </property> |
228 | <property stdset="1"> | 232 | <property stdset="1"> |
229 | <name>text</name> | 233 | <name>text</name> |
230 | <string>7</string> | 234 | <string>7</string> |
231 | </property> | 235 | </property> |
232 | </widget> | 236 | </widget> |
233 | <widget row="0" column="3" > | 237 | <widget row="0" column="3" > |
234 | <class>QCheckBox</class> | 238 | <class>QCheckBox</class> |
235 | <property stdset="1"> | 239 | <property stdset="1"> |
236 | <name>name</name> | 240 | <name>name</name> |
237 | <cstring>channel3</cstring> | 241 | <cstring>channel3</cstring> |
238 | </property> | 242 | </property> |
239 | <property stdset="1"> | 243 | <property stdset="1"> |
240 | <name>text</name> | 244 | <name>text</name> |
241 | <string>3</string> | 245 | <string>3</string> |
242 | </property> | 246 | </property> |
243 | </widget> | 247 | </widget> |
@@ -334,256 +338,260 @@ | |||
334 | </property> | 338 | </property> |
335 | </item> | 339 | </item> |
336 | <item> | 340 | <item> |
337 | <property> | 341 | <property> |
338 | <name>text</name> | 342 | <name>text</name> |
339 | <string>hostap</string> | 343 | <string>hostap</string> |
340 | </property> | 344 | </property> |
341 | </item> | 345 | </item> |
342 | <item> | 346 | <item> |
343 | <property> | 347 | <property> |
344 | <name>text</name> | 348 | <name>text</name> |
345 | <string>orinoco</string> | 349 | <string>orinoco</string> |
346 | </property> | 350 | </property> |
347 | </item> | 351 | </item> |
348 | <item> | 352 | <item> |
349 | <property> | 353 | <property> |
350 | <name>text</name> | 354 | <name>text</name> |
351 | <string><manual></string> | 355 | <string><manual></string> |
352 | </property> | 356 | </property> |
353 | </item> | 357 | </item> |
354 | <item> | 358 | <item> |
355 | <property> | 359 | <property> |
356 | <name>text</name> | 360 | <name>text</name> |
357 | <string><file></string> | 361 | <string><file></string> |
358 | </property> | 362 | </property> |
359 | </item> | 363 | </item> |
360 | <property stdset="1"> | 364 | <property stdset="1"> |
361 | <name>name</name> | 365 | <name>name</name> |
362 | <cstring>deviceType</cstring> | 366 | <cstring>deviceType</cstring> |
363 | </property> | 367 | </property> |
364 | <property stdset="1"> | 368 | <property stdset="1"> |
365 | <name>enabled</name> | 369 | <name>enabled</name> |
366 | <bool>true</bool> | 370 | <bool>true</bool> |
367 | </property> | 371 | </property> |
368 | <property> | 372 | <property> |
369 | <name>whatsThis</name> | 373 | <name>whatsThis</name> |
370 | <string>Choose the type of driver used for sniffing.</string> | 374 | <string>Choose the type of driver used for sniffing.</string> |
371 | </property> | 375 | </property> |
372 | </widget> | 376 | </widget> |
373 | <spacer row="3" column="0" > | 377 | <spacer row="3" column="0" > |
374 | <property> | 378 | <property> |
375 | <name>name</name> | 379 | <name>name</name> |
376 | <cstring>Spacer4</cstring> | 380 | <cstring>Spacer4</cstring> |
377 | </property> | 381 | </property> |
378 | <property stdset="1"> | 382 | <property stdset="1"> |
379 | <name>orientation</name> | 383 | <name>orientation</name> |
380 | <enum>Vertical</enum> | 384 | <enum>Vertical</enum> |
381 | </property> | 385 | </property> |
382 | <property stdset="1"> | 386 | <property stdset="1"> |
383 | <name>sizeType</name> | 387 | <name>sizeType</name> |
384 | <enum>Expanding</enum> | 388 | <enum>Expanding</enum> |
385 | </property> | 389 | </property> |
386 | <property> | 390 | <property> |
387 | <name>sizeHint</name> | 391 | <name>sizeHint</name> |
388 | <size> | 392 | <size> |
389 | <width>20</width> | 393 | <width>20</width> |
390 | <height>20</height> | 394 | <height>20</height> |
391 | </size> | 395 | </size> |
392 | </property> | 396 | </property> |
393 | </spacer> | 397 | </spacer> |
394 | <widget row="4" column="2" > | 398 | <widget row="4" column="2" > |
395 | <class>QLabel</class> | 399 | <class>QLabel</class> |
396 | <property stdset="1"> | 400 | <property stdset="1"> |
397 | <name>name</name> | 401 | <name>name</name> |
398 | <cstring>TextLabel1</cstring> | 402 | <cstring>TextLabel1</cstring> |
399 | </property> | 403 | </property> |
400 | <property stdset="1"> | 404 | <property stdset="1"> |
401 | <name>text</name> | 405 | <name>text</name> |
402 | <string>every</string> | 406 | <string>every</string> |
403 | </property> | 407 | </property> |
404 | </widget> | 408 | </widget> |
405 | <widget row="4" column="0" rowspan="1" colspan="2" > | 409 | <widget row="4" column="0" rowspan="1" colspan="2" > |
406 | <class>QCheckBox</class> | 410 | <class>QCheckBox</class> |
407 | <property stdset="1"> | 411 | <property stdset="1"> |
408 | <name>name</name> | 412 | <name>name</name> |
409 | <cstring>hopChannels</cstring> | 413 | <cstring>hopChannels</cstring> |
410 | </property> | 414 | </property> |
411 | <property stdset="1"> | 415 | <property stdset="1"> |
412 | <name>text</name> | 416 | <name>text</name> |
413 | <string>Hop Channels</string> | 417 | <string>Hop Channels</string> |
414 | </property> | 418 | </property> |
415 | <property stdset="1"> | 419 | <property stdset="1"> |
416 | <name>checked</name> | 420 | <name>checked</name> |
417 | <bool>true</bool> | 421 | <bool>true</bool> |
418 | </property> | 422 | </property> |
419 | </widget> | 423 | </widget> |
420 | <widget row="4" column="3" > | 424 | <widget row="4" column="3" > |
421 | <class>QSpinBox</class> | 425 | <class>QSpinBox</class> |
422 | <property stdset="1"> | 426 | <property stdset="1"> |
423 | <name>name</name> | 427 | <name>name</name> |
424 | <cstring>hopInterval</cstring> | 428 | <cstring>hopInterval</cstring> |
425 | </property> | 429 | </property> |
426 | <property stdset="1"> | 430 | <property stdset="1"> |
427 | <name>enabled</name> | 431 | <name>enabled</name> |
428 | <bool>true</bool> | 432 | <bool>true</bool> |
429 | </property> | 433 | </property> |
430 | <property stdset="1"> | 434 | <property stdset="1"> |
431 | <name>suffix</name> | 435 | <name>suffix</name> |
432 | <string> ms</string> | 436 | <string> ms</string> |
433 | </property> | 437 | </property> |
434 | <property stdset="1"> | 438 | <property stdset="1"> |
435 | <name>maxValue</name> | 439 | <name>maxValue</name> |
436 | <number>2000</number> | 440 | <number>2000</number> |
437 | </property> | 441 | </property> |
438 | <property stdset="1"> | 442 | <property stdset="1"> |
439 | <name>minValue</name> | 443 | <name>minValue</name> |
440 | <number>100</number> | 444 | <number>100</number> |
441 | </property> | 445 | </property> |
442 | <property stdset="1"> | 446 | <property stdset="1"> |
443 | <name>lineStep</name> | 447 | <name>lineStep</name> |
444 | <number>100</number> | 448 | <number>100</number> |
445 | </property> | 449 | </property> |
446 | <property stdset="1"> | 450 | <property stdset="1"> |
447 | <name>value</name> | 451 | <name>value</name> |
448 | <number>1000</number> | 452 | <number>1000</number> |
449 | </property> | 453 | </property> |
450 | <property> | 454 | <property> |
451 | <name>whatsThis</name> | 455 | <name>whatsThis</name> |
452 | <string>Choose the channel hop interval.</string> | 456 | <string>Choose the channel hop interval.</string> |
453 | </property> | 457 | </property> |
454 | </widget> | 458 | </widget> |
455 | <widget row="5" column="0" rowspan="1" colspan="4" > | 459 | <widget row="5" column="0" rowspan="1" colspan="4" > |
456 | <class>QCheckBox</class> | 460 | <class>QCheckBox</class> |
457 | <property stdset="1"> | 461 | <property stdset="1"> |
458 | <name>name</name> | 462 | <name>name</name> |
459 | <cstring>adaptiveHopping</cstring> | 463 | <cstring>adaptiveHopping</cstring> |
460 | </property> | 464 | </property> |
461 | <property stdset="1"> | 465 | <property stdset="1"> |
466 | <name>enabled</name> | ||
467 | <bool>false</bool> | ||
468 | </property> | ||
469 | <property stdset="1"> | ||
462 | <name>text</name> | 470 | <name>text</name> |
463 | <string>Use Adaptive(TM) Hop Scheme</string> | 471 | <string>Use Adaptive(TM) Hop Scheme</string> |
464 | </property> | 472 | </property> |
465 | </widget> | 473 | </widget> |
466 | </grid> | 474 | </grid> |
467 | </widget> | 475 | </widget> |
468 | <widget> | 476 | <widget> |
469 | <class>QWidget</class> | 477 | <class>QWidget</class> |
470 | <property stdset="1"> | 478 | <property stdset="1"> |
471 | <name>name</name> | 479 | <name>name</name> |
472 | <cstring>tab</cstring> | 480 | <cstring>tab</cstring> |
473 | </property> | 481 | </property> |
474 | <attribute> | 482 | <attribute> |
475 | <name>title</name> | 483 | <name>title</name> |
476 | <string>Capture</string> | 484 | <string>Capture</string> |
477 | </attribute> | 485 | </attribute> |
478 | <grid> | 486 | <grid> |
479 | <property stdset="1"> | 487 | <property stdset="1"> |
480 | <name>margin</name> | 488 | <name>margin</name> |
481 | <number>5</number> | 489 | <number>5</number> |
482 | </property> | 490 | </property> |
483 | <property stdset="1"> | 491 | <property stdset="1"> |
484 | <name>spacing</name> | 492 | <name>spacing</name> |
485 | <number>3</number> | 493 | <number>3</number> |
486 | </property> | 494 | </property> |
487 | <widget row="2" column="0" rowspan="1" colspan="3" > | 495 | <widget row="2" column="0" rowspan="1" colspan="3" > |
488 | <class>ProtocolListView</class> | 496 | <class>ProtocolListView</class> |
489 | <property stdset="1"> | 497 | <property stdset="1"> |
490 | <name>name</name> | 498 | <name>name</name> |
491 | <cstring>capturePackets</cstring> | 499 | <cstring>capturePackets</cstring> |
492 | </property> | 500 | </property> |
493 | <property stdset="1"> | 501 | <property stdset="1"> |
494 | <name>enabled</name> | 502 | <name>enabled</name> |
495 | <bool>false</bool> | 503 | <bool>false</bool> |
496 | </property> | 504 | </property> |
497 | <property stdset="1"> | 505 | <property stdset="1"> |
498 | <name>sizePolicy</name> | 506 | <name>sizePolicy</name> |
499 | <sizepolicy> | 507 | <sizepolicy> |
500 | <hsizetype>7</hsizetype> | 508 | <hsizetype>7</hsizetype> |
501 | <vsizetype>7</vsizetype> | 509 | <vsizetype>7</vsizetype> |
502 | </sizepolicy> | 510 | </sizepolicy> |
503 | </property> | 511 | </property> |
504 | </widget> | 512 | </widget> |
505 | <widget row="1" column="0" rowspan="1" colspan="3" > | 513 | <widget row="1" column="0" rowspan="1" colspan="3" > |
506 | <class>QLineEdit</class> | 514 | <class>QLineEdit</class> |
507 | <property stdset="1"> | 515 | <property stdset="1"> |
508 | <name>name</name> | 516 | <name>name</name> |
509 | <cstring>captureFileName</cstring> | 517 | <cstring>captureFileName</cstring> |
510 | </property> | 518 | </property> |
511 | <property stdset="1"> | 519 | <property stdset="1"> |
512 | <name>enabled</name> | 520 | <name>enabled</name> |
513 | <bool>false</bool> | 521 | <bool>false</bool> |
514 | </property> | 522 | </property> |
515 | <property stdset="1"> | 523 | <property stdset="1"> |
516 | <name>text</name> | 524 | <name>text</name> |
517 | <string>/tmp/capture</string> | 525 | <string>/tmp/capture</string> |
518 | </property> | 526 | </property> |
519 | </widget> | 527 | </widget> |
520 | <widget row="0" column="2" > | 528 | <widget row="0" column="2" > |
521 | <class>QToolButton</class> | 529 | <class>QToolButton</class> |
522 | <property stdset="1"> | 530 | <property stdset="1"> |
523 | <name>name</name> | 531 | <name>name</name> |
524 | <cstring>getCaptureFileName</cstring> | 532 | <cstring>getCaptureFileName</cstring> |
525 | </property> | 533 | </property> |
526 | <property stdset="1"> | 534 | <property stdset="1"> |
527 | <name>enabled</name> | 535 | <name>enabled</name> |
528 | <bool>false</bool> | 536 | <bool>false</bool> |
529 | </property> | 537 | </property> |
530 | <property stdset="1"> | 538 | <property stdset="1"> |
531 | <name>text</name> | 539 | <name>text</name> |
532 | <string>Browse</string> | 540 | <string>Browse</string> |
533 | </property> | 541 | </property> |
534 | </widget> | 542 | </widget> |
535 | <spacer row="0" column="1" > | 543 | <spacer row="0" column="1" > |
536 | <property> | 544 | <property> |
537 | <name>name</name> | 545 | <name>name</name> |
538 | <cstring>Spacer2</cstring> | 546 | <cstring>Spacer2</cstring> |
539 | </property> | 547 | </property> |
540 | <property stdset="1"> | 548 | <property stdset="1"> |
541 | <name>orientation</name> | 549 | <name>orientation</name> |
542 | <enum>Horizontal</enum> | 550 | <enum>Horizontal</enum> |
543 | </property> | 551 | </property> |
544 | <property stdset="1"> | 552 | <property stdset="1"> |
545 | <name>sizeType</name> | 553 | <name>sizeType</name> |
546 | <enum>Expanding</enum> | 554 | <enum>Expanding</enum> |
547 | </property> | 555 | </property> |
548 | <property> | 556 | <property> |
549 | <name>sizeHint</name> | 557 | <name>sizeHint</name> |
550 | <size> | 558 | <size> |
551 | <width>20</width> | 559 | <width>20</width> |
552 | <height>20</height> | 560 | <height>20</height> |
553 | </size> | 561 | </size> |
554 | </property> | 562 | </property> |
555 | </spacer> | 563 | </spacer> |
556 | <widget row="0" column="0" > | 564 | <widget row="0" column="0" > |
557 | <class>QCheckBox</class> | 565 | <class>QCheckBox</class> |
558 | <property stdset="1"> | 566 | <property stdset="1"> |
559 | <name>name</name> | 567 | <name>name</name> |
560 | <cstring>writeCaptureFile</cstring> | 568 | <cstring>writeCaptureFile</cstring> |
561 | </property> | 569 | </property> |
562 | <property stdset="1"> | 570 | <property stdset="1"> |
563 | <name>enabled</name> | 571 | <name>enabled</name> |
564 | <bool>true</bool> | 572 | <bool>true</bool> |
565 | </property> | 573 | </property> |
566 | <property stdset="1"> | 574 | <property stdset="1"> |
567 | <name>text</name> | 575 | <name>text</name> |
568 | <string>Write Capture Files To</string> | 576 | <string>Write Capture Files To</string> |
569 | </property> | 577 | </property> |
570 | </widget> | 578 | </widget> |
571 | </grid> | 579 | </grid> |
572 | </widget> | 580 | </widget> |
573 | <widget> | 581 | <widget> |
574 | <class>QWidget</class> | 582 | <class>QWidget</class> |
575 | <property stdset="1"> | 583 | <property stdset="1"> |
576 | <name>name</name> | 584 | <name>name</name> |
577 | <cstring>tab</cstring> | 585 | <cstring>tab</cstring> |
578 | </property> | 586 | </property> |
579 | <attribute> | 587 | <attribute> |
580 | <name>title</name> | 588 | <name>title</name> |
581 | <string>Parse</string> | 589 | <string>Parse</string> |
582 | </attribute> | 590 | </attribute> |
583 | <grid> | 591 | <grid> |
584 | <property stdset="1"> | 592 | <property stdset="1"> |
585 | <name>margin</name> | 593 | <name>margin</name> |
586 | <number>5</number> | 594 | <number>5</number> |
587 | </property> | 595 | </property> |
588 | <property stdset="1"> | 596 | <property stdset="1"> |
589 | <name>spacing</name> | 597 | <name>spacing</name> |
diff --git a/noncore/net/wellenreiter/gui/main.cpp b/noncore/net/wellenreiter/gui/main.cpp index 96ebb3f..55a5260 100644 --- a/noncore/net/wellenreiter/gui/main.cpp +++ b/noncore/net/wellenreiter/gui/main.cpp | |||
@@ -1,99 +1,114 @@ | |||
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 | #include "mainwindow.h" | 16 | #include "mainwindow.h" |
17 | #ifdef QWS | 17 | #ifdef QWS |
18 | #include <opie2/oapplication.h> | 18 | #include <opie2/oapplication.h> |
19 | #else | 19 | #else |
20 | #include <qapplication.h> | 20 | #include <qapplication.h> |
21 | #endif | 21 | #endif |
22 | 22 | ||
23 | #include <qmessagebox.h> | 23 | #include <qmessagebox.h> |
24 | #include <qstringlist.h> | 24 | #include <qstringlist.h> |
25 | 25 | ||
26 | // ==> OProcess | 26 | // ==> OProcess |
27 | #include <qdir.h> | 27 | #include <qdir.h> |
28 | #include <qfileinfo.h> | 28 | #include <qfileinfo.h> |
29 | #include <qregexp.h> | 29 | #include <qregexp.h> |
30 | #include <qtextstream.h> | 30 | #include <qtextstream.h> |
31 | 31 | ||
32 | #include <errno.h> | 32 | #include <errno.h> |
33 | #include <signal.h> | 33 | #include <signal.h> |
34 | #include <string.h> | 34 | #include <string.h> |
35 | #include <unistd.h> | 35 | #include <unistd.h> |
36 | 36 | ||
37 | int main( int argc, char **argv ) | 37 | int main( int argc, char **argv ) |
38 | { | 38 | { |
39 | #ifdef QWS | 39 | #ifdef QWS |
40 | OApplication a( argc, argv, "Wellenreiter II" ); | 40 | OApplication a( argc, argv, "Wellenreiter II" ); |
41 | #else | 41 | #else |
42 | QApplication a( argc, argv ); | 42 | QApplication a( argc, argv ); |
43 | #endif | 43 | #endif |
44 | WellenreiterMainWindow* w = new WellenreiterMainWindow(); | 44 | WellenreiterMainWindow* w = new WellenreiterMainWindow(); |
45 | #ifdef QWS | 45 | #ifdef QWS |
46 | a.showMainWidget( w ); | 46 | a.showMainWidget( w ); |
47 | #else | 47 | #else |
48 | a.setMainWidget( w ); | 48 | a.setMainWidget( w ); |
49 | w->setCaption( "Wellenreiter II" ); | ||
49 | w->show(); | 50 | w->show(); |
50 | #endif | 51 | #endif |
51 | 52 | ||
52 | a.processEvents(); // show the window before doing the safety checks | 53 | a.processEvents(); // show the window before doing the safety checks |
53 | int result = -1; | 54 | int result = -1; |
54 | 55 | ||
55 | // root check | 56 | // root check |
56 | if ( getuid() ) | 57 | if ( getuid() ) |
57 | { | 58 | { |
58 | qWarning( QObject::tr( "Wellenreiter: trying to run as non-root!" ) ); | 59 | qWarning( QObject::tr( "Wellenreiter: trying to run as non-root!" ) ); |
59 | result = QMessageBox::warning( w, " - Wellenreiter II - (non-root)", QObject::tr( "You have started Wellenreiter II\n" | 60 | result = QMessageBox::warning( w, " - Wellenreiter II - (non-root)", QObject::tr( "You have started Wellenreiter II\n" |
60 | "as non-root. You will have\nonly limited functionality.\nProceed anyway?" ), | 61 | "as non-root. You will have\nonly limited functionality.\nProceed anyway?" ), |
61 | QMessageBox::Yes, QMessageBox::No ); | 62 | QMessageBox::Yes, QMessageBox::No ); |
62 | if ( result == QMessageBox::No ) return -1; | 63 | if ( result == QMessageBox::No ) return -1; |
63 | } | 64 | } |
64 | 65 | ||
65 | // dhcp check - NOT HERE! This really belongs as a static member to OProcess | 66 | // dhcp check - NOT HERE! This really belongs as a static member to OProcess |
66 | // and I want to call it like that: if ( OProcess::isRunning( QString& ) ) ... | 67 | // and I want to call it like that: if ( OProcess::isRunning( QString& ) ) ... |
67 | 68 | ||
69 | static int killed = false; | ||
70 | |||
68 | QString line; | 71 | QString line; |
69 | QDir d = QDir( "/proc" ); | 72 | QDir d = QDir( "/proc" ); |
70 | QStringList dirs = d.entryList( QDir::Dirs ); | 73 | QStringList dirs = d.entryList( QDir::Dirs ); |
71 | QStringList::Iterator it; | 74 | QStringList::Iterator it; |
72 | for ( it = dirs.begin(); it != dirs.end(); ++it ) | 75 | for ( it = dirs.begin(); it != dirs.end(); ++it ) |
73 | { | 76 | { |
74 | //qDebug( "next entry: %s", (const char*) *it ); | 77 | //qDebug( "next entry: %s", (const char*) *it ); |
75 | QFile file( "/proc/"+*it+"/cmdline" ); | 78 | QFile file( "/proc/"+*it+"/cmdline" ); |
76 | file.open( IO_ReadOnly ); | 79 | file.open( IO_ReadOnly ); |
77 | if ( !file.isOpen() ) continue; | 80 | if ( !file.isOpen() ) continue; |
78 | QTextStream t( &file ); | 81 | QTextStream t( &file ); |
79 | line = t.readLine(); | 82 | line = t.readLine(); |
80 | //qDebug( "cmdline = %s", (const char*) line ); | 83 | //qDebug( "cmdline = %s", (const char*) line ); |
81 | if ( line.contains( "dhcp" ) ) break; | 84 | if ( line.contains( "dhcp" ) ) break; |
82 | } | 85 | } |
83 | if ( line.contains( "dhcp" ) ) | 86 | if ( line.contains( "dhcp" ) ) |
84 | { | 87 | { |
85 | qWarning( "Wellenreiter: found dhcp process #%d", (*it).toInt() ); | 88 | qWarning( "Wellenreiter: found dhcp process #%d", (*it).toInt() ); |
86 | result = QMessageBox::warning( w, " - Wellenreiter II - (dhcp)", QObject::tr( "You have a dhcp client running.\n" | 89 | result = QMessageBox::warning( w, " - Wellenreiter II - (dhcp)", QObject::tr( "You have a dhcp client running.\n" |
87 | "This can severly limit scanning!\nShould I kill it for you?" ), | 90 | "This can severly limit scanning!\nShould I kill it for you?" ), |
88 | QMessageBox::Yes, QMessageBox::No ); | 91 | QMessageBox::Yes, QMessageBox::No ); |
89 | if ( result == QMessageBox::Yes ) | 92 | if ( result == QMessageBox::Yes ) |
90 | { | 93 | { |
91 | if ( -1 == ::kill( (*it).toInt(), SIGTERM ) ) | 94 | if ( -1 == ::kill( (*it).toInt(), SIGTERM ) ) |
92 | qWarning( "Wellenreiter: can't kill process (%s)", result, strerror( errno ) ); | 95 | qWarning( "Wellenreiter: can't kill process #%d (%s)", result, strerror( errno ) ); |
96 | else | ||
97 | killed = true; | ||
93 | } | 98 | } |
94 | } | 99 | } |
95 | 100 | ||
96 | a.exec(); | 101 | a.exec(); |
102 | |||
103 | if ( killed ) | ||
104 | { | ||
105 | result = QMessageBox::warning( w, " - Wellenreiter II - (dhcp)", QObject::tr( "Restart your dhcp client?" ), QMessageBox::Yes, QMessageBox::No ); | ||
106 | if ( result == QMessageBox::Yes ) | ||
107 | { | ||
108 | system( QString().sprintf( "dhclient &; udhcpcd &; dhcpcd &" ) ); | ||
109 | } | ||
110 | } | ||
111 | |||
97 | delete w; | 112 | delete w; |
98 | return 0; | 113 | return 0; |
99 | } | 114 | } |
diff --git a/noncore/net/wellenreiter/gui/mainwindow.cpp b/noncore/net/wellenreiter/gui/mainwindow.cpp index 7241f7a..3e36f5b 100644 --- a/noncore/net/wellenreiter/gui/mainwindow.cpp +++ b/noncore/net/wellenreiter/gui/mainwindow.cpp | |||
@@ -10,352 +10,357 @@ | |||
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 | #include "configwindow.h" | 16 | #include "configwindow.h" |
17 | #include "logwindow.h" | 17 | #include "logwindow.h" |
18 | #include "hexwindow.h" | 18 | #include "hexwindow.h" |
19 | #include "mainwindow.h" | 19 | #include "mainwindow.h" |
20 | #include "wellenreiter.h" | 20 | #include "wellenreiter.h" |
21 | #include "scanlist.h" | 21 | #include "scanlist.h" |
22 | 22 | ||
23 | #include <qcombobox.h> | 23 | #include <qcombobox.h> |
24 | #include <qdatastream.h> | 24 | #include <qdatastream.h> |
25 | #include <qfile.h> | 25 | #include <qfile.h> |
26 | #include <qfileinfo.h> | 26 | #include <qfileinfo.h> |
27 | #include <qiconset.h> | 27 | #include <qiconset.h> |
28 | #include <qmenubar.h> | 28 | #include <qmenubar.h> |
29 | #include <qmessagebox.h> | 29 | #include <qmessagebox.h> |
30 | #include <qpopupmenu.h> | 30 | #include <qpopupmenu.h> |
31 | #include <qstatusbar.h> | 31 | #include <qstatusbar.h> |
32 | #include <qtextstream.h> | 32 | #include <qtextstream.h> |
33 | #include <qtoolbutton.h> | 33 | #include <qtoolbutton.h> |
34 | 34 | ||
35 | #ifdef QWS | 35 | #ifdef QWS |
36 | #include <qpe/resource.h> | 36 | #include <qpe/resource.h> |
37 | #include <opie/ofiledialog.h> | 37 | #include <opie/ofiledialog.h> |
38 | #else | 38 | #else |
39 | #include "resource.h" | 39 | #include "resource.h" |
40 | #include <qapplication.h> | 40 | #include <qapplication.h> |
41 | #include <qfiledialog.h> | 41 | #include <qfiledialog.h> |
42 | #endif | 42 | #endif |
43 | 43 | ||
44 | WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * name, WFlags f ) | 44 | WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * name, WFlags f ) |
45 | :QMainWindow( parent, name, f ) | 45 | :QMainWindow( parent, name, f ) |
46 | { | 46 | { |
47 | cw = new WellenreiterConfigWindow( this ); | 47 | cw = new WellenreiterConfigWindow( this ); |
48 | mw = new Wellenreiter( this ); | 48 | mw = new Wellenreiter( this ); |
49 | mw->setConfigWindow( cw ); | 49 | mw->setConfigWindow( cw ); |
50 | setCentralWidget( mw ); | 50 | setCentralWidget( mw ); |
51 | 51 | ||
52 | // setup application icon | 52 | // setup application icon |
53 | 53 | ||
54 | #ifndef QWS | 54 | #ifndef QWS |
55 | setIcon( Resource::loadPixmap( "wellenreiter/appicon-trans" ) ); | 55 | setIcon( Resource::loadPixmap( "wellenreiter/appicon-trans" ) ); |
56 | setIconText( "Wellenreiter/X11" ); | 56 | setIconText( "Wellenreiter/X11" ); |
57 | #endif | 57 | #endif |
58 | 58 | ||
59 | // setup icon sets | 59 | // setup icon sets |
60 | 60 | ||
61 | infoIconSet = new QIconSet( Resource::loadPixmap( "wellenreiter/InfoIcon" ) ); | 61 | infoIconSet = new QIconSet( Resource::loadPixmap( "wellenreiter/InfoIcon" ) ); |
62 | settingsIconSet = new QIconSet( Resource::loadPixmap( "wellenreiter/SettingsIcon" ) ); | 62 | settingsIconSet = new QIconSet( Resource::loadPixmap( "wellenreiter/SettingsIcon" ) ); |
63 | startIconSet = new QIconSet( Resource::loadPixmap( "wellenreiter/SearchIcon" ) ); | 63 | startIconSet = new QIconSet( Resource::loadPixmap( "wellenreiter/SearchIcon" ) ); |
64 | stopIconSet = new QIconSet( Resource::loadPixmap( "wellenreiter/CancelIcon" ) ); | 64 | stopIconSet = new QIconSet( Resource::loadPixmap( "wellenreiter/CancelIcon" ) ); |
65 | 65 | ||
66 | // setup tool buttons | 66 | // setup tool buttons |
67 | 67 | ||
68 | startButton = new QToolButton( 0 ); | 68 | startButton = new QToolButton( 0 ); |
69 | #ifdef QWS | 69 | #ifdef QWS |
70 | startButton->setAutoRaise( true ); | 70 | startButton->setAutoRaise( true ); |
71 | #endif | 71 | #endif |
72 | startButton->setIconSet( *startIconSet ); | 72 | startButton->setIconSet( *startIconSet ); |
73 | startButton->setEnabled( false ); | 73 | startButton->setEnabled( false ); |
74 | connect( startButton, SIGNAL( clicked() ), mw, SLOT( startClicked() ) ); | 74 | connect( startButton, SIGNAL( clicked() ), mw, SLOT( startClicked() ) ); |
75 | 75 | ||
76 | stopButton = new QToolButton( 0 ); | 76 | stopButton = new QToolButton( 0 ); |
77 | #ifdef QWS | 77 | #ifdef QWS |
78 | stopButton->setAutoRaise( true ); | 78 | stopButton->setAutoRaise( true ); |
79 | #endif | 79 | #endif |
80 | stopButton->setIconSet( *stopIconSet ); | 80 | stopButton->setIconSet( *stopIconSet ); |
81 | stopButton->setEnabled( false ); | 81 | stopButton->setEnabled( false ); |
82 | connect( stopButton, SIGNAL( clicked() ), mw, SLOT( stopClicked() ) ); | 82 | connect( stopButton, SIGNAL( clicked() ), mw, SLOT( stopClicked() ) ); |
83 | 83 | ||
84 | QToolButton* c = new QToolButton( 0 ); | 84 | QToolButton* c = new QToolButton( 0 ); |
85 | #ifdef QWS | 85 | #ifdef QWS |
86 | c->setAutoRaise( true ); | 86 | c->setAutoRaise( true ); |
87 | #endif | 87 | #endif |
88 | c->setIconSet( *infoIconSet ); | 88 | c->setIconSet( *infoIconSet ); |
89 | c->setEnabled( false ); | 89 | c->setEnabled( false ); |
90 | 90 | ||
91 | QToolButton* d = new QToolButton( 0 ); | 91 | QToolButton* d = new QToolButton( 0 ); |
92 | #ifdef QWS | 92 | #ifdef QWS |
93 | d->setAutoRaise( true ); | 93 | d->setAutoRaise( true ); |
94 | #endif | 94 | #endif |
95 | d->setIconSet( *settingsIconSet ); | 95 | d->setIconSet( *settingsIconSet ); |
96 | connect( d, SIGNAL( clicked() ), this, SLOT( showConfigure() ) ); | 96 | connect( d, SIGNAL( clicked() ), this, SLOT( showConfigure() ) ); |
97 | 97 | ||
98 | // setup menu bar | 98 | // setup menu bar |
99 | 99 | ||
100 | int id; | 100 | int id; |
101 | 101 | ||
102 | QMenuBar* mb = menuBar(); | 102 | QMenuBar* mb = menuBar(); |
103 | 103 | ||
104 | QPopupMenu* fileSave = new QPopupMenu( mb ); | 104 | QPopupMenu* fileSave = new QPopupMenu( mb ); |
105 | fileSave->insertItem( tr( "&Session..." ), this, SLOT( fileSaveSession() ) ); | 105 | fileSave->insertItem( tr( "&Session..." ), this, SLOT( fileSaveSession() ) ); |
106 | fileSave->insertItem( tr( "&Text Log..." ), this, SLOT( fileSaveLog() ) ); | 106 | fileSave->insertItem( tr( "&Text Log..." ), this, SLOT( fileSaveLog() ) ); |
107 | fileSave->insertItem( tr( "&Hex Log..." ), this, SLOT( fileSaveHex() ) ); | 107 | fileSave->insertItem( tr( "&Hex Log..." ), this, SLOT( fileSaveHex() ) ); |
108 | 108 | ||
109 | QPopupMenu* fileLoad = new QPopupMenu( mb ); | 109 | QPopupMenu* fileLoad = new QPopupMenu( mb ); |
110 | fileLoad->insertItem( tr( "&Session..." ), this, SLOT( fileLoadSession() ) ); | 110 | fileLoad->insertItem( tr( "&Session..." ), this, SLOT( fileLoadSession() ) ); |
111 | //fileLoad->insertItem( "&Log", this, SLOT( fileLoadLog() ) ); | 111 | //fileLoad->insertItem( "&Log", this, SLOT( fileLoadLog() ) ); |
112 | 112 | ||
113 | QPopupMenu* file = new QPopupMenu( mb ); | 113 | QPopupMenu* file = new QPopupMenu( mb ); |
114 | file->insertItem( tr( "&New" ), this, SLOT( fileNew() ) ); | 114 | file->insertItem( tr( "&New" ), this, SLOT( fileNew() ) ); |
115 | id = file->insertItem( tr( "&Load" ), fileLoad ); | 115 | id = file->insertItem( tr( "&Load" ), fileLoad ); |
116 | file->insertItem( tr( "&Save" ), fileSave ); | 116 | file->insertItem( tr( "&Save" ), fileSave ); |
117 | file->insertSeparator(); | 117 | file->insertSeparator(); |
118 | file->insertItem( tr( "&Exit" ), qApp, SLOT( quit() ) ); | 118 | file->insertItem( tr( "&Exit" ), qApp, SLOT( quit() ) ); |
119 | 119 | ||
120 | QPopupMenu* view = new QPopupMenu( mb ); | 120 | QPopupMenu* view = new QPopupMenu( mb ); |
121 | view->insertItem( tr( "&Configure..." ) ); | 121 | view->insertItem( tr( "&Configure..." ) ); |
122 | 122 | ||
123 | QPopupMenu* sniffer = new QPopupMenu( mb ); | 123 | QPopupMenu* sniffer = new QPopupMenu( mb ); |
124 | sniffer->insertItem( tr( "&Configure..." ), this, SLOT( showConfigure() ) ); | 124 | sniffer->insertItem( tr( "&Configure..." ), this, SLOT( showConfigure() ) ); |
125 | sniffer->insertSeparator(); | 125 | sniffer->insertSeparator(); |
126 | startID = sniffer->insertItem( tr( "&Start" ), mw, SLOT( startClicked() ) ); | 126 | startID = sniffer->insertItem( tr( "&Start" ), mw, SLOT( startClicked() ) ); |
127 | sniffer->setItemEnabled( startID, false ); | 127 | sniffer->setItemEnabled( startID, false ); |
128 | stopID = sniffer->insertItem( tr( "Sto&p" ), mw, SLOT( stopClicked() ) ); | 128 | stopID = sniffer->insertItem( tr( "Sto&p" ), mw, SLOT( stopClicked() ) ); |
129 | sniffer->setItemEnabled( stopID, false ); | 129 | sniffer->setItemEnabled( stopID, false ); |
130 | 130 | ||
131 | QPopupMenu* demo = new QPopupMenu( mb ); | 131 | QPopupMenu* demo = new QPopupMenu( mb ); |
132 | demo->insertItem( tr( "&Add something" ), this, SLOT( demoAddStations() ) ); | 132 | demo->insertItem( tr( "&Add something" ), this, SLOT( demoAddStations() ) ); |
133 | 133 | ||
134 | id = mb->insertItem( tr( "&File" ), file ); | 134 | id = mb->insertItem( tr( "&File" ), file ); |
135 | //id = mb->insertItem( tr( "&View" ), view ); | 135 | //id = mb->insertItem( tr( "&View" ), view ); |
136 | //mb->setItemEnabled( id, false ); | 136 | //mb->setItemEnabled( id, false ); |
137 | id = mb->insertItem( tr( "&Sniffer" ), sniffer ); | 137 | id = mb->insertItem( tr( "&Sniffer" ), sniffer ); |
138 | //id = mb->insertItem( tr( "&Demo" ), demo ); | 138 | |
139 | //mb->setItemEnabled( id, true ); | 139 | id = mb->insertItem( tr( "&Demo" ), demo ); |
140 | mb->setItemEnabled( id, true ); | ||
140 | 141 | ||
141 | #ifdef QWS | 142 | #ifdef QWS |
142 | mb->insertItem( startButton ); | 143 | mb->insertItem( startButton ); |
143 | mb->insertItem( stopButton ); | 144 | mb->insertItem( stopButton ); |
144 | mb->insertItem( c ); | 145 | mb->insertItem( c ); |
145 | mb->insertItem( d ); | 146 | mb->insertItem( d ); |
146 | #else // Qt3 changed the insertion order. It's now totally random :( | 147 | #else // Qt3 changed the insertion order. It's now totally random :( |
147 | mb->insertItem( d ); | 148 | mb->insertItem( d ); |
148 | mb->insertItem( c ); | 149 | mb->insertItem( c ); |
149 | mb->insertItem( stopButton ); | 150 | mb->insertItem( stopButton ); |
150 | mb->insertItem( startButton ); | 151 | mb->insertItem( startButton ); |
151 | #endif | 152 | #endif |
152 | 153 | ||
153 | updateToolButtonState(); | 154 | updateToolButtonState(); |
154 | 155 | ||
155 | // setup status bar (for now only on X11) | 156 | // setup status bar (for now only on X11) |
156 | 157 | ||
157 | #ifndef QWS | 158 | #ifndef QWS |
158 | statusBar()->message( tr( "Ready." ) ); | 159 | statusBar()->message( tr( "Ready." ) ); |
159 | #endif | 160 | #endif |
160 | 161 | ||
161 | connect( mw, SIGNAL( startedSniffing() ), this, SLOT( changedSniffingState() ) ); | 162 | connect( mw, SIGNAL( startedSniffing() ), this, SLOT( changedSniffingState() ) ); |
162 | connect( mw, SIGNAL( stoppedSniffing() ), this, SLOT( changedSniffingState() ) ); | 163 | connect( mw, SIGNAL( stoppedSniffing() ), this, SLOT( changedSniffingState() ) ); |
163 | }; | 164 | }; |
164 | 165 | ||
165 | 166 | ||
166 | 167 | ||
167 | void WellenreiterMainWindow::showConfigure() | 168 | void WellenreiterMainWindow::showConfigure() |
168 | { | 169 | { |
169 | qDebug( "show configure..." ); | 170 | qDebug( "show configure..." ); |
170 | cw->setCaption( tr( "Configure" ) ); | 171 | cw->setCaption( tr( "Configure" ) ); |
171 | #ifdef QWS | 172 | #ifdef QWS |
172 | cw->showMaximized(); | 173 | cw->showMaximized(); |
173 | #endif | 174 | #endif |
174 | int result = cw->exec(); | 175 | int result = cw->exec(); |
175 | 176 | ||
176 | if ( result ) updateToolButtonState(); | 177 | if ( result ) updateToolButtonState(); |
177 | } | 178 | } |
178 | 179 | ||
179 | 180 | ||
180 | 181 | ||
181 | void WellenreiterMainWindow::updateToolButtonState() | 182 | void WellenreiterMainWindow::updateToolButtonState() |
182 | { | 183 | { |
183 | const QString& interface = cw->interfaceName->currentText(); | 184 | const QString& interface = cw->interfaceName->currentText(); |
184 | const int cardtype = cw->driverType(); | 185 | const int cardtype = cw->driverType(); |
185 | 186 | ||
186 | if ( ( interface != "<select>" ) && ( cardtype != 0 ) ) | 187 | if ( ( interface != "<select>" ) && ( cardtype != 0 ) ) |
187 | { | 188 | { |
188 | startButton->setEnabled( true ); | 189 | startButton->setEnabled( true ); |
189 | menuBar()->setItemEnabled( startID, true ); | 190 | menuBar()->setItemEnabled( startID, true ); |
190 | } | 191 | } |
191 | else | 192 | else |
192 | { | 193 | { |
193 | startButton->setEnabled( false ); | 194 | startButton->setEnabled( false ); |
194 | menuBar()->setItemEnabled( startID, false ); | 195 | menuBar()->setItemEnabled( startID, false ); |
195 | } | 196 | } |
196 | } | 197 | } |
197 | 198 | ||
198 | 199 | ||
199 | void WellenreiterMainWindow::changedSniffingState() | 200 | void WellenreiterMainWindow::changedSniffingState() |
200 | { | 201 | { |
201 | startButton->setEnabled( !mw->sniffing ); | 202 | startButton->setEnabled( !mw->sniffing ); |
202 | menuBar()->setItemEnabled( startID, !mw->sniffing ); | 203 | menuBar()->setItemEnabled( startID, !mw->sniffing ); |
203 | stopButton->setEnabled( mw->sniffing ); | 204 | stopButton->setEnabled( mw->sniffing ); |
204 | menuBar()->setItemEnabled( stopID, mw->sniffing ); | 205 | menuBar()->setItemEnabled( stopID, mw->sniffing ); |
205 | } | 206 | } |
206 | 207 | ||
207 | 208 | ||
208 | WellenreiterMainWindow::~WellenreiterMainWindow() | 209 | WellenreiterMainWindow::~WellenreiterMainWindow() |
209 | { | 210 | { |
210 | delete infoIconSet; | 211 | delete infoIconSet; |
211 | delete settingsIconSet; | 212 | delete settingsIconSet; |
212 | delete startIconSet; | 213 | delete startIconSet; |
213 | delete stopIconSet; | 214 | delete stopIconSet; |
214 | }; | 215 | }; |
215 | 216 | ||
216 | void WellenreiterMainWindow::demoAddStations() | 217 | void WellenreiterMainWindow::demoAddStations() |
217 | { | 218 | { |
219 | mw = 0; | ||
220 | |||
218 | mw->netView()->addNewItem( "managed", "Vanille", "00:00:20:EF:A6:43", true, 6, 80 ); | 221 | mw->netView()->addNewItem( "managed", "Vanille", "00:00:20:EF:A6:43", true, 6, 80 ); |
219 | mw->netView()->addNewItem( "managed", "Vanille", "00:30:6D:EF:A6:23", true, 11, 10 ); | 222 | mw->netView()->addNewItem( "managed", "Vanille", "00:30:6D:EF:A6:23", true, 11, 10 ); |
220 | mw->netView()->addNewItem( "adhoc", "ELAN", "00:A0:F8:E7:16:22", false, 3, 10 ); | 223 | mw->netView()->addNewItem( "adhoc", "ELAN", "00:A0:F8:E7:16:22", false, 3, 10 ); |
221 | mw->netView()->addNewItem( "adhoc", "ELAN", "00:AA:01:E7:56:62", false, 3, 15 ); | 224 | mw->netView()->addNewItem( "adhoc", "ELAN", "00:AA:01:E7:56:62", false, 3, 15 ); |
222 | mw->netView()->addNewItem( "adhoc", "ELAN", "00:B0:8E:E7:56:E2", false, 3, 20 ); | 225 | mw->netView()->addNewItem( "adhoc", "ELAN", "00:B0:8E:E7:56:E2", false, 3, 20 ); |
223 | } | 226 | } |
224 | 227 | ||
225 | 228 | ||
226 | QString WellenreiterMainWindow::getFileName( bool save ) | 229 | QString WellenreiterMainWindow::getFileName( bool save ) |
227 | { | 230 | { |
228 | QMap<QString, QStringList> map; | 231 | QMap<QString, QStringList> map; |
229 | map.insert( tr("All"), QStringList() ); | 232 | map.insert( tr("All"), QStringList() ); |
230 | QStringList text; | 233 | QStringList text; |
231 | text << "text/*"; | 234 | text << "text/*"; |
232 | map.insert( tr("Text"), text ); | 235 | map.insert( tr("Text"), text ); |
233 | text << "*"; | 236 | text << "*"; |
234 | map.insert( tr("All"), text ); | 237 | map.insert( tr("All"), text ); |
235 | 238 | ||
236 | QString str; | 239 | QString str; |
237 | if ( save ) | 240 | if ( save ) |
238 | { | 241 | { |
239 | #ifdef QWS | 242 | #ifdef QWS |
240 | str = OFileDialog::getSaveFileName( 2, "/", QString::null, map ); | 243 | str = OFileDialog::getSaveFileName( 2, "/", QString::null, map ); |
241 | #else | 244 | #else |
242 | str = QFileDialog::getSaveFileName(); | 245 | str = QFileDialog::getSaveFileName(); |
243 | #endif | 246 | #endif |
244 | if ( str.isEmpty() /*|| QFileInfo(str).isDir()*/ ) | 247 | if ( str.isEmpty() /*|| QFileInfo(str).isDir()*/ ) |
245 | return ""; | 248 | return ""; |
246 | } | 249 | } |
247 | else | 250 | else |
248 | { | 251 | { |
249 | #ifdef QWS | 252 | #ifdef QWS |
250 | str = OFileDialog::getOpenFileName( 2, "/", QString::null, map ); | 253 | str = OFileDialog::getOpenFileName( 2, "/", QString::null, map ); |
251 | #else | 254 | #else |
252 | str = QFileDialog::getOpenFileName(); | 255 | str = QFileDialog::getOpenFileName(); |
253 | #endif | 256 | #endif |
254 | if ( str.isEmpty() || !QFile(str).exists() || QFileInfo(str).isDir() ) | 257 | if ( str.isEmpty() || !QFile(str).exists() || QFileInfo(str).isDir() ) |
255 | return ""; | 258 | return ""; |
256 | } | 259 | } |
257 | return str; | 260 | return str; |
258 | } | 261 | } |
259 | 262 | ||
260 | 263 | ||
261 | void WellenreiterMainWindow::fileSaveLog() | 264 | void WellenreiterMainWindow::fileSaveLog() |
262 | { | 265 | { |
263 | QString fname = getFileName( true ); | 266 | QString fname = getFileName( true ); |
264 | if ( !fname.isEmpty() ) | 267 | if ( !fname.isEmpty() ) |
265 | { | 268 | { |
266 | QFile f( fname ); | 269 | QFile f( fname ); |
267 | if ( f.open(IO_WriteOnly) ) | 270 | if ( f.open(IO_WriteOnly) ) |
268 | { | 271 | { |
269 | QTextStream t( &f ); | 272 | QTextStream t( &f ); |
270 | t << mw->logWindow()->getLog(); | 273 | t << mw->logWindow()->getLog(); |
271 | f.close(); | 274 | f.close(); |
272 | qDebug( "Saved log to file '%s'", (const char*) fname ); | 275 | qDebug( "Saved log to file '%s'", (const char*) fname ); |
273 | } | 276 | } |
274 | else | 277 | else |
275 | { | 278 | { |
276 | qDebug( "Problem saving log to file '%s'", (const char*) fname ); | 279 | qDebug( "Problem saving log to file '%s'", (const char*) fname ); |
277 | } | 280 | } |
278 | } | 281 | } |
279 | } | 282 | } |
280 | 283 | ||
281 | void WellenreiterMainWindow::fileSaveSession() | 284 | void WellenreiterMainWindow::fileSaveSession() |
282 | { | 285 | { |
283 | QString fname = getFileName( true ); | 286 | QString fname = getFileName( true ); |
284 | if ( !fname.isEmpty() ) | 287 | if ( !fname.isEmpty() ) |
285 | { | 288 | { |
286 | 289 | ||
287 | QFile f( fname ); | 290 | QFile f( fname ); |
288 | if ( f.open(IO_WriteOnly) ) | 291 | if ( f.open(IO_WriteOnly) ) |
289 | { | 292 | { |
290 | QDataStream t( &f ); | 293 | QDataStream t( &f ); |
291 | t << *mw->netView(); | 294 | t << *mw->netView(); |
292 | f.close(); | 295 | f.close(); |
293 | qDebug( "Saved session to file '%s'", (const char*) fname ); | 296 | qDebug( "Saved session to file '%s'", (const char*) fname ); |
294 | } | 297 | } |
295 | else | 298 | else |
296 | { | 299 | { |
297 | qDebug( "Problem saving session to file '%s'", (const char*) fname ); | 300 | qDebug( "Problem saving session to file '%s'", (const char*) fname ); |
298 | } | 301 | } |
299 | } | 302 | } |
300 | } | 303 | } |
301 | 304 | ||
302 | void WellenreiterMainWindow::fileSaveHex() | 305 | void WellenreiterMainWindow::fileSaveHex() |
303 | { | 306 | { |
304 | QString fname = getFileName( true ); | 307 | QString fname = getFileName( true ); |
305 | if ( !fname.isEmpty() ) | 308 | if ( !fname.isEmpty() ) |
306 | { | 309 | { |
307 | QFile f( fname ); | 310 | QFile f( fname ); |
308 | if ( f.open(IO_WriteOnly) ) | 311 | if ( f.open(IO_WriteOnly) ) |
309 | { | 312 | { |
310 | QTextStream t( &f ); | 313 | QTextStream t( &f ); |
311 | t << mw->hexWindow()->getLog(); | 314 | t << mw->hexWindow()->getLog(); |
312 | f.close(); | 315 | f.close(); |
313 | qDebug( "Saved hex log to file '%s'", (const char*) fname ); | 316 | qDebug( "Saved hex log to file '%s'", (const char*) fname ); |
314 | } | 317 | } |
315 | else | 318 | else |
316 | { | 319 | { |
317 | qDebug( "Problem saving hex log to file '%s'", (const char*) fname ); | 320 | qDebug( "Problem saving hex log to file '%s'", (const char*) fname ); |
318 | } | 321 | } |
319 | } | 322 | } |
320 | } | 323 | } |
321 | 324 | ||
322 | void WellenreiterMainWindow::fileLoadSession() | 325 | void WellenreiterMainWindow::fileLoadSession() |
323 | { | 326 | { |
324 | QString fname = getFileName( false ); | 327 | QString fname = getFileName( false ); |
325 | if ( !fname.isEmpty() ) | 328 | if ( !fname.isEmpty() ) |
326 | { | 329 | { |
327 | QFile f( fname ); | 330 | QFile f( fname ); |
328 | if ( f.open(IO_ReadOnly) ) | 331 | if ( f.open(IO_ReadOnly) ) |
329 | { | 332 | { |
330 | QDataStream t( &f ); | 333 | QDataStream t( &f ); |
331 | t >> *mw->netView(); | 334 | t >> *mw->netView(); |
332 | f.close(); | 335 | f.close(); |
333 | qDebug( "Loaded session from file '%s'", (const char*) fname ); | 336 | qDebug( "Loaded session from file '%s'", (const char*) fname ); |
334 | } | 337 | } |
335 | else | 338 | else |
336 | { | 339 | { |
337 | qDebug( "Problem loading session from file '%s'", (const char*) fname ); | 340 | qDebug( "Problem loading session from file '%s'", (const char*) fname ); |
338 | } | 341 | } |
339 | } | 342 | } |
340 | } | 343 | } |
341 | 344 | ||
342 | void WellenreiterMainWindow::fileNew() | 345 | void WellenreiterMainWindow::fileNew() |
343 | { | 346 | { |
344 | mw->netView()->clear(); | 347 | mw->netView()->clear(); |
345 | mw->logWindow()->clear(); | 348 | mw->logWindow()->clear(); |
346 | mw->hexWindow()->clear(); | 349 | mw->hexWindow()->clear(); |
347 | } | 350 | } |
348 | 351 | ||
349 | void WellenreiterMainWindow::closeEvent( QCloseEvent* e ) | 352 | void WellenreiterMainWindow::closeEvent( QCloseEvent* e ) |
350 | { | 353 | { |
351 | if ( mw->isDaemonRunning() ) | 354 | if ( mw->isDaemonRunning() ) |
352 | { | 355 | { |
353 | QMessageBox::warning( this, "Wellenreiter/Opie", | 356 | QMessageBox::warning( this, "Wellenreiter/Opie", |
354 | tr( "Sniffing in progress!\nPlease stop sniffing before closing." ) ); | 357 | tr( "Sniffing in progress!\nPlease stop sniffing before closing." ) ); |
355 | e->ignore(); | 358 | e->ignore(); |
356 | } | 359 | } |
357 | else | 360 | else |
358 | { | 361 | { |
359 | QMainWindow::closeEvent( e ); | 362 | QMainWindow::closeEvent( e ); |
360 | } | 363 | } |
361 | } | 364 | } |
365 | |||
366 | |||
diff --git a/noncore/net/wellenreiter/gui/protolistview.cpp b/noncore/net/wellenreiter/gui/protolistview.cpp index f4b45d0..daca095 100644 --- a/noncore/net/wellenreiter/gui/protolistview.cpp +++ b/noncore/net/wellenreiter/gui/protolistview.cpp | |||
@@ -1,124 +1,124 @@ | |||
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 | /* LOCAL */ | 16 | /* LOCAL */ |
17 | #include "protolistview.h" | 17 | #include "protolistview.h" |
18 | 18 | ||
19 | #include <qcheckbox.h> | 19 | #include <qcheckbox.h> |
20 | #include <qcombobox.h> | 20 | #include <qcombobox.h> |
21 | #include <qhbox.h> | 21 | #include <qhbox.h> |
22 | #include <qvbox.h> | 22 | #include <qvbox.h> |
23 | #include <qpalette.h> | 23 | #include <qpalette.h> |
24 | #include <qcolor.h> | 24 | #include <qcolor.h> |
25 | #include <qlabel.h> | 25 | #include <qlabel.h> |
26 | #include <qframe.h> | 26 | #include <qframe.h> |
27 | 27 | ||
28 | ProtocolListView::ProtocolListView( QWidget* parent, const char* name, WFlags f ) | 28 | ProtocolListView::ProtocolListView( QWidget* parent, const char* name, WFlags f ) |
29 | :QScrollView( parent, name, f ) | 29 | :QScrollView( parent, name, f ) |
30 | { | 30 | { |
31 | parse = ( QString( "parsePackets" ) == QString( name ) ); | 31 | parse = ( QString( "parsePackets" ) == QString( name ) ); |
32 | 32 | ||
33 | setMargins( 3, 3, 0, 0 ); | 33 | setMargins( 3, 3, 0, 0 ); |
34 | viewport()->setBackgroundColor( QCheckBox(0).palette().color( QPalette::Active, QColorGroup::Background ) ); | 34 | viewport()->setBackgroundColor( QCheckBox(0).palette().color( QPalette::Active, QColorGroup::Background ) ); |
35 | 35 | ||
36 | vbox = new QVBox( viewport() ); | 36 | vbox = new QVBox( viewport() ); |
37 | vbox->setSpacing( 1 ); | 37 | vbox->setSpacing( 1 ); |
38 | addChild( vbox ); | 38 | addChild( vbox ); |
39 | 39 | ||
40 | QHBox* hbox = new QHBox( vbox ); | 40 | QHBox* hbox = new QHBox( vbox ); |
41 | hbox->setSpacing( 40 ); | 41 | hbox->setSpacing( 40 ); |
42 | new QLabel( tr( "Protocol Family" ), hbox ); | 42 | new QLabel( tr( "Protocol Family" ), hbox ); |
43 | new QLabel( tr( "Perform Action" ), hbox ); | 43 | new QLabel( tr( "Perform Action" ), hbox ); |
44 | QFrame* frame = new QFrame( vbox ); | 44 | QFrame* frame = new QFrame( vbox ); |
45 | frame->setFrameStyle( QFrame::HLine + QFrame::Sunken ); | 45 | frame->setFrameStyle( QFrame::HLine + QFrame::Sunken ); |
46 | 46 | ||
47 | //TODO: hardcoded for now...a protocol database would be nice!? | 47 | //TODO: hardcoded for now...a protocol database would be nice!? |
48 | 48 | ||
49 | //addProtocol( "Ethernet" ); | 49 | //addProtocol( "Ethernet" ); |
50 | addProtocol( "Prism" ); | 50 | addProtocol( "Prism" ); |
51 | //addProtocol( "802.11" ); | 51 | //addProtocol( "802.11" ); |
52 | addProtocol( "802.11 Management" ); | 52 | addProtocol( "802.11 Management" ); |
53 | addProtocol( "802.11 SSID" ); | 53 | addProtocol( "802.11 SSID" ); |
54 | addProtocol( "802.11 Rates" ); | 54 | addProtocol( "802.11 Rates" ); |
55 | addProtocol( "802.11 CF" ); | 55 | addProtocol( "802.11 CF" ); |
56 | addProtocol( "802.11 FH" ); | 56 | addProtocol( "802.11 FH" ); |
57 | addProtocol( "802.11 DS" ); | 57 | addProtocol( "802.11 DS" ); |
58 | addProtocol( "802.11 Tim" ); | 58 | addProtocol( "802.11 Tim" ); |
59 | addProtocol( "802.11 IBSS" ); | 59 | addProtocol( "802.11 IBSS" ); |
60 | addProtocol( "802.11 Challenge" ); | 60 | addProtocol( "802.11 Challenge" ); |
61 | addProtocol( "802.11 Data" ); | 61 | addProtocol( "802.11 Data" ); |
62 | addProtocol( "802.11 LLC" ); | 62 | addProtocol( "802.11 LLC" ); |
63 | addProtocol( "802.11 Data" ); | 63 | addProtocol( "802.11 Data" ); |
64 | addProtocol( "IP" ); | 64 | addProtocol( "IP" ); |
65 | addProtocol( "ARP" ); | 65 | addProtocol( "ARP" ); |
66 | addProtocol( "UDP" ); | 66 | addProtocol( "UDP" ); |
67 | addProtocol( "TCP" ); | 67 | addProtocol( "TCP" ); |
68 | } | 68 | } |
69 | 69 | ||
70 | 70 | ||
71 | ProtocolListView::~ProtocolListView() | 71 | ProtocolListView::~ProtocolListView() |
72 | { | 72 | { |
73 | } | 73 | } |
74 | 74 | ||
75 | 75 | ||
76 | void ProtocolListView::addProtocol( const QString& name ) | 76 | void ProtocolListView::addProtocol( const QString& name ) |
77 | { | 77 | { |
78 | QHBox* hbox = new QHBox( vbox ); | 78 | QHBox* hbox = new QHBox( vbox ); |
79 | new QCheckBox( name, hbox, (const char*) name ); | 79 | new QCheckBox( name, hbox, (const char*) name ); |
80 | 80 | ||
81 | if ( parse ) | 81 | if ( parse ) |
82 | { | 82 | { |
83 | QComboBox* combo = new QComboBox( hbox, (const char*) name ); | 83 | QComboBox* combo = new QComboBox( hbox, (const char*) name ); |
84 | #ifdef QWS | 84 | #ifdef QWS |
85 | combo->setFixedWidth( 75 ); | 85 | combo->setFixedWidth( 75 ); |
86 | #endif | 86 | #endif |
87 | combo->insertItem( "Ignore" ); | 87 | combo->insertItem( "Pass" ); |
88 | combo->insertItem( "Discard!" ); | 88 | combo->insertItem( "Discard!" ); |
89 | combo->insertItem( "TouchSound" ); | 89 | combo->insertItem( "TouchSound" ); |
90 | combo->insertItem( "AlarmSound" ); | 90 | combo->insertItem( "AlarmSound" ); |
91 | combo->insertItem( "KeySound" ); | 91 | combo->insertItem( "KeySound" ); |
92 | combo->insertItem( "LedOn" ); | 92 | combo->insertItem( "LedOn" ); |
93 | combo->insertItem( "LedOff" ); | 93 | combo->insertItem( "LedOff" ); |
94 | combo->insertItem( "LogMessage" ); | 94 | combo->insertItem( "LogMessage" ); |
95 | combo->insertItem( "MessageBox" ); | 95 | combo->insertItem( "MessageBox" ); |
96 | } | 96 | } |
97 | else | 97 | else |
98 | { | 98 | { |
99 | QComboBox* combo = new QComboBox( hbox, (const char*) name ); | 99 | QComboBox* combo = new QComboBox( hbox, (const char*) name ); |
100 | #ifdef QWS | 100 | #ifdef QWS |
101 | combo->setFixedWidth( 75 ); | 101 | combo->setFixedWidth( 75 ); |
102 | #endif | 102 | #endif |
103 | combo->insertItem( "Pass" ); | 103 | combo->insertItem( "Pass" ); |
104 | combo->insertItem( "Discard!" ); | 104 | combo->insertItem( "Discard!" ); |
105 | } | 105 | } |
106 | } | 106 | } |
107 | 107 | ||
108 | 108 | ||
109 | bool ProtocolListView::isProtocolChecked( const QString& name ) | 109 | bool ProtocolListView::isProtocolChecked( const QString& name ) |
110 | { | 110 | { |
111 | QCheckBox* box = (QCheckBox*) child( (const char*) name ); | 111 | QCheckBox* box = (QCheckBox*) child( (const char*) name ); |
112 | return ( box && box->isOn() ); | 112 | return ( box && box->isOn() ); |
113 | } | 113 | } |
114 | 114 | ||
115 | 115 | ||
116 | QString ProtocolListView::protocolAction( const QString& name ) | 116 | QString ProtocolListView::protocolAction( const QString& name ) |
117 | { | 117 | { |
118 | QComboBox* combo = (QComboBox*) child( (const char*) name, "QComboBox" ); | 118 | QComboBox* combo = (QComboBox*) child( (const char*) name, "QComboBox" ); |
119 | if ( combo ) | 119 | if ( combo ) |
120 | return combo->currentText(); | 120 | return combo->currentText(); |
121 | else | 121 | else |
122 | return "<unknown>"; | 122 | return "<unknown>"; |
123 | } | 123 | } |
124 | 124 | ||
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp index 965f6b0..4257be1 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp | |||
@@ -278,255 +278,263 @@ QObject* Wellenreiter::childIfToParse( OPacket* p, const QString& protocol ) | |||
278 | return 0; | 278 | return 0; |
279 | 279 | ||
280 | return p->child( protocol ); | 280 | return p->child( protocol ); |
281 | } | 281 | } |
282 | 282 | ||
283 | 283 | ||
284 | bool Wellenreiter::checkDumpPacket( OPacket* p ) | 284 | bool Wellenreiter::checkDumpPacket( OPacket* p ) |
285 | { | 285 | { |
286 | // go through all child packets and see if one is inside the child hierarchy for p | 286 | // go through all child packets and see if one is inside the child hierarchy for p |
287 | // if so, do what the user requested (protocolAction), e.g. pass or discard | 287 | // if so, do what the user requested (protocolAction), e.g. pass or discard |
288 | if ( !configwindow->writeCaptureFile->isOn() ) | 288 | if ( !configwindow->writeCaptureFile->isOn() ) |
289 | return false; | 289 | return false; |
290 | 290 | ||
291 | QObjectList* l = p->queryList(); | 291 | QObjectList* l = p->queryList(); |
292 | QObjectListIt it( *l ); | 292 | QObjectListIt it( *l ); |
293 | QObject* o; | 293 | QObject* o; |
294 | 294 | ||
295 | while ( (o = it.current()) != 0 ) | 295 | while ( (o = it.current()) != 0 ) |
296 | { | 296 | { |
297 | QString name = it.current()->name(); | 297 | QString name = it.current()->name(); |
298 | if ( configwindow->capturePackets->isProtocolChecked( name ) ) | 298 | if ( configwindow->capturePackets->isProtocolChecked( name ) ) |
299 | { | 299 | { |
300 | QString action = configwindow->capturePackets->protocolAction( name ); | 300 | QString action = configwindow->capturePackets->protocolAction( name ); |
301 | qDebug( "capturePackets-action for '%s' seems to be '%s'", (const char*) name, (const char*) action ); | 301 | qDebug( "capturePackets-action for '%s' seems to be '%s'", (const char*) name, (const char*) action ); |
302 | if ( action == "Discard" ) | 302 | if ( action == "Discard" ) |
303 | { | 303 | { |
304 | logwindow->log( QString().sprintf( "(i) dump-discarding of '%s' packet requested.", (const char*) name ) ); | 304 | logwindow->log( QString().sprintf( "(i) dump-discarding of '%s' packet requested.", (const char*) name ) ); |
305 | return false; | 305 | return false; |
306 | } | 306 | } |
307 | } | 307 | } |
308 | else | 308 | else |
309 | { | 309 | { |
310 | qDebug( "protocol '%s' not checked in capturePackets.", (const char*) name ); | 310 | qDebug( "protocol '%s' not checked in capturePackets.", (const char*) name ); |
311 | } | 311 | } |
312 | ++it; | 312 | ++it; |
313 | } | 313 | } |
314 | return true; | 314 | return true; |
315 | } | 315 | } |
316 | 316 | ||
317 | 317 | ||
318 | void Wellenreiter::receivePacket( OPacket* p ) | 318 | void Wellenreiter::receivePacket( OPacket* p ) |
319 | { | 319 | { |
320 | hexWindow()->log( p->dump( 8 ) ); | 320 | hexWindow()->log( p->dump( 8 ) ); |
321 | 321 | ||
322 | if ( checkDumpPacket( p ) ) | 322 | if ( checkDumpPacket( p ) ) |
323 | { | 323 | { |
324 | pcap->dump( p ); | 324 | pcap->dump( p ); |
325 | } | 325 | } |
326 | 326 | ||
327 | // check if we received a beacon frame | 327 | // check if we received a beacon frame |
328 | OWaveLanManagementPacket* beacon = static_cast<OWaveLanManagementPacket*>( childIfToParse( p, "802.11 Management" ) ); | 328 | OWaveLanManagementPacket* beacon = static_cast<OWaveLanManagementPacket*>( childIfToParse( p, "802.11 Management" ) ); |
329 | if ( beacon && beacon->managementType() == "Beacon" ) | 329 | if ( beacon && beacon->managementType() == "Beacon" ) |
330 | { | 330 | { |
331 | handleBeacon( p, beacon ); | 331 | handleBeacon( p, beacon ); |
332 | return; | 332 | return; |
333 | } | 333 | } |
334 | 334 | ||
335 | //TODO: WEP check here | 335 | //TODO: WEP check here |
336 | 336 | ||
337 | // check for a data frame | 337 | // check for a data frame |
338 | OWaveLanDataPacket* data = static_cast<OWaveLanDataPacket*>( childIfToParse( p, "802.11 Data" ) ); | 338 | OWaveLanDataPacket* data = static_cast<OWaveLanDataPacket*>( childIfToParse( p, "802.11 Data" ) ); |
339 | if ( data ) | 339 | if ( data ) |
340 | { | 340 | { |
341 | handleData( p, data ); | 341 | handleData( p, data ); |
342 | } | 342 | } |
343 | 343 | ||
344 | handleNotification( p ); | 344 | handleNotification( p ); |
345 | 345 | ||
346 | } | 346 | } |
347 | 347 | ||
348 | 348 | ||
349 | void Wellenreiter::stopClicked() | 349 | void Wellenreiter::stopClicked() |
350 | { | 350 | { |
351 | if ( iface ) | 351 | if ( iface ) |
352 | { | 352 | { |
353 | disconnect( SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) ); | 353 | disconnect( SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) ); |
354 | disconnect( SIGNAL( hopped(int) ), this, SLOT( channelHopped(int) ) ); | 354 | disconnect( SIGNAL( hopped(int) ), this, SLOT( channelHopped(int) ) ); |
355 | iface->setChannelHopping(); // stop hopping channels | 355 | iface->setChannelHopping(); // stop hopping channels |
356 | } | 356 | } |
357 | else | 357 | else |
358 | killTimers(); | 358 | killTimers(); |
359 | 359 | ||
360 | pcap->close(); | 360 | pcap->close(); |
361 | sniffing = false; | 361 | sniffing = false; |
362 | 362 | ||
363 | if ( iface ) | 363 | if ( iface ) |
364 | { | 364 | { |
365 | // switch off monitor mode | 365 | // switch off monitor mode |
366 | iface->setMonitorMode( false ); | 366 | iface->setMonitorMode( false ); |
367 | // switch off promisc flag | 367 | // switch off promisc flag |
368 | iface->setPromiscuousMode( false ); | 368 | iface->setPromiscuousMode( false ); |
369 | 369 | ||
370 | system( "cardctl reset; sleep 1" ); //FIXME: Use OProcess | 370 | system( "cardctl reset; sleep 1" ); //FIXME: Use OProcess |
371 | } | 371 | } |
372 | 372 | ||
373 | logwindow->log( "(i) Stopped Scanning." ); | 373 | logwindow->log( "(i) Stopped Scanning." ); |
374 | assert( parent() ); | 374 | assert( parent() ); |
375 | ( (QMainWindow*) parent() )->setCaption( "Wellenreiter II" ); | 375 | ( (QMainWindow*) parent() )->setCaption( "Wellenreiter II" ); |
376 | 376 | ||
377 | // message the user | 377 | // message the user |
378 | QMessageBox::information( this, "Wellenreiter II", | 378 | QMessageBox::information( this, "Wellenreiter II", |
379 | tr( "Your wireless card\nshould now be usable again." ) ); | 379 | tr( "Your wireless card\nshould now be usable again." ) ); |
380 | 380 | ||
381 | sniffing = false; | 381 | sniffing = false; |
382 | emit( stoppedSniffing() ); | 382 | emit( stoppedSniffing() ); |
383 | 383 | ||
384 | // print out statistics | 384 | // print out statistics |
385 | for( QMap<QString,int>::ConstIterator it = pcap->statistics().begin(); it != pcap->statistics().end(); ++it ) | 385 | for( QMap<QString,int>::ConstIterator it = pcap->statistics().begin(); it != pcap->statistics().end(); ++it ) |
386 | statwindow->updateCounter( it.key(), it.data() ); | 386 | statwindow->updateCounter( it.key(), it.data() ); |
387 | } | 387 | } |
388 | 388 | ||
389 | 389 | ||
390 | void Wellenreiter::startClicked() | 390 | void Wellenreiter::startClicked() |
391 | { | 391 | { |
392 | // get configuration from config window | 392 | // get configuration from config window |
393 | 393 | ||
394 | const QString& interface = configwindow->interfaceName->currentText(); | 394 | const QString& interface = configwindow->interfaceName->currentText(); |
395 | const int cardtype = configwindow->driverType(); | 395 | const int cardtype = configwindow->driverType(); |
396 | const int interval = configwindow->hoppingInterval(); | 396 | const int interval = configwindow->hoppingInterval(); |
397 | 397 | ||
398 | if ( ( interface == "" ) || ( cardtype == 0 ) ) | 398 | if ( ( interface == "" ) || ( cardtype == 0 ) ) |
399 | { | 399 | { |
400 | QMessageBox::information( this, "Wellenreiter II", | 400 | QMessageBox::information( this, "Wellenreiter II", |
401 | tr( "Your device is not\nproperly configured. Please reconfigure!" ) ); | 401 | tr( "Your device is not\nproperly configured. Please reconfigure!" ) ); |
402 | return; | 402 | return; |
403 | } | 403 | } |
404 | 404 | ||
405 | // configure device | 405 | // configure device |
406 | |||
407 | ONetwork* net = ONetwork::instance(); | 406 | ONetwork* net = ONetwork::instance(); |
408 | iface = static_cast<OWirelessNetworkInterface*>(net->interface( interface )); | 407 | iface = static_cast<OWirelessNetworkInterface*>(net->interface( interface )); |
409 | 408 | ||
410 | // set monitor mode | 409 | // bring device UP |
410 | iface->setUp( true ); | ||
411 | if ( !iface->isUp() ) | ||
412 | { | ||
413 | QMessageBox::warning( this, "Wellenreiter II", | ||
414 | tr( "Can't bring interface '%1' up:\n" ).arg( iface->name() ) + strerror( errno ) ); | ||
415 | return; | ||
416 | } | ||
411 | 417 | ||
418 | // set monitor mode | ||
412 | bool usePrism = configwindow->usePrismHeader(); | 419 | bool usePrism = configwindow->usePrismHeader(); |
413 | 420 | ||
414 | switch ( cardtype ) | 421 | switch ( cardtype ) |
415 | { | 422 | { |
416 | case DEVTYPE_CISCO: iface->setMonitoring( new OCiscoMonitoringInterface( iface, usePrism ) ); break; | 423 | case DEVTYPE_CISCO: iface->setMonitoring( new OCiscoMonitoringInterface( iface, usePrism ) ); break; |
417 | case DEVTYPE_WLAN_NG: iface->setMonitoring( new OWlanNGMonitoringInterface( iface, usePrism ) ); break; | 424 | case DEVTYPE_WLAN_NG: iface->setMonitoring( new OWlanNGMonitoringInterface( iface, usePrism ) ); break; |
418 | case DEVTYPE_HOSTAP: iface->setMonitoring( new OHostAPMonitoringInterface( iface, usePrism ) ); break; | 425 | case DEVTYPE_HOSTAP: iface->setMonitoring( new OHostAPMonitoringInterface( iface, usePrism ) ); break; |
419 | case DEVTYPE_ORINOCO: iface->setMonitoring( new OOrinocoMonitoringInterface( iface, usePrism ) ); break; | 426 | case DEVTYPE_ORINOCO: iface->setMonitoring( new OOrinocoMonitoringInterface( iface, usePrism ) ); break; |
420 | case DEVTYPE_MANUAL: QMessageBox::information( this, "Wellenreiter II", tr( "Bring your device into\nmonitor mode now." ) ); break; | 427 | case DEVTYPE_MANUAL: QMessageBox::information( this, "Wellenreiter II", tr( "Bring your device into\nmonitor mode now." ) ); break; |
421 | case DEVTYPE_FILE: qDebug( "Wellenreiter: Capturing from file '%s'", (const char*) interface ); break; | 428 | case DEVTYPE_FILE: qDebug( "Wellenreiter: Capturing from file '%s'", (const char*) interface ); break; |
422 | default: assert( 0 ); // shouldn't reach this | 429 | default: assert( 0 ); // shouldn't reach this |
423 | } | 430 | } |
424 | 431 | ||
425 | // switch device into monitor mode | 432 | // switch device into monitor mode |
426 | if ( cardtype < DEVTYPE_FILE ) | 433 | if ( cardtype < DEVTYPE_FILE ) |
427 | { | 434 | { |
428 | if ( cardtype != DEVTYPE_MANUAL ) | 435 | if ( cardtype != DEVTYPE_MANUAL ) |
429 | iface->setMonitorMode( true ); | 436 | iface->setMonitorMode( true ); |
430 | if ( !iface->monitorMode() ) | 437 | if ( !iface->monitorMode() ) |
431 | { | 438 | { |
432 | QMessageBox::warning( this, "Wellenreiter II", | 439 | QMessageBox::warning( this, "Wellenreiter II", |
433 | tr( "Can't set device into monitor mode." ) ); | 440 | tr( "Can't set interface '%1' into monitor mode:\n" ).arg( iface->name() ) + strerror( errno ) ); |
434 | return; | 441 | return; |
435 | } | 442 | } |
436 | } | 443 | } |
437 | 444 | ||
438 | // open pcap and start sniffing | 445 | // open pcap and start sniffing |
439 | if ( cardtype != DEVTYPE_FILE ) | 446 | if ( cardtype != DEVTYPE_FILE ) |
440 | { | 447 | { |
441 | pcap->open( interface ); | 448 | pcap->open( interface ); |
442 | 449 | ||
443 | if ( configwindow->writeCaptureFile->isOn() ) | 450 | if ( configwindow->writeCaptureFile->isOn() ) |
444 | { | 451 | { |
445 | QString dumpname( configwindow->captureFileName->text() ); | 452 | QString dumpname( configwindow->captureFileName->text() ); |
446 | dumpname.append( '-' ); | 453 | dumpname.append( '-' ); |
447 | dumpname.append( QTime::currentTime().toString().replace( QRegExp( ":" ), "-" ) ); | 454 | dumpname.append( QTime::currentTime().toString().replace( QRegExp( ":" ), "-" ) ); |
448 | dumpname.append( ".wellenreiter" ); | 455 | dumpname.append( ".wellenreiter" ); |
449 | pcap->openDumpFile( dumpname ); | 456 | pcap->openDumpFile( dumpname ); |
450 | } | 457 | } |
451 | else | 458 | else |
452 | { | 459 | { |
453 | pcap->open( interface ); | 460 | pcap->open( interface ); |
454 | } | 461 | } |
455 | } | 462 | } |
456 | else | 463 | else |
457 | { | 464 | { |
458 | pcap->open( QFile( interface ) ); | 465 | pcap->open( QFile( interface ) ); |
459 | } | 466 | } |
460 | 467 | ||
461 | if ( !pcap->isOpen() ) | 468 | if ( !pcap->isOpen() ) |
462 | { | 469 | { |
463 | QMessageBox::warning( this, "Wellenreiter II", | 470 | QMessageBox::warning( this, "Wellenreiter II", |
464 | tr( "Can't open packet capturer:\n" ) + QString(strerror( errno ) )); | 471 | tr( "Can't open packet capturer for '%1':\n" ).arg( iface->name() ) + QString(strerror( errno ) )); |
465 | return; | 472 | return; |
466 | } | 473 | } |
467 | 474 | ||
468 | // set capturer to non-blocking mode | 475 | // set capturer to non-blocking mode |
469 | pcap->setBlocking( false ); | 476 | pcap->setBlocking( false ); |
470 | 477 | ||
471 | // start channel hopper | 478 | // start channel hopper |
472 | if ( cardtype != DEVTYPE_FILE ) | 479 | if ( cardtype != DEVTYPE_FILE ) |
473 | iface->setChannelHopping( 1000 ); //use interval from config window | 480 | iface->setChannelHopping( 1000 ); //use interval from config window |
474 | 481 | ||
475 | if ( cardtype != DEVTYPE_FILE ) | 482 | if ( cardtype != DEVTYPE_FILE ) |
476 | { | 483 | { |
477 | // connect socket notifier and start channel hopper | 484 | // connect socket notifier and start channel hopper |
478 | connect( pcap, SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) ); | 485 | connect( pcap, SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) ); |
479 | connect( iface->channelHopper(), SIGNAL( hopped(int) ), this, SLOT( channelHopped(int) ) ); | 486 | connect( iface->channelHopper(), SIGNAL( hopped(int) ), this, SLOT( channelHopped(int) ) ); |
480 | } | 487 | } |
481 | else | 488 | else |
482 | { | 489 | { |
483 | // start timer for reading packets | 490 | // start timer for reading packets |
484 | startTimer( 100 ); | 491 | startTimer( 100 ); |
485 | } | 492 | } |
486 | 493 | ||
487 | logwindow->log( "(i) Started Scanning." ); | 494 | logwindow->log( "(i) Started Scanning." ); |
488 | sniffing = true; | 495 | sniffing = true; |
489 | emit( startedSniffing() ); | 496 | emit( startedSniffing() ); |
490 | if ( cardtype != DEVTYPE_FILE ) channelHopped( 6 ); // set title | 497 | if ( cardtype != DEVTYPE_FILE ) channelHopped( 6 ); // set title |
491 | else | 498 | else |
492 | { | 499 | { |
493 | assert( parent() ); | 500 | assert( parent() ); |
494 | ( (QMainWindow*) parent() )->setCaption( tr( "Wellenreiter II - replaying capture file..." ) ); | 501 | ( (QMainWindow*) parent() )->setCaption( tr( "Wellenreiter II - replaying capture file..." ) ); |
495 | } | 502 | } |
496 | } | 503 | } |
497 | 504 | ||
498 | 505 | ||
499 | void Wellenreiter::timerEvent( QTimerEvent* ) | 506 | void Wellenreiter::timerEvent( QTimerEvent* ) |
500 | { | 507 | { |
501 | qDebug( "Wellenreiter::timerEvent()" ); | 508 | qDebug( "Wellenreiter::timerEvent()" ); |
502 | OPacket* p = pcap->next(); | 509 | OPacket* p = pcap->next(); |
503 | if ( !p ) // no more packets available | 510 | if ( !p ) // no more packets available |
504 | { | 511 | { |
505 | stopClicked(); | 512 | stopClicked(); |
506 | } | 513 | } |
507 | else | 514 | else |
508 | { | 515 | { |
509 | receivePacket( p ); | 516 | receivePacket( p ); |
510 | delete p; | 517 | delete p; |
511 | } | 518 | } |
512 | } | 519 | } |
513 | 520 | ||
514 | 521 | ||
515 | void Wellenreiter::doAction( const QString& action, const QString& protocol, OPacket* p ) | 522 | void Wellenreiter::doAction( const QString& action, const QString& protocol, OPacket* p ) |
516 | { | 523 | { |
517 | if ( action == "TouchSound" ) | 524 | if ( action == "TouchSound" ) |
518 | ODevice::inst()->touchSound(); | 525 | ODevice::inst()->touchSound(); |
519 | else if ( action == "AlarmSound" ) | 526 | else if ( action == "AlarmSound" ) |
520 | ODevice::inst()->alarmSound(); | 527 | ODevice::inst()->alarmSound(); |
521 | else if ( action == "KeySound" ) | 528 | else if ( action == "KeySound" ) |
522 | ODevice::inst()->keySound(); | 529 | ODevice::inst()->keySound(); |
523 | else if ( action == "LedOn" ) | 530 | else if ( action == "LedOn" ) |
524 | ODevice::inst()->setLedState( Led_Mail, Led_On ); | 531 | ODevice::inst()->setLedState( Led_Mail, Led_On ); |
525 | else if ( action == "LedOff" ) | 532 | else if ( action == "LedOff" ) |
526 | ODevice::inst()->setLedState( Led_Mail, Led_Off ); | 533 | ODevice::inst()->setLedState( Led_Mail, Led_Off ); |
527 | else if ( action == "LogMessage" ) | 534 | else if ( action == "LogMessage" ) |
528 | logwindow->log( QString().sprintf( "Got packet with protocol '%s'", (const char*) protocol ) ); | 535 | logwindow->log( QString().sprintf( "Got packet with protocol '%s'", (const char*) protocol ) ); |
529 | else if ( action == "MessageBox" ) | 536 | else if ( action == "MessageBox" ) |
530 | QMessageBox::information ( this, "Notification!", | 537 | QMessageBox::information ( this, "Notification!", |
531 | QString().sprintf( "Got packet with protocol '%s'", (const char*) protocol ) ); | 538 | QString().sprintf( "Got packet with protocol '%s'", (const char*) protocol ) ); |
532 | } | 539 | } |
540 | |||
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.h b/noncore/net/wellenreiter/gui/wellenreiter.h index 37e692c..d776492 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.h +++ b/noncore/net/wellenreiter/gui/wellenreiter.h | |||
@@ -1,90 +1,91 @@ | |||
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 | ||
21 | #ifdef QWS | 21 | #ifdef QWS |
22 | #include <opie/odevice.h> | 22 | #include <opie/odevice.h> |
23 | using namespace Opie; | 23 | using namespace Opie; |
24 | #endif | 24 | #endif |
25 | 25 | ||
26 | class QTimerEvent; | 26 | class QTimerEvent; |
27 | class QPixmap; | 27 | class QPixmap; |
28 | class OPacket; | 28 | class OPacket; |
29 | class OWaveLanManagementPacket; | 29 | class OWaveLanManagementPacket; |
30 | class OWaveLanDataPacket; | 30 | class OWaveLanDataPacket; |
31 | class OPacketCapturer; | 31 | class OPacketCapturer; |
32 | class OWirelessNetworkInterface; | 32 | class OWirelessNetworkInterface; |
33 | class ManufacturerDB; | 33 | class ManufacturerDB; |
34 | class WellenreiterConfigWindow; | 34 | class WellenreiterConfigWindow; |
35 | class MLogWindow; | 35 | class MLogWindow; |
36 | class MHexWindow; | 36 | class MHexWindow; |
37 | 37 | ||
38 | class Wellenreiter : public WellenreiterBase { | 38 | class Wellenreiter : public WellenreiterBase { |
39 | Q_OBJECT | 39 | Q_OBJECT |
40 | 40 | ||
41 | public: | 41 | public: |
42 | Wellenreiter( QWidget* parent = 0 ); | 42 | Wellenreiter( QWidget* parent = 0 ); |
43 | ~Wellenreiter(); | 43 | ~Wellenreiter(); |
44 | 44 | ||
45 | void setConfigWindow( WellenreiterConfigWindow* cw ); | 45 | void setConfigWindow( WellenreiterConfigWindow* cw ); |
46 | MScanListView* netView() const { return netview; }; | 46 | MScanListView* netView() const { return netview; }; |
47 | MLogWindow* logWindow() const { return logwindow; }; | 47 | MLogWindow* logWindow() const { return logwindow; }; |
48 | MHexWindow* hexWindow() const { return hexwindow; }; | 48 | MHexWindow* hexWindow() const { return hexwindow; }; |
49 | bool isDaemonRunning() const { return sniffing; }; | 49 | bool isDaemonRunning() const { return sniffing; }; |
50 | 50 | ||
51 | public: | ||
51 | bool sniffing; | 52 | bool sniffing; |
52 | 53 | ||
53 | protected: | 54 | protected: |
54 | virtual void timerEvent( QTimerEvent* ); | 55 | virtual void timerEvent( QTimerEvent* ); |
55 | 56 | ||
56 | public slots: | 57 | public slots: |
57 | void channelHopped(int); | 58 | void channelHopped(int); |
58 | void receivePacket(OPacket*); | 59 | void receivePacket(OPacket*); |
59 | void startClicked(); | 60 | void startClicked(); |
60 | void stopClicked(); | 61 | void stopClicked(); |
61 | 62 | ||
62 | signals: | 63 | signals: |
63 | void startedSniffing(); | 64 | void startedSniffing(); |
64 | void stoppedSniffing(); | 65 | void stoppedSniffing(); |
65 | 66 | ||
66 | private: | 67 | private: |
67 | void handleBeacon( OPacket* p, OWaveLanManagementPacket* beacon ); | 68 | void handleBeacon( OPacket* p, OWaveLanManagementPacket* beacon ); |
68 | void handleData( OPacket* p, OWaveLanDataPacket* data ); | 69 | void handleData( OPacket* p, OWaveLanDataPacket* data ); |
69 | void handleNotification( OPacket* p ); | 70 | void handleNotification( OPacket* p ); |
70 | void doAction( const QString& action, const QString& protocol, OPacket* p ); | 71 | void doAction( const QString& action, const QString& protocol, OPacket* p ); |
71 | QObject* childIfToParse( OPacket* p, const QString& protocol ); | 72 | QObject* childIfToParse( OPacket* p, const QString& protocol ); |
72 | bool checkDumpPacket( OPacket* p ); | 73 | bool checkDumpPacket( OPacket* p ); |
73 | 74 | ||
74 | private: | 75 | private: |
75 | #ifdef QWS | 76 | #ifdef QWS |
76 | OSystem _system; // Opie Operating System identifier | 77 | OSystem _system; // Opie Operating System identifier |
77 | #endif | 78 | #endif |
78 | 79 | ||
79 | OWirelessNetworkInterface* iface; | 80 | OWirelessNetworkInterface* iface; |
80 | OPacketCapturer* pcap; | 81 | OPacketCapturer* pcap; |
81 | ManufacturerDB* manufacturerdb; | 82 | ManufacturerDB* manufacturerdb; |
82 | WellenreiterConfigWindow* configwindow; | 83 | WellenreiterConfigWindow* configwindow; |
83 | 84 | ||
84 | //void readConfig(); | 85 | //void readConfig(); |
85 | //void writeConfig(); | 86 | //void writeConfig(); |
86 | }; | 87 | }; |
87 | 88 | ||
88 | 89 | ||
89 | 90 | ||
90 | #endif | 91 | #endif |