author | mickeyl <mickeyl> | 2003-05-08 13:37:06 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-05-08 13:37:06 (UTC) |
commit | 78c60031b506b85dc20bd555d83486aeb831bf38 (patch) (unidiff) | |
tree | 8bd0af604c911309162560fcac7bc2dcd9855d51 | |
parent | 08f9d5965b127b0b889b96cf16b7d34b5a9a6928 (diff) | |
download | opie-78c60031b506b85dc20bd555d83486aeb831bf38.zip opie-78c60031b506b85dc20bd555d83486aeb831bf38.tar.gz opie-78c60031b506b85dc20bd555d83486aeb831bf38.tar.bz2 |
- add more sanity checks and verbose error messages
- try to restart dhcp client after having killed it before
-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,890 +1,898 @@ | |||
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> |
244 | <widget row="1" column="0" > | 248 | <widget row="1" column="0" > |
245 | <class>QCheckBox</class> | 249 | <class>QCheckBox</class> |
246 | <property stdset="1"> | 250 | <property stdset="1"> |
247 | <name>name</name> | 251 | <name>name</name> |
248 | <cstring>channel5</cstring> | 252 | <cstring>channel5</cstring> |
249 | </property> | 253 | </property> |
250 | <property stdset="1"> | 254 | <property stdset="1"> |
251 | <name>text</name> | 255 | <name>text</name> |
252 | <string>5</string> | 256 | <string>5</string> |
253 | </property> | 257 | </property> |
254 | </widget> | 258 | </widget> |
255 | <widget row="0" column="4" > | 259 | <widget row="0" column="4" > |
256 | <class>QCheckBox</class> | 260 | <class>QCheckBox</class> |
257 | <property stdset="1"> | 261 | <property stdset="1"> |
258 | <name>name</name> | 262 | <name>name</name> |
259 | <cstring>channel4</cstring> | 263 | <cstring>channel4</cstring> |
260 | </property> | 264 | </property> |
261 | <property stdset="1"> | 265 | <property stdset="1"> |
262 | <name>text</name> | 266 | <name>text</name> |
263 | <string>4</string> | 267 | <string>4</string> |
264 | </property> | 268 | </property> |
265 | </widget> | 269 | </widget> |
266 | <widget row="2" column="2" > | 270 | <widget row="2" column="2" > |
267 | <class>QCheckBox</class> | 271 | <class>QCheckBox</class> |
268 | <property stdset="1"> | 272 | <property stdset="1"> |
269 | <name>name</name> | 273 | <name>name</name> |
270 | <cstring>channel12</cstring> | 274 | <cstring>channel12</cstring> |
271 | </property> | 275 | </property> |
272 | <property stdset="1"> | 276 | <property stdset="1"> |
273 | <name>text</name> | 277 | <name>text</name> |
274 | <string>12</string> | 278 | <string>12</string> |
275 | </property> | 279 | </property> |
276 | </widget> | 280 | </widget> |
277 | <widget row="2" column="3" > | 281 | <widget row="2" column="3" > |
278 | <class>QCheckBox</class> | 282 | <class>QCheckBox</class> |
279 | <property stdset="1"> | 283 | <property stdset="1"> |
280 | <name>name</name> | 284 | <name>name</name> |
281 | <cstring>channel13</cstring> | 285 | <cstring>channel13</cstring> |
282 | </property> | 286 | </property> |
283 | <property stdset="1"> | 287 | <property stdset="1"> |
284 | <name>text</name> | 288 | <name>text</name> |
285 | <string>13</string> | 289 | <string>13</string> |
286 | </property> | 290 | </property> |
287 | </widget> | 291 | </widget> |
288 | <widget row="2" column="4" > | 292 | <widget row="2" column="4" > |
289 | <class>QCheckBox</class> | 293 | <class>QCheckBox</class> |
290 | <property stdset="1"> | 294 | <property stdset="1"> |
291 | <name>name</name> | 295 | <name>name</name> |
292 | <cstring>channel14</cstring> | 296 | <cstring>channel14</cstring> |
293 | </property> | 297 | </property> |
294 | <property stdset="1"> | 298 | <property stdset="1"> |
295 | <name>text</name> | 299 | <name>text</name> |
296 | <string>14</string> | 300 | <string>14</string> |
297 | </property> | 301 | </property> |
298 | </widget> | 302 | </widget> |
299 | </grid> | 303 | </grid> |
300 | </widget> | 304 | </widget> |
301 | <widget row="0" column="1" rowspan="1" colspan="3" > | 305 | <widget row="0" column="1" rowspan="1" colspan="3" > |
302 | <class>QComboBox</class> | 306 | <class>QComboBox</class> |
303 | <property stdset="1"> | 307 | <property stdset="1"> |
304 | <name>name</name> | 308 | <name>name</name> |
305 | <cstring>interfaceName</cstring> | 309 | <cstring>interfaceName</cstring> |
306 | </property> | 310 | </property> |
307 | <property stdset="1"> | 311 | <property stdset="1"> |
308 | <name>enabled</name> | 312 | <name>enabled</name> |
309 | <bool>true</bool> | 313 | <bool>true</bool> |
310 | </property> | 314 | </property> |
311 | <property> | 315 | <property> |
312 | <name>whatsThis</name> | 316 | <name>whatsThis</name> |
313 | <string>Choose the interface used for sniffing.</string> | 317 | <string>Choose the interface used for sniffing.</string> |
314 | </property> | 318 | </property> |
315 | </widget> | 319 | </widget> |
316 | <widget row="1" column="1" rowspan="1" colspan="3" > | 320 | <widget row="1" column="1" rowspan="1" colspan="3" > |
317 | <class>QComboBox</class> | 321 | <class>QComboBox</class> |
318 | <item> | 322 | <item> |
319 | <property> | 323 | <property> |
320 | <name>text</name> | 324 | <name>text</name> |
321 | <string><select></string> | 325 | <string><select></string> |
322 | </property> | 326 | </property> |
323 | </item> | 327 | </item> |
324 | <item> | 328 | <item> |
325 | <property> | 329 | <property> |
326 | <name>text</name> | 330 | <name>text</name> |
327 | <string>cisco</string> | 331 | <string>cisco</string> |
328 | </property> | 332 | </property> |
329 | </item> | 333 | </item> |
330 | <item> | 334 | <item> |
331 | <property> | 335 | <property> |
332 | <name>text</name> | 336 | <name>text</name> |
333 | <string>wlan-ng</string> | 337 | <string>wlan-ng</string> |
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> |
590 | <number>3</number> | 598 | <number>3</number> |
591 | </property> | 599 | </property> |
592 | <widget row="0" column="0" > | 600 | <widget row="0" column="0" > |
593 | <class>ProtocolListView</class> | 601 | <class>ProtocolListView</class> |
594 | <property stdset="1"> | 602 | <property stdset="1"> |
595 | <name>name</name> | 603 | <name>name</name> |
596 | <cstring>parsePackets</cstring> | 604 | <cstring>parsePackets</cstring> |
597 | </property> | 605 | </property> |
598 | <property stdset="1"> | 606 | <property stdset="1"> |
599 | <name>sizePolicy</name> | 607 | <name>sizePolicy</name> |
600 | <sizepolicy> | 608 | <sizepolicy> |
601 | <hsizetype>7</hsizetype> | 609 | <hsizetype>7</hsizetype> |
602 | <vsizetype>7</vsizetype> | 610 | <vsizetype>7</vsizetype> |
603 | </sizepolicy> | 611 | </sizepolicy> |
604 | </property> | 612 | </property> |
605 | </widget> | 613 | </widget> |
606 | </grid> | 614 | </grid> |
607 | </widget> | 615 | </widget> |
608 | <widget> | 616 | <widget> |
609 | <class>QWidget</class> | 617 | <class>QWidget</class> |
610 | <property stdset="1"> | 618 | <property stdset="1"> |
611 | <name>name</name> | 619 | <name>name</name> |
612 | <cstring>tab</cstring> | 620 | <cstring>tab</cstring> |
613 | </property> | 621 | </property> |
614 | <attribute> | 622 | <attribute> |
615 | <name>title</name> | 623 | <name>title</name> |
616 | <string>Intrusion</string> | 624 | <string>Intrusion</string> |
617 | </attribute> | 625 | </attribute> |
618 | <grid> | 626 | <grid> |
619 | <property stdset="1"> | 627 | <property stdset="1"> |
620 | <name>margin</name> | 628 | <name>margin</name> |
621 | <number>11</number> | 629 | <number>11</number> |
622 | </property> | 630 | </property> |
623 | <property stdset="1"> | 631 | <property stdset="1"> |
624 | <name>spacing</name> | 632 | <name>spacing</name> |
625 | <number>6</number> | 633 | <number>6</number> |
626 | </property> | 634 | </property> |
627 | <widget row="1" column="0" > | 635 | <widget row="1" column="0" > |
628 | <class>QGroupBox</class> | 636 | <class>QGroupBox</class> |
629 | <property stdset="1"> | 637 | <property stdset="1"> |
630 | <name>name</name> | 638 | <name>name</name> |
631 | <cstring>GroupBox3</cstring> | 639 | <cstring>GroupBox3</cstring> |
632 | </property> | 640 | </property> |
633 | <property stdset="1"> | 641 | <property stdset="1"> |
634 | <name>enabled</name> | 642 | <name>enabled</name> |
635 | <bool>false</bool> | 643 | <bool>false</bool> |
636 | </property> | 644 | </property> |
637 | <property stdset="1"> | 645 | <property stdset="1"> |
638 | <name>title</name> | 646 | <name>title</name> |
639 | <string>Link Level</string> | 647 | <string>Link Level</string> |
640 | </property> | 648 | </property> |
641 | <grid> | 649 | <grid> |
642 | <property stdset="1"> | 650 | <property stdset="1"> |
643 | <name>margin</name> | 651 | <name>margin</name> |
644 | <number>11</number> | 652 | <number>11</number> |
645 | </property> | 653 | </property> |
646 | <property stdset="1"> | 654 | <property stdset="1"> |
647 | <name>spacing</name> | 655 | <name>spacing</name> |
648 | <number>6</number> | 656 | <number>6</number> |
649 | </property> | 657 | </property> |
650 | <widget row="0" column="0" > | 658 | <widget row="0" column="0" > |
651 | <class>QLabel</class> | 659 | <class>QLabel</class> |
652 | <property stdset="1"> | 660 | <property stdset="1"> |
653 | <name>name</name> | 661 | <name>name</name> |
654 | <cstring>TextLabel1_5</cstring> | 662 | <cstring>TextLabel1_5</cstring> |
655 | </property> | 663 | </property> |
656 | <property stdset="1"> | 664 | <property stdset="1"> |
657 | <name>text</name> | 665 | <name>text</name> |
658 | <string>Fake Mac:</string> | 666 | <string>Fake Mac:</string> |
659 | </property> | 667 | </property> |
660 | </widget> | 668 | </widget> |
661 | <widget row="1" column="0" rowspan="1" colspan="2" > | 669 | <widget row="1" column="0" rowspan="1" colspan="2" > |
662 | <class>QCheckBox</class> | 670 | <class>QCheckBox</class> |
663 | <property stdset="1"> | 671 | <property stdset="1"> |
664 | <name>name</name> | 672 | <name>name</name> |
665 | <cstring>sendProbeRequests</cstring> | 673 | <cstring>sendProbeRequests</cstring> |
666 | </property> | 674 | </property> |
667 | <property stdset="1"> | 675 | <property stdset="1"> |
668 | <name>text</name> | 676 | <name>text</name> |
669 | <string>Send proble requests</string> | 677 | <string>Send proble requests</string> |
670 | </property> | 678 | </property> |
671 | </widget> | 679 | </widget> |
672 | <widget row="0" column="1" > | 680 | <widget row="0" column="1" > |
673 | <class>QComboBox</class> | 681 | <class>QComboBox</class> |
674 | <item> | 682 | <item> |
675 | <property> | 683 | <property> |
676 | <name>text</name> | 684 | <name>text</name> |
677 | <string><automatic></string> | 685 | <string><automatic></string> |
678 | </property> | 686 | </property> |
679 | </item> | 687 | </item> |
680 | <item> | 688 | <item> |
681 | <property> | 689 | <property> |
682 | <name>text</name> | 690 | <name>text</name> |
683 | <string>44:44:44:44:44:44</string> | 691 | <string>44:44:44:44:44:44</string> |
684 | </property> | 692 | </property> |
685 | </item> | 693 | </item> |
686 | <property stdset="1"> | 694 | <property stdset="1"> |
687 | <name>name</name> | 695 | <name>name</name> |
688 | <cstring>fakeMac</cstring> | 696 | <cstring>fakeMac</cstring> |
689 | </property> | 697 | </property> |
690 | <property stdset="1"> | 698 | <property stdset="1"> |
691 | <name>sizePolicy</name> | 699 | <name>sizePolicy</name> |
692 | <sizepolicy> | 700 | <sizepolicy> |
693 | <hsizetype>7</hsizetype> | 701 | <hsizetype>7</hsizetype> |
694 | <vsizetype>0</vsizetype> | 702 | <vsizetype>0</vsizetype> |
695 | </sizepolicy> | 703 | </sizepolicy> |
696 | </property> | 704 | </property> |
697 | <property stdset="1"> | 705 | <property stdset="1"> |
698 | <name>editable</name> | 706 | <name>editable</name> |
699 | <bool>true</bool> | 707 | <bool>true</bool> |
700 | </property> | 708 | </property> |
701 | <property stdset="1"> | 709 | <property stdset="1"> |
702 | <name>currentItem</name> | 710 | <name>currentItem</name> |
703 | <number>1</number> | 711 | <number>1</number> |
704 | </property> | 712 | </property> |
705 | <property stdset="1"> | 713 | <property stdset="1"> |
706 | <name>autoCompletion</name> | 714 | <name>autoCompletion</name> |
707 | <bool>true</bool> | 715 | <bool>true</bool> |
708 | </property> | 716 | </property> |
709 | </widget> | 717 | </widget> |
710 | <widget row="2" column="0" rowspan="1" colspan="2" > | 718 | <widget row="2" column="0" rowspan="1" colspan="2" > |
711 | <class>QCheckBox</class> | 719 | <class>QCheckBox</class> |
712 | <property stdset="1"> | 720 | <property stdset="1"> |
713 | <name>name</name> | 721 | <name>name</name> |
714 | <cstring>tryToAuthenticate</cstring> | 722 | <cstring>tryToAuthenticate</cstring> |
715 | </property> | 723 | </property> |
716 | <property stdset="1"> | 724 | <property stdset="1"> |
717 | <name>text</name> | 725 | <name>text</name> |
718 | <string>Try to authenticate</string> | 726 | <string>Try to authenticate</string> |
719 | </property> | 727 | </property> |
720 | </widget> | 728 | </widget> |
721 | </grid> | 729 | </grid> |
722 | </widget> | 730 | </widget> |
723 | <widget row="0" column="0" > | 731 | <widget row="0" column="0" > |
724 | <class>QCheckBox</class> | 732 | <class>QCheckBox</class> |
725 | <property stdset="1"> | 733 | <property stdset="1"> |
726 | <name>name</name> | 734 | <name>name</name> |
727 | <cstring>enableActiveScanning</cstring> | 735 | <cstring>enableActiveScanning</cstring> |
728 | </property> | 736 | </property> |
729 | <property stdset="1"> | 737 | <property stdset="1"> |
730 | <name>enabled</name> | 738 | <name>enabled</name> |
731 | <bool>false</bool> | 739 | <bool>false</bool> |
732 | </property> | 740 | </property> |
733 | <property stdset="1"> | 741 | <property stdset="1"> |
734 | <name>text</name> | 742 | <name>text</name> |
735 | <string>Enable active scanning</string> | 743 | <string>Enable active scanning</string> |
736 | </property> | 744 | </property> |
737 | </widget> | 745 | </widget> |
738 | <widget row="2" column="0" > | 746 | <widget row="2" column="0" > |
739 | <class>QGroupBox</class> | 747 | <class>QGroupBox</class> |
740 | <property stdset="1"> | 748 | <property stdset="1"> |
741 | <name>name</name> | 749 | <name>name</name> |
742 | <cstring>GroupBox4</cstring> | 750 | <cstring>GroupBox4</cstring> |
743 | </property> | 751 | </property> |
744 | <property stdset="1"> | 752 | <property stdset="1"> |
745 | <name>enabled</name> | 753 | <name>enabled</name> |
746 | <bool>false</bool> | 754 | <bool>false</bool> |
747 | </property> | 755 | </property> |
748 | <property stdset="1"> | 756 | <property stdset="1"> |
749 | <name>title</name> | 757 | <name>title</name> |
750 | <string>IP Level</string> | 758 | <string>IP Level</string> |
751 | </property> | 759 | </property> |
752 | <grid> | 760 | <grid> |
753 | <property stdset="1"> | 761 | <property stdset="1"> |
754 | <name>margin</name> | 762 | <name>margin</name> |
755 | <number>11</number> | 763 | <number>11</number> |
756 | </property> | 764 | </property> |
757 | <property stdset="1"> | 765 | <property stdset="1"> |
758 | <name>spacing</name> | 766 | <name>spacing</name> |
759 | <number>6</number> | 767 | <number>6</number> |
760 | </property> | 768 | </property> |
761 | <widget row="1" column="0" rowspan="1" colspan="2" > | 769 | <widget row="1" column="0" rowspan="1" colspan="2" > |
762 | <class>QCheckBox</class> | 770 | <class>QCheckBox</class> |
763 | <property stdset="1"> | 771 | <property stdset="1"> |
764 | <name>name</name> | 772 | <name>name</name> |
765 | <cstring>CheckBox24</cstring> | 773 | <cstring>CheckBox24</cstring> |
766 | </property> | 774 | </property> |
767 | <property stdset="1"> | 775 | <property stdset="1"> |
768 | <name>text</name> | 776 | <name>text</name> |
769 | <string>Request DHCP Address</string> | 777 | <string>Request DHCP Address</string> |
770 | </property> | 778 | </property> |
771 | </widget> | 779 | </widget> |
772 | <widget row="0" column="0" > | 780 | <widget row="0" column="0" > |
773 | <class>QLabel</class> | 781 | <class>QLabel</class> |
774 | <property stdset="1"> | 782 | <property stdset="1"> |
775 | <name>name</name> | 783 | <name>name</name> |
776 | <cstring>TextLabel1_5_2</cstring> | 784 | <cstring>TextLabel1_5_2</cstring> |
777 | </property> | 785 | </property> |
778 | <property stdset="1"> | 786 | <property stdset="1"> |
779 | <name>text</name> | 787 | <name>text</name> |
780 | <string>Fake IP:</string> | 788 | <string>Fake IP:</string> |
781 | </property> | 789 | </property> |
782 | </widget> | 790 | </widget> |
783 | <widget row="0" column="1" > | 791 | <widget row="0" column="1" > |
784 | <class>QComboBox</class> | 792 | <class>QComboBox</class> |
785 | <item> | 793 | <item> |
786 | <property> | 794 | <property> |
787 | <name>text</name> | 795 | <name>text</name> |
788 | <string>192.168.125.1</string> | 796 | <string>192.168.125.1</string> |
789 | </property> | 797 | </property> |
790 | </item> | 798 | </item> |
791 | <item> | 799 | <item> |
792 | <property> | 800 | <property> |
793 | <name>text</name> | 801 | <name>text</name> |
794 | <string><automatic></string> | 802 | <string><automatic></string> |
795 | </property> | 803 | </property> |
796 | </item> | 804 | </item> |
797 | <property stdset="1"> | 805 | <property stdset="1"> |
798 | <name>name</name> | 806 | <name>name</name> |
799 | <cstring>fakeIP</cstring> | 807 | <cstring>fakeIP</cstring> |
800 | </property> | 808 | </property> |
801 | <property stdset="1"> | 809 | <property stdset="1"> |
802 | <name>sizePolicy</name> | 810 | <name>sizePolicy</name> |
803 | <sizepolicy> | 811 | <sizepolicy> |
804 | <hsizetype>7</hsizetype> | 812 | <hsizetype>7</hsizetype> |
805 | <vsizetype>0</vsizetype> | 813 | <vsizetype>0</vsizetype> |
806 | </sizepolicy> | 814 | </sizepolicy> |
807 | </property> | 815 | </property> |
808 | <property stdset="1"> | 816 | <property stdset="1"> |
809 | <name>editable</name> | 817 | <name>editable</name> |
810 | <bool>true</bool> | 818 | <bool>true</bool> |
811 | </property> | 819 | </property> |
812 | <property stdset="1"> | 820 | <property stdset="1"> |
813 | <name>currentItem</name> | 821 | <name>currentItem</name> |
814 | <number>0</number> | 822 | <number>0</number> |
815 | </property> | 823 | </property> |
816 | </widget> | 824 | </widget> |
817 | </grid> | 825 | </grid> |
818 | </widget> | 826 | </widget> |
819 | </grid> | 827 | </grid> |
820 | </widget> | 828 | </widget> |
821 | </widget> | 829 | </widget> |
822 | </grid> | 830 | </grid> |
823 | </widget> | 831 | </widget> |
824 | <customwidgets> | 832 | <customwidgets> |
825 | <customwidget> | 833 | <customwidget> |
826 | <class>ProtocolListView</class> | 834 | <class>ProtocolListView</class> |
827 | <header location="local">protolistview.h</header> | 835 | <header location="local">protolistview.h</header> |
828 | <sizehint> | 836 | <sizehint> |
829 | <width>100</width> | 837 | <width>100</width> |
830 | <height>100</height> | 838 | <height>100</height> |
831 | </sizehint> | 839 | </sizehint> |
832 | <container>0</container> | 840 | <container>0</container> |
833 | <sizepolicy> | 841 | <sizepolicy> |
834 | <hordata>3</hordata> | 842 | <hordata>3</hordata> |
835 | <verdata>3</verdata> | 843 | <verdata>3</verdata> |
836 | </sizepolicy> | 844 | </sizepolicy> |
837 | <pixmap>image0</pixmap> | 845 | <pixmap>image0</pixmap> |
838 | </customwidget> | 846 | </customwidget> |
839 | </customwidgets> | 847 | </customwidgets> |
840 | <images> | 848 | <images> |
841 | <image> | 849 | <image> |
842 | <name>image0</name> | 850 | <name>image0</name> |
843 | <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data> | 851 | <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data> |
844 | </image> | 852 | </image> |
845 | </images> | 853 | </images> |
846 | <connections> | 854 | <connections> |
847 | <connection> | 855 | <connection> |
848 | <sender>hopChannels</sender> | 856 | <sender>hopChannels</sender> |
849 | <signal>toggled(bool)</signal> | 857 | <signal>toggled(bool)</signal> |
850 | <receiver>hopInterval</receiver> | 858 | <receiver>hopInterval</receiver> |
851 | <slot>setEnabled(bool)</slot> | 859 | <slot>setEnabled(bool)</slot> |
852 | </connection> | 860 | </connection> |
853 | <connection> | 861 | <connection> |
854 | <sender>hopChannels</sender> | 862 | <sender>hopChannels</sender> |
855 | <signal>toggled(bool)</signal> | 863 | <signal>toggled(bool)</signal> |
856 | <receiver>TextLabel1</receiver> | 864 | <receiver>TextLabel1</receiver> |
857 | <slot>setEnabled(bool)</slot> | 865 | <slot>setEnabled(bool)</slot> |
858 | </connection> | 866 | </connection> |
859 | <connection> | 867 | <connection> |
860 | <sender>enableActiveScanning</sender> | 868 | <sender>enableActiveScanning</sender> |
861 | <signal>toggled(bool)</signal> | 869 | <signal>toggled(bool)</signal> |
862 | <receiver>GroupBox3</receiver> | 870 | <receiver>GroupBox3</receiver> |
863 | <slot>setEnabled(bool)</slot> | 871 | <slot>setEnabled(bool)</slot> |
864 | </connection> | 872 | </connection> |
865 | <connection> | 873 | <connection> |
866 | <sender>enableActiveScanning</sender> | 874 | <sender>enableActiveScanning</sender> |
867 | <signal>toggled(bool)</signal> | 875 | <signal>toggled(bool)</signal> |
868 | <receiver>GroupBox4</receiver> | 876 | <receiver>GroupBox4</receiver> |
869 | <slot>setEnabled(bool)</slot> | 877 | <slot>setEnabled(bool)</slot> |
870 | </connection> | 878 | </connection> |
871 | <connection> | 879 | <connection> |
872 | <sender>writeCaptureFile</sender> | 880 | <sender>writeCaptureFile</sender> |
873 | <signal>toggled(bool)</signal> | 881 | <signal>toggled(bool)</signal> |
874 | <receiver>getCaptureFileName</receiver> | 882 | <receiver>getCaptureFileName</receiver> |
875 | <slot>setEnabled(bool)</slot> | 883 | <slot>setEnabled(bool)</slot> |
876 | </connection> | 884 | </connection> |
877 | <connection> | 885 | <connection> |
878 | <sender>writeCaptureFile</sender> | 886 | <sender>writeCaptureFile</sender> |
879 | <signal>toggled(bool)</signal> | 887 | <signal>toggled(bool)</signal> |
880 | <receiver>captureFileName</receiver> | 888 | <receiver>captureFileName</receiver> |
881 | <slot>setEnabled(bool)</slot> | 889 | <slot>setEnabled(bool)</slot> |
882 | </connection> | 890 | </connection> |
883 | <connection> | 891 | <connection> |
884 | <sender>writeCaptureFile</sender> | 892 | <sender>writeCaptureFile</sender> |
885 | <signal>toggled(bool)</signal> | 893 | <signal>toggled(bool)</signal> |
886 | <receiver>capturePackets</receiver> | 894 | <receiver>capturePackets</receiver> |
887 | <slot>setEnabled(bool)</slot> | 895 | <slot>setEnabled(bool)</slot> |
888 | </connection> | 896 | </connection> |
889 | </connections> | 897 | </connections> |
890 | </UI> | 898 | </UI> |
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 | |||
@@ -1,361 +1,366 @@ | |||
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 "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 | |||
@@ -1,532 +1,540 @@ | |||
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 | 17 | ||
18 | #include "wellenreiter.h" | 18 | #include "wellenreiter.h" |
19 | #include "scanlist.h" | 19 | #include "scanlist.h" |
20 | #include "logwindow.h" | 20 | #include "logwindow.h" |
21 | #include "hexwindow.h" | 21 | #include "hexwindow.h" |
22 | #include "configwindow.h" | 22 | #include "configwindow.h" |
23 | #include "statwindow.h" | 23 | #include "statwindow.h" |
24 | #include "graphwindow.h" | 24 | #include "graphwindow.h" |
25 | #include "manufacturers.h" | 25 | #include "manufacturers.h" |
26 | #include "protolistview.h" | 26 | #include "protolistview.h" |
27 | 27 | ||
28 | // Opie | 28 | // Opie |
29 | 29 | ||
30 | #ifdef QWS | 30 | #ifdef QWS |
31 | #include <opie/odevice.h> | 31 | #include <opie/odevice.h> |
32 | using namespace Opie; | 32 | using namespace Opie; |
33 | #endif | 33 | #endif |
34 | 34 | ||
35 | #ifdef QWS | 35 | #ifdef QWS |
36 | #include <opie2/oapplication.h> | 36 | #include <opie2/oapplication.h> |
37 | #else | 37 | #else |
38 | #include <qapplication.h> | 38 | #include <qapplication.h> |
39 | #endif | 39 | #endif |
40 | #include <opie2/onetwork.h> | 40 | #include <opie2/onetwork.h> |
41 | #include <opie2/opcap.h> | 41 | #include <opie2/opcap.h> |
42 | 42 | ||
43 | // Qt | 43 | // Qt |
44 | 44 | ||
45 | #include <qcheckbox.h> | 45 | #include <qcheckbox.h> |
46 | #include <qcombobox.h> | 46 | #include <qcombobox.h> |
47 | #include <qdatetime.h> | 47 | #include <qdatetime.h> |
48 | #include <qpushbutton.h> | 48 | #include <qpushbutton.h> |
49 | #include <qlineedit.h> | 49 | #include <qlineedit.h> |
50 | #include <qmessagebox.h> | 50 | #include <qmessagebox.h> |
51 | #include <qobjectlist.h> | 51 | #include <qobjectlist.h> |
52 | #include <qregexp.h> | 52 | #include <qregexp.h> |
53 | #include <qspinbox.h> | 53 | #include <qspinbox.h> |
54 | #include <qtoolbutton.h> | 54 | #include <qtoolbutton.h> |
55 | #include <qmainwindow.h> | 55 | #include <qmainwindow.h> |
56 | 56 | ||
57 | // Standard | 57 | // Standard |
58 | 58 | ||
59 | #include <assert.h> | 59 | #include <assert.h> |
60 | #include <errno.h> | 60 | #include <errno.h> |
61 | #include <unistd.h> | 61 | #include <unistd.h> |
62 | #include <string.h> | 62 | #include <string.h> |
63 | #include <sys/types.h> | 63 | #include <sys/types.h> |
64 | #include <stdlib.h> | 64 | #include <stdlib.h> |
65 | 65 | ||
66 | Wellenreiter::Wellenreiter( QWidget* parent ) | 66 | Wellenreiter::Wellenreiter( QWidget* parent ) |
67 | : WellenreiterBase( parent, 0, 0 ), | 67 | : WellenreiterBase( parent, 0, 0 ), |
68 | sniffing( false ), iface( 0 ), manufacturerdb( 0 ), configwindow( 0 ) | 68 | sniffing( false ), iface( 0 ), manufacturerdb( 0 ), configwindow( 0 ) |
69 | { | 69 | { |
70 | 70 | ||
71 | // | 71 | // |
72 | // construct manufacturer database | 72 | // construct manufacturer database |
73 | // | 73 | // |
74 | 74 | ||
75 | QString manufile; | 75 | QString manufile; |
76 | #ifdef QWS | 76 | #ifdef QWS |
77 | manufile.sprintf( "%s/share/wellenreiter/manufacturers.dat", (const char*) QPEApplication::qpeDir() ); | 77 | manufile.sprintf( "%s/share/wellenreiter/manufacturers.dat", (const char*) QPEApplication::qpeDir() ); |
78 | #else | 78 | #else |
79 | manufile.sprintf( "/usr/local/share/wellenreiter/manufacturers.dat" ); | 79 | manufile.sprintf( "/usr/local/share/wellenreiter/manufacturers.dat" ); |
80 | #endif | 80 | #endif |
81 | manufacturerdb = new ManufacturerDB( manufile ); | 81 | manufacturerdb = new ManufacturerDB( manufile ); |
82 | 82 | ||
83 | logwindow->log( "(i) Wellenreiter has been started." ); | 83 | logwindow->log( "(i) Wellenreiter has been started." ); |
84 | 84 | ||
85 | // | 85 | // |
86 | // detect operating system | 86 | // detect operating system |
87 | // | 87 | // |
88 | 88 | ||
89 | #ifdef QWS | 89 | #ifdef QWS |
90 | QString sys; | 90 | QString sys; |
91 | sys.sprintf( "(i) Running on '%s'.", (const char*) ODevice::inst()->systemString() ); | 91 | sys.sprintf( "(i) Running on '%s'.", (const char*) ODevice::inst()->systemString() ); |
92 | _system = ODevice::inst()->system(); | 92 | _system = ODevice::inst()->system(); |
93 | logwindow->log( sys ); | 93 | logwindow->log( sys ); |
94 | #endif | 94 | #endif |
95 | 95 | ||
96 | // setup GUI | 96 | // setup GUI |
97 | netview->setColumnWidthMode( 1, QListView::Manual ); | 97 | netview->setColumnWidthMode( 1, QListView::Manual ); |
98 | 98 | ||
99 | if ( manufacturerdb ) | 99 | if ( manufacturerdb ) |
100 | netview->setManufacturerDB( manufacturerdb ); | 100 | netview->setManufacturerDB( manufacturerdb ); |
101 | 101 | ||
102 | pcap = new OPacketCapturer(); | 102 | pcap = new OPacketCapturer(); |
103 | 103 | ||
104 | } | 104 | } |
105 | 105 | ||
106 | 106 | ||
107 | Wellenreiter::~Wellenreiter() | 107 | Wellenreiter::~Wellenreiter() |
108 | { | 108 | { |
109 | // no need to delete child widgets, Qt does it all for us | 109 | // no need to delete child widgets, Qt does it all for us |
110 | 110 | ||
111 | delete manufacturerdb; | 111 | delete manufacturerdb; |
112 | delete pcap; | 112 | delete pcap; |
113 | } | 113 | } |
114 | 114 | ||
115 | 115 | ||
116 | void Wellenreiter::setConfigWindow( WellenreiterConfigWindow* cw ) | 116 | void Wellenreiter::setConfigWindow( WellenreiterConfigWindow* cw ) |
117 | { | 117 | { |
118 | configwindow = cw; | 118 | configwindow = cw; |
119 | } | 119 | } |
120 | 120 | ||
121 | 121 | ||
122 | void Wellenreiter::channelHopped(int c) | 122 | void Wellenreiter::channelHopped(int c) |
123 | { | 123 | { |
124 | QString title = "Wellenreiter II -scan- ["; | 124 | QString title = "Wellenreiter II -scan- ["; |
125 | QString left; | 125 | QString left; |
126 | if ( c > 1 ) left.fill( '.', c-1 ); | 126 | if ( c > 1 ) left.fill( '.', c-1 ); |
127 | title.append( left ); | 127 | title.append( left ); |
128 | title.append( '|' ); | 128 | title.append( '|' ); |
129 | if ( c < iface->channels() ) | 129 | if ( c < iface->channels() ) |
130 | { | 130 | { |
131 | QString right; | 131 | QString right; |
132 | right.fill( '.', iface->channels()-c ); | 132 | right.fill( '.', iface->channels()-c ); |
133 | title.append( right ); | 133 | title.append( right ); |
134 | } | 134 | } |
135 | title.append( "]" ); | 135 | title.append( "]" ); |
136 | //title.append( QString().sprintf( " %02d", c ) ); | 136 | //title.append( QString().sprintf( " %02d", c ) ); |
137 | assert( parent() ); | 137 | assert( parent() ); |
138 | ( (QMainWindow*) parent() )->setCaption( title ); | 138 | ( (QMainWindow*) parent() )->setCaption( title ); |
139 | } | 139 | } |
140 | 140 | ||
141 | 141 | ||
142 | void Wellenreiter::handleNotification( OPacket* p ) | 142 | void Wellenreiter::handleNotification( OPacket* p ) |
143 | { | 143 | { |
144 | QObjectList* l = p->queryList(); | 144 | QObjectList* l = p->queryList(); |
145 | QObjectListIt it( *l ); | 145 | QObjectListIt it( *l ); |
146 | QObject* o; | 146 | QObject* o; |
147 | 147 | ||
148 | while ( (o = it.current()) != 0 ) | 148 | while ( (o = it.current()) != 0 ) |
149 | { | 149 | { |
150 | QString name = it.current()->name(); | 150 | QString name = it.current()->name(); |
151 | if ( configwindow->parsePackets->isProtocolChecked( name ) ) | 151 | if ( configwindow->parsePackets->isProtocolChecked( name ) ) |
152 | { | 152 | { |
153 | QString action = configwindow->parsePackets->protocolAction( name ); | 153 | QString action = configwindow->parsePackets->protocolAction( name ); |
154 | qDebug( "parsePacket-action for '%s' seems to be '%s'", (const char*) name, (const char*) action ); | 154 | qDebug( "parsePacket-action for '%s' seems to be '%s'", (const char*) name, (const char*) action ); |
155 | doAction( action, name, p ); | 155 | doAction( action, name, p ); |
156 | } | 156 | } |
157 | else | 157 | else |
158 | { | 158 | { |
159 | qDebug( "protocol '%s' not checked in parsePackets.", (const char*) name ); | 159 | qDebug( "protocol '%s' not checked in parsePackets.", (const char*) name ); |
160 | } | 160 | } |
161 | ++it; | 161 | ++it; |
162 | } | 162 | } |
163 | } | 163 | } |
164 | 164 | ||
165 | 165 | ||
166 | void Wellenreiter::handleBeacon( OPacket* p, OWaveLanManagementPacket* beacon ) | 166 | void Wellenreiter::handleBeacon( OPacket* p, OWaveLanManagementPacket* beacon ) |
167 | { | 167 | { |
168 | QString type; | 168 | QString type; |
169 | if ( beacon->canIBSS() ) | 169 | if ( beacon->canIBSS() ) |
170 | { | 170 | { |
171 | type = "adhoc"; | 171 | type = "adhoc"; |
172 | } | 172 | } |
173 | else if ( beacon->canESS() ) | 173 | else if ( beacon->canESS() ) |
174 | { | 174 | { |
175 | type = "managed"; | 175 | type = "managed"; |
176 | } | 176 | } |
177 | else | 177 | else |
178 | { | 178 | { |
179 | qWarning( "Wellenreiter::invalid frame [possibly noise] detected!" ); | 179 | qWarning( "Wellenreiter::invalid frame [possibly noise] detected!" ); |
180 | return; | 180 | return; |
181 | } | 181 | } |
182 | 182 | ||
183 | OWaveLanManagementSSID* ssid = static_cast<OWaveLanManagementSSID*>( p->child( "802.11 SSID" ) ); | 183 | OWaveLanManagementSSID* ssid = static_cast<OWaveLanManagementSSID*>( p->child( "802.11 SSID" ) ); |
184 | QString essid = ssid ? ssid->ID() : QString("<unknown>"); | 184 | QString essid = ssid ? ssid->ID() : QString("<unknown>"); |
185 | OWaveLanManagementDS* ds = static_cast<OWaveLanManagementDS*>( p->child( "802.11 DS" ) ); | 185 | OWaveLanManagementDS* ds = static_cast<OWaveLanManagementDS*>( p->child( "802.11 DS" ) ); |
186 | int channel = ds ? ds->channel() : -1; | 186 | int channel = ds ? ds->channel() : -1; |
187 | 187 | ||
188 | OWaveLanPacket* header = static_cast<OWaveLanPacket*>( p->child( "802.11" ) ); | 188 | OWaveLanPacket* header = static_cast<OWaveLanPacket*>( p->child( "802.11" ) ); |
189 | netView()->addNewItem( type, essid, header->macAddress2().toString(), beacon->canPrivacy(), channel, 0 ); | 189 | netView()->addNewItem( type, essid, header->macAddress2().toString(), beacon->canPrivacy(), channel, 0 ); |
190 | 190 | ||
191 | // update graph window | 191 | // update graph window |
192 | if ( ds ) | 192 | if ( ds ) |
193 | { | 193 | { |
194 | OPrismHeaderPacket* prism = static_cast<OPrismHeaderPacket*>( p->child( "Prism" ) ); | 194 | OPrismHeaderPacket* prism = static_cast<OPrismHeaderPacket*>( p->child( "Prism" ) ); |
195 | if ( prism ) | 195 | if ( prism ) |
196 | graphwindow->traffic( ds->channel(), prism->signalStrength() ); | 196 | graphwindow->traffic( ds->channel(), prism->signalStrength() ); |
197 | else | 197 | else |
198 | graphwindow->traffic( ds->channel(), 95 ); | 198 | graphwindow->traffic( ds->channel(), 95 ); |
199 | } | 199 | } |
200 | } | 200 | } |
201 | 201 | ||
202 | 202 | ||
203 | void Wellenreiter::handleData( OPacket* p, OWaveLanDataPacket* data ) | 203 | void Wellenreiter::handleData( OPacket* p, OWaveLanDataPacket* data ) |
204 | { | 204 | { |
205 | OWaveLanPacket* wlan = (OWaveLanPacket*) p->child( "802.11" ); | 205 | OWaveLanPacket* wlan = (OWaveLanPacket*) p->child( "802.11" ); |
206 | if ( wlan->fromDS() && !wlan->toDS() ) | 206 | if ( wlan->fromDS() && !wlan->toDS() ) |
207 | { | 207 | { |
208 | qDebug( "FromDS traffic: '%s' -> '%s' via '%s'", | 208 | qDebug( "FromDS traffic: '%s' -> '%s' via '%s'", |
209 | (const char*) wlan->macAddress3().toString(true), | 209 | (const char*) wlan->macAddress3().toString(true), |
210 | (const char*) wlan->macAddress1().toString(true), | 210 | (const char*) wlan->macAddress1().toString(true), |
211 | (const char*) wlan->macAddress2().toString(true) ); | 211 | (const char*) wlan->macAddress2().toString(true) ); |
212 | netView()->fromDStraffic( wlan->macAddress3().toString(), | 212 | netView()->fromDStraffic( wlan->macAddress3().toString(), |
213 | wlan->macAddress1().toString(), | 213 | wlan->macAddress1().toString(), |
214 | wlan->macAddress2().toString() ); | 214 | wlan->macAddress2().toString() ); |
215 | } | 215 | } |
216 | else | 216 | else |
217 | if ( !wlan->fromDS() && wlan->toDS() ) | 217 | if ( !wlan->fromDS() && wlan->toDS() ) |
218 | { | 218 | { |
219 | qDebug( "ToDS traffic: '%s' -> '%s' via '%s'", | 219 | qDebug( "ToDS traffic: '%s' -> '%s' via '%s'", |
220 | (const char*) wlan->macAddress2().toString(true), | 220 | (const char*) wlan->macAddress2().toString(true), |
221 | (const char*) wlan->macAddress3().toString(true), | 221 | (const char*) wlan->macAddress3().toString(true), |
222 | (const char*) wlan->macAddress1().toString(true) ); | 222 | (const char*) wlan->macAddress1().toString(true) ); |
223 | netView()->toDStraffic( wlan->macAddress2().toString(), | 223 | netView()->toDStraffic( wlan->macAddress2().toString(), |
224 | wlan->macAddress3().toString(), | 224 | wlan->macAddress3().toString(), |
225 | wlan->macAddress1().toString() ); | 225 | wlan->macAddress1().toString() ); |
226 | } | 226 | } |
227 | else | 227 | else |
228 | if ( wlan->fromDS() && wlan->toDS() ) | 228 | if ( wlan->fromDS() && wlan->toDS() ) |
229 | { | 229 | { |
230 | qDebug( "WDS(bridge) traffic: '%s' -> '%s' via '%s' and '%s'", | 230 | qDebug( "WDS(bridge) traffic: '%s' -> '%s' via '%s' and '%s'", |
231 | (const char*) wlan->macAddress4().toString(true), | 231 | (const char*) wlan->macAddress4().toString(true), |
232 | (const char*) wlan->macAddress3().toString(true), | 232 | (const char*) wlan->macAddress3().toString(true), |
233 | (const char*) wlan->macAddress1().toString(true), | 233 | (const char*) wlan->macAddress1().toString(true), |
234 | (const char*) wlan->macAddress2().toString(true) ); | 234 | (const char*) wlan->macAddress2().toString(true) ); |
235 | netView()->WDStraffic( wlan->macAddress4().toString(), | 235 | netView()->WDStraffic( wlan->macAddress4().toString(), |
236 | wlan->macAddress3().toString(), | 236 | wlan->macAddress3().toString(), |
237 | wlan->macAddress1().toString(), | 237 | wlan->macAddress1().toString(), |
238 | wlan->macAddress2().toString() ); | 238 | wlan->macAddress2().toString() ); |
239 | } | 239 | } |
240 | else | 240 | else |
241 | { | 241 | { |
242 | qDebug( "IBSS(AdHoc) traffic: '%s' -> '%s' (Cell: '%s')'", | 242 | qDebug( "IBSS(AdHoc) traffic: '%s' -> '%s' (Cell: '%s')'", |
243 | (const char*) wlan->macAddress2().toString(true), | 243 | (const char*) wlan->macAddress2().toString(true), |
244 | (const char*) wlan->macAddress1().toString(true), | 244 | (const char*) wlan->macAddress1().toString(true), |
245 | (const char*) wlan->macAddress3().toString(true) ); | 245 | (const char*) wlan->macAddress3().toString(true) ); |
246 | netView()->IBSStraffic( wlan->macAddress2().toString(), | 246 | netView()->IBSStraffic( wlan->macAddress2().toString(), |
247 | wlan->macAddress1().toString(), | 247 | wlan->macAddress1().toString(), |
248 | wlan->macAddress3().toString() ); | 248 | wlan->macAddress3().toString() ); |
249 | } | 249 | } |
250 | 250 | ||
251 | OARPPacket* arp = (OARPPacket*) p->child( "ARP" ); | 251 | OARPPacket* arp = (OARPPacket*) p->child( "ARP" ); |
252 | if ( arp ) | 252 | if ( arp ) |
253 | { | 253 | { |
254 | qDebug( "Received ARP traffic (type '%s'): ", (const char*) arp->type() ); | 254 | qDebug( "Received ARP traffic (type '%s'): ", (const char*) arp->type() ); |
255 | if ( arp->type() == "REQUEST" ) | 255 | if ( arp->type() == "REQUEST" ) |
256 | { | 256 | { |
257 | netView()->identify( arp->senderMacAddress().toString(), arp->senderIPV4Address().toString() ); | 257 | netView()->identify( arp->senderMacAddress().toString(), arp->senderIPV4Address().toString() ); |
258 | } | 258 | } |
259 | else if ( arp->type() == "REPLY" ) | 259 | else if ( arp->type() == "REPLY" ) |
260 | { | 260 | { |
261 | netView()->identify( arp->senderMacAddress().toString(), arp->senderIPV4Address().toString() ); | 261 | netView()->identify( arp->senderMacAddress().toString(), arp->senderIPV4Address().toString() ); |
262 | netView()->identify( arp->targetMacAddress().toString(), arp->targetIPV4Address().toString() ); | 262 | netView()->identify( arp->targetMacAddress().toString(), arp->targetIPV4Address().toString() ); |
263 | } | 263 | } |
264 | } | 264 | } |
265 | 265 | ||
266 | OIPPacket* ip = (OIPPacket*) p->child( "IP" ); | 266 | OIPPacket* ip = (OIPPacket*) p->child( "IP" ); |
267 | if ( ip ) | 267 | if ( ip ) |
268 | { | 268 | { |
269 | qDebug( "Received IP packet." ); | 269 | qDebug( "Received IP packet." ); |
270 | } | 270 | } |
271 | } | 271 | } |
272 | 272 | ||
273 | 273 | ||
274 | QObject* Wellenreiter::childIfToParse( OPacket* p, const QString& protocol ) | 274 | QObject* Wellenreiter::childIfToParse( OPacket* p, const QString& protocol ) |
275 | { | 275 | { |
276 | if ( configwindow->parsePackets->isProtocolChecked( protocol ) ) | 276 | if ( configwindow->parsePackets->isProtocolChecked( protocol ) ) |
277 | if ( configwindow->parsePackets->protocolAction( protocol ) == "Discard!" ) | 277 | if ( configwindow->parsePackets->protocolAction( protocol ) == "Discard!" ) |
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 |