summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/ChangeLog5
-rw-r--r--noncore/net/wellenreiter/TODO5
-rw-r--r--noncore/net/wellenreiter/gui/configbase.ui287
-rw-r--r--noncore/net/wellenreiter/gui/configwindow.cpp103
-rw-r--r--noncore/net/wellenreiter/gui/configwindow.h7
-rw-r--r--noncore/net/wellenreiter/gui/gps.cpp8
-rw-r--r--noncore/net/wellenreiter/gui/scanlist.cpp20
-rw-r--r--noncore/net/wellenreiter/gui/scanlist.h3
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiter.cpp8
-rw-r--r--noncore/net/wellenreiter/opie-wellenreiter.control2
10 files changed, 357 insertions, 91 deletions
diff --git a/noncore/net/wellenreiter/ChangeLog b/noncore/net/wellenreiter/ChangeLog
index 8bf8cc8..d4dca9f 100644
--- a/noncore/net/wellenreiter/ChangeLog
+++ b/noncore/net/wellenreiter/ChangeLog
@@ -1,74 +1,79 @@
1 2004-??-?? Michael Lauer <mickey@Vanille.de> 1 2004-??-?? Michael Lauer <mickey@Vanille.de>
2 2
3 * Rewrote the simple actions on new {Network, Client, Station}. Besides playing a sound or
4 blinking a LED, a user customizable script can now be executed, if something has been
5 detected. This opens up many possibilities, i.e. a qcop to qpegps or exec'ing Flite.
6 * Added decloaking of cloaked ESSIDs (length != 0, but essid[0] == \0)
7 * Hided the 'Parse' Tab in the configuration window. Not functional now and may come later
3 * Added parsing of control frames. Display stations sending them SSID "???" for now. 8 * Added parsing of control frames. Display stations sending them SSID "???" for now.
4 * Added command line option "-nocheck" to skip non-root and dhcp tests 9 * Added command line option "-nocheck" to skip non-root and dhcp tests
5 * Improved the speed reading the manufacturer list 10 * Improved the speed reading the manufacturer list
6 * GPS coordinates are now presented in the DMS (as opposed to decimal) format 11 * GPS coordinates are now presented in the DMS (as opposed to decimal) format
7 12
8 2003-12-18 Michael Lauer <mickey@Vanille.de> 13 2003-12-18 Michael Lauer <mickey@Vanille.de>
9 14
10 * Released as Version 1.0.2 (Development Snapshot) 15 * Released as Version 1.0.2 (Development Snapshot)
11 * Added automatic uploading of capture files to "The Capture Dump" site at 16 * Added automatic uploading of capture files to "The Capture Dump" site at
12 http://www.Vanille.de/projects/capturedump.spy 17 http://www.Vanille.de/projects/capturedump.spy
13 * Initial reading of the manufacturer database happens now in background 18 * Initial reading of the manufacturer database happens now in background
14 * Removed deprecated setMonitorMode() API ==> Use setMode( "monitor" ) now. 19 * Removed deprecated setMonitorMode() API ==> Use setMode( "monitor" ) now.
15 The monitor mode now tries to use the standard IW_MODE_MONITOR first. If that 20 The monitor mode now tries to use the standard IW_MODE_MONITOR first. If that
16 doesn't work, it falls back to using the proprietary iwpriv commands 21 doesn't work, it falls back to using the proprietary iwpriv commands
17 22
18 2003-11-30 Michael Lauer <mickey@Vanille.de> 23 2003-11-30 Michael Lauer <mickey@Vanille.de>
19 24
20 * Released as Version 1.0.1 (Development Snapshot) 25 * Released as Version 1.0.1 (Development Snapshot)
21 * Fixed ARP decoding for wired networks. 26 * Fixed ARP decoding for wired networks.
22 Interestingly, 802.11 encapsulates these in IP packets, while wired ethernet just tags the type_of_protocol. 27 Interestingly, 802.11 encapsulates these in IP packets, while wired ethernet just tags the type_of_protocol.
23 * Added reading GPS data from a gps daemon. 28 * Added reading GPS data from a gps daemon.
24 * Started preparations for utilizing Wellenreiter II in wired networks. 29 * Started preparations for utilizing Wellenreiter II in wired networks.
25 * Implemented persistant configuration interface and retriggerable auto detection. 30 * Implemented persistant configuration interface and retriggerable auto detection.
26 * Added QCOP interface for talking to opie-networksettings. 31 * Added QCOP interface for talking to opie-networksettings.
27 * Added parsing of DHCP packets and detecting DHCP servers. 32 * Added parsing of DHCP packets and detecting DHCP servers.
28 * Overhauled the configuration window and started with the customizable event system. 33 * Overhauled the configuration window and started with the customizable event system.
29 * Added disabling the screensaver. 34 * Added disabling the screensaver.
30 * Added automatic opening and scrolling to the network tree if a new station appears. 35 * Added automatic opening and scrolling to the network tree if a new station appears.
31 36
32 2003-05-10 Michael Lauer <mickey@Vanille.de> 37 2003-05-10 Michael Lauer <mickey@Vanille.de>
33 38
34 * Released as Version 1.0 (Stable) 39 * Released as Version 1.0 (Stable)
35 * Added restarting the dhcp client if having killed it before. 40 * Added restarting the dhcp client if having killed it before.
36 * Decouple dump files from live capture to shift control over 'what' is dumped to applications. 41 * Decouple dump files from live capture to shift control over 'what' is dumped to applications.
37 42
38 2003-05-05 Michael Lauer <mickey@Vanille.de> 43 2003-05-05 Michael Lauer <mickey@Vanille.de>
39 44
40 * Released as Version 1.0-RC1 (Release Candidate) 45 * Released as Version 1.0-RC1 (Release Candidate)
41 * Fixed rare segfaults while sniffing and operating the GUI simultaenously. 46 * Fixed rare segfaults while sniffing and operating the GUI simultaenously.
42 * Parse more data packets and detect more participating stations. 47 * Parse more data packets and detect more participating stations.
43 * Added live graph window showing the signal strength on all channels. 48 * Added live graph window showing the signal strength on all channels.
44 * Added parsing ARP packets and identifying IP addresses of participating stations. 49 * Added parsing ARP packets and identifying IP addresses of participating stations.
45 * Added parsing with optionally enabled PRISM headers (signal strength). 50 * Added parsing with optionally enabled PRISM headers (signal strength).
46 51
47 2003-04-12 Michael Lauer <mickey@Vanille.de> 52 2003-04-12 Michael Lauer <mickey@Vanille.de>
48 53
49 * Released as Version 1.0 (Beta) 54 * Released as Version 1.0 (Beta)
50 * GUI enhancements in the Menubar and the Toolbar. 55 * GUI enhancements in the Menubar and the Toolbar.
51 * Improved keyboard handling. 56 * Improved keyboard handling.
52 * Added sanity checks for running Wellenreiter II as non-root or with dhcp clients in the background. 57 * Added sanity checks for running Wellenreiter II as non-root or with dhcp clients in the background.
53 * Add writing and replaying of libpcap compatible capture files. 58 * Add writing and replaying of libpcap compatible capture files.
54 59
55 2003-04-08 Michael Lauer <mickey@Vanille.de> 60 2003-04-08 Michael Lauer <mickey@Vanille.de>
56 61
57 * Released as Version 0.2 (Alpha) 62 * Released as Version 0.2 (Alpha)
58 * Closed memory leak in packet capturer. 63 * Closed memory leak in packet capturer.
59 * Fixed client stations appearing under essid as access points. 64 * Fixed client stations appearing under essid as access points.
60 * Fixed false WEP reporting in some cases. 65 * Fixed false WEP reporting in some cases.
61 * Started with inspecting data packages. 66 * Started with inspecting data packages.
62 * Add detecting associated client stations in infrastructural networks (if they transmit data). 67 * Add detecting associated client stations in infrastructural networks (if they transmit data).
63 * Worked around buggy hostap drivers writing past fixed-length-structures on arm. 68 * Worked around buggy hostap drivers writing past fixed-length-structures on arm.
64 * Added dynamic checking of available private ioctls. 69 * Added dynamic checking of available private ioctls.
65 * Added a saveable hex window for packet dissection. 70 * Added a saveable hex window for packet dissection.
66 71
67 2003-03-30 Michael Lauer <mickey@Vanille.de> 72 2003-03-30 Michael Lauer <mickey@Vanille.de>
68 73
69 * Released as Version 0.1 (Alpha) 74 * Released as Version 0.1 (Alpha)
70 75
71 2003-03-25 Michael Lauer <mickey@Vanille.de> 76 2003-03-25 Michael Lauer <mickey@Vanille.de>
72 77
73 * Rewrote Wellenreiter II from scratch - including the sniffing engine. 78 * Rewrote Wellenreiter II from scratch - including the sniffing engine.
74 * Beacon inspection works and finds ad-hoc networks and managed networks. 79 * Beacon inspection works and finds ad-hoc networks and managed networks.
diff --git a/noncore/net/wellenreiter/TODO b/noncore/net/wellenreiter/TODO
index ff98eaf..ab171c8 100644
--- a/noncore/net/wellenreiter/TODO
+++ b/noncore/net/wellenreiter/TODO
@@ -1,35 +1,38 @@
1- beep over headphone / customizable 1- beep over headphone / customizable
2 2
3- add configuration for scrollback buffer in hex window and log window 3- add configuration for scrollback buffer in hex window and log window
4 4
5- implement beacon stripping (the first beacon is enough to detect a 5- implement beacon stripping (the first beacon is enough to detect a
6 new network - further beacons just blow up the capture file) 6 new network - further beacons just blow up the capture file)
7 7
8- identification of probe requests 8- identification of probe requests
9 i.e. other sniffers around 9 i.e. other sniffers around
10 10
11- decloaking of falsely reported zero-length SSIDs 11- decloaking of falsely reported SSIDs [done]
12 12
13- option to launch an external application (i.e. qcop) on 13- option to launch an external application (i.e. qcop) on
14 - new net 14 - new net
15 - new station 15 - new station
16 - <whatever> event 16 - <whatever> event
17 17
18- adaptive hopping scheme ! 18- adaptive hopping scheme !
19 19
20- display interface capabilities 20- display interface capabilities
21 21
22- enable sniffing in wired networks 22- enable sniffing in wired networks
23 23
24- enable multiple packet sources 24- enable multiple packet sources
25 - infrared 25 - infrared
26 - bluetooth 26 - bluetooth
27 - usb? 27 - usb?
28 28
29- define packet structure in a metalanguage and generate 29- define packet structure in a metalanguage and generate
30 the actual parsing code (hmmm) 30 the actual parsing code (hmmm)
31 31
32- pester the ethereal folks to settle for an application independant 32- pester the ethereal folks to settle for an application independant
33 packet dissection framework... (unlikely) 33 packet dissection framework... (unlikely)
34 34
35- revamp hex window, make it more sophisticated than just a QMultiLineEdit 35- revamp hex window, make it more sophisticated than just a QMultiLineEdit
36
37- write kismet-like .network format and format to be importable into AutoRoute
38
diff --git a/noncore/net/wellenreiter/gui/configbase.ui b/noncore/net/wellenreiter/gui/configbase.ui
index 2c335df..de6abfc 100644
--- a/noncore/net/wellenreiter/gui/configbase.ui
+++ b/noncore/net/wellenreiter/gui/configbase.ui
@@ -1,1228 +1,1405 @@
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>303</width> 14 <width>250</width>
15 <height>343</height> 15 <height>371</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 <vbox> 59 <vbox>
60 <property stdset="1"> 60 <property stdset="1">
61 <name>margin</name> 61 <name>margin</name>
62 <number>6</number> 62 <number>6</number>
63 </property> 63 </property>
64 <property stdset="1"> 64 <property stdset="1">
65 <name>spacing</name> 65 <name>spacing</name>
66 <number>6</number> 66 <number>6</number>
67 </property> 67 </property>
68 <widget> 68 <widget>
69 <class>QLayoutWidget</class> 69 <class>QLayoutWidget</class>
70 <property stdset="1"> 70 <property stdset="1">
71 <name>name</name> 71 <name>name</name>
72 <cstring>Layout7</cstring> 72 <cstring>Layout7</cstring>
73 </property> 73 </property>
74 <grid> 74 <grid>
75 <property stdset="1"> 75 <property stdset="1">
76 <name>margin</name> 76 <name>margin</name>
77 <number>0</number> 77 <number>0</number>
78 </property> 78 </property>
79 <property stdset="1"> 79 <property stdset="1">
80 <name>spacing</name> 80 <name>spacing</name>
81 <number>6</number> 81 <number>6</number>
82 </property> 82 </property>
83 <widget row="1" column="1" > 83 <widget row="1" column="1" >
84 <class>QComboBox</class> 84 <class>QComboBox</class>
85 <item> 85 <item>
86 <property> 86 <property>
87 <name>text</name> 87 <name>text</name>
88 <string>&lt;select&gt;</string> 88 <string>&lt;select&gt;</string>
89 </property> 89 </property>
90 </item> 90 </item>
91 <item> 91 <item>
92 <property> 92 <property>
93 <name>text</name> 93 <name>text</name>
94 <string>cisco</string> 94 <string>cisco</string>
95 </property> 95 </property>
96 </item> 96 </item>
97 <item> 97 <item>
98 <property> 98 <property>
99 <name>text</name> 99 <name>text</name>
100 <string>wlan-ng</string> 100 <string>wlan-ng</string>
101 </property> 101 </property>
102 </item> 102 </item>
103 <item> 103 <item>
104 <property> 104 <property>
105 <name>text</name> 105 <name>text</name>
106 <string>hostap</string> 106 <string>hostap</string>
107 </property> 107 </property>
108 </item> 108 </item>
109 <item> 109 <item>
110 <property> 110 <property>
111 <name>text</name> 111 <name>text</name>
112 <string>orinoco</string> 112 <string>orinoco</string>
113 </property> 113 </property>
114 </item> 114 </item>
115 <item> 115 <item>
116 <property> 116 <property>
117 <name>text</name> 117 <name>text</name>
118 <string>&lt;manual&gt;</string> 118 <string>&lt;manual&gt;</string>
119 </property> 119 </property>
120 </item> 120 </item>
121 <item> 121 <item>
122 <property> 122 <property>
123 <name>text</name> 123 <name>text</name>
124 <string>&lt;file&gt;</string> 124 <string>&lt;file&gt;</string>
125 </property> 125 </property>
126 </item> 126 </item>
127 <property stdset="1"> 127 <property stdset="1">
128 <name>name</name> 128 <name>name</name>
129 <cstring>deviceType</cstring> 129 <cstring>deviceType</cstring>
130 </property> 130 </property>
131 <property stdset="1"> 131 <property stdset="1">
132 <name>enabled</name> 132 <name>enabled</name>
133 <bool>true</bool> 133 <bool>true</bool>
134 </property> 134 </property>
135 <property stdset="1"> 135 <property stdset="1">
136 <name>sizePolicy</name> 136 <name>sizePolicy</name>
137 <sizepolicy> 137 <sizepolicy>
138 <hsizetype>7</hsizetype> 138 <hsizetype>7</hsizetype>
139 <vsizetype>0</vsizetype> 139 <vsizetype>0</vsizetype>
140 </sizepolicy> 140 </sizepolicy>
141 </property> 141 </property>
142 <property> 142 <property>
143 <name>whatsThis</name> 143 <name>whatsThis</name>
144 <string>Choose the type of driver used for sniffing.</string> 144 <string>Choose the type of driver used for sniffing.</string>
145 </property> 145 </property>
146 </widget> 146 </widget>
147 <widget row="1" column="0" > 147 <widget row="1" column="0" >
148 <class>QLabel</class> 148 <class>QLabel</class>
149 <property stdset="1"> 149 <property stdset="1">
150 <name>name</name> 150 <name>name</name>
151 <cstring>TextLabel2_3</cstring> 151 <cstring>TextLabel2_3</cstring>
152 </property> 152 </property>
153 <property stdset="1"> 153 <property stdset="1">
154 <name>enabled</name> 154 <name>enabled</name>
155 <bool>true</bool> 155 <bool>true</bool>
156 </property> 156 </property>
157 <property stdset="1"> 157 <property stdset="1">
158 <name>text</name> 158 <name>text</name>
159 <string>Driver:</string> 159 <string>Driver:</string>
160 </property> 160 </property>
161 </widget> 161 </widget>
162 <widget row="0" column="1" > 162 <widget row="0" column="1" >
163 <class>QComboBox</class> 163 <class>QComboBox</class>
164 <property stdset="1"> 164 <property stdset="1">
165 <name>name</name> 165 <name>name</name>
166 <cstring>interfaceName</cstring> 166 <cstring>interfaceName</cstring>
167 </property> 167 </property>
168 <property stdset="1"> 168 <property stdset="1">
169 <name>enabled</name> 169 <name>enabled</name>
170 <bool>true</bool> 170 <bool>true</bool>
171 </property> 171 </property>
172 <property stdset="1"> 172 <property stdset="1">
173 <name>sizePolicy</name> 173 <name>sizePolicy</name>
174 <sizepolicy> 174 <sizepolicy>
175 <hsizetype>7</hsizetype> 175 <hsizetype>7</hsizetype>
176 <vsizetype>0</vsizetype> 176 <vsizetype>0</vsizetype>
177 </sizepolicy> 177 </sizepolicy>
178 </property> 178 </property>
179 <property stdset="1"> 179 <property stdset="1">
180 <name>editable</name> 180 <name>editable</name>
181 <bool>false</bool> 181 <bool>false</bool>
182 </property> 182 </property>
183 <property> 183 <property>
184 <name>whatsThis</name> 184 <name>whatsThis</name>
185 <string>Choose the interface used for sniffing.</string> 185 <string>Choose the interface used for sniffing.</string>
186 </property> 186 </property>
187 </widget> 187 </widget>
188 <widget row="0" column="0" > 188 <widget row="0" column="0" >
189 <class>QLabel</class> 189 <class>QLabel</class>
190 <property stdset="1"> 190 <property stdset="1">
191 <name>name</name> 191 <name>name</name>
192 <cstring>TextLabel1_2</cstring> 192 <cstring>TextLabel1_2</cstring>
193 </property> 193 </property>
194 <property stdset="1"> 194 <property stdset="1">
195 <name>enabled</name> 195 <name>enabled</name>
196 <bool>true</bool> 196 <bool>true</bool>
197 </property> 197 </property>
198 <property stdset="1"> 198 <property stdset="1">
199 <name>text</name> 199 <name>text</name>
200 <string>Name:</string> 200 <string>Name:</string>
201 </property> 201 </property>
202 </widget> 202 </widget>
203 </grid> 203 </grid>
204 </widget> 204 </widget>
205 <widget> 205 <widget>
206 <class>QLayoutWidget</class> 206 <class>QLayoutWidget</class>
207 <property stdset="1"> 207 <property stdset="1">
208 <name>name</name> 208 <name>name</name>
209 <cstring>Layout5</cstring> 209 <cstring>Layout5</cstring>
210 </property> 210 </property>
211 <hbox> 211 <hbox>
212 <property stdset="1"> 212 <property stdset="1">
213 <name>margin</name> 213 <name>margin</name>
214 <number>0</number> 214 <number>0</number>
215 </property> 215 </property>
216 <property stdset="1"> 216 <property stdset="1">
217 <name>spacing</name> 217 <name>spacing</name>
218 <number>6</number> 218 <number>6</number>
219 </property> 219 </property>
220 <widget> 220 <widget>
221 <class>QPushButton</class> 221 <class>QPushButton</class>
222 <property stdset="1"> 222 <property stdset="1">
223 <name>name</name> 223 <name>name</name>
224 <cstring>autodetect</cstring> 224 <cstring>autodetect</cstring>
225 </property> 225 </property>
226 <property stdset="1"> 226 <property stdset="1">
227 <name>text</name> 227 <name>text</name>
228 <string>Perform Autodetection</string> 228 <string>Perform Autodetection</string>
229 </property> 229 </property>
230 </widget> 230 </widget>
231 </hbox> 231 </hbox>
232 </widget> 232 </widget>
233 <widget> 233 <widget>
234 <class>QCheckBox</class> 234 <class>QCheckBox</class>
235 <property stdset="1"> 235 <property stdset="1">
236 <name>name</name> 236 <name>name</name>
237 <cstring>prismHeader</cstring> 237 <cstring>prismHeader</cstring>
238 </property> 238 </property>
239 <property stdset="1"> 239 <property stdset="1">
240 <name>text</name> 240 <name>text</name>
241 <string>Use additional PRISM header</string> 241 <string>Use additional PRISM header</string>
242 </property> 242 </property>
243 </widget> 243 </widget>
244 <spacer> 244 <spacer>
245 <property> 245 <property>
246 <name>name</name> 246 <name>name</name>
247 <cstring>Spacer4</cstring> 247 <cstring>Spacer4</cstring>
248 </property> 248 </property>
249 <property stdset="1"> 249 <property stdset="1">
250 <name>orientation</name> 250 <name>orientation</name>
251 <enum>Vertical</enum> 251 <enum>Vertical</enum>
252 </property> 252 </property>
253 <property stdset="1"> 253 <property stdset="1">
254 <name>sizeType</name> 254 <name>sizeType</name>
255 <enum>Expanding</enum> 255 <enum>Expanding</enum>
256 </property> 256 </property>
257 <property> 257 <property>
258 <name>sizeHint</name> 258 <name>sizeHint</name>
259 <size> 259 <size>
260 <width>20</width> 260 <width>20</width>
261 <height>20</height> 261 <height>20</height>
262 </size> 262 </size>
263 </property> 263 </property>
264 </spacer> 264 </spacer>
265 <widget> 265 <widget>
266 <class>QLayoutWidget</class> 266 <class>QLayoutWidget</class>
267 <property stdset="1"> 267 <property stdset="1">
268 <name>name</name> 268 <name>name</name>
269 <cstring>Layout6</cstring> 269 <cstring>Layout6</cstring>
270 </property> 270 </property>
271 <hbox> 271 <hbox>
272 <property stdset="1"> 272 <property stdset="1">
273 <name>margin</name> 273 <name>margin</name>
274 <number>0</number> 274 <number>0</number>
275 </property> 275 </property>
276 <property stdset="1"> 276 <property stdset="1">
277 <name>spacing</name> 277 <name>spacing</name>
278 <number>6</number> 278 <number>6</number>
279 </property> 279 </property>
280 <widget> 280 <widget>
281 <class>QCheckBox</class> 281 <class>QCheckBox</class>
282 <property stdset="1"> 282 <property stdset="1">
283 <name>name</name> 283 <name>name</name>
284 <cstring>hopChannels</cstring> 284 <cstring>hopChannels</cstring>
285 </property> 285 </property>
286 <property stdset="1"> 286 <property stdset="1">
287 <name>text</name> 287 <name>text</name>
288 <string>Hop Channels</string> 288 <string>Hop Channels</string>
289 </property> 289 </property>
290 <property stdset="1"> 290 <property stdset="1">
291 <name>checked</name> 291 <name>checked</name>
292 <bool>true</bool> 292 <bool>true</bool>
293 </property> 293 </property>
294 </widget> 294 </widget>
295 <widget> 295 <widget>
296 <class>QLabel</class> 296 <class>QLabel</class>
297 <property stdset="1"> 297 <property stdset="1">
298 <name>name</name> 298 <name>name</name>
299 <cstring>TextLabel1</cstring> 299 <cstring>TextLabel1</cstring>
300 </property> 300 </property>
301 <property stdset="1"> 301 <property stdset="1">
302 <name>text</name> 302 <name>text</name>
303 <string>every</string> 303 <string>every</string>
304 </property> 304 </property>
305 </widget> 305 </widget>
306 <widget> 306 <widget>
307 <class>QSpinBox</class> 307 <class>QSpinBox</class>
308 <property stdset="1"> 308 <property stdset="1">
309 <name>name</name> 309 <name>name</name>
310 <cstring>hopInterval</cstring> 310 <cstring>hopInterval</cstring>
311 </property> 311 </property>
312 <property stdset="1"> 312 <property stdset="1">
313 <name>enabled</name> 313 <name>enabled</name>
314 <bool>true</bool> 314 <bool>true</bool>
315 </property> 315 </property>
316 <property stdset="1"> 316 <property stdset="1">
317 <name>suffix</name> 317 <name>suffix</name>
318 <string> ms</string> 318 <string> ms</string>
319 </property> 319 </property>
320 <property stdset="1"> 320 <property stdset="1">
321 <name>maxValue</name> 321 <name>maxValue</name>
322 <number>2000</number> 322 <number>2000</number>
323 </property> 323 </property>
324 <property stdset="1"> 324 <property stdset="1">
325 <name>minValue</name> 325 <name>minValue</name>
326 <number>100</number> 326 <number>100</number>
327 </property> 327 </property>
328 <property stdset="1"> 328 <property stdset="1">
329 <name>lineStep</name> 329 <name>lineStep</name>
330 <number>100</number> 330 <number>100</number>
331 </property> 331 </property>
332 <property stdset="1"> 332 <property stdset="1">
333 <name>value</name> 333 <name>value</name>
334 <number>1000</number> 334 <number>1000</number>
335 </property> 335 </property>
336 <property> 336 <property>
337 <name>whatsThis</name> 337 <name>whatsThis</name>
338 <string>Choose the channel hop interval.</string> 338 <string>Choose the channel hop interval.</string>
339 </property> 339 </property>
340 </widget> 340 </widget>
341 </hbox> 341 </hbox>
342 </widget> 342 </widget>
343 <widget> 343 <widget>
344 <class>QCheckBox</class> 344 <class>QCheckBox</class>
345 <property stdset="1"> 345 <property stdset="1">
346 <name>name</name> 346 <name>name</name>
347 <cstring>adaptiveHopping</cstring> 347 <cstring>adaptiveHopping</cstring>
348 </property> 348 </property>
349 <property stdset="1"> 349 <property stdset="1">
350 <name>enabled</name> 350 <name>enabled</name>
351 <bool>false</bool> 351 <bool>false</bool>
352 </property> 352 </property>
353 <property stdset="1"> 353 <property stdset="1">
354 <name>text</name> 354 <name>text</name>
355 <string>Use Adaptive(TM) Hop Scheme</string> 355 <string>Use Adaptive(TM) Hop Scheme</string>
356 </property> 356 </property>
357 </widget> 357 </widget>
358 <widget> 358 <widget>
359 <class>QGroupBox</class> 359 <class>QGroupBox</class>
360 <property stdset="1"> 360 <property stdset="1">
361 <name>name</name> 361 <name>name</name>
362 <cstring>GroupBox1</cstring> 362 <cstring>GroupBox1</cstring>
363 </property> 363 </property>
364 <property stdset="1"> 364 <property stdset="1">
365 <name>enabled</name> 365 <name>enabled</name>
366 <bool>false</bool> 366 <bool>false</bool>
367 </property> 367 </property>
368 <property stdset="1"> 368 <property stdset="1">
369 <name>title</name> 369 <name>title</name>
370 <string>Scan on channel</string> 370 <string>Scan on channel</string>
371 </property> 371 </property>
372 <property> 372 <property>
373 <name>layoutMargin</name> 373 <name>layoutMargin</name>
374 </property> 374 </property>
375 <property> 375 <property>
376 <name>layoutSpacing</name> 376 <name>layoutSpacing</name>
377 </property> 377 </property>
378 <grid> 378 <grid>
379 <property stdset="1"> 379 <property stdset="1">
380 <name>margin</name> 380 <name>margin</name>
381 <number>4</number> 381 <number>4</number>
382 </property> 382 </property>
383 <property stdset="1"> 383 <property stdset="1">
384 <name>spacing</name> 384 <name>spacing</name>
385 <number>2</number> 385 <number>2</number>
386 </property> 386 </property>
387 <widget row="1" column="1" > 387 <widget row="1" column="1" >
388 <class>QCheckBox</class> 388 <class>QCheckBox</class>
389 <property stdset="1"> 389 <property stdset="1">
390 <name>name</name> 390 <name>name</name>
391 <cstring>channel6</cstring> 391 <cstring>channel6</cstring>
392 </property> 392 </property>
393 <property stdset="1"> 393 <property stdset="1">
394 <name>text</name> 394 <name>text</name>
395 <string>6</string> 395 <string>6</string>
396 </property> 396 </property>
397 </widget> 397 </widget>
398 <widget row="1" column="3" > 398 <widget row="1" column="3" >
399 <class>QCheckBox</class> 399 <class>QCheckBox</class>
400 <property stdset="1"> 400 <property stdset="1">
401 <name>name</name> 401 <name>name</name>
402 <cstring>channel8</cstring> 402 <cstring>channel8</cstring>
403 </property> 403 </property>
404 <property stdset="1"> 404 <property stdset="1">
405 <name>text</name> 405 <name>text</name>
406 <string>8</string> 406 <string>8</string>
407 </property> 407 </property>
408 </widget> 408 </widget>
409 <widget row="0" column="2" > 409 <widget row="0" column="2" >
410 <class>QCheckBox</class> 410 <class>QCheckBox</class>
411 <property stdset="1"> 411 <property stdset="1">
412 <name>name</name> 412 <name>name</name>
413 <cstring>channel2</cstring> 413 <cstring>channel2</cstring>
414 </property> 414 </property>
415 <property stdset="1"> 415 <property stdset="1">
416 <name>text</name> 416 <name>text</name>
417 <string>2</string> 417 <string>2</string>
418 </property> 418 </property>
419 </widget> 419 </widget>
420 <widget row="1" column="4" > 420 <widget row="1" column="4" >
421 <class>QCheckBox</class> 421 <class>QCheckBox</class>
422 <property stdset="1"> 422 <property stdset="1">
423 <name>name</name> 423 <name>name</name>
424 <cstring>channel9</cstring> 424 <cstring>channel9</cstring>
425 </property> 425 </property>
426 <property stdset="1"> 426 <property stdset="1">
427 <name>text</name> 427 <name>text</name>
428 <string>9</string> 428 <string>9</string>
429 </property> 429 </property>
430 </widget> 430 </widget>
431 <widget row="0" column="1" > 431 <widget row="0" column="1" >
432 <class>QCheckBox</class> 432 <class>QCheckBox</class>
433 <property stdset="1"> 433 <property stdset="1">
434 <name>name</name> 434 <name>name</name>
435 <cstring>channel1</cstring> 435 <cstring>channel1</cstring>
436 </property> 436 </property>
437 <property stdset="1"> 437 <property stdset="1">
438 <name>text</name> 438 <name>text</name>
439 <string>1</string> 439 <string>1</string>
440 </property> 440 </property>
441 </widget> 441 </widget>
442 <widget row="0" column="0" > 442 <widget row="0" column="0" >
443 <class>QCheckBox</class> 443 <class>QCheckBox</class>
444 <property stdset="1"> 444 <property stdset="1">
445 <name>name</name> 445 <name>name</name>
446 <cstring>channelAll</cstring> 446 <cstring>channelAll</cstring>
447 </property> 447 </property>
448 <property stdset="1"> 448 <property stdset="1">
449 <name>text</name> 449 <name>text</name>
450 <string>All</string> 450 <string>All</string>
451 </property> 451 </property>
452 </widget> 452 </widget>
453 <widget row="2" column="1" > 453 <widget row="2" column="1" >
454 <class>QCheckBox</class> 454 <class>QCheckBox</class>
455 <property stdset="1"> 455 <property stdset="1">
456 <name>name</name> 456 <name>name</name>
457 <cstring>channel11</cstring> 457 <cstring>channel11</cstring>
458 </property> 458 </property>
459 <property stdset="1"> 459 <property stdset="1">
460 <name>text</name> 460 <name>text</name>
461 <string>11</string> 461 <string>11</string>
462 </property> 462 </property>
463 </widget> 463 </widget>
464 <widget row="2" column="0" > 464 <widget row="2" column="0" >
465 <class>QCheckBox</class> 465 <class>QCheckBox</class>
466 <property stdset="1"> 466 <property stdset="1">
467 <name>name</name> 467 <name>name</name>
468 <cstring>channel10</cstring> 468 <cstring>channel10</cstring>
469 </property> 469 </property>
470 <property stdset="1"> 470 <property stdset="1">
471 <name>text</name> 471 <name>text</name>
472 <string>10</string> 472 <string>10</string>
473 </property> 473 </property>
474 </widget> 474 </widget>
475 <widget row="1" column="2" > 475 <widget row="1" column="2" >
476 <class>QCheckBox</class> 476 <class>QCheckBox</class>
477 <property stdset="1"> 477 <property stdset="1">
478 <name>name</name> 478 <name>name</name>
479 <cstring>channel7</cstring> 479 <cstring>channel7</cstring>
480 </property> 480 </property>
481 <property stdset="1"> 481 <property stdset="1">
482 <name>text</name> 482 <name>text</name>
483 <string>7</string> 483 <string>7</string>
484 </property> 484 </property>
485 </widget> 485 </widget>
486 <widget row="0" column="3" > 486 <widget row="0" column="3" >
487 <class>QCheckBox</class> 487 <class>QCheckBox</class>
488 <property stdset="1"> 488 <property stdset="1">
489 <name>name</name> 489 <name>name</name>
490 <cstring>channel3</cstring> 490 <cstring>channel3</cstring>
491 </property> 491 </property>
492 <property stdset="1"> 492 <property stdset="1">
493 <name>text</name> 493 <name>text</name>
494 <string>3</string> 494 <string>3</string>
495 </property> 495 </property>
496 </widget> 496 </widget>
497 <widget row="1" column="0" > 497 <widget row="1" column="0" >
498 <class>QCheckBox</class> 498 <class>QCheckBox</class>
499 <property stdset="1"> 499 <property stdset="1">
500 <name>name</name> 500 <name>name</name>
501 <cstring>channel5</cstring> 501 <cstring>channel5</cstring>
502 </property> 502 </property>
503 <property stdset="1"> 503 <property stdset="1">
504 <name>text</name> 504 <name>text</name>
505 <string>5</string> 505 <string>5</string>
506 </property> 506 </property>
507 </widget> 507 </widget>
508 <widget row="0" column="4" > 508 <widget row="0" column="4" >
509 <class>QCheckBox</class> 509 <class>QCheckBox</class>
510 <property stdset="1"> 510 <property stdset="1">
511 <name>name</name> 511 <name>name</name>
512 <cstring>channel4</cstring> 512 <cstring>channel4</cstring>
513 </property> 513 </property>
514 <property stdset="1"> 514 <property stdset="1">
515 <name>text</name> 515 <name>text</name>
516 <string>4</string> 516 <string>4</string>
517 </property> 517 </property>
518 </widget> 518 </widget>
519 <widget row="2" column="2" > 519 <widget row="2" column="2" >
520 <class>QCheckBox</class> 520 <class>QCheckBox</class>
521 <property stdset="1"> 521 <property stdset="1">
522 <name>name</name> 522 <name>name</name>
523 <cstring>channel12</cstring> 523 <cstring>channel12</cstring>
524 </property> 524 </property>
525 <property stdset="1"> 525 <property stdset="1">
526 <name>text</name> 526 <name>text</name>
527 <string>12</string> 527 <string>12</string>
528 </property> 528 </property>
529 </widget> 529 </widget>
530 <widget row="2" column="3" > 530 <widget row="2" column="3" >
531 <class>QCheckBox</class> 531 <class>QCheckBox</class>
532 <property stdset="1"> 532 <property stdset="1">
533 <name>name</name> 533 <name>name</name>
534 <cstring>channel13</cstring> 534 <cstring>channel13</cstring>
535 </property> 535 </property>
536 <property stdset="1"> 536 <property stdset="1">
537 <name>text</name> 537 <name>text</name>
538 <string>13</string> 538 <string>13</string>
539 </property> 539 </property>
540 </widget> 540 </widget>
541 <widget row="2" column="4" > 541 <widget row="2" column="4" >
542 <class>QCheckBox</class> 542 <class>QCheckBox</class>
543 <property stdset="1"> 543 <property stdset="1">
544 <name>name</name> 544 <name>name</name>
545 <cstring>channel14</cstring> 545 <cstring>channel14</cstring>
546 </property> 546 </property>
547 <property stdset="1"> 547 <property stdset="1">
548 <name>text</name> 548 <name>text</name>
549 <string>14</string> 549 <string>14</string>
550 </property> 550 </property>
551 </widget> 551 </widget>
552 </grid> 552 </grid>
553 </widget> 553 </widget>
554 </vbox> 554 </vbox>
555 </widget> 555 </widget>
556 <widget> 556 <widget>
557 <class>QWidget</class> 557 <class>QWidget</class>
558 <property stdset="1"> 558 <property stdset="1">
559 <name>name</name> 559 <name>name</name>
560 <cstring>tab</cstring> 560 <cstring>tab</cstring>
561 </property> 561 </property>
562 <attribute> 562 <attribute>
563 <name>title</name> 563 <name>title</name>
564 <string>Capture</string> 564 <string>Capture</string>
565 </attribute> 565 </attribute>
566 <grid> 566 <grid>
567 <property stdset="1"> 567 <property stdset="1">
568 <name>margin</name> 568 <name>margin</name>
569 <number>5</number> 569 <number>5</number>
570 </property> 570 </property>
571 <property stdset="1"> 571 <property stdset="1">
572 <name>spacing</name> 572 <name>spacing</name>
573 <number>3</number> 573 <number>3</number>
574 </property> 574 </property>
575 <widget row="2" column="0" rowspan="1" colspan="3" > 575 <widget row="2" column="0" rowspan="1" colspan="3" >
576 <class>ProtocolListView</class> 576 <class>ProtocolListView</class>
577 <property stdset="1"> 577 <property stdset="1">
578 <name>name</name> 578 <name>name</name>
579 <cstring>capturePackets</cstring> 579 <cstring>capturePackets</cstring>
580 </property> 580 </property>
581 <property stdset="1"> 581 <property stdset="1">
582 <name>enabled</name> 582 <name>enabled</name>
583 <bool>false</bool> 583 <bool>false</bool>
584 </property> 584 </property>
585 <property stdset="1"> 585 <property stdset="1">
586 <name>sizePolicy</name> 586 <name>sizePolicy</name>
587 <sizepolicy> 587 <sizepolicy>
588 <hsizetype>7</hsizetype> 588 <hsizetype>7</hsizetype>
589 <vsizetype>7</vsizetype> 589 <vsizetype>7</vsizetype>
590 </sizepolicy> 590 </sizepolicy>
591 </property> 591 </property>
592 </widget> 592 </widget>
593 <widget row="1" column="0" rowspan="1" colspan="3" > 593 <widget row="1" column="0" rowspan="1" colspan="3" >
594 <class>QLineEdit</class> 594 <class>QLineEdit</class>
595 <property stdset="1"> 595 <property stdset="1">
596 <name>name</name> 596 <name>name</name>
597 <cstring>captureFileName</cstring> 597 <cstring>captureFileName</cstring>
598 </property> 598 </property>
599 <property stdset="1"> 599 <property stdset="1">
600 <name>enabled</name> 600 <name>enabled</name>
601 <bool>false</bool> 601 <bool>false</bool>
602 </property> 602 </property>
603 <property stdset="1"> 603 <property stdset="1">
604 <name>text</name> 604 <name>text</name>
605 <string>/tmp/capture</string> 605 <string>/tmp/capture</string>
606 </property> 606 </property>
607 </widget> 607 </widget>
608 <widget row="0" column="2" > 608 <widget row="0" column="2" >
609 <class>QToolButton</class> 609 <class>QToolButton</class>
610 <property stdset="1"> 610 <property stdset="1">
611 <name>name</name> 611 <name>name</name>
612 <cstring>getCaptureFileName</cstring> 612 <cstring>getCaptureFileName</cstring>
613 </property> 613 </property>
614 <property stdset="1"> 614 <property stdset="1">
615 <name>enabled</name> 615 <name>enabled</name>
616 <bool>false</bool> 616 <bool>false</bool>
617 </property> 617 </property>
618 <property stdset="1"> 618 <property stdset="1">
619 <name>text</name> 619 <name>text</name>
620 <string>Browse</string> 620 <string>Browse</string>
621 </property> 621 </property>
622 </widget> 622 </widget>
623 <spacer row="0" column="1" > 623 <spacer row="0" column="1" >
624 <property> 624 <property>
625 <name>name</name> 625 <name>name</name>
626 <cstring>Spacer2</cstring> 626 <cstring>Spacer2</cstring>
627 </property> 627 </property>
628 <property stdset="1"> 628 <property stdset="1">
629 <name>orientation</name> 629 <name>orientation</name>
630 <enum>Horizontal</enum> 630 <enum>Horizontal</enum>
631 </property> 631 </property>
632 <property stdset="1"> 632 <property stdset="1">
633 <name>sizeType</name> 633 <name>sizeType</name>
634 <enum>Expanding</enum> 634 <enum>Expanding</enum>
635 </property> 635 </property>
636 <property> 636 <property>
637 <name>sizeHint</name> 637 <name>sizeHint</name>
638 <size> 638 <size>
639 <width>20</width> 639 <width>20</width>
640 <height>20</height> 640 <height>20</height>
641 </size> 641 </size>
642 </property> 642 </property>
643 </spacer> 643 </spacer>
644 <widget row="0" column="0" > 644 <widget row="0" column="0" >
645 <class>QCheckBox</class> 645 <class>QCheckBox</class>
646 <property stdset="1"> 646 <property stdset="1">
647 <name>name</name> 647 <name>name</name>
648 <cstring>writeCaptureFile</cstring> 648 <cstring>writeCaptureFile</cstring>
649 </property> 649 </property>
650 <property stdset="1"> 650 <property stdset="1">
651 <name>enabled</name> 651 <name>enabled</name>
652 <bool>true</bool> 652 <bool>true</bool>
653 </property> 653 </property>
654 <property stdset="1"> 654 <property stdset="1">
655 <name>text</name> 655 <name>text</name>
656 <string>Write Capture Files To</string> 656 <string>Write Capture Files To</string>
657 </property> 657 </property>
658 </widget> 658 </widget>
659 </grid> 659 </grid>
660 </widget> 660 </widget>
661 <widget> 661 <widget>
662 <class>QWidget</class> 662 <class>QWidget</class>
663 <property stdset="1"> 663 <property stdset="1">
664 <name>name</name> 664 <name>name</name>
665 <cstring>tab</cstring> 665 <cstring>tab</cstring>
666 </property> 666 </property>
667 <attribute> 667 <attribute>
668 <name>title</name> 668 <name>title</name>
669 <string>Parse</string> 669 <string>Parse</string>
670 </attribute> 670 </attribute>
671 <grid> 671 <grid>
672 <property stdset="1"> 672 <property stdset="1">
673 <name>margin</name> 673 <name>margin</name>
674 <number>5</number> 674 <number>5</number>
675 </property> 675 </property>
676 <property stdset="1"> 676 <property stdset="1">
677 <name>spacing</name> 677 <name>spacing</name>
678 <number>3</number> 678 <number>3</number>
679 </property> 679 </property>
680 <widget row="0" column="0" > 680 <widget row="0" column="0" >
681 <class>ProtocolListView</class> 681 <class>ProtocolListView</class>
682 <property stdset="1"> 682 <property stdset="1">
683 <name>name</name> 683 <name>name</name>
684 <cstring>parsePackets</cstring> 684 <cstring>parsePackets</cstring>
685 </property> 685 </property>
686 <property stdset="1"> 686 <property stdset="1">
687 <name>sizePolicy</name> 687 <name>sizePolicy</name>
688 <sizepolicy> 688 <sizepolicy>
689 <hsizetype>7</hsizetype> 689 <hsizetype>7</hsizetype>
690 <vsizetype>7</vsizetype> 690 <vsizetype>7</vsizetype>
691 </sizepolicy> 691 </sizepolicy>
692 </property> 692 </property>
693 </widget> 693 </widget>
694 </grid> 694 </grid>
695 </widget> 695 </widget>
696 <widget> 696 <widget>
697 <class>QWidget</class> 697 <class>QWidget</class>
698 <property stdset="1"> 698 <property stdset="1">
699 <name>name</name> 699 <name>name</name>
700 <cstring>tab</cstring> 700 <cstring>tab</cstring>
701 </property> 701 </property>
702 <attribute> 702 <attribute>
703 <name>title</name> 703 <name>title</name>
704 <string>UI</string> 704 <string>UI</string>
705 </attribute> 705 </attribute>
706 <vbox> 706 <vbox>
707 <property stdset="1"> 707 <property stdset="1">
708 <name>margin</name> 708 <name>margin</name>
709 <number>6</number> 709 <number>5</number>
710 </property> 710 </property>
711 <property stdset="1"> 711 <property stdset="1">
712 <name>spacing</name> 712 <name>spacing</name>
713 <number>6</number> 713 <number>3</number>
714 </property> 714 </property>
715 <widget> 715 <widget>
716 <class>QCheckBox</class> 716 <class>QCheckBox</class>
717 <property stdset="1"> 717 <property stdset="1">
718 <name>name</name> 718 <name>name</name>
719 <cstring>lookupVendor</cstring> 719 <cstring>lookupVendor</cstring>
720 </property> 720 </property>
721 <property stdset="1"> 721 <property stdset="1">
722 <name>text</name> 722 <name>text</name>
723 <string>Lookup MAC vendor names</string> 723 <string>Lookup MAC vendor names</string>
724 </property> 724 </property>
725 </widget> 725 </widget>
726 <widget> 726 <widget>
727 <class>QCheckBox</class> 727 <class>QCheckBox</class>
728 <property stdset="1"> 728 <property stdset="1">
729 <name>name</name> 729 <name>name</name>
730 <cstring>openTree</cstring> 730 <cstring>openTree</cstring>
731 </property> 731 </property>
732 <property stdset="1"> 732 <property stdset="1">
733 <name>text</name> 733 <name>text</name>
734 <string>Open Tree On New Station</string> 734 <string>Open Tree On New Station</string>
735 </property> 735 </property>
736 </widget> 736 </widget>
737 <widget> 737 <widget>
738 <class>QCheckBox</class> 738 <class>QCheckBox</class>
739 <property stdset="1"> 739 <property stdset="1">
740 <name>name</name> 740 <name>name</name>
741 <cstring>disablePM</cstring> 741 <cstring>disablePM</cstring>
742 </property> 742 </property>
743 <property stdset="1"> 743 <property stdset="1">
744 <name>text</name> 744 <name>text</name>
745 <string>Disable Power Management</string> 745 <string>Disable Power Management</string>
746 </property> 746 </property>
747 </widget> 747 </widget>
748 <spacer> 748 <spacer>
749 <property> 749 <property>
750 <name>name</name> 750 <name>name</name>
751 <cstring>Spacer3</cstring> 751 <cstring>Spacer3</cstring>
752 </property> 752 </property>
753 <property stdset="1"> 753 <property stdset="1">
754 <name>orientation</name> 754 <name>orientation</name>
755 <enum>Vertical</enum> 755 <enum>Vertical</enum>
756 </property> 756 </property>
757 <property stdset="1"> 757 <property stdset="1">
758 <name>sizeType</name> 758 <name>sizeType</name>
759 <enum>Expanding</enum> 759 <enum>Expanding</enum>
760 </property> 760 </property>
761 <property> 761 <property>
762 <name>sizeHint</name> 762 <name>sizeHint</name>
763 <size> 763 <size>
764 <width>20</width> 764 <width>20</width>
765 <height>20</height> 765 <height>20</height>
766 </size> 766 </size>
767 </property> 767 </property>
768 </spacer> 768 </spacer>
769 <widget> 769 <widget>
770 <class>QGroupBox</class> 770 <class>QGroupBox</class>
771 <property stdset="1"> 771 <property stdset="1">
772 <name>name</name> 772 <name>name</name>
773 <cstring>GroupBox4_2</cstring> 773 <cstring>GroupBox4_2</cstring>
774 </property> 774 </property>
775 <property stdset="1"> 775 <property stdset="1">
776 <name>enabled</name> 776 <name>enabled</name>
777 <bool>false</bool> 777 <bool>true</bool>
778 </property> 778 </property>
779 <property stdset="1"> 779 <property stdset="1">
780 <name>title</name> 780 <name>title</name>
781 <string>Action On Detecting</string> 781 <string>Action on detecting a new</string>
782 </property>
783 <property>
784 <name>layoutMargin</name>
785 </property>
786 <property>
787 <name>layoutSpacing</name>
782 </property> 788 </property>
783 <grid> 789 <grid>
784 <property stdset="1"> 790 <property stdset="1">
785 <name>margin</name> 791 <name>margin</name>
786 <number>11</number> 792 <number>3</number>
787 </property> 793 </property>
788 <property stdset="1"> 794 <property stdset="1">
789 <name>spacing</name> 795 <name>spacing</name>
790 <number>6</number> 796 <number>0</number>
791 </property> 797 </property>
792 <widget row="1" column="0" >
793 <class>QLabel</class>
794 <property stdset="1">
795 <name>name</name>
796 <cstring>TextLabel2</cstring>
797 </property>
798 <property stdset="1">
799 <name>text</name>
800 <string>New Wireless Station</string>
801 </property>
802 </widget>
803 <widget row="0" column="0" > 798 <widget row="0" column="0" >
804 <class>QLabel</class> 799 <class>QLayoutWidget</class>
805 <property stdset="1">
806 <name>name</name>
807 <cstring>TextLabel1_3</cstring>
808 </property>
809 <property stdset="1">
810 <name>text</name>
811 <string>New Network</string>
812 </property>
813 </widget>
814 <widget row="0" column="1" >
815 <class>QComboBox</class>
816 <property stdset="1">
817 <name>name</name>
818 <cstring>newNetwork</cstring>
819 </property>
820 </widget>
821 <widget row="1" column="1" >
822 <class>QComboBox</class>
823 <property stdset="1">
824 <name>name</name>
825 <cstring>newWirelessStation</cstring>
826 </property>
827 </widget>
828 <widget row="2" column="1" >
829 <class>QComboBox</class>
830 <property stdset="1"> 800 <property stdset="1">
831 <name>name</name> 801 <name>name</name>
832 <cstring>newStation</cstring> 802 <cstring>Layout6</cstring>
833 </property> 803 </property>
834 </widget> 804 <property>
835 <widget row="2" column="0" > 805 <name>layoutMargin</name>
836 <class>QLabel</class>
837 <property stdset="1">
838 <name>name</name>
839 <cstring>TextLabel3</cstring>
840 </property> 806 </property>
841 <property stdset="1"> 807 <property>
842 <name>text</name> 808 <name>layoutSpacing</name>
843 <string>New Station</string>
844 </property> 809 </property>
810 <grid>
811 <property stdset="1">
812 <name>margin</name>
813 <number>2</number>
814 </property>
815 <property stdset="1">
816 <name>spacing</name>
817 <number>2</number>
818 </property>
819 <widget row="4" column="0" >
820 <class>QLabel</class>
821 <property stdset="1">
822 <name>name</name>
823 <cstring>TextLabel3</cstring>
824 </property>
825 <property stdset="1">
826 <name>text</name>
827 <string>Wired Station:</string>
828 </property>
829 </widget>
830 <widget row="0" column="0" >
831 <class>QLabel</class>
832 <property stdset="1">
833 <name>name</name>
834 <cstring>TextLabel1_3</cstring>
835 </property>
836 <property stdset="1">
837 <name>text</name>
838 <string>Network:</string>
839 </property>
840 </widget>
841 <widget row="2" column="1" >
842 <class>QComboBox</class>
843 <item>
844 <property>
845 <name>text</name>
846 <string>&lt;Ignore&gt;</string>
847 </property>
848 </item>
849 <item>
850 <property>
851 <name>text</name>
852 <string>Play Alarm</string>
853 </property>
854 </item>
855 <item>
856 <property>
857 <name>text</name>
858 <string>Play Click</string>
859 </property>
860 </item>
861 <item>
862 <property>
863 <name>text</name>
864 <string>Blink LED</string>
865 </property>
866 </item>
867 <item>
868 <property>
869 <name>text</name>
870 <string>Run Script</string>
871 </property>
872 </item>
873 <property stdset="1">
874 <name>name</name>
875 <cstring>newClientAction</cstring>
876 </property>
877 <property stdset="1">
878 <name>sizePolicy</name>
879 <sizepolicy>
880 <hsizetype>7</hsizetype>
881 <vsizetype>0</vsizetype>
882 </sizepolicy>
883 </property>
884 </widget>
885 <widget row="3" column="0" rowspan="1" colspan="2" >
886 <class>QLineEdit</class>
887 <property stdset="1">
888 <name>name</name>
889 <cstring>newClientScript</cstring>
890 </property>
891 <property stdset="1">
892 <name>enabled</name>
893 <bool>true</bool>
894 </property>
895 </widget>
896 <widget row="2" column="0" >
897 <class>QLabel</class>
898 <property stdset="1">
899 <name>name</name>
900 <cstring>TextLabel2</cstring>
901 </property>
902 <property stdset="1">
903 <name>text</name>
904 <string>Wireless Station:</string>
905 </property>
906 </widget>
907 <widget row="4" column="1" >
908 <class>QComboBox</class>
909 <item>
910 <property>
911 <name>text</name>
912 <string>&lt;Ignore&gt;</string>
913 </property>
914 </item>
915 <item>
916 <property>
917 <name>text</name>
918 <string>Play Alarm</string>
919 </property>
920 </item>
921 <item>
922 <property>
923 <name>text</name>
924 <string>Play Click</string>
925 </property>
926 </item>
927 <item>
928 <property>
929 <name>text</name>
930 <string>Blink LED</string>
931 </property>
932 </item>
933 <item>
934 <property>
935 <name>text</name>
936 <string>Run Script</string>
937 </property>
938 </item>
939 <property stdset="1">
940 <name>name</name>
941 <cstring>newStationAction</cstring>
942 </property>
943 <property stdset="1">
944 <name>sizePolicy</name>
945 <sizepolicy>
946 <hsizetype>7</hsizetype>
947 <vsizetype>0</vsizetype>
948 </sizepolicy>
949 </property>
950 </widget>
951 <widget row="0" column="1" >
952 <class>QComboBox</class>
953 <item>
954 <property>
955 <name>text</name>
956 <string>&lt;Ignore&gt;</string>
957 </property>
958 </item>
959 <item>
960 <property>
961 <name>text</name>
962 <string>Play Alarm</string>
963 </property>
964 </item>
965 <item>
966 <property>
967 <name>text</name>
968 <string>Play Click</string>
969 </property>
970 </item>
971 <item>
972 <property>
973 <name>text</name>
974 <string>Blink LED</string>
975 </property>
976 </item>
977 <item>
978 <property>
979 <name>text</name>
980 <string>Run Script</string>
981 </property>
982 </item>
983 <property stdset="1">
984 <name>name</name>
985 <cstring>newNetworkAction</cstring>
986 </property>
987 <property stdset="1">
988 <name>sizePolicy</name>
989 <sizepolicy>
990 <hsizetype>7</hsizetype>
991 <vsizetype>0</vsizetype>
992 </sizepolicy>
993 </property>
994 <property stdset="1">
995 <name>editable</name>
996 <bool>false</bool>
997 </property>
998 </widget>
999 <widget row="1" column="0" rowspan="1" colspan="2" >
1000 <class>QLineEdit</class>
1001 <property stdset="1">
1002 <name>name</name>
1003 <cstring>newNetworkScript</cstring>
1004 </property>
1005 <property stdset="1">
1006 <name>enabled</name>
1007 <bool>true</bool>
1008 </property>
1009 </widget>
1010 <widget row="5" column="0" rowspan="1" colspan="2" >
1011 <class>QLineEdit</class>
1012 <property stdset="1">
1013 <name>name</name>
1014 <cstring>newStationScript</cstring>
1015 </property>
1016 <property stdset="1">
1017 <name>enabled</name>
1018 <bool>true</bool>
1019 </property>
1020 </widget>
1021 </grid>
845 </widget> 1022 </widget>
846 </grid> 1023 </grid>
847 </widget> 1024 </widget>
848 </vbox> 1025 </vbox>
849 </widget> 1026 </widget>
850 <widget> 1027 <widget>
851 <class>QWidget</class> 1028 <class>QWidget</class>
852 <property stdset="1"> 1029 <property stdset="1">
853 <name>name</name> 1030 <name>name</name>
854 <cstring>tab</cstring> 1031 <cstring>tab</cstring>
855 </property> 1032 </property>
856 <attribute> 1033 <attribute>
857 <name>title</name> 1034 <name>title</name>
858 <string>Intrusion</string> 1035 <string>Intrusion</string>
859 </attribute> 1036 </attribute>
860 <grid> 1037 <grid>
861 <property stdset="1"> 1038 <property stdset="1">
862 <name>margin</name> 1039 <name>margin</name>
863 <number>6</number> 1040 <number>6</number>
864 </property> 1041 </property>
865 <property stdset="1"> 1042 <property stdset="1">
866 <name>spacing</name> 1043 <name>spacing</name>
867 <number>6</number> 1044 <number>6</number>
868 </property> 1045 </property>
869 <widget row="1" column="0" > 1046 <widget row="1" column="0" >
870 <class>QGroupBox</class> 1047 <class>QGroupBox</class>
871 <property stdset="1"> 1048 <property stdset="1">
872 <name>name</name> 1049 <name>name</name>
873 <cstring>GroupBox3</cstring> 1050 <cstring>GroupBox3</cstring>
874 </property> 1051 </property>
875 <property stdset="1"> 1052 <property stdset="1">
876 <name>enabled</name> 1053 <name>enabled</name>
877 <bool>false</bool> 1054 <bool>false</bool>
878 </property> 1055 </property>
879 <property stdset="1"> 1056 <property stdset="1">
880 <name>title</name> 1057 <name>title</name>
881 <string>Link Level</string> 1058 <string>Link Level</string>
882 </property> 1059 </property>
883 <grid> 1060 <grid>
884 <property stdset="1"> 1061 <property stdset="1">
885 <name>margin</name> 1062 <name>margin</name>
886 <number>11</number> 1063 <number>11</number>
887 </property> 1064 </property>
888 <property stdset="1"> 1065 <property stdset="1">
889 <name>spacing</name> 1066 <name>spacing</name>
890 <number>6</number> 1067 <number>6</number>
891 </property> 1068 </property>
892 <widget row="0" column="0" > 1069 <widget row="0" column="0" >
893 <class>QLabel</class> 1070 <class>QLabel</class>
894 <property stdset="1"> 1071 <property stdset="1">
895 <name>name</name> 1072 <name>name</name>
896 <cstring>TextLabel1_5</cstring> 1073 <cstring>TextLabel1_5</cstring>
897 </property> 1074 </property>
898 <property stdset="1"> 1075 <property stdset="1">
899 <name>text</name> 1076 <name>text</name>
900 <string>Fake Mac:</string> 1077 <string>Fake Mac:</string>
901 </property> 1078 </property>
902 </widget> 1079 </widget>
903 <widget row="1" column="0" rowspan="1" colspan="2" > 1080 <widget row="1" column="0" rowspan="1" colspan="2" >
904 <class>QCheckBox</class> 1081 <class>QCheckBox</class>
905 <property stdset="1"> 1082 <property stdset="1">
906 <name>name</name> 1083 <name>name</name>
907 <cstring>sendProbeRequests</cstring> 1084 <cstring>sendProbeRequests</cstring>
908 </property> 1085 </property>
909 <property stdset="1"> 1086 <property stdset="1">
910 <name>text</name> 1087 <name>text</name>
911 <string>Send proble requests</string> 1088 <string>Send proble requests</string>
912 </property> 1089 </property>
913 </widget> 1090 </widget>
914 <widget row="0" column="1" > 1091 <widget row="0" column="1" >
915 <class>QComboBox</class> 1092 <class>QComboBox</class>
916 <item> 1093 <item>
917 <property> 1094 <property>
918 <name>text</name> 1095 <name>text</name>
919 <string>&lt;automatic&gt;</string> 1096 <string>&lt;automatic&gt;</string>
920 </property> 1097 </property>
921 </item> 1098 </item>
922 <item> 1099 <item>
923 <property> 1100 <property>
924 <name>text</name> 1101 <name>text</name>
925 <string>44:44:44:44:44:44</string> 1102 <string>44:44:44:44:44:44</string>
926 </property> 1103 </property>
927 </item> 1104 </item>
928 <property stdset="1"> 1105 <property stdset="1">
929 <name>name</name> 1106 <name>name</name>
930 <cstring>fakeMac</cstring> 1107 <cstring>fakeMac</cstring>
931 </property> 1108 </property>
932 <property stdset="1"> 1109 <property stdset="1">
933 <name>sizePolicy</name> 1110 <name>sizePolicy</name>
934 <sizepolicy> 1111 <sizepolicy>
935 <hsizetype>7</hsizetype> 1112 <hsizetype>7</hsizetype>
936 <vsizetype>0</vsizetype> 1113 <vsizetype>0</vsizetype>
937 </sizepolicy> 1114 </sizepolicy>
938 </property> 1115 </property>
939 <property stdset="1"> 1116 <property stdset="1">
940 <name>editable</name> 1117 <name>editable</name>
941 <bool>true</bool> 1118 <bool>true</bool>
942 </property> 1119 </property>
943 <property stdset="1"> 1120 <property stdset="1">
944 <name>currentItem</name> 1121 <name>currentItem</name>
945 <number>1</number> 1122 <number>1</number>
946 </property> 1123 </property>
947 <property stdset="1"> 1124 <property stdset="1">
948 <name>autoCompletion</name> 1125 <name>autoCompletion</name>
949 <bool>true</bool> 1126 <bool>true</bool>
950 </property> 1127 </property>
951 </widget> 1128 </widget>
952 <widget row="2" column="0" rowspan="1" colspan="2" > 1129 <widget row="2" column="0" rowspan="1" colspan="2" >
953 <class>QCheckBox</class> 1130 <class>QCheckBox</class>
954 <property stdset="1"> 1131 <property stdset="1">
955 <name>name</name> 1132 <name>name</name>
956 <cstring>tryToAuthenticate</cstring> 1133 <cstring>tryToAuthenticate</cstring>
957 </property> 1134 </property>
958 <property stdset="1"> 1135 <property stdset="1">
959 <name>text</name> 1136 <name>text</name>
960 <string>Try to authenticate</string> 1137 <string>Try to authenticate</string>
961 </property> 1138 </property>
962 </widget> 1139 </widget>
963 </grid> 1140 </grid>
964 </widget> 1141 </widget>
965 <widget row="0" column="0" > 1142 <widget row="0" column="0" >
966 <class>QCheckBox</class> 1143 <class>QCheckBox</class>
967 <property stdset="1"> 1144 <property stdset="1">
968 <name>name</name> 1145 <name>name</name>
969 <cstring>enableActiveScanning</cstring> 1146 <cstring>enableActiveScanning</cstring>
970 </property> 1147 </property>
971 <property stdset="1"> 1148 <property stdset="1">
972 <name>enabled</name> 1149 <name>enabled</name>
973 <bool>false</bool> 1150 <bool>false</bool>
974 </property> 1151 </property>
975 <property stdset="1"> 1152 <property stdset="1">
976 <name>text</name> 1153 <name>text</name>
977 <string>Enable active scanning</string> 1154 <string>Enable active scanning</string>
978 </property> 1155 </property>
979 </widget> 1156 </widget>
980 <widget row="2" column="0" > 1157 <widget row="2" column="0" >
981 <class>QGroupBox</class> 1158 <class>QGroupBox</class>
982 <property stdset="1"> 1159 <property stdset="1">
983 <name>name</name> 1160 <name>name</name>
984 <cstring>GroupBox4</cstring> 1161 <cstring>GroupBox4</cstring>
985 </property> 1162 </property>
986 <property stdset="1"> 1163 <property stdset="1">
987 <name>enabled</name> 1164 <name>enabled</name>
988 <bool>false</bool> 1165 <bool>false</bool>
989 </property> 1166 </property>
990 <property stdset="1"> 1167 <property stdset="1">
991 <name>title</name> 1168 <name>title</name>
992 <string>IP Level</string> 1169 <string>IP Level</string>
993 </property> 1170 </property>
994 <grid> 1171 <grid>
995 <property stdset="1"> 1172 <property stdset="1">
996 <name>margin</name> 1173 <name>margin</name>
997 <number>11</number> 1174 <number>11</number>
998 </property> 1175 </property>
999 <property stdset="1"> 1176 <property stdset="1">
1000 <name>spacing</name> 1177 <name>spacing</name>
1001 <number>6</number> 1178 <number>6</number>
1002 </property> 1179 </property>
1003 <widget row="1" column="0" rowspan="1" colspan="2" > 1180 <widget row="1" column="0" rowspan="1" colspan="2" >
1004 <class>QCheckBox</class> 1181 <class>QCheckBox</class>
1005 <property stdset="1"> 1182 <property stdset="1">
1006 <name>name</name> 1183 <name>name</name>
1007 <cstring>CheckBox24</cstring> 1184 <cstring>CheckBox24</cstring>
1008 </property> 1185 </property>
1009 <property stdset="1"> 1186 <property stdset="1">
1010 <name>text</name> 1187 <name>text</name>
1011 <string>Request DHCP Address</string> 1188 <string>Request DHCP Address</string>
1012 </property> 1189 </property>
1013 </widget> 1190 </widget>
1014 <widget row="0" column="0" > 1191 <widget row="0" column="0" >
1015 <class>QLabel</class> 1192 <class>QLabel</class>
1016 <property stdset="1"> 1193 <property stdset="1">
1017 <name>name</name> 1194 <name>name</name>
1018 <cstring>TextLabel1_5_2</cstring> 1195 <cstring>TextLabel1_5_2</cstring>
1019 </property> 1196 </property>
1020 <property stdset="1"> 1197 <property stdset="1">
1021 <name>text</name> 1198 <name>text</name>
1022 <string>Fake IP:</string> 1199 <string>Fake IP:</string>
1023 </property> 1200 </property>
1024 </widget> 1201 </widget>
1025 <widget row="0" column="1" > 1202 <widget row="0" column="1" >
1026 <class>QComboBox</class> 1203 <class>QComboBox</class>
1027 <item> 1204 <item>
1028 <property> 1205 <property>
1029 <name>text</name> 1206 <name>text</name>
1030 <string>192.168.125.1</string> 1207 <string>192.168.125.1</string>
1031 </property> 1208 </property>
1032 </item> 1209 </item>
1033 <item> 1210 <item>
1034 <property> 1211 <property>
1035 <name>text</name> 1212 <name>text</name>
1036 <string>&lt;automatic&gt;</string> 1213 <string>&lt;automatic&gt;</string>
1037 </property> 1214 </property>
1038 </item> 1215 </item>
1039 <property stdset="1"> 1216 <property stdset="1">
1040 <name>name</name> 1217 <name>name</name>
1041 <cstring>fakeIP</cstring> 1218 <cstring>fakeIP</cstring>
1042 </property> 1219 </property>
1043 <property stdset="1"> 1220 <property stdset="1">
1044 <name>sizePolicy</name> 1221 <name>sizePolicy</name>
1045 <sizepolicy> 1222 <sizepolicy>
1046 <hsizetype>7</hsizetype> 1223 <hsizetype>7</hsizetype>
1047 <vsizetype>0</vsizetype> 1224 <vsizetype>0</vsizetype>
1048 </sizepolicy> 1225 </sizepolicy>
1049 </property> 1226 </property>
1050 <property stdset="1"> 1227 <property stdset="1">
1051 <name>editable</name> 1228 <name>editable</name>
1052 <bool>true</bool> 1229 <bool>true</bool>
1053 </property> 1230 </property>
1054 <property stdset="1"> 1231 <property stdset="1">
1055 <name>currentItem</name> 1232 <name>currentItem</name>
1056 <number>0</number> 1233 <number>0</number>
1057 </property> 1234 </property>
1058 </widget> 1235 </widget>
1059 </grid> 1236 </grid>
1060 </widget> 1237 </widget>
1061 </grid> 1238 </grid>
1062 </widget> 1239 </widget>
1063 <widget> 1240 <widget>
1064 <class>QWidget</class> 1241 <class>QWidget</class>
1065 <property stdset="1"> 1242 <property stdset="1">
1066 <name>name</name> 1243 <name>name</name>
1067 <cstring>tab</cstring> 1244 <cstring>tab</cstring>
1068 </property> 1245 </property>
1069 <attribute> 1246 <attribute>
1070 <name>title</name> 1247 <name>title</name>
1071 <string>GPS</string> 1248 <string>GPS</string>
1072 </attribute> 1249 </attribute>
1073 <grid> 1250 <grid>
1074 <property stdset="1"> 1251 <property stdset="1">
1075 <name>margin</name> 1252 <name>margin</name>
1076 <number>5</number> 1253 <number>5</number>
1077 </property> 1254 </property>
1078 <property stdset="1"> 1255 <property stdset="1">
1079 <name>spacing</name> 1256 <name>spacing</name>
1080 <number>4</number> 1257 <number>4</number>
1081 </property> 1258 </property>
1082 <widget row="0" column="0" > 1259 <widget row="0" column="0" >
1083 <class>QLayoutWidget</class> 1260 <class>QLayoutWidget</class>
1084 <property stdset="1"> 1261 <property stdset="1">
1085 <name>name</name> 1262 <name>name</name>
1086 <cstring>Layout6</cstring> 1263 <cstring>Layout6</cstring>
1087 </property> 1264 </property>
1088 <vbox> 1265 <vbox>
1089 <property stdset="1"> 1266 <property stdset="1">
1090 <name>margin</name> 1267 <name>margin</name>
1091 <number>0</number> 1268 <number>0</number>
1092 </property> 1269 </property>
1093 <property stdset="1"> 1270 <property stdset="1">
1094 <name>spacing</name> 1271 <name>spacing</name>
1095 <number>6</number> 1272 <number>6</number>
1096 </property> 1273 </property>
1097 <widget> 1274 <widget>
1098 <class>QCheckBox</class> 1275 <class>QCheckBox</class>
1099 <property stdset="1"> 1276 <property stdset="1">
1100 <name>name</name> 1277 <name>name</name>
1101 <cstring>enableGPS</cstring> 1278 <cstring>enableGPS</cstring>
1102 </property> 1279 </property>
1103 <property stdset="1"> 1280 <property stdset="1">
1104 <name>text</name> 1281 <name>text</name>
1105 <string>Enable GPS logging w/ gpsd</string> 1282 <string>Enable GPS logging w/ gpsd</string>
1106 </property> 1283 </property>
1107 </widget> 1284 </widget>
1108 <widget> 1285 <widget>
1109 <class>QLayoutWidget</class> 1286 <class>QLayoutWidget</class>
1110 <property stdset="1"> 1287 <property stdset="1">
1111 <name>name</name> 1288 <name>name</name>
1112 <cstring>Layout1</cstring> 1289 <cstring>Layout1</cstring>
1113 </property> 1290 </property>
1114 <hbox> 1291 <hbox>
1115 <property stdset="1"> 1292 <property stdset="1">
1116 <name>margin</name> 1293 <name>margin</name>
1117 <number>0</number> 1294 <number>0</number>
1118 </property> 1295 </property>
1119 <property stdset="1"> 1296 <property stdset="1">
1120 <name>spacing</name> 1297 <name>spacing</name>
1121 <number>6</number> 1298 <number>6</number>
1122 </property> 1299 </property>
1123 <widget> 1300 <widget>
1124 <class>QLabel</class> 1301 <class>QLabel</class>
1125 <property stdset="1"> 1302 <property stdset="1">
1126 <name>name</name> 1303 <name>name</name>
1127 <cstring>TextLabel1_4</cstring> 1304 <cstring>TextLabel1_4</cstring>
1128 </property> 1305 </property>
1129 <property stdset="1"> 1306 <property stdset="1">
1130 <name>text</name> 1307 <name>text</name>
1131 <string>Host</string> 1308 <string>Host</string>
1132 </property> 1309 </property>
1133 </widget> 1310 </widget>
1134 <widget> 1311 <widget>
1135 <class>QComboBox</class> 1312 <class>QComboBox</class>
1136 <item> 1313 <item>
1137 <property> 1314 <property>
1138 <name>text</name> 1315 <name>text</name>
1139 <string>localhost</string> 1316 <string>localhost</string>
1140 </property> 1317 </property>
1141 </item> 1318 </item>
1142 <property stdset="1"> 1319 <property stdset="1">
1143 <name>name</name> 1320 <name>name</name>
1144 <cstring>gpsdHost</cstring> 1321 <cstring>gpsdHost</cstring>
1145 </property> 1322 </property>
1146 <property stdset="1"> 1323 <property stdset="1">
1147 <name>enabled</name> 1324 <name>enabled</name>
1148 <bool>false</bool> 1325 <bool>false</bool>
1149 </property> 1326 </property>
1150 <property stdset="1"> 1327 <property stdset="1">
1151 <name>editable</name> 1328 <name>editable</name>
1152 <bool>true</bool> 1329 <bool>true</bool>
1153 </property> 1330 </property>
1154 <property stdset="1"> 1331 <property stdset="1">
1155 <name>currentItem</name> 1332 <name>currentItem</name>
1156 <number>0</number> 1333 <number>0</number>
1157 </property> 1334 </property>
1158 </widget> 1335 </widget>
1159 <widget> 1336 <widget>
1160 <class>QLabel</class> 1337 <class>QLabel</class>
1161 <property stdset="1"> 1338 <property stdset="1">
1162 <name>name</name> 1339 <name>name</name>
1163 <cstring>TextLabel2_2</cstring> 1340 <cstring>TextLabel2_2</cstring>
1164 </property> 1341 </property>
1165 <property stdset="1"> 1342 <property stdset="1">
1166 <name>text</name> 1343 <name>text</name>
1167 <string>:</string> 1344 <string>:</string>
1168 </property> 1345 </property>
1169 </widget> 1346 </widget>
1170 <widget> 1347 <widget>
1171 <class>QSpinBox</class> 1348 <class>QSpinBox</class>
1172 <property stdset="1"> 1349 <property stdset="1">
1173 <name>name</name> 1350 <name>name</name>
1174 <cstring>gpsdPort</cstring> 1351 <cstring>gpsdPort</cstring>
1175 </property> 1352 </property>
1176 <property stdset="1"> 1353 <property stdset="1">
1177 <name>enabled</name> 1354 <name>enabled</name>
1178 <bool>false</bool> 1355 <bool>false</bool>
1179 </property> 1356 </property>
1180 <property stdset="1"> 1357 <property stdset="1">
1181 <name>maxValue</name> 1358 <name>maxValue</name>
1182 <number>65535</number> 1359 <number>65535</number>
1183 </property> 1360 </property>
1184 <property stdset="1"> 1361 <property stdset="1">
1185 <name>minValue</name> 1362 <name>minValue</name>
1186 <number>1024</number> 1363 <number>1024</number>
1187 </property> 1364 </property>
1188 <property stdset="1"> 1365 <property stdset="1">
1189 <name>value</name> 1366 <name>value</name>
1190 <number>2947</number> 1367 <number>2947</number>
1191 </property> 1368 </property>
1192 </widget> 1369 </widget>
1193 </hbox> 1370 </hbox>
1194 </widget> 1371 </widget>
1195 <widget> 1372 <widget>
1196 <class>QCheckBox</class> 1373 <class>QCheckBox</class>
1197 <property stdset="1"> 1374 <property stdset="1">
1198 <name>name</name> 1375 <name>name</name>
1199 <cstring>startGPS</cstring> 1376 <cstring>startGPS</cstring>
1200 </property> 1377 </property>
1201 <property stdset="1"> 1378 <property stdset="1">
1202 <name>text</name> 1379 <name>text</name>
1203 <string>Start gpsd on localhost</string> 1380 <string>Start gpsd on localhost</string>
1204 </property> 1381 </property>
1205 </widget> 1382 </widget>
1206 <widget> 1383 <widget>
1207 <class>QLineEdit</class> 1384 <class>QLineEdit</class>
1208 <property stdset="1"> 1385 <property stdset="1">
1209 <name>name</name> 1386 <name>name</name>
1210 <cstring>commandGPS</cstring> 1387 <cstring>commandGPS</cstring>
1211 </property> 1388 </property>
1212 <property stdset="1"> 1389 <property stdset="1">
1213 <name>enabled</name> 1390 <name>enabled</name>
1214 <bool>false</bool> 1391 <bool>false</bool>
1215 </property> 1392 </property>
1216 <property stdset="1"> 1393 <property stdset="1">
1217 <name>text</name> 1394 <name>text</name>
1218 <string>gpsd -p /dev/ttyS3 -s 57600</string> 1395 <string>gpsd -p /dev/ttyS3 -s 57600</string>
1219 </property> 1396 </property>
1220 </widget> 1397 </widget>
1221 <spacer> 1398 <spacer>
1222 <property> 1399 <property>
1223 <name>name</name> 1400 <name>name</name>
1224 <cstring>Spacer4_2</cstring> 1401 <cstring>Spacer4_2</cstring>
1225 </property> 1402 </property>
1226 <property stdset="1"> 1403 <property stdset="1">
1227 <name>orientation</name> 1404 <name>orientation</name>
1228 <enum>Vertical</enum> 1405 <enum>Vertical</enum>
diff --git a/noncore/net/wellenreiter/gui/configwindow.cpp b/noncore/net/wellenreiter/gui/configwindow.cpp
index f536f4e..1341d03 100644
--- a/noncore/net/wellenreiter/gui/configwindow.cpp
+++ b/noncore/net/wellenreiter/gui/configwindow.cpp
@@ -1,347 +1,436 @@
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 "configwindow.h" 17#include "configwindow.h"
18#include "mainwindow.h" 18#include "mainwindow.h"
19 19
20/* OPIE */
21#include <opie2/onetwork.h>
22#ifdef QWS
23#include <opie2/oapplication.h>
24#include <opie2/oconfig.h>
25#endif
26
20/* QT */ 27/* QT */
21#include <qapplication.h> 28#include <qapplication.h>
22#include <qcheckbox.h> 29#include <qcheckbox.h>
23#include <qcombobox.h> 30#include <qcombobox.h>
24#include <qfile.h> 31#include <qfile.h>
25#include <qlineedit.h> 32#include <qlineedit.h>
26#include <qlayout.h> 33#include <qlayout.h>
27#include <qmap.h> 34#include <qmap.h>
28#include <qpushbutton.h> 35#include <qpushbutton.h>
36#include <qtabwidget.h>
29#include <qtoolbutton.h> 37#include <qtoolbutton.h>
30#include <qspinbox.h> 38#include <qspinbox.h>
31#include <qtextstream.h> 39#include <qtextstream.h>
32 40
33/* OPIE */
34#include <opie2/onetwork.h>
35
36#ifdef QWS
37#include <opie2/oapplication.h>
38#include <opie2/oconfig.h>
39#endif
40 41
41WellenreiterConfigWindow* WellenreiterConfigWindow::_instance = 0; 42WellenreiterConfigWindow* WellenreiterConfigWindow::_instance = 0;
42 43
43WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char * name, WFlags f ) 44WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char * name, WFlags f )
44 :WellenreiterConfigBase( parent, name, true, f ) 45 :WellenreiterConfigBase( parent, name, true, f )
45{ 46{
46 _devicetype[ "cisco" ] = DEVTYPE_CISCO; 47 _devicetype[ "cisco" ] = DEVTYPE_CISCO;
47 _devicetype[ "wlan-ng" ] = DEVTYPE_WLAN_NG; 48 _devicetype[ "wlan-ng" ] = DEVTYPE_WLAN_NG;
48 _devicetype[ "hostap" ] = DEVTYPE_HOSTAP; 49 _devicetype[ "hostap" ] = DEVTYPE_HOSTAP;
49 _devicetype[ "orinoco" ] = DEVTYPE_ORINOCO; 50 _devicetype[ "orinoco" ] = DEVTYPE_ORINOCO;
50 _devicetype[ "<manual>" ] = DEVTYPE_MANUAL; 51 _devicetype[ "<manual>" ] = DEVTYPE_MANUAL;
51 _devicetype[ "<file>" ] = DEVTYPE_FILE; 52 _devicetype[ "<file>" ] = DEVTYPE_FILE;
52 53
53 // gather possible interface names from ONetwork 54 // gather possible interface names from ONetwork
54 ONetwork* net = ONetwork::instance(); 55 ONetwork* net = ONetwork::instance();
55 ONetwork::InterfaceIterator it = net->iterator(); 56 ONetwork::InterfaceIterator it = net->iterator();
56 while ( it.current() ) 57 while ( it.current() )
57 { 58 {
58 if ( it.current()->isWireless() ) 59 if ( it.current()->isWireless() )
59 interfaceName->insertItem( it.current()->name() ); 60 interfaceName->insertItem( it.current()->name() );
60 ++it; 61 ++it;
61 } 62 }
62 63
63 load(); 64 load();
64 65
65 #ifdef Q_WS_X11 // We're on X11: adding an Ok-Button for the Dialog here 66 #ifdef Q_WS_X11 // We're on X11: adding an Ok-Button for the Dialog here
66 QPushButton* okButton = new QPushButton( "ok", this ); 67 QPushButton* okButton = new QPushButton( "ok", this );
67 okButton->show(); 68 okButton->show();
68 WellenreiterConfigBaseLayout->addWidget( okButton, 0, 3 ); //FIXME: rename this in configbase.ui 69 WellenreiterConfigBaseLayout->addWidget( okButton, 0, 3 ); //FIXME: rename this in configbase.ui
69 connect( okButton, SIGNAL( clicked() ), this, SLOT( accept() ) ); 70 connect( okButton, SIGNAL( clicked() ), this, SLOT( accept() ) );
70 #endif 71 #endif
71 72
72 WellenreiterConfigWindow::_instance = this; 73 WellenreiterConfigWindow::_instance = this;
73 74
74 connect( deviceType, SIGNAL( activated(int) ), this, SLOT( changedDeviceType(int) ) ); 75 connect( deviceType, SIGNAL( activated(int) ), this, SLOT( changedDeviceType(int) ) );
76 connect( newNetworkAction, SIGNAL( activated(int) ), this, SLOT( changedNetworkAction(int) ) );
77 connect( newClientAction, SIGNAL( activated(int) ), this, SLOT( changedClientAction(int) ) );
78 connect( newStationAction, SIGNAL( activated(int) ), this, SLOT( changedStationAction(int) ) );
75 connect( getCaptureFileName, SIGNAL( clicked() ), this, SLOT( getCaptureFileNameClicked() ) ); 79 connect( getCaptureFileName, SIGNAL( clicked() ), this, SLOT( getCaptureFileNameClicked() ) );
76 80
77 // make the checkbox 'channelAll' control all other channels 81 // make the checkbox 'channelAll' control all other channels
78 connect( channelAll, SIGNAL( stateChanged(int) ), this, SLOT( channelAllClicked(int) ) ); 82 connect( channelAll, SIGNAL( stateChanged(int) ), this, SLOT( channelAllClicked(int) ) );
79 83
80 connect( autodetect, SIGNAL( clicked() ), this, SLOT( performAutodetection() ) ); 84 connect( autodetect, SIGNAL( clicked() ), this, SLOT( performAutodetection() ) );
85
86 // hide tab4 (parse) until Wellenreiter 1.2
87 tab->removePage( tab_4 );
81}; 88};
82 89
83 90
84WellenreiterConfigWindow::~WellenreiterConfigWindow() 91WellenreiterConfigWindow::~WellenreiterConfigWindow()
85{ 92{
86 save(); 93 save();
87} 94}
88 95
89 96
90void WellenreiterConfigWindow::performAutodetection() 97void WellenreiterConfigWindow::performAutodetection()
91{ 98{
92 //TODO: insert modal splash screen here 99 //TODO: insert modal splash screen here
93 // and sleep a second, so that it looks 100 // and sleep a second, so that it looks
94 // like we're actually doing something fancy... ;-) 101 // like we're actually doing something fancy... ;-)
95 102
96 qDebug( "WellenreiterConfigWindow::performAutodetection()" ); 103 qDebug( "WellenreiterConfigWindow::performAutodetection()" );
97 104
98 // try to guess device type 105 // try to guess device type
99 QFile m( "/proc/modules" ); 106 QFile m( "/proc/modules" );
100 if ( m.open( IO_ReadOnly ) ) 107 if ( m.open( IO_ReadOnly ) )
101 { 108 {
102 int devicetype(0); 109 int devicetype(0);
103 QString line; 110 QString line;
104 QTextStream modules( &m ); 111 QTextStream modules( &m );
105 while( !modules.atEnd() && !devicetype ) 112 while( !modules.atEnd() && !devicetype )
106 { 113 {
107 modules >> line; 114 modules >> line;
108 if ( line.contains( "cisco" ) ) devicetype = DEVTYPE_CISCO; 115 if ( line.contains( "cisco" ) ) devicetype = DEVTYPE_CISCO;
109 else if ( line.contains( "hostap" ) ) devicetype = DEVTYPE_HOSTAP; 116 else if ( line.contains( "hostap" ) ) devicetype = DEVTYPE_HOSTAP;
110 else if ( line.contains( "prism" ) ) devicetype = DEVTYPE_WLAN_NG; 117 else if ( line.contains( "prism" ) ) devicetype = DEVTYPE_WLAN_NG;
111 else if ( line.contains( "orinoco" ) ) devicetype = DEVTYPE_ORINOCO; 118 else if ( line.contains( "orinoco" ) ) devicetype = DEVTYPE_ORINOCO;
112 } 119 }
113 if ( devicetype ) 120 if ( devicetype )
114 { 121 {
115 deviceType->setCurrentItem( devicetype ); 122 deviceType->setCurrentItem( devicetype );
116 _guess = devicetype; 123 _guess = devicetype;
117 qDebug( "Wellenreiter: guessed device type to be #%d", devicetype ); 124 qDebug( "Wellenreiter: guessed device type to be #%d", devicetype );
118 } 125 }
119 } 126 }
120} 127}
121 128
122 129
123int WellenreiterConfigWindow::driverType() const 130int WellenreiterConfigWindow::driverType() const
124{ 131{
125 QString name = deviceType->currentText(); 132 QString name = deviceType->currentText();
126 if ( _devicetype.contains( name ) ) 133 if ( _devicetype.contains( name ) )
127 { 134 {
128 return _devicetype[name]; 135 return _devicetype[name];
129 } 136 }
130 else 137 else
131 { 138 {
132 return 0; 139 return 0;
133 } 140 }
134}; 141};
135 142
136 143
137int WellenreiterConfigWindow::hoppingInterval() const 144int WellenreiterConfigWindow::hoppingInterval() const
138{ 145{
139 return hopInterval->cleanText().toInt(); 146 return hopInterval->cleanText().toInt();
140} 147}
141 148
142 149
143bool WellenreiterConfigWindow::usePrismHeader() const 150bool WellenreiterConfigWindow::usePrismHeader() const
144{ 151{
145 return prismHeader->isChecked(); 152 return prismHeader->isChecked();
146} 153}
147 154
148 155
149bool WellenreiterConfigWindow::isChannelChecked( int channel ) const 156bool WellenreiterConfigWindow::isChannelChecked( int channel ) const
150{ 157{
151 switch ( channel ) 158 switch ( channel )
152 { 159 {
153 case 1: return channel1->isOn(); 160 case 1: return channel1->isOn();
154 case 2: return channel2->isOn(); 161 case 2: return channel2->isOn();
155 case 3: return channel3->isOn(); 162 case 3: return channel3->isOn();
156 case 4: return channel4->isOn(); 163 case 4: return channel4->isOn();
157 case 5: return channel5->isOn(); 164 case 5: return channel5->isOn();
158 case 6: return channel6->isOn(); 165 case 6: return channel6->isOn();
159 case 7: return channel7->isOn(); 166 case 7: return channel7->isOn();
160 case 8: return channel8->isOn(); 167 case 8: return channel8->isOn();
161 case 9: return channel9->isOn(); 168 case 9: return channel9->isOn();
162 case 10: return channel10->isOn(); 169 case 10: return channel10->isOn();
163 case 11: return channel11->isOn(); 170 case 11: return channel11->isOn();
164 case 12: return channel12->isOn(); 171 case 12: return channel12->isOn();
165 case 13: return channel13->isOn(); 172 case 13: return channel13->isOn();
166 case 14: return channel14->isOn(); 173 case 14: return channel14->isOn();
167 } 174 }
168} 175}
169 176
170 177
171void WellenreiterConfigWindow::changedDeviceType(int t) 178void WellenreiterConfigWindow::changedDeviceType(int t)
172{ 179{
173 if ( t != DEVTYPE_FILE ) return; 180 if ( t != DEVTYPE_FILE ) return;
174 QString name = ( (WellenreiterMainWindow*) qApp->mainWidget() )->getFileName(false); 181 QString name = ( (WellenreiterMainWindow*) qApp->mainWidget() )->getFileName(false);
175 if ( !name.isEmpty() && QFile::exists( name ) ) 182 if ( !name.isEmpty() && QFile::exists( name ) )
176 { 183 {
177 interfaceName->insertItem( name ); 184 interfaceName->insertItem( name );
178 interfaceName->setCurrentItem( interfaceName->count()-1 ); 185 interfaceName->setCurrentItem( interfaceName->count()-1 );
179 } 186 }
180 else 187 else
181 { 188 {
182 deviceType->setCurrentItem( _guess ); 189 deviceType->setCurrentItem( _guess );
183 } 190 }
184 191
185} 192}
186 193
187 194
195void WellenreiterConfigWindow::synchronizeActionsAndScripts()
196{
197 if ( newNetworkAction->currentItem() == 4 ) newNetworkScript->show(); else newNetworkScript->hide();
198 if ( newClientAction->currentItem() == 4 ) newClientScript->show(); else newClientScript->hide();
199 if ( newStationAction->currentItem() == 4 ) newStationScript->show(); else newStationScript->hide();
200
201 //newNetworkScript->setEnabled( newNetworkAction->currentItem() == 4 );
202 //newClientScript->setEnabled( newClientAction->currentItem() == 4 );
203 //newStationScript->setEnabled( newStationAction->currentItem() == 4 );
204}
205
206
207void WellenreiterConfigWindow::changedNetworkAction(int t)
208{
209 synchronizeActionsAndScripts();
210}
211
212
213void WellenreiterConfigWindow::changedClientAction(int t)
214{
215 synchronizeActionsAndScripts();
216}
217
218
219void WellenreiterConfigWindow::changedStationAction(int t)
220{
221 synchronizeActionsAndScripts();
222}
223
224
188void WellenreiterConfigWindow::getCaptureFileNameClicked() 225void WellenreiterConfigWindow::getCaptureFileNameClicked()
189{ 226{
190 QString name = ( (WellenreiterMainWindow*) qApp->mainWidget() )->getFileName(true); 227 QString name = ( (WellenreiterMainWindow*) qApp->mainWidget() )->getFileName(true);
191 qDebug( "name = %s", (const char*) name ); 228 qDebug( "name = %s", (const char*) name );
192 if ( !name.isEmpty() ) 229 if ( !name.isEmpty() )
193 { 230 {
194 captureFileName->setText( name ); 231 captureFileName->setText( name );
195 } 232 }
196} 233}
197 234
198 235
199void WellenreiterConfigWindow::channelAllClicked(int state) 236void WellenreiterConfigWindow::channelAllClicked(int state)
200{ 237{
201 bool b = state; 238 bool b = state;
202 channel1->setChecked( b ); 239 channel1->setChecked( b );
203 channel2->setChecked( b ); 240 channel2->setChecked( b );
204 channel3->setChecked( b ); 241 channel3->setChecked( b );
205 channel4->setChecked( b ); 242 channel4->setChecked( b );
206 channel5->setChecked( b ); 243 channel5->setChecked( b );
207 channel6->setChecked( b ); 244 channel6->setChecked( b );
208 channel7->setChecked( b ); 245 channel7->setChecked( b );
209 channel8->setChecked( b ); 246 channel8->setChecked( b );
210 channel9->setChecked( b ); 247 channel9->setChecked( b );
211 channel10->setChecked( b ); 248 channel10->setChecked( b );
212 channel11->setChecked( b ); 249 channel11->setChecked( b );
213 channel12->setChecked( b ); 250 channel12->setChecked( b );
214 channel13->setChecked( b ); 251 channel13->setChecked( b );
215 channel14->setChecked( b ); 252 channel14->setChecked( b );
216} 253}
217 254
218 255
219bool WellenreiterConfigWindow::useGPS() const 256bool WellenreiterConfigWindow::useGPS() const
220{ 257{
221 return enableGPS->isChecked(); 258 return enableGPS->isChecked();
222} 259}
223 260
224 261
225const QString WellenreiterConfigWindow::gpsHost() const 262const QString WellenreiterConfigWindow::gpsHost() const
226{ 263{
227 return useGPS() ? gpsdHost->currentText() : QString::null; 264 return useGPS() ? gpsdHost->currentText() : QString::null;
228} 265}
229 266
230 267
231int WellenreiterConfigWindow::gpsPort() const 268int WellenreiterConfigWindow::gpsPort() const
232{ 269{
233 bool ok; 270 bool ok;
234 return useGPS() ? gpsdPort->value() : -1; 271 return useGPS() ? gpsdPort->value() : -1;
235} 272}
236 273
237 274
275void WellenreiterConfigWindow::performAction( const QString& type )
276{
277 int action;
278 QString script;
279
280 if ( type == "network" )
281 {
282 action = newNetworkAction->currentItem();
283 script = newNetworkScript->text();
284 }
285 else if ( type == "managed" || type == "adhoc" )
286 {
287 action = newClientAction->currentItem();
288 script = newClientScript->text();
289 }
290 else if ( type == "station" )
291 {
292 action = newStationAction->currentItem();
293 script = newStationScript->text();
294 }
295 else
296 {
297 qWarning( "WellenreiterConfigWindow::performAction(): unknown type '%s'", (const char*) type );
298 return;
299 }
300
301 qDebug( "going to perform action %d (script='%s')", action, (const char*) script );
302
303 /*
304
305 if ( sound == "Ignore" ) return;
306 else if ( sound == "Touch" ) ODevice::inst()->touchSound();
307 else if ( sound == "Key" ) ODevice::inst()->keySound();
308 else if ( sound == "Alarm" ) ODevice::inst()->alarmSound();
309
310 */
311}
312
313
238void WellenreiterConfigWindow::load() 314void WellenreiterConfigWindow::load()
239{ 315{
240#ifdef Q_WS_X11 316#ifdef Q_WS_X11
241 #warning Persistent Configuration not yet implemented for standalone X11 build 317 #warning Persistent Configuration not yet implemented for standalone X11 build
242 performAutodetection(); 318 performAutodetection();
243#else 319#else
244 qDebug( "loading configuration settings..." ); 320 qDebug( "loading configuration settings..." );
245 321
246 /* This is dumb monkey typing stuff... We _need_ to do this automatically! */ 322 /* This is dumb monkey typing stuff... We _need_ to do this automatically! */
247 323
248 OConfig* c = oApp->config(); 324 OConfig* c = oApp->config();
249 325
250 c->setGroup( "Interface" ); 326 c->setGroup( "Interface" );
251 327
252 QString interface = c->readEntry( "name", "<none>" ); 328 QString interface = c->readEntry( "name", "<none>" );
253 if ( interface != "<none>" ) 329 if ( interface != "<none>" )
254 { 330 {
255#if QT_VERSION < 300 331#if QT_VERSION < 300
256 interfaceName->insertItem( interface, 0 ); 332 interfaceName->insertItem( interface, 0 );
257 interfaceName->setCurrentItem( 0 ); 333 interfaceName->setCurrentItem( 0 );
258#else 334#else
259 interfaceName->setCurrentText( interface ); 335 interfaceName->setCurrentText( interface );
260#endif 336#endif
261 337
262 QString device = c->readEntry( "type", "<select>" ); 338 QString device = c->readEntry( "type", "<select>" );
263#if QT_VERSION < 300 339#if QT_VERSION < 300
264 for ( int i = 0; i < deviceType->count(); ++i ) 340 for ( int i = 0; i < deviceType->count(); ++i )
265 { 341 {
266 if ( deviceType->text( i ) == device ) 342 if ( deviceType->text( i ) == device )
267 { 343 {
268 deviceType->setCurrentItem( i ); 344 deviceType->setCurrentItem( i );
269 break; 345 break;
270 } 346 }
271 } 347 }
272#else 348#else
273 deviceType->setCurrentText( device ); 349 deviceType->setCurrentText( device );
274#endif 350#endif
275 } 351 }
276 else 352 else
277 { 353 {
278 performAutodetection(); 354 performAutodetection();
279 } 355 }
280 356
281 prismHeader->setChecked( c->readBoolEntry( "prism", false ) ); 357 prismHeader->setChecked( c->readBoolEntry( "prism", false ) );
282 hopChannels->setChecked( c->readBoolEntry( "hop", true ) ); 358 hopChannels->setChecked( c->readBoolEntry( "hop", true ) );
283 hopInterval->setValue( c->readNumEntry( "interval", 250 ) ); 359 hopInterval->setValue( c->readNumEntry( "interval", 250 ) );
284 adaptiveHopping->setChecked( c->readBoolEntry( "adaptive", true ) ); 360 adaptiveHopping->setChecked( c->readBoolEntry( "adaptive", true ) );
285 361
286 c->setGroup( "Capture" ); 362 c->setGroup( "Capture" );
287 captureFileName->setText( c->readEntry( "filename", "/tmp/capture" ) ); 363 captureFileName->setText( c->readEntry( "filename", "/tmp/capture" ) );
288 364
289 c->setGroup( "UI" ); 365 c->setGroup( "UI" );
290 lookupVendor->setChecked( c->readBoolEntry( "lookupVendor", true ) ); 366 lookupVendor->setChecked( c->readBoolEntry( "lookupVendor", true ) );
291 openTree->setChecked( c->readBoolEntry( "openTree", true ) ); 367 openTree->setChecked( c->readBoolEntry( "openTree", true ) );
292 disablePM->setChecked( c->readBoolEntry( "disablePM", true ) ); 368 disablePM->setChecked( c->readBoolEntry( "disablePM", true ) );
369 newNetworkAction->setCurrentItem( c->readNumEntry( "newNetworkAction", 0 ) );
370 newNetworkScript->setText( c->readEntry( "newNetworkScript", "" ) );
371 newClientAction->setCurrentItem( c->readNumEntry( "newClientAction", 0 ) );
372 newClientScript->setText( c->readEntry( "newClientScript", "" ) );
373 newStationAction->setCurrentItem( c->readNumEntry( "newStationAction", 0 ) );
374 newStationScript->setText( c->readEntry( "newStationScript", "" ) );
375 synchronizeActionsAndScripts(); // needed for showing/hiding the script QLineEdit on demand
293 376
294 c->setGroup( "GPS" ); 377 c->setGroup( "GPS" );
295 enableGPS->setChecked( c->readBoolEntry( "use", false ) ); 378 enableGPS->setChecked( c->readBoolEntry( "use", false ) );
296#if QT_VERSION < 300 379#if QT_VERSION < 300
297 gpsdHost->insertItem( c->readEntry( "host", "localhost" ), 0 ); 380 gpsdHost->insertItem( c->readEntry( "host", "localhost" ), 0 );
298 gpsdHost->setCurrentItem( 0 ); 381 gpsdHost->setCurrentItem( 0 );
299#else 382#else
300 gpsdHost->setCurrentText( c->readEntry( "host", "localhost" ) ); 383 gpsdHost->setCurrentText( c->readEntry( "host", "localhost" ) );
301#endif 384#endif
302 gpsdPort->setValue( c->readNumEntry( "port", 2947 ) ); 385 gpsdPort->setValue( c->readNumEntry( "port", 2947 ) );
303 startGPS->setChecked( c->readBoolEntry( "start", false ) ); 386 startGPS->setChecked( c->readBoolEntry( "start", false ) );
304 commandGPS->setText( c->readEntry( "command", "gpsd -p /dev/ttyS3 -s 57600" ) ); 387 commandGPS->setText( c->readEntry( "command", "gpsd -p /dev/ttyS3 -s 57600" ) );
305 388
306#endif 389#endif
307} 390}
308 391
309 392
310void WellenreiterConfigWindow::save() 393void WellenreiterConfigWindow::save()
311{ 394{
312#ifdef Q_WS_X11 395#ifdef Q_WS_X11
313 #warning Persistent Configuration not yet implemented for standalone X11 build 396 #warning Persistent Configuration not yet implemented for standalone X11 build
314#else 397#else
315 qDebug( "saving configuration settings..." ); 398 qDebug( "saving configuration settings..." );
316 399
317 /* This is dumb monkey typing stuff... We _need_ to do this automatically! */ 400 /* This is dumb monkey typing stuff... We _need_ to do this automatically! */
318 401
319 OConfig* c = oApp->config(); 402 OConfig* c = oApp->config();
320 403
321 c->setGroup( "Interface" ); 404 c->setGroup( "Interface" );
322 c->writeEntry( "name", interfaceName->currentText() ); 405 c->writeEntry( "name", interfaceName->currentText() );
323 c->writeEntry( "type", deviceType->currentText() ); 406 c->writeEntry( "type", deviceType->currentText() );
324 c->writeEntry( "prism", prismHeader->isChecked() ); 407 c->writeEntry( "prism", prismHeader->isChecked() );
325 c->writeEntry( "hop", hopChannels->isChecked() ); 408 c->writeEntry( "hop", hopChannels->isChecked() );
326 c->writeEntry( "interval", hopInterval->value() ); 409 c->writeEntry( "interval", hopInterval->value() );
327 c->writeEntry( "adaptive", adaptiveHopping->isChecked() ); 410 c->writeEntry( "adaptive", adaptiveHopping->isChecked() );
328 411
329 c->setGroup( "Capture" ); 412 c->setGroup( "Capture" );
330 c->writeEntry( "filename", captureFileName->text() ); 413 c->writeEntry( "filename", captureFileName->text() );
331 414
332 c->setGroup( "UI" ); 415 c->setGroup( "UI" );
333 c->writeEntry( "lookupVendor", lookupVendor->isChecked() ); 416 c->writeEntry( "lookupVendor", lookupVendor->isChecked() );
334 c->writeEntry( "openTree", openTree->isChecked() ); 417 c->writeEntry( "openTree", openTree->isChecked() );
335 c->writeEntry( "disablePM", disablePM->isChecked() ); 418 c->writeEntry( "disablePM", disablePM->isChecked() );
419 c->writeEntry( "newNetworkAction", newNetworkAction->currentItem() );
420 c->writeEntry( "newNetworkScript", newNetworkScript->text() );
421 c->writeEntry( "newClientAction", newClientAction->currentItem() );
422 c->writeEntry( "newClientScript", newClientScript->text() );
423 c->writeEntry( "newStationAction", newStationAction->currentItem() );
424 c->writeEntry( "newStationScript", newStationScript->text() );
336 425
337 c->setGroup( "GPS" ); 426 c->setGroup( "GPS" );
338 c->writeEntry( "use", enableGPS->isChecked() ); 427 c->writeEntry( "use", enableGPS->isChecked() );
339 c->writeEntry( "host", gpsdHost->currentText() ); 428 c->writeEntry( "host", gpsdHost->currentText() );
340 c->writeEntry( "port", gpsdPort->value() ); 429 c->writeEntry( "port", gpsdPort->value() );
341 c->writeEntry( "start", startGPS->isChecked() ); 430 c->writeEntry( "start", startGPS->isChecked() );
342 c->writeEntry( "command", commandGPS->text() ); 431 c->writeEntry( "command", commandGPS->text() );
343 432
344 c->write(); 433 c->write();
345 434
346#endif 435#endif
347} 436}
diff --git a/noncore/net/wellenreiter/gui/configwindow.h b/noncore/net/wellenreiter/gui/configwindow.h
index 80b4d2b..b082331 100644
--- a/noncore/net/wellenreiter/gui/configwindow.h
+++ b/noncore/net/wellenreiter/gui/configwindow.h
@@ -1,71 +1,78 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. 2** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved.
3** 3**
4** This file is part of Opie Environment. 4** This file is part of Opie Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14**********************************************************************/ 14**********************************************************************/
15 15
16#ifndef WELLENREITERCONFIGWINDOW_H 16#ifndef WELLENREITERCONFIGWINDOW_H
17#define WELLENREITERCONFIGWINDOW_H 17#define WELLENREITERCONFIGWINDOW_H
18 18
19#include "configbase.h" 19#include "configbase.h"
20#include <qmap.h> 20#include <qmap.h>
21#include <qcombobox.h> 21#include <qcombobox.h>
22#include <qstring.h> 22#include <qstring.h>
23 23
24const int DEVTYPE_SELECT = 0; 24const int DEVTYPE_SELECT = 0;
25const int DEVTYPE_CISCO = 1; 25const int DEVTYPE_CISCO = 1;
26const int DEVTYPE_WLAN_NG = 2; 26const int DEVTYPE_WLAN_NG = 2;
27const int DEVTYPE_HOSTAP = 3; 27const int DEVTYPE_HOSTAP = 3;
28const int DEVTYPE_ORINOCO = 4; 28const int DEVTYPE_ORINOCO = 4;
29const int DEVTYPE_MANUAL = 5; 29const int DEVTYPE_MANUAL = 5;
30const int DEVTYPE_FILE = 6; 30const int DEVTYPE_FILE = 6;
31 31
32class WellenreiterConfigWindow; 32class WellenreiterConfigWindow;
33 33
34class WellenreiterConfigWindow : public WellenreiterConfigBase 34class WellenreiterConfigWindow : public WellenreiterConfigBase
35{ 35{
36 Q_OBJECT 36 Q_OBJECT
37 37
38 public: 38 public:
39 WellenreiterConfigWindow( QWidget * parent = 0, const char * name = "WellenreiterConfigWindow", WFlags f = 0 ); 39 WellenreiterConfigWindow( QWidget * parent = 0, const char * name = "WellenreiterConfigWindow", WFlags f = 0 );
40 ~WellenreiterConfigWindow(); 40 ~WellenreiterConfigWindow();
41 41
42 int driverType() const; 42 int driverType() const;
43 const QString soundOnNetwork() const { return "";/*netSound->currentText();*/ }; 43 const QString soundOnNetwork() const { return "";/*netSound->currentText();*/ };
44 const QString soundOnBeacon() const { return "";/*beaconSound->currentText();*/ }; 44 const QString soundOnBeacon() const { return "";/*beaconSound->currentText();*/ };
45 static WellenreiterConfigWindow* instance() { return _instance; }; 45 static WellenreiterConfigWindow* instance() { return _instance; };
46 46
47 int hoppingInterval() const; 47 int hoppingInterval() const;
48 bool usePrismHeader() const; 48 bool usePrismHeader() const;
49 bool isChannelChecked( int ) const; 49 bool isChannelChecked( int ) const;
50 50
51 bool useGPS() const; 51 bool useGPS() const;
52 const QString gpsHost() const; 52 const QString gpsHost() const;
53 int gpsPort() const; 53 int gpsPort() const;
54 54
55 void save(); 55 void save();
56 void load(); 56 void load();
57 57
58 public slots: 58 public slots:
59 void changedDeviceType(int); 59 void changedDeviceType(int);
60 void changedNetworkAction(int t);
61 void changedClientAction(int t);
62 void changedStationAction(int t);
60 void getCaptureFileNameClicked(); 63 void getCaptureFileNameClicked();
61 void performAutodetection(); 64 void performAutodetection();
62 void channelAllClicked(int); 65 void channelAllClicked(int);
66 void performAction( const QString& );
67
68 protected:
69 void synchronizeActionsAndScripts();
63 70
64 protected: 71 protected:
65 QMap<QString, int> _devicetype; 72 QMap<QString, int> _devicetype;
66 static WellenreiterConfigWindow* _instance; 73 static WellenreiterConfigWindow* _instance;
67 int _guess; 74 int _guess;
68 75
69}; 76};
70 77
71#endif 78#endif
diff --git a/noncore/net/wellenreiter/gui/gps.cpp b/noncore/net/wellenreiter/gui/gps.cpp
index 31f95ce..b814427 100644
--- a/noncore/net/wellenreiter/gui/gps.cpp
+++ b/noncore/net/wellenreiter/gui/gps.cpp
@@ -1,131 +1,131 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2003 Michael 'Mickey' Lauer. All rights reserved. 2** Copyright (C) 2003 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 "gps.h" 16#include "gps.h"
17 17
18/* QT */ 18/* QT */
19#include <qtextstream.h> 19#include <qtextstream.h>
20 20
21/* STD */ 21/* STD */
22#include <stdlib.h> 22#include <stdlib.h>
23#include <unistd.h> 23#include <unistd.h>
24 24
25GPS::GPS( QObject* parent, const char * name ) 25GPS::GPS( QObject* parent, const char * name )
26 :QObject( parent, name ) 26 :QObject( parent, name )
27{ 27{
28 qDebug( "GPS::GPS()" ); 28 qDebug( "GPS::GPS()" );
29 _socket = new QSocket( this, "gpsd commsock" ); 29 _socket = new QSocket( this, "gpsd commsock" );
30} 30}
31 31
32 32
33GPS::~GPS() 33GPS::~GPS()
34{ 34{
35 qDebug( "GPS::~GPS()" ); 35 qDebug( "GPS::~GPS()" );
36} 36}
37 37
38 38
39bool GPS::open( const QString& host, int port ) 39bool GPS::open( const QString& host, int port )
40{ 40{
41 _socket->connectToHost( host, port ); 41 _socket->connectToHost( host, port );
42} 42}
43 43
44 44
45GpsLocation GPS::position() const 45GpsLocation GPS::position() const
46{ 46{
47 char buf[256]; 47 char buf[256];
48 48
49 int result = _socket->writeBlock( "p\r\n", 3 ); 49 int result = _socket->writeBlock( "p\r\n", 3 );
50 _socket->flush(); 50 _socket->flush();
51 if ( result ) 51 if ( result )
52 { 52 {
53 int numAvail = _socket->bytesAvailable(); 53 int numAvail = _socket->bytesAvailable();
54 qDebug( "GPS write succeeded, %d bytes available for reading...", numAvail ); 54 qDebug( "GPS write succeeded, %d bytes available for reading...", numAvail );
55 if ( numAvail ) 55 if ( numAvail )
56 { 56 {
57 QTextStream stream( _socket ); 57 QTextStream stream( _socket );
58 58
59 QString str; 59 QString str;
60 stream.readRawBytes( &buf[0], 7 ); 60 stream.readRawBytes( &buf[0], 7 );
61 float lat = -111.111; 61 float lat = -111;
62 stream >> lat; 62 stream >> lat;
63 stream.skipWhiteSpace(); 63 stream.skipWhiteSpace();
64 float lon = -111.111; 64 float lon = -111;
65 stream >> lon; 65 stream >> lon;
66 stream.readRawBytes( &buf[0], 200 ); // read and discard the stuff until EOF 66 stream.readRawBytes( &buf[0], 200 ); // read and discard the stuff until EOF
67 67
68 return GpsLocation( lat, lon ); 68 return GpsLocation( lat, lon );
69 } 69 }
70 } 70 }
71 return GpsLocation( -111.111, -111.111 ); 71 return GpsLocation( -111, -111 );
72} 72}
73 73
74 74
75QString GpsLocation::dmsPosition() const 75QString GpsLocation::dmsPosition() const
76{ 76{
77 if ( _latitude == -111.111 || _longitude == -111.11 ) 77 if ( _latitude == -111 || _longitude == -111 )
78 return "N/A"; 78 return "N/A";
79 if ( _latitude == 0.0 && _longitude == 0.0 ) 79 if ( _latitude == 0.0 && _longitude == 0.0 )
80 return "NULL"; 80 return "NULL";
81 81
82 /* compute latitude */ 82 /* compute latitude */
83 83
84 QString dms = "N"; 84 QString dms = "N";
85 if ( _latitude >= 0 ) dms.append( "+" ); 85 if ( _latitude >= 0 ) dms.append( "+" );
86 86
87 int trunc = int( _latitude ); 87 int trunc = int( _latitude );
88 float rest = _latitude - trunc; 88 float rest = _latitude - trunc;
89 89
90 float minf = rest * 60; 90 float minf = rest * 60;
91 int minutes = int( minf ); 91 int minutes = int( minf );
92 92
93 rest = minf - minutes; 93 rest = minf - minutes;
94 int seconds = int( rest * 60 ); 94 int seconds = int( rest * 60 );
95 95
96 dms.append( QString::number( trunc ) ); 96 dms.append( QString::number( trunc ) );
97 dms.append( "° " ); 97 dms.append( "° " );
98 dms.append( QString::number( ::abs( minutes ) ) ); 98 dms.append( QString::number( ::abs( minutes ) ) );
99 dms.append( "' " ); 99 dms.append( "' " );
100 dms.append( QString::number( ::abs( seconds ) ) ); 100 dms.append( QString::number( ::abs( seconds ) ) );
101 dms.append( "'' " ); 101 dms.append( "'' " );
102 102
103 /* compute longitude */ 103 /* compute longitude */
104 104
105 dms.append( " | W" ); 105 dms.append( " | W" );
106 if ( _longitude > 0 ) dms.append( "+" ); 106 if ( _longitude > 0 ) dms.append( "+" );
107 107
108 trunc = int( _longitude ); 108 trunc = int( _longitude );
109 rest = _longitude - trunc; 109 rest = _longitude - trunc;
110 110
111 minf = rest * 60; 111 minf = rest * 60;
112 minutes = int( minf ); 112 minutes = int( minf );
113 113
114 rest = minf - minutes; 114 rest = minf - minutes;
115 seconds = int( rest * 60 ); 115 seconds = int( rest * 60 );
116 116
117 dms.append( QString::number( trunc ) ); 117 dms.append( QString::number( trunc ) );
118 dms.append( "° " ); 118 dms.append( "° " );
119 dms.append( QString::number( ::abs( minutes ) ) ); 119 dms.append( QString::number( ::abs( minutes ) ) );
120 dms.append( "' " ); 120 dms.append( "' " );
121 dms.append( QString::number( ::abs( seconds ) ) ); 121 dms.append( QString::number( ::abs( seconds ) ) );
122 dms.append( "'' " ); 122 dms.append( "'' " );
123 123
124 return dms; 124 return dms;
125} 125}
126 126
127 127
128 128
129 129
130 130
131 131
diff --git a/noncore/net/wellenreiter/gui/scanlist.cpp b/noncore/net/wellenreiter/gui/scanlist.cpp
index d89c71f..470646d 100644
--- a/noncore/net/wellenreiter/gui/scanlist.cpp
+++ b/noncore/net/wellenreiter/gui/scanlist.cpp
@@ -1,566 +1,554 @@
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 "scanlist.h" 16#include "scanlist.h"
17#include "configwindow.h" 17#include "configwindow.h"
18#include "logwindow.h" 18#include "logwindow.h"
19 19
20#include <assert.h> 20#include <assert.h>
21#include <qcursor.h> 21#include <qcursor.h>
22#include <qdatetime.h> 22#include <qdatetime.h>
23#include <qtextstream.h> 23#include <qtextstream.h>
24#include <qpopupmenu.h> 24#include <qpopupmenu.h>
25#include <qcheckbox.h> 25#include <qcheckbox.h>
26 26
27#ifdef QWS 27#ifdef QWS
28#include <qpe/qpeapplication.h> 28#include <qpe/qpeapplication.h>
29#include <opie/odevice.h>
30using namespace Opie;
31#endif 29#endif
32 30
33
34#ifdef QWS 31#ifdef QWS
35#include <qpe/resource.h> 32#include <qpe/resource.h>
36#else 33#else
37#include "resource.h" 34#include "resource.h"
38#endif 35#endif
39 36
40const int col_type = 0; 37const int col_type = 0;
41const int col_essid = 0; 38const int col_essid = 0;
42const int col_sig = 1; 39const int col_sig = 1;
43const int col_ap = 2; 40const int col_ap = 2;
44const int col_channel = 3; 41const int col_channel = 3;
45const int col_wep = 4; 42const int col_wep = 4;
46const int col_traffic = 5; 43const int col_traffic = 5;
47const int col_ip = 6; 44const int col_ip = 6;
48const int col_manuf = 7; 45const int col_manuf = 7;
49const int col_firstseen = 8; 46const int col_firstseen = 8;
50const int col_lastseen = 9; 47const int col_lastseen = 9;
51const int col_location = 10; 48const int col_location = 10;
52 49
53MScanListView::MScanListView( QWidget* parent, const char* name ) 50MScanListView::MScanListView( QWidget* parent, const char* name )
54 :OListView( parent, name ) 51 :OListView( parent, name )
55{ 52{
56 53
57 setFrameShape( QListView::StyledPanel ); 54 setFrameShape( QListView::StyledPanel );
58 setFrameShadow( QListView::Sunken ); 55 setFrameShadow( QListView::Sunken );
59 56
60 addColumn( tr( "Net/Station" ) ); 57 addColumn( tr( "Net/Station" ) );
61 setColumnAlignment( col_essid, AlignLeft || AlignVCenter ); 58 setColumnAlignment( col_essid, AlignLeft || AlignVCenter );
62 addColumn( tr( "#" ) ); 59 addColumn( tr( "#" ) );
63 setColumnAlignment( col_sig, AlignCenter ); 60 setColumnAlignment( col_sig, AlignCenter );
64 addColumn( tr( "MAC" ) ); 61 addColumn( tr( "MAC" ) );
65 setColumnAlignment( col_ap, AlignCenter ); 62 setColumnAlignment( col_ap, AlignCenter );
66 addColumn( tr( "Chn" ) ); 63 addColumn( tr( "Chn" ) );
67 setColumnAlignment( col_channel, AlignCenter ); 64 setColumnAlignment( col_channel, AlignCenter );
68 addColumn( tr( "W" ) ); 65 addColumn( tr( "W" ) );
69 setColumnAlignment( col_wep, AlignCenter ); 66 setColumnAlignment( col_wep, AlignCenter );
70 addColumn( tr( "T" ) ); 67 addColumn( tr( "T" ) );
71 setColumnAlignment( col_traffic, AlignCenter ); 68 setColumnAlignment( col_traffic, AlignCenter );
72 addColumn( tr( "IP" ) ); 69 addColumn( tr( "IP" ) );
73 setColumnAlignment( col_ip, AlignCenter ); 70 setColumnAlignment( col_ip, AlignCenter );
74 addColumn( tr( "Manufacturer" ) ); 71 addColumn( tr( "Manufacturer" ) );
75 setColumnAlignment( col_manuf, AlignCenter ); 72 setColumnAlignment( col_manuf, AlignCenter );
76 addColumn( tr( "First Seen" ) ); 73 addColumn( tr( "First Seen" ) );
77 setColumnAlignment( col_firstseen, AlignCenter ); 74 setColumnAlignment( col_firstseen, AlignCenter );
78 addColumn( tr( "Last Seen" ) ); 75 addColumn( tr( "Last Seen" ) );
79 setColumnAlignment( col_lastseen, AlignCenter ); 76 setColumnAlignment( col_lastseen, AlignCenter );
80 addColumn( tr( "Location" ) ); 77 addColumn( tr( "Location" ) );
81 setColumnAlignment( col_location, AlignCenter ); 78 setColumnAlignment( col_location, AlignCenter );
82 setRootIsDecorated( true ); 79 setRootIsDecorated( true );
83 setAllColumnsShowFocus( true ); 80 setAllColumnsShowFocus( true );
84 81
85 connect( this, SIGNAL( rightButtonClicked(QListViewItem*,const QPoint&,int) ), 82 connect( this, SIGNAL( rightButtonClicked(QListViewItem*,const QPoint&,int) ),
86 this, SLOT( contextMenuRequested(QListViewItem*,const QPoint&,int) ) ); 83 this, SLOT( contextMenuRequested(QListViewItem*,const QPoint&,int) ) );
87 84
88 #ifdef QWS 85 #ifdef QWS
89 QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold ); 86 QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold );
90 #endif 87 #endif
91 88
92}; 89};
93 90
94 91
95MScanListView::~MScanListView() 92MScanListView::~MScanListView()
96{ 93{
97}; 94};
98 95
99 96
100OListViewItem* MScanListView::childFactory() 97OListViewItem* MScanListView::childFactory()
101{ 98{
102 return new MScanListItem( this ); 99 return new MScanListItem( this );
103} 100}
104 101
105 102
106void MScanListView::serializeTo( QDataStream& s) const 103void MScanListView::serializeTo( QDataStream& s) const
107{ 104{
108 qDebug( "serializing MScanListView" ); 105 qDebug( "serializing MScanListView" );
109 OListView::serializeTo( s ); 106 OListView::serializeTo( s );
110} 107}
111 108
112 109
113void MScanListView::serializeFrom( QDataStream& s) 110void MScanListView::serializeFrom( QDataStream& s)
114{ 111{
115 qDebug( "serializing MScanListView" ); 112 qDebug( "serializing MScanListView" );
116 OListView::serializeFrom( s ); 113 OListView::serializeFrom( s );
117} 114}
118 115
119 116
120void MScanListView::addNewItem( const QString& type, 117void MScanListView::addNewItem( const QString& type,
121 const QString& essid, 118 const QString& essid,
122 const OMacAddress& mac, 119 const OMacAddress& mac,
123 bool wep, 120 bool wep,
124 int channel, 121 int channel,
125 int signal, 122 int signal,
126 const GpsLocation& loc ) 123 const GpsLocation& loc )
127{ 124{
128 QString macaddr = mac.toString(true); 125 QString macaddr = mac.toString(true);
129 126
130 #ifdef DEBUG 127 #ifdef DEBUG
131 qDebug( "MScanList::addNewItem( %s / %s / %s [%d]", (const char*) type, 128 qDebug( "MScanList::addNewItem( %s / %s / %s [%d]", (const char*) type,
132 (const char*) essid, (const char*) macaddr, channel ); 129 (const char*) essid, (const char*) macaddr, channel );
133 #endif 130 #endif
134 131
135 // search, if we already have seen this net 132 // search, if we already have seen this net
136 133
137 QString s; 134 QString s;
138 MScanListItem* network; 135 MScanListItem* network;
139 MScanListItem* item = static_cast<MScanListItem*> ( firstChild() ); 136 MScanListItem* item = static_cast<MScanListItem*> ( firstChild() );
140 137
141 while ( item && ( item->text( col_essid ) != essid ) ) 138 while ( item && ( item->text( col_essid ) != essid ) )
142 { 139 {
143 #ifdef DEBUG 140 #ifdef DEBUG
144 qDebug( "itemtext: %s", (const char*) item->text( col_essid ) ); 141 qDebug( "itemtext: %s", (const char*) item->text( col_essid ) );
145 #endif 142 #endif
146 item = static_cast<MScanListItem*> ( item->nextSibling() ); 143 item = static_cast<MScanListItem*> ( item->nextSibling() );
147 } 144 }
148 if ( item ) 145 if ( item )
149 { 146 {
150 // we have already seen this net, check all childs if MAC exists 147 // we have already seen this net, check all childs if MAC exists
151 148
152 network = item; 149 network = item;
153 150
154 item = static_cast<MScanListItem*> ( item->firstChild() ); 151 item = static_cast<MScanListItem*> ( item->firstChild() );
155 assert( item ); // this shouldn't fail 152 assert( item ); // this shouldn't fail
156 153
157 while ( item && ( item->text( col_ap ) != macaddr ) ) 154 while ( item && ( item->text( col_ap ) != macaddr ) )
158 { 155 {
159 #ifdef DEBUG 156 #ifdef DEBUG
160 qDebug( "subitemtext: %s", (const char*) item->text( col_ap ) ); 157 qDebug( "subitemtext: %s", (const char*) item->text( col_ap ) );
161 #endif 158 #endif
162 item = static_cast<MScanListItem*> ( item->nextSibling() ); 159 item = static_cast<MScanListItem*> ( item->nextSibling() );
163 } 160 }
164 161
165 if ( item ) 162 if ( item )
166 { 163 {
167 // we have already seen this item, it's a dupe 164 // we have already seen this item, it's a dupe
168 #ifdef DEBUG 165 #ifdef DEBUG
169 qDebug( "%s is a dupe - ignoring...", (const char*) macaddr ); 166 qDebug( "%s is a dupe - ignoring...", (const char*) macaddr );
170 #endif 167 #endif
171 item->receivedBeacon(); 168 item->receivedBeacon();
172 return; 169 return;
173 } 170 }
174 } 171 }
175 else 172 else
176 { 173 {
177 s.sprintf( "(i) New network: ESSID '%s'", (const char*) essid ); 174 s.sprintf( "(i) New network: ESSID '%s'", (const char*) essid );
178 MLogWindow::logwindow()->log( s ); 175 MLogWindow::logwindow()->log( s );
179 network = new MScanListItem( this, "network", essid, QString::null, 0, 0, 0 ); 176 network = new MScanListItem( this, "network", essid, QString::null, 0, 0, 0 );
180 } 177 }
181 178
182 179
183 // insert new station as child from network 180 // insert new station as child from network
184 // no essid to reduce clutter, maybe later we have a nick or stationname to display!? 181 // no essid to reduce clutter, maybe later we have a nick or stationname to display!?
185 182
186 #ifdef DEBUG 183 #ifdef DEBUG
187 qDebug( "inserting new station %s", (const char*) macaddr ); 184 qDebug( "inserting new station %s", (const char*) macaddr );
188 #endif 185 #endif
189 186
190 MScanListItem* station = new MScanListItem( network, type, "", macaddr, wep, channel, signal ); 187 MScanListItem* station = new MScanListItem( network, type, "", macaddr, wep, channel, signal );
191 station->setManufacturer( mac.manufacturer() ); 188 station->setManufacturer( mac.manufacturer() );
192 station->setLocation( loc.dmsPosition() ); 189 station->setLocation( loc.dmsPosition() );
193 190
194 if ( type == "managed" ) 191 if ( type == "managed" )
195 { 192 {
196 s.sprintf( "(i) New Access Point in '%s' [%d]", (const char*) essid, channel ); 193 s.sprintf( "(i) New Access Point in '%s' [%d]", (const char*) essid, channel );
197 } 194 }
198 else 195 else
199 { 196 {
200 s.sprintf( "(i) New AdHoc station in '%s' [%d]", (const char*) essid, channel ); 197 s.sprintf( "(i) New AdHoc station in '%s' [%d]", (const char*) essid, channel );
201 } 198 }
202 MLogWindow::logwindow()->log( s ); 199 MLogWindow::logwindow()->log( s );
203 200
204} 201}
205 202
206 203
207void MScanListView::addIfNotExisting( MScanListItem* network, const OMacAddress& addr, const QString& type ) 204void MScanListView::addIfNotExisting( MScanListItem* network, const OMacAddress& addr, const QString& type )
208{ 205{
209 MScanListItem* subitem = static_cast<MScanListItem*>( network->firstChild() ); 206 MScanListItem* subitem = static_cast<MScanListItem*>( network->firstChild() );
210 207
211 while ( subitem && ( subitem->text( col_ap ) != addr.toString(true) ) ) 208 while ( subitem && ( subitem->text( col_ap ) != addr.toString(true) ) )
212 { 209 {
213 #ifdef DEBUG 210 #ifdef DEBUG
214 qDebug( "subitemtext: %s", (const char*) subitem->text( col_ap ) ); 211 qDebug( "subitemtext: %s", (const char*) subitem->text( col_ap ) );
215 #endif 212 #endif
216 subitem = static_cast<MScanListItem*> ( subitem->nextSibling() ); 213 subitem = static_cast<MScanListItem*> ( subitem->nextSibling() );
217 } 214 }
218 215
219 if ( subitem ) 216 if ( subitem )
220 { 217 {
221 // we have already seen this item, it's a dupe 218 // we have already seen this item, it's a dupe
222 #ifdef DEBUG 219 #ifdef DEBUG
223 qDebug( "%s is a dupe - ignoring...", (const char*) addr.toString(true) ); 220 qDebug( "%s is a dupe - ignoring...", (const char*) addr.toString(true) );
224 #endif 221 #endif
225 subitem->receivedBeacon(); //FIXME: sent data bit 222 subitem->receivedBeacon(); //FIXME: sent data bit
226 return; 223 return;
227 } 224 }
228 225
229 // Hey, it seems to be a new item :-D 226 // Hey, it seems to be a new item :-D
230 MScanListItem* station = new MScanListItem( network, type, /* network->text( col_essid ) */ "", addr.toString(true), false, -1, -1 ); 227 MScanListItem* station = new MScanListItem( network, type, /* network->text( col_essid ) */ "", addr.toString(true), false, -1, -1 );
231 station->setManufacturer( addr.manufacturer() ); 228 station->setManufacturer( addr.manufacturer() );
232 229
233 QString s; 230 QString s;
234 if ( type == "station" ) 231 if ( type == "station" )
235 { 232 {
236 s.sprintf( "(i) New Station in '%s' [xx]", (const char*) network->text( col_essid ) ); 233 s.sprintf( "(i) New Station in '%s' [xx]", (const char*) network->text( col_essid ) );
237 } 234 }
238 else 235 else
239 { 236 {
240 s.sprintf( "(i) New Wireless Station in '%s' [xx]", (const char*) network->text( col_essid ) ); 237 s.sprintf( "(i) New Wireless Station in '%s' [xx]", (const char*) network->text( col_essid ) );
241 } 238 }
242 MLogWindow::logwindow()->log( s ); 239 MLogWindow::logwindow()->log( s );
243} 240}
244 241
245 242
246void MScanListView::WDStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& viaFrom, const OMacAddress& viaTo ) 243void MScanListView::WDStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& viaFrom, const OMacAddress& viaTo )
247{ 244{
248 QString s; 245 QString s;
249 MScanListItem* network; 246 MScanListItem* network;
250 247
251 QListViewItemIterator it( this ); 248 QListViewItemIterator it( this );
252 while ( it.current() && 249 while ( it.current() &&
253 it.current()->text( col_ap ) != viaFrom.toString(true) && 250 it.current()->text( col_ap ) != viaFrom.toString(true) &&
254 it.current()->text( col_ap ) != viaTo.toString(true) ) ++it; 251 it.current()->text( col_ap ) != viaTo.toString(true) ) ++it;
255 252
256 MScanListItem* item = static_cast<MScanListItem*>( it.current() ); 253 MScanListItem* item = static_cast<MScanListItem*>( it.current() );
257 254
258 if ( item ) // Either viaFrom or viaTo AP has shown up yet, so just add our two new stations 255 if ( item ) // Either viaFrom or viaTo AP has shown up yet, so just add our two new stations
259 { 256 {
260 addIfNotExisting( static_cast<MScanListItem*>(item->parent()), from ); 257 addIfNotExisting( static_cast<MScanListItem*>(item->parent()), from );
261 addIfNotExisting( static_cast<MScanListItem*>(item->parent()), to ); 258 addIfNotExisting( static_cast<MScanListItem*>(item->parent()), to );
262 } 259 }
263 else 260 else
264 { 261 {
265 qDebug( "D'Oh! Stations without AP... ignoring for now... will handle this in 1.1 version :-D" ); 262 qDebug( "D'Oh! Stations without AP... ignoring for now... will handle this in 1.1 version :-D" );
266 MLogWindow::logwindow()->log( "WARNING: Unhandled WSD traffic!" ); 263 MLogWindow::logwindow()->log( "WARNING: Unhandled WSD traffic!" );
267 } 264 }
268} 265}
269 266
270 267
271void MScanListView::toDStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& via ) 268void MScanListView::toDStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& via )
272{ 269{
273 QString s; 270 QString s;
274 MScanListItem* network; 271 MScanListItem* network;
275 272
276 QListViewItemIterator it( this ); 273 QListViewItemIterator it( this );
277 while ( it.current() && it.current()->text( col_ap ) != via.toString(true) ) ++it; 274 while ( it.current() && it.current()->text( col_ap ) != via.toString(true) ) ++it;
278 275
279 MScanListItem* item = static_cast<MScanListItem*>( it.current() ); 276 MScanListItem* item = static_cast<MScanListItem*>( it.current() );
280 277
281 if ( item ) // AP has shown up yet, so just add our new "from" - station 278 if ( item ) // AP has shown up yet, so just add our new "from" - station
282 { 279 {
283 addIfNotExisting( static_cast<MScanListItem*>(item->parent()), from, "adhoc" ); 280 addIfNotExisting( static_cast<MScanListItem*>(item->parent()), from, "adhoc" );
284 } 281 }
285 else 282 else
286 { 283 {
287 qDebug( "D'Oh! Station without AP... ignoring for now... will handle this in 1.1 :-D" ); 284 qDebug( "D'Oh! Station without AP... ignoring for now... will handle this in 1.1 :-D" );
288 MLogWindow::logwindow()->log( "WARNING: Unhandled toDS traffic!" ); 285 MLogWindow::logwindow()->log( "WARNING: Unhandled toDS traffic!" );
289 286
290 } 287 }
291} 288}
292 289
293 290
294void MScanListView::fromDStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& via ) 291void MScanListView::fromDStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& via )
295{ 292{
296 QString s; 293 QString s;
297 MScanListItem* network; 294 MScanListItem* network;
298 295
299 QListViewItemIterator it( this ); 296 QListViewItemIterator it( this );
300 while ( it.current() && it.current()->text( col_ap ) != via.toString(true) ) ++it; 297 while ( it.current() && it.current()->text( col_ap ) != via.toString(true) ) ++it;
301 298
302 MScanListItem* item = static_cast<MScanListItem*>( it.current() ); 299 MScanListItem* item = static_cast<MScanListItem*>( it.current() );
303 300
304 if ( item ) // AP has shown up yet, so just add our new "from" - station 301 if ( item ) // AP has shown up yet, so just add our new "from" - station
305 { 302 {
306 addIfNotExisting( static_cast<MScanListItem*>(item->parent()), from, "station" ); 303 addIfNotExisting( static_cast<MScanListItem*>(item->parent()), from, "station" );
307 } 304 }
308 else 305 else
309 { 306 {
310 qDebug( "D'Oh! Station without AP... ignoring for now... will handle this in 1.1 :-D" ); 307 qDebug( "D'Oh! Station without AP... ignoring for now... will handle this in 1.1 :-D" );
311 MLogWindow::logwindow()->log( "WARNING: Unhandled fromDS traffic!" ); 308 MLogWindow::logwindow()->log( "WARNING: Unhandled fromDS traffic!" );
312 } 309 }
313} 310}
314 311
315 312
316void MScanListView::IBSStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& via ) 313void MScanListView::IBSStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& via )
317{ 314{
318 qWarning( "D'oh! Not yet implemented..." ); 315 qWarning( "D'oh! Not yet implemented..." );
319 MLogWindow::logwindow()->log( "WARNING: Unhandled IBSS traffic!" ); 316 MLogWindow::logwindow()->log( "WARNING: Unhandled IBSS traffic!" );
320} 317}
321 318
322 319
323void MScanListView::identify( const OMacAddress& macaddr, const QString& ip ) 320void MScanListView::identify( const OMacAddress& macaddr, const QString& ip )
324{ 321{
325 qDebug( "identify %s = %s", (const char*) macaddr.toString(), (const char*) ip ); 322 qDebug( "identify %s = %s", (const char*) macaddr.toString(), (const char*) ip );
326 323
327 QListViewItemIterator it( this ); 324 QListViewItemIterator it( this );
328 for ( ; it.current(); ++it ) 325 for ( ; it.current(); ++it )
329 { 326 {
330 if ( it.current()->text( col_ap ) == macaddr.toString(true) ) 327 if ( it.current()->text( col_ap ) == macaddr.toString(true) )
331 { 328 {
332 it.current()->setText( col_ip, ip ); 329 it.current()->setText( col_ip, ip );
333 return; 330 return;
334 } 331 }
335 } 332 }
336 qDebug( "D'oh! Received identification, but item not yet in list... ==> Handle this!" ); 333 qDebug( "D'oh! Received identification, but item not yet in list... ==> Handle this!" );
337 MLogWindow::logwindow()->log( QString().sprintf( "WARNING: Unhandled identification %s = %s!", 334 MLogWindow::logwindow()->log( QString().sprintf( "WARNING: Unhandled identification %s = %s!",
338 (const char*) macaddr.toString(), (const char*) ip ) ); 335 (const char*) macaddr.toString(), (const char*) ip ) );
339} 336}
340 337
341 338
342void MScanListView::addService( const QString& name, const OMacAddress& macaddr, const QString& ip ) 339void MScanListView::addService( const QString& name, const OMacAddress& macaddr, const QString& ip )
343{ 340{
344 qDebug( "addService '%s', Server = %s = %s", (const char*) name, (const char*) macaddr.toString(), (const char*) ip ); 341 qDebug( "addService '%s', Server = %s = %s", (const char*) name, (const char*) macaddr.toString(), (const char*) ip );
345 342
346 //TODO: Refactor that out, we need it all over the place. 343 //TODO: Refactor that out, we need it all over the place.
347 // Best to do it in a more comfortable abstraction in OListView 344 // Best to do it in a more comfortable abstraction in OListView
348 // (Hmm, didn't I already start something in this direction?) 345 // (Hmm, didn't I already start something in this direction?)
349 346
350 QListViewItemIterator it( this ); 347 QListViewItemIterator it( this );
351 for ( ; it.current(); ++it ) 348 for ( ; it.current(); ++it )
352 { 349 {
353 if ( it.current()->text( col_ap ) == macaddr.toString(true) ) 350 if ( it.current()->text( col_ap ) == macaddr.toString(true) )
354 { 351 {
355 352
356 MScanListItem* subitem = static_cast<MScanListItem*>( it.current()->firstChild() ); 353 MScanListItem* subitem = static_cast<MScanListItem*>( it.current()->firstChild() );
357 354
358 while ( subitem && ( subitem->text( col_essid ) != name ) ) 355 while ( subitem && ( subitem->text( col_essid ) != name ) )
359 { 356 {
360 #ifdef DEBUG 357 #ifdef DEBUG
361 qDebug( "subitemtext: %s", (const char*) subitem->text( col_essid ) ); 358 qDebug( "subitemtext: %s", (const char*) subitem->text( col_essid ) );
362 #endif 359 #endif
363 subitem = static_cast<MScanListItem*> ( subitem->nextSibling() ); 360 subitem = static_cast<MScanListItem*> ( subitem->nextSibling() );
364 } 361 }
365 362
366 if ( subitem ) 363 if ( subitem )
367 { 364 {
368 // we have already seen this item, it's a dupe 365 // we have already seen this item, it's a dupe
369 #ifdef DEBUG 366 #ifdef DEBUG
370 qDebug( "%s is a dupe - ignoring...", (const char*) name ); 367 qDebug( "%s is a dupe - ignoring...", (const char*) name );
371 #endif 368 #endif
372 subitem->receivedBeacon(); //FIXME: sent data bit 369 subitem->receivedBeacon(); //FIXME: sent data bit
373 return; 370 return;
374 } 371 }
375 372
376 // never seen that - add new item 373 // never seen that - add new item
377 374
378 MScanListItem* item = new MScanListItem( it.current(), "service", "N/A", " ", false, -1, -1 ); 375 MScanListItem* item = new MScanListItem( it.current(), "service", "N/A", " ", false, -1, -1 );
379 item->setText( col_essid, name ); 376 item->setText( col_essid, name );
380 377
381 return; 378 return;
382 } 379 }
383 } 380 }
384 qDebug( "D'oh! Received identification, but item not yet in list... ==> Handle this!" ); 381 qDebug( "D'oh! Received identification, but item not yet in list... ==> Handle this!" );
385 MLogWindow::logwindow()->log( QString().sprintf( "WARNING: Unhandled service addition %s = %s!", 382 MLogWindow::logwindow()->log( QString().sprintf( "WARNING: Unhandled service addition %s = %s!",
386 (const char*) macaddr.toString(), (const char*) ip ) ); 383 (const char*) macaddr.toString(), (const char*) ip ) );
387} 384}
388 385
389 386
390void MScanListView::contextMenuRequested( QListViewItem* item, const QPoint&, int col ) 387void MScanListView::contextMenuRequested( QListViewItem* item, const QPoint&, int col )
391{ 388{
392 if ( !item ) return; 389 if ( !item ) return;
393 390
394 MScanListItem* itm = static_cast<MScanListItem*>( item ); 391 MScanListItem* itm = static_cast<MScanListItem*>( item );
395 392
396 qDebug( "contextMenuRequested on item '%s' (%s) in column: '%d'", 393 qDebug( "contextMenuRequested on item '%s' (%s) in column: '%d'",
397 (const char*) itm->text(0), (const char*) itm->type, col ); 394 (const char*) itm->text(0), (const char*) itm->type, col );
398 395
399 if ( itm->type == "adhoc" || itm->type == "managed" ) 396 if ( itm->type == "adhoc" || itm->type == "managed" )
400 { 397 {
401 QString entry = QString().sprintf( "&Join %s Net '%s'...", (const char*) itm->type, (const char*) itm->essid() ); 398 QString entry = QString().sprintf( "&Join %s Net '%s'...", (const char*) itm->type, (const char*) itm->essid() );
402 399
403 QPopupMenu m( this ); 400 QPopupMenu m( this );
404 m.insertItem( entry, 37773, 0 ); 401 m.insertItem( entry, 37773, 0 );
405 int result = m.exec( QCursor::pos() ); 402 int result = m.exec( QCursor::pos() );
406 if ( result == 37773 ) 403 if ( result == 37773 )
407 emit joinNetwork( itm->type, itm->essid(), itm->channel(), itm->macaddr() ); 404 emit joinNetwork( itm->type, itm->essid(), itm->channel(), itm->macaddr() );
408 } 405 }
409} 406}
410 407
411//============================================================ 408//============================================================
412// MScanListItem 409// MScanListItem
413//============================================================ 410//============================================================
414 411
415MScanListItem::MScanListItem( QListView* parent, QString type, QString essid, QString macaddr, 412MScanListItem::MScanListItem( QListView* parent, QString type, QString essid, QString macaddr,
416 bool wep, int channel, int signal ) 413 bool wep, int channel, int signal )
417 :OListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ), 414 :OListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ),
418 _type( type ), _essid( essid ), _macaddr( macaddr ), _wep( wep ), 415 _type( type ), _essid( essid ), _macaddr( macaddr ), _wep( wep ),
419 _channel( channel ), _signal( signal ), _beacons( 1 ) 416 _channel( channel ), _signal( signal ), _beacons( 1 )
420{ 417{
421 #ifdef DEBUG 418 #ifdef DEBUG
422 qDebug( "creating scanlist item" ); 419 qDebug( "creating scanlist item" );
423 #endif 420 #endif
424 if ( WellenreiterConfigWindow::instance() && type == "network" ) 421
425 playSound( WellenreiterConfigWindow::instance()->soundOnNetwork() ); 422 if ( WellenreiterConfigWindow::instance() )
423 WellenreiterConfigWindow::instance()->performAction( type ); // better use signal/slot combination here
424
426 decorateItem( type, essid, macaddr, wep, channel, signal ); 425 decorateItem( type, essid, macaddr, wep, channel, signal );
427} 426}
428 427
429MScanListItem::MScanListItem( QListViewItem* parent, QString type, QString essid, QString macaddr, 428MScanListItem::MScanListItem( QListViewItem* parent, QString type, QString essid, QString macaddr,
430 bool wep, int channel, int signal ) 429 bool wep, int channel, int signal )
431 :OListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ) 430 :OListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null )
432{ 431{
433 #ifdef DEBUG 432 #ifdef DEBUG
434 qDebug( "creating scanlist item" ); 433 qDebug( "creating scanlist item" );
435 #endif 434 #endif
436 decorateItem( type, essid, macaddr, wep, channel, signal ); 435 decorateItem( type, essid, macaddr, wep, channel, signal );
437} 436}
438 437
439const QString& MScanListItem::essid() const 438const QString& MScanListItem::essid() const
440{ 439{
441 if ( type == "network" ) 440 if ( type == "network" )
442 return _essid; 441 return _essid;
443 else 442 else
444 return ( (MScanListItem*) parent() )->essid(); 443 return ( (MScanListItem*) parent() )->essid();
445} 444}
446 445
447OListViewItem* MScanListItem::childFactory() 446OListViewItem* MScanListItem::childFactory()
448{ 447{
449 return new MScanListItem( this ); 448 return new MScanListItem( this );
450} 449}
451 450
452void MScanListItem::serializeTo( QDataStream& s ) const 451void MScanListItem::serializeTo( QDataStream& s ) const
453{ 452{
454 #ifdef DEBUG 453 #ifdef DEBUG
455 qDebug( "serializing MScanListItem" ); 454 qDebug( "serializing MScanListItem" );
456 #endif 455 #endif
457 OListViewItem::serializeTo( s ); 456 OListViewItem::serializeTo( s );
458 457
459 s << _type; 458 s << _type;
460 s << (Q_UINT8) ( _wep ? 'y' : 'n' ); 459 s << (Q_UINT8) ( _wep ? 'y' : 'n' );
461} 460}
462 461
463void MScanListItem::serializeFrom( QDataStream& s ) 462void MScanListItem::serializeFrom( QDataStream& s )
464{ 463{
465 #ifdef DEBUG 464 #ifdef DEBUG
466 qDebug( "serializing MScanListItem" ); 465 qDebug( "serializing MScanListItem" );
467 #endif 466 #endif
468 OListViewItem::serializeFrom( s ); 467 OListViewItem::serializeFrom( s );
469 468
470 char wep; 469 char wep;
471 s >> _type; 470 s >> _type;
472 s >> (Q_UINT8) wep; 471 s >> (Q_UINT8) wep;
473 _wep = (wep == 'y'); 472 _wep = (wep == 'y');
474 473
475 QString name; 474 QString name;
476 name.sprintf( "wellenreiter/%s", (const char*) _type ); 475 name.sprintf( "wellenreiter/%s", (const char*) _type );
477 setPixmap( col_type, Resource::loadPixmap( name ) ); 476 setPixmap( col_type, Resource::loadPixmap( name ) );
478 if ( _wep ) 477 if ( _wep )
479 setPixmap( col_wep, Resource::loadPixmap( "wellenreiter/cracked" ) ); //FIXME: rename the pixmap! 478 setPixmap( col_wep, Resource::loadPixmap( "wellenreiter/cracked" ) ); //FIXME: rename the pixmap!
480 listView()->triggerUpdate(); 479 listView()->triggerUpdate();
481} 480}
482 481
483void MScanListItem::decorateItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal ) 482void MScanListItem::decorateItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal )
484{ 483{
485 #ifdef DEBUG 484 #ifdef DEBUG
486 qDebug( "decorating scanlist item %s / %s / %s [%d]", 485 qDebug( "decorating scanlist item %s / %s / %s [%d]",
487 (const char*) type, 486 (const char*) type,
488 (const char*) essid, 487 (const char*) essid,
489 (const char*) macaddr, 488 (const char*) macaddr,
490 channel ); 489 channel );
491 #endif 490 #endif
492 491
493 // set icon for managed or adhoc mode 492 // set icon for managed or adhoc mode
494 QString name; 493 QString name;
495 name.sprintf( "wellenreiter/%s", (const char*) type ); 494 name.sprintf( "wellenreiter/%s", (const char*) type );
496 setPixmap( col_type, Resource::loadPixmap( name ) ); 495 setPixmap( col_type, Resource::loadPixmap( name ) );
497 496
498 // set icon for wep (wireless encryption protocol) 497 // set icon for wep (wireless encryption protocol)
499 if ( wep ) 498 if ( wep )
500 setPixmap( col_wep, Resource::loadPixmap( "wellenreiter/cracked" ) ); //FIXME: rename the pixmap! 499 setPixmap( col_wep, Resource::loadPixmap( "wellenreiter/cracked" ) ); //FIXME: rename the pixmap!
501 500
502 // set channel and signal text 501 // set channel and signal text
503 502
504 if ( signal != -1 ) 503 if ( signal != -1 )
505 setText( col_sig, QString::number( signal ) ); 504 setText( col_sig, QString::number( signal ) );
506 if ( channel != -1 ) 505 if ( channel != -1 )
507 setText( col_channel, QString::number( channel ) ); 506 setText( col_channel, QString::number( channel ) );
508 507
509 setText( col_firstseen, QTime::currentTime().toString() ); 508 setText( col_firstseen, QTime::currentTime().toString() );
510 //setText( col_lastseen, QTime::currentTime().toString() ); 509 //setText( col_lastseen, QTime::currentTime().toString() );
511 510
512 listView()->triggerUpdate(); 511 listView()->triggerUpdate();
513 512
514 this->type = type; 513 this->type = type;
515 _type = type; 514 _type = type;
516 _essid = essid; 515 _essid = essid;
517 _macaddr = macaddr; 516 _macaddr = macaddr;
518 _channel = channel; 517 _channel = channel;
519 _beacons = 1; 518 _beacons = 1;
520 _signal = 0; 519 _signal = 0;
521 520
522 if ( WellenreiterConfigWindow::instance()->openTree->isChecked() ) 521 if ( WellenreiterConfigWindow::instance()->openTree->isChecked() )
523 { 522 {
524 listView()->ensureItemVisible( this ); 523 listView()->ensureItemVisible( this );
525 } 524 }
526 525
527} 526}
528 527
529 528
530void MScanListItem::setManufacturer( const QString& manufacturer ) 529void MScanListItem::setManufacturer( const QString& manufacturer )
531{ 530{
532 setText( col_manuf, manufacturer ); 531 setText( col_manuf, manufacturer );
533} 532}
534 533
535 534
536void MScanListItem::setLocation( const QString& location ) 535void MScanListItem::setLocation( const QString& location )
537{ 536{
538 setText( col_location, location ); 537 setText( col_location, location );
539} 538}
540 539
541 540
542void MScanListItem::playSound( const QString& sound ) const
543{
544 #ifdef QWS
545 if ( sound == "Ignore" ) return;
546 else if ( sound == "Touch" ) ODevice::inst()->touchSound();
547 else if ( sound == "Key" ) ODevice::inst()->keySound();
548 else if ( sound == "Alarm" ) ODevice::inst()->alarmSound();
549 #endif
550}
551
552
553void MScanListItem::receivedBeacon() 541void MScanListItem::receivedBeacon()
554{ 542{
555 _beacons++; 543 _beacons++;
556 #ifdef DEBUG 544 #ifdef DEBUG
557 qDebug( "MScanListItem %s: received beacon #%d", (const char*) _macaddr, _beacons ); 545 qDebug( "MScanListItem %s: received beacon #%d", (const char*) _macaddr, _beacons );
558 #endif 546 #endif
559 setText( col_sig, QString::number( _beacons ) ); 547 setText( col_sig, QString::number( _beacons ) );
560 setText( col_lastseen, QTime::currentTime().toString() ); 548 setText( col_lastseen, QTime::currentTime().toString() );
561 549
562 MScanListItem* p = (MScanListItem*) parent(); 550 MScanListItem* p = (MScanListItem*) parent();
563 if ( p ) p->receivedBeacon(); 551 if ( p ) p->receivedBeacon();
564 552
565} 553}
566 554
diff --git a/noncore/net/wellenreiter/gui/scanlist.h b/noncore/net/wellenreiter/gui/scanlist.h
index 6cd8fc0..42f35c2 100644
--- a/noncore/net/wellenreiter/gui/scanlist.h
+++ b/noncore/net/wellenreiter/gui/scanlist.h
@@ -1,142 +1,139 @@
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 SCANLIST_H 16#ifndef SCANLIST_H
17#define SCANLIST_H 17#define SCANLIST_H
18 18
19#include "gps.h" 19#include "gps.h"
20 20
21/* OPIE */ 21/* OPIE */
22#include <opie2/olistview.h> 22#include <opie2/olistview.h>
23#include <opie2/onetutils.h> 23#include <opie2/onetutils.h>
24 24
25/* QT */ 25/* QT */
26#include <qtextstream.h> 26#include <qtextstream.h>
27 27
28class QString; 28class QString;
29class MScanListItem; 29class MScanListItem;
30 30
31class MScanListView: public OListView 31class MScanListView: public OListView
32{ 32{
33 Q_OBJECT 33 Q_OBJECT
34 34
35 public: 35 public:
36 MScanListView( QWidget* parent = 0, const char* name = 0 ); 36 MScanListView( QWidget* parent = 0, const char* name = 0 );
37 virtual ~MScanListView(); 37 virtual ~MScanListView();
38 38
39 virtual OListViewItem* childFactory(); 39 virtual OListViewItem* childFactory();
40 virtual void serializeTo( QDataStream& s ) const; 40 virtual void serializeTo( QDataStream& s ) const;
41 virtual void serializeFrom( QDataStream& s ); 41 virtual void serializeFrom( QDataStream& s );
42 42
43 public slots: 43 public slots:
44 void addNewItem( const QString& type, const QString& essid, const OMacAddress& macaddr, bool wep, int channel, int signal, const GpsLocation& location ); 44 void addNewItem( const QString& type, const QString& essid, const OMacAddress& macaddr, bool wep, int channel, int signal, const GpsLocation& location );
45 void addService( const QString& name, const OMacAddress& macaddr, const QString& ip ); 45 void addService( const QString& name, const OMacAddress& macaddr, const QString& ip );
46 46
47 void fromDStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& via ); 47 void fromDStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& via );
48 void toDStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& via ); 48 void toDStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& via );
49 void WDStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& viaFrom, const OMacAddress& viaTo ); 49 void WDStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& viaFrom, const OMacAddress& viaTo );
50 void IBSStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& via ); 50 void IBSStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& via );
51 51
52 void identify( const OMacAddress&, const QString& ipaddr ); 52 void identify( const OMacAddress&, const QString& ipaddr );
53 53
54 void contextMenuRequested( QListViewItem* item, const QPoint&, int ); 54 void contextMenuRequested( QListViewItem* item, const QPoint&, int );
55 55
56 signals: 56 signals:
57 void rightButtonClicked(QListViewItem*,const QPoint&,int); 57 void rightButtonClicked(QListViewItem*,const QPoint&,int);
58 void joinNetwork( const QString&, const QString&, int, const QString& ); 58 void joinNetwork( const QString&, const QString&, int, const QString& );
59 59
60 protected: 60 protected:
61 void addIfNotExisting( MScanListItem* parent, const OMacAddress& addr, const QString& type = "station" ); 61 void addIfNotExisting( MScanListItem* parent, const OMacAddress& addr, const QString& type = "station" );
62 62
63}; 63};
64 64
65//****************************** MScanListItem **************************************************************** 65//****************************** MScanListItem ****************************************************************
66 66
67class MScanListItem: public OListViewItem 67class MScanListItem: public OListViewItem
68{ 68{
69 public: 69 public:
70 MScanListItem::MScanListItem( QListView* parent, 70 MScanListItem::MScanListItem( QListView* parent,
71 QString type = "unknown", 71 QString type = "unknown",
72 QString essid = "unknown", 72 QString essid = "unknown",
73 QString macaddr = "unknown", 73 QString macaddr = "unknown",
74 bool wep = false, 74 bool wep = false,
75 int channel = 0, 75 int channel = 0,
76 int signal = 0 ); 76 int signal = 0 );
77 77
78 MScanListItem::MScanListItem( QListViewItem* parent, 78 MScanListItem::MScanListItem( QListViewItem* parent,
79 QString type = "unknown", 79 QString type = "unknown",
80 QString essid = "unknown", 80 QString essid = "unknown",
81 QString macaddr = "unknown", 81 QString macaddr = "unknown",
82 bool wep = false, 82 bool wep = false,
83 int channel = 0, 83 int channel = 0,
84 int signal = 0 ); 84 int signal = 0 );
85 85
86 86
87 protected: 87 protected:
88 virtual void decorateItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal ); 88 virtual void decorateItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal );
89 89
90 public: 90 public:
91 QString type; 91 QString type;
92 92
93 public: 93 public:
94 //const QString& type() { return _type; }; 94 //const QString& type() { return _type; };
95 const QString& essid() const; 95 const QString& essid() const;
96 const QString& macaddr() { return _macaddr; }; 96 const QString& macaddr() { return _macaddr; };
97 bool wep() { return _wep; }; 97 bool wep() { return _wep; };
98 int channel() { return _channel; }; 98 int channel() { return _channel; };
99 int signal() { return _signal; }; 99 int signal() { return _signal; };
100 int beacons() { return _beacons; }; 100 int beacons() { return _beacons; };
101 101
102 void setSignal( int signal ) { /* TODO */ }; 102 void setSignal( int signal ) { /* TODO */ };
103 void receivedBeacon(); 103 void receivedBeacon();
104 104
105 void setManufacturer( const QString& manufacturer ); 105 void setManufacturer( const QString& manufacturer );
106 void setLocation( const QString& location ); 106 void setLocation( const QString& location );
107 107
108 virtual OListViewItem* childFactory(); 108 virtual OListViewItem* childFactory();
109 virtual void serializeTo( QDataStream& s ) const; 109 virtual void serializeTo( QDataStream& s ) const;
110 virtual void serializeFrom( QDataStream& s ); 110 virtual void serializeFrom( QDataStream& s );
111 111
112 protected:
113 void playSound( const QString& ) const;
114
115 private: 112 private:
116 QString _type; 113 QString _type;
117 QString _essid; 114 QString _essid;
118 QString _macaddr; 115 QString _macaddr;
119 bool _wep; 116 bool _wep;
120 int _channel; 117 int _channel;
121 int _signal; 118 int _signal;
122 int _beacons; 119 int _beacons;
123 120
124}; 121};
125 122
126//****************************** MScanListViewFactory **************************************************************** 123//****************************** MScanListViewFactory ****************************************************************
127 124
128/* 125/*
129 126
130class MScanListViewFactory : public OListViewFactory 127class MScanListViewFactory : public OListViewFactory
131{ 128{
132public: 129public:
133 virtual QListView* listViewFactory(); 130 virtual QListView* listViewFactory();
134 virtual QListViewItem* listViewItemFactory( QListView* lv ); 131 virtual QListViewItem* listViewItemFactory( QListView* lv );
135 virtual QListViewItem* listViewItemFactory( QListViewItem* lvi ); 132 virtual QListViewItem* listViewItemFactory( QListViewItem* lvi );
136 virtual void setColumnText( int depth, QListViewItem* lvi, int column, const QString& text ); 133 virtual void setColumnText( int depth, QListViewItem* lvi, int column, const QString& text );
137 virtual void setCustomData( int depth, QListViewItem* lvi, const QString& text ); 134 virtual void setCustomData( int depth, QListViewItem* lvi, const QString& text );
138} 135}
139*/ 136*/
140 137
141#endif 138#endif
142 139
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp
index 45d7142..25632f3 100644
--- a/noncore/net/wellenreiter/gui/wellenreiter.cpp
+++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp
@@ -1,647 +1,647 @@
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 "gps.h" 18#include "gps.h"
19#include "wellenreiter.h" 19#include "wellenreiter.h"
20#include "scanlist.h" 20#include "scanlist.h"
21#include "logwindow.h" 21#include "logwindow.h"
22#include "hexwindow.h" 22#include "hexwindow.h"
23#include "configwindow.h" 23#include "configwindow.h"
24#include "statwindow.h" 24#include "statwindow.h"
25#include "graphwindow.h" 25#include "graphwindow.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#include <qpe/qcopenvelope_qws.h> 32#include <qpe/qcopenvelope_qws.h>
33using namespace Opie; 33using namespace Opie;
34#endif 34#endif
35 35
36#ifdef QWS 36#ifdef QWS
37#include <opie2/oapplication.h> 37#include <opie2/oapplication.h>
38#else 38#else
39#include <qapplication.h> 39#include <qapplication.h>
40#endif 40#endif
41#include <opie2/omanufacturerdb.h> 41#include <opie2/omanufacturerdb.h>
42#include <opie2/onetwork.h> 42#include <opie2/onetwork.h>
43#include <opie2/opcap.h> 43#include <opie2/opcap.h>
44 44
45// Qt 45// Qt
46 46
47#include <qcheckbox.h> 47#include <qcheckbox.h>
48#include <qcombobox.h> 48#include <qcombobox.h>
49#include <qdatetime.h> 49#include <qdatetime.h>
50#include <qpushbutton.h> 50#include <qpushbutton.h>
51#include <qlineedit.h> 51#include <qlineedit.h>
52#include <qmessagebox.h> 52#include <qmessagebox.h>
53#include <qobjectlist.h> 53#include <qobjectlist.h>
54#include <qregexp.h> 54#include <qregexp.h>
55#include <qspinbox.h> 55#include <qspinbox.h>
56#include <qtimer.h> 56#include <qtimer.h>
57#include <qtoolbutton.h> 57#include <qtoolbutton.h>
58#include <qmainwindow.h> 58#include <qmainwindow.h>
59 59
60// Standard 60// Standard
61 61
62#include <assert.h> 62#include <assert.h>
63#include <errno.h> 63#include <errno.h>
64#include <unistd.h> 64#include <unistd.h>
65#include <string.h> 65#include <string.h>
66#include <sys/types.h> 66#include <sys/types.h>
67#include <stdlib.h> 67#include <stdlib.h>
68 68
69Wellenreiter::Wellenreiter( QWidget* parent ) 69Wellenreiter::Wellenreiter( QWidget* parent )
70 : WellenreiterBase( parent, 0, 0 ), 70 : WellenreiterBase( parent, 0, 0 ),
71 sniffing( false ), iface( 0 ), configwindow( 0 ) 71 sniffing( false ), iface( 0 ), configwindow( 0 )
72{ 72{
73 73
74 logwindow->log( "(i) Wellenreiter has been started." ); 74 logwindow->log( "(i) Wellenreiter has been started." );
75 75
76 // 76 //
77 // detect operating system 77 // detect operating system
78 // 78 //
79 79
80 #ifdef QWS 80 #ifdef QWS
81 QString sys; 81 QString sys;
82 sys.sprintf( "(i) Running on '%s'.", (const char*) ODevice::inst()->systemString() ); 82 sys.sprintf( "(i) Running on '%s'.", (const char*) ODevice::inst()->systemString() );
83 _system = ODevice::inst()->system(); 83 _system = ODevice::inst()->system();
84 logwindow->log( sys ); 84 logwindow->log( sys );
85 #endif 85 #endif
86 86
87 netview->setColumnWidthMode( 1, QListView::Manual ); 87 netview->setColumnWidthMode( 1, QListView::Manual );
88 connect( netview, SIGNAL( joinNetwork(const QString&,const QString&,int,const QString&) ), 88 connect( netview, SIGNAL( joinNetwork(const QString&,const QString&,int,const QString&) ),
89 this, SLOT( joinNetwork(const QString&,const QString&,int,const QString&) ) ); 89 this, SLOT( joinNetwork(const QString&,const QString&,int,const QString&) ) );
90 pcap = new OPacketCapturer(); 90 pcap = new OPacketCapturer();
91 91
92 gps = new GPS( this ); 92 gps = new GPS( this );
93 93
94 QTimer::singleShot( 1000, this, SLOT( initialTimer() ) ); 94 QTimer::singleShot( 1000, this, SLOT( initialTimer() ) );
95 95
96} 96}
97 97
98 98
99Wellenreiter::~Wellenreiter() 99Wellenreiter::~Wellenreiter()
100{ 100{
101 delete pcap; 101 delete pcap;
102} 102}
103 103
104 104
105void Wellenreiter::initialTimer() 105void Wellenreiter::initialTimer()
106{ 106{
107 qDebug( "Wellenreiter::preloading manufacturer database..." ); 107 qDebug( "Wellenreiter::preloading manufacturer database..." );
108 OManufacturerDB::instance(); 108 OManufacturerDB::instance();
109} 109}
110 110
111 111
112void Wellenreiter::setConfigWindow( WellenreiterConfigWindow* cw ) 112void Wellenreiter::setConfigWindow( WellenreiterConfigWindow* cw )
113{ 113{
114 configwindow = cw; 114 configwindow = cw;
115} 115}
116 116
117 117
118void Wellenreiter::channelHopped(int c) 118void Wellenreiter::channelHopped(int c)
119{ 119{
120 QString title = "Wellenreiter II -scan- ["; 120 QString title = "Wellenreiter II -scan- [";
121 QString left; 121 QString left;
122 if ( c > 1 ) left.fill( '.', c-1 ); 122 if ( c > 1 ) left.fill( '.', c-1 );
123 title.append( left ); 123 title.append( left );
124 title.append( '|' ); 124 title.append( '|' );
125 if ( c < iface->channels() ) 125 if ( c < iface->channels() )
126 { 126 {
127 QString right; 127 QString right;
128 right.fill( '.', iface->channels()-c ); 128 right.fill( '.', iface->channels()-c );
129 title.append( right ); 129 title.append( right );
130 } 130 }
131 title.append( "]" ); 131 title.append( "]" );
132 //title.append( QString().sprintf( " %02d", c ) ); 132 //title.append( QString().sprintf( " %02d", c ) );
133 assert( parent() ); 133 assert( parent() );
134 ( (QMainWindow*) parent() )->setCaption( title ); 134 ( (QMainWindow*) parent() )->setCaption( title );
135} 135}
136 136
137 137
138void Wellenreiter::handleNotification( OPacket* p ) 138void Wellenreiter::handleNotification( OPacket* p )
139{ 139{
140 QObjectList* l = p->queryList(); 140 QObjectList* l = p->queryList();
141 QObjectListIt it( *l ); 141 QObjectListIt it( *l );
142 QObject* o; 142 QObject* o;
143 143
144 while ( (o = it.current()) != 0 ) 144 while ( (o = it.current()) != 0 )
145 { 145 {
146 QString name = it.current()->name(); 146 QString name = it.current()->name();
147 if ( configwindow->parsePackets->isProtocolChecked( name ) ) 147 if ( configwindow->parsePackets->isProtocolChecked( name ) )
148 { 148 {
149 QString action = configwindow->parsePackets->protocolAction( name ); 149 QString action = configwindow->parsePackets->protocolAction( name );
150 qDebug( "parsePacket-action for '%s' seems to be '%s'", (const char*) name, (const char*) action ); 150 qDebug( "parsePacket-action for '%s' seems to be '%s'", (const char*) name, (const char*) action );
151 doAction( action, name, p ); 151 doAction( action, name, p );
152 } 152 }
153 else 153 else
154 { 154 {
155 qDebug( "protocol '%s' not checked in parsePackets.", (const char*) name ); 155 qDebug( "protocol '%s' not checked in parsePackets.", (const char*) name );
156 } 156 }
157 ++it; 157 ++it;
158 } 158 }
159} 159}
160 160
161 161
162void Wellenreiter::handleManagementFrame( OPacket* p, OWaveLanManagementPacket* manage ) 162void Wellenreiter::handleManagementFrame( OPacket* p, OWaveLanManagementPacket* manage )
163{ 163{
164 if ( manage->managementType() != "Beacon" ) return; // only handling beacons at that time 164 if ( manage->managementType() != "Beacon" ) return; // only handling beacons at that time
165 165
166 OWaveLanManagementPacket* beacon = manage; 166 OWaveLanManagementPacket* beacon = manage;
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( true /* decloak */ ) : 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 189
190 GpsLocation loc( -111.111, -111.111 ); 190 GpsLocation loc( -111, -111 );
191 if ( configwindow->enableGPS->isChecked() ) 191 if ( configwindow->enableGPS->isChecked() )
192 { 192 {
193 // TODO: add check if GPS is working!? 193 // TODO: add check if GPS is working!?
194 qDebug( "Wellenreiter::gathering GPS data..." ); 194 qDebug( "Wellenreiter::gathering GPS data..." );
195 loc = gps->position(); 195 loc = gps->position();
196 qDebug( "Wellenreiter::GPS data received is ( %f , %f ) - dms string = '%s'", loc.latitude(), loc.longitude(), loc.dmsPosition().latin1() ); 196 qDebug( "Wellenreiter::GPS data received is ( %f , %f ) - dms string = '%s'", loc.latitude(), loc.longitude(), loc.dmsPosition().latin1() );
197 } 197 }
198 198
199 netView()->addNewItem( type, essid, header->macAddress2(), beacon->canPrivacy(), channel, 0, loc ); 199 netView()->addNewItem( type, essid, header->macAddress2(), beacon->canPrivacy(), channel, 0, loc );
200 200
201 // update graph window 201 // update graph window
202 if ( ds ) 202 if ( ds )
203 { 203 {
204 OPrismHeaderPacket* prism = static_cast<OPrismHeaderPacket*>( p->child( "Prism" ) ); 204 OPrismHeaderPacket* prism = static_cast<OPrismHeaderPacket*>( p->child( "Prism" ) );
205 if ( prism ) 205 if ( prism )
206 graphwindow->traffic( ds->channel(), prism->signalStrength() ); 206 graphwindow->traffic( ds->channel(), prism->signalStrength() );
207 else 207 else
208 graphwindow->traffic( ds->channel(), 95 ); 208 graphwindow->traffic( ds->channel(), 95 );
209 } 209 }
210} 210}
211 211
212 212
213void Wellenreiter::handleControlFrame( OPacket* p, OWaveLanControlPacket* control ) 213void Wellenreiter::handleControlFrame( OPacket* p, OWaveLanControlPacket* control )
214{ 214{
215 OWaveLanPacket* header = static_cast<OWaveLanPacket*>( p->child( "802.11" ) ); 215 OWaveLanPacket* header = static_cast<OWaveLanPacket*>( p->child( "802.11" ) );
216 216
217 if ( control->controlType() == "Acknowledge" ) 217 if ( control->controlType() == "Acknowledge" )
218 { 218 {
219 netView()->addNewItem( "adhoc", "???", header->macAddress1(), false, -1, 0, GpsLocation( -111.111, -111.111 ) ); 219 netView()->addNewItem( "adhoc", "???", header->macAddress1(), false, -1, 0, GpsLocation( -111, -111 ) );
220 } 220 }
221 else 221 else
222 { 222 {
223 qDebug( "Wellenreiter::handleControlFrame - please handle %s in a future version! :D", (const char*) control->controlType() ); 223 qDebug( "Wellenreiter::handleControlFrame - please handle %s in a future version! :D", (const char*) control->controlType() );
224 } 224 }
225} 225}
226 226
227 227
228void Wellenreiter::handleWlanData( OPacket* p, OWaveLanDataPacket* data, OMacAddress& from, OMacAddress& to ) 228void Wellenreiter::handleWlanData( OPacket* p, OWaveLanDataPacket* data, OMacAddress& from, OMacAddress& to )
229{ 229{
230 OWaveLanPacket* wlan = (OWaveLanPacket*) p->child( "802.11" ); 230 OWaveLanPacket* wlan = (OWaveLanPacket*) p->child( "802.11" );
231 if ( wlan->fromDS() && !wlan->toDS() ) 231 if ( wlan->fromDS() && !wlan->toDS() )
232 { 232 {
233 netView()->fromDStraffic( wlan->macAddress3(), wlan->macAddress1(), wlan->macAddress2() ); 233 netView()->fromDStraffic( wlan->macAddress3(), wlan->macAddress1(), wlan->macAddress2() );
234 from = wlan->macAddress3(); 234 from = wlan->macAddress3();
235 to = wlan->macAddress2(); 235 to = wlan->macAddress2();
236 } 236 }
237 else if ( !wlan->fromDS() && wlan->toDS() ) 237 else if ( !wlan->fromDS() && wlan->toDS() )
238 { 238 {
239 netView()->toDStraffic( wlan->macAddress2(), wlan->macAddress3(), wlan->macAddress1() ); 239 netView()->toDStraffic( wlan->macAddress2(), wlan->macAddress3(), wlan->macAddress1() );
240 from = wlan->macAddress2(); 240 from = wlan->macAddress2();
241 to = wlan->macAddress3(); 241 to = wlan->macAddress3();
242 } 242 }
243 else if ( wlan->fromDS() && wlan->toDS() ) 243 else if ( wlan->fromDS() && wlan->toDS() )
244 { 244 {
245 netView()->WDStraffic( wlan->macAddress4(), wlan->macAddress3(), wlan->macAddress1(), wlan->macAddress2() ); 245 netView()->WDStraffic( wlan->macAddress4(), wlan->macAddress3(), wlan->macAddress1(), wlan->macAddress2() );
246 from = wlan->macAddress4(); 246 from = wlan->macAddress4();
247 to = wlan->macAddress3(); 247 to = wlan->macAddress3();
248 } 248 }
249 else 249 else
250 { 250 {
251 netView()->IBSStraffic( wlan->macAddress2(), wlan->macAddress1(), wlan->macAddress3() ); 251 netView()->IBSStraffic( wlan->macAddress2(), wlan->macAddress1(), wlan->macAddress3() );
252 from = wlan->macAddress2(); 252 from = wlan->macAddress2();
253 to = wlan->macAddress1(); 253 to = wlan->macAddress1();
254 } 254 }
255} 255}
256 256
257 257
258void Wellenreiter::handleEthernetData( OPacket* p, OEthernetPacket* data, OMacAddress& from, OMacAddress& to ) 258void Wellenreiter::handleEthernetData( OPacket* p, OEthernetPacket* data, OMacAddress& from, OMacAddress& to )
259{ 259{
260 from = data->sourceAddress(); 260 from = data->sourceAddress();
261 to = data->destinationAddress(); 261 to = data->destinationAddress();
262 262
263 netView()->addNewItem( "station", "<wired>", from, false, -1, 0, GpsLocation( -111.111, -111.111 ) ); 263 netView()->addNewItem( "station", "<wired>", from, false, -1, 0, GpsLocation( -111, -111 ) );
264} 264}
265 265
266 266
267void Wellenreiter::handleARPData( OPacket* p, OARPPacket*, OMacAddress& source, OMacAddress& dest ) 267void Wellenreiter::handleARPData( OPacket* p, OARPPacket*, OMacAddress& source, OMacAddress& dest )
268{ 268{
269 OARPPacket* arp = (OARPPacket*) p->child( "ARP" ); 269 OARPPacket* arp = (OARPPacket*) p->child( "ARP" );
270 if ( arp ) 270 if ( arp )
271 { 271 {
272 qDebug( "Received ARP traffic (type '%s'): ", (const char*) arp->type() ); 272 qDebug( "Received ARP traffic (type '%s'): ", (const char*) arp->type() );
273 if ( arp->type() == "REQUEST" ) 273 if ( arp->type() == "REQUEST" )
274 { 274 {
275 netView()->identify( arp->senderMacAddress(), arp->senderIPV4Address().toString() ); 275 netView()->identify( arp->senderMacAddress(), arp->senderIPV4Address().toString() );
276 } 276 }
277 else if ( arp->type() == "REPLY" ) 277 else if ( arp->type() == "REPLY" )
278 { 278 {
279 netView()->identify( arp->senderMacAddress(), arp->senderIPV4Address().toString() ); 279 netView()->identify( arp->senderMacAddress(), arp->senderIPV4Address().toString() );
280 netView()->identify( arp->targetMacAddress(), arp->targetIPV4Address().toString() ); 280 netView()->identify( arp->targetMacAddress(), arp->targetIPV4Address().toString() );
281 } 281 }
282 } 282 }
283} 283}
284 284
285 285
286void Wellenreiter::handleIPData( OPacket* p, OIPPacket* ip, OMacAddress& source, OMacAddress& dest ) 286void Wellenreiter::handleIPData( OPacket* p, OIPPacket* ip, OMacAddress& source, OMacAddress& dest )
287{ 287{
288 //TODO: Implement more IP based protocols 288 //TODO: Implement more IP based protocols
289 289
290 ODHCPPacket* dhcp = (ODHCPPacket*) p->child( "DHCP" ); 290 ODHCPPacket* dhcp = (ODHCPPacket*) p->child( "DHCP" );
291 if ( dhcp ) 291 if ( dhcp )
292 { 292 {
293 qDebug( "Received DHCP '%s' packet", (const char*) dhcp->type() ); 293 qDebug( "Received DHCP '%s' packet", (const char*) dhcp->type() );
294 if ( dhcp->type() == "OFFER" ) 294 if ( dhcp->type() == "OFFER" )
295 { 295 {
296 qDebug( "DHCP: '%s' ('%s') seems to be a DHCP server.", (const char*) source.toString(), (const char*) dhcp->serverAddress().toString() ); 296 qDebug( "DHCP: '%s' ('%s') seems to be a DHCP server.", (const char*) source.toString(), (const char*) dhcp->serverAddress().toString() );
297 netView()->identify( source, dhcp->serverAddress().toString() ); 297 netView()->identify( source, dhcp->serverAddress().toString() );
298 netView()->addService( "DHCP", source, dhcp->serverAddress().toString() ); 298 netView()->addService( "DHCP", source, dhcp->serverAddress().toString() );
299 } 299 }
300 else if ( dhcp->type() == "ACK" ) 300 else if ( dhcp->type() == "ACK" )
301 { 301 {
302 qDebug( "DHCP: '%s' ('%s') accepted the offered DHCP address.", (const char*) dhcp->clientMacAddress().toString(), (const char*) dhcp->yourAddress().toString() ); 302 qDebug( "DHCP: '%s' ('%s') accepted the offered DHCP address.", (const char*) dhcp->clientMacAddress().toString(), (const char*) dhcp->yourAddress().toString() );
303 netView()->identify( dhcp->clientMacAddress(), dhcp->yourAddress().toString() ); 303 netView()->identify( dhcp->clientMacAddress(), dhcp->yourAddress().toString() );
304 } 304 }
305 } 305 }
306} 306}
307 307
308 308
309QObject* Wellenreiter::childIfToParse( OPacket* p, const QString& protocol ) 309QObject* Wellenreiter::childIfToParse( OPacket* p, const QString& protocol )
310{ 310{
311 if ( configwindow->parsePackets->isProtocolChecked( protocol ) ) 311 if ( configwindow->parsePackets->isProtocolChecked( protocol ) )
312 if ( configwindow->parsePackets->protocolAction( protocol ) == "Discard!" ) 312 if ( configwindow->parsePackets->protocolAction( protocol ) == "Discard!" )
313 return 0; 313 return 0;
314 314
315 return p->child( protocol ); 315 return p->child( protocol );
316} 316}
317 317
318 318
319bool Wellenreiter::checkDumpPacket( OPacket* p ) 319bool Wellenreiter::checkDumpPacket( OPacket* p )
320{ 320{
321 // go through all child packets and see if one is inside the child hierarchy for p 321 // go through all child packets and see if one is inside the child hierarchy for p
322 // if so, do what the user requested (protocolAction), e.g. pass or discard 322 // if so, do what the user requested (protocolAction), e.g. pass or discard
323 if ( !configwindow->writeCaptureFile->isChecked() ) 323 if ( !configwindow->writeCaptureFile->isChecked() )
324 return true; // semantic change - we're logging anyway now to /tmp/wellenreiter 324 return true; // semantic change - we're logging anyway now to /tmp/wellenreiter
325 325
326 QObjectList* l = p->queryList(); 326 QObjectList* l = p->queryList();
327 QObjectListIt it( *l ); 327 QObjectListIt it( *l );
328 QObject* o; 328 QObject* o;
329 329
330 while ( (o = it.current()) != 0 ) 330 while ( (o = it.current()) != 0 )
331 { 331 {
332 QString name = it.current()->name(); 332 QString name = it.current()->name();
333 if ( configwindow->capturePackets->isProtocolChecked( name ) ) 333 if ( configwindow->capturePackets->isProtocolChecked( name ) )
334 { 334 {
335 QString action = configwindow->capturePackets->protocolAction( name ); 335 QString action = configwindow->capturePackets->protocolAction( name );
336 qDebug( "capturePackets-action for '%s' seems to be '%s'", (const char*) name, (const char*) action ); 336 qDebug( "capturePackets-action for '%s' seems to be '%s'", (const char*) name, (const char*) action );
337 if ( action == "Discard" ) 337 if ( action == "Discard" )
338 { 338 {
339 logwindow->log( QString().sprintf( "(i) dump-discarding of '%s' packet requested.", (const char*) name ) ); 339 logwindow->log( QString().sprintf( "(i) dump-discarding of '%s' packet requested.", (const char*) name ) );
340 return false; 340 return false;
341 } 341 }
342 } 342 }
343 else 343 else
344 { 344 {
345 qDebug( "protocol '%s' not checked in capturePackets.", (const char*) name ); 345 qDebug( "protocol '%s' not checked in capturePackets.", (const char*) name );
346 } 346 }
347 ++it; 347 ++it;
348 } 348 }
349 return true; 349 return true;
350} 350}
351 351
352 352
353void Wellenreiter::receivePacket( OPacket* p ) 353void Wellenreiter::receivePacket( OPacket* p )
354{ 354{
355 hexWindow()->log( p->dump( 8 ) ); 355 hexWindow()->log( p->dump( 8 ) );
356 356
357 if ( checkDumpPacket( p ) ) 357 if ( checkDumpPacket( p ) )
358 { 358 {
359 pcap->dump( p ); 359 pcap->dump( p );
360 } 360 }
361 361
362 // check for a management frame 362 // check for a management frame
363 OWaveLanManagementPacket* manage = static_cast<OWaveLanManagementPacket*>( childIfToParse( p, "802.11 Management" ) ); 363 OWaveLanManagementPacket* manage = static_cast<OWaveLanManagementPacket*>( childIfToParse( p, "802.11 Management" ) );
364 if ( manage ) 364 if ( manage )
365 { 365 {
366 handleManagementFrame( p, manage ); 366 handleManagementFrame( p, manage );
367 return; 367 return;
368 } 368 }
369 369
370 // check for a control frame 370 // check for a control frame
371 OWaveLanControlPacket* control = static_cast<OWaveLanControlPacket*>( childIfToParse( p, "802.11 Control" ) ); 371 OWaveLanControlPacket* control = static_cast<OWaveLanControlPacket*>( childIfToParse( p, "802.11 Control" ) );
372 if ( control ) 372 if ( control )
373 { 373 {
374 handleControlFrame( p, control ); 374 handleControlFrame( p, control );
375 return; 375 return;
376 } 376 }
377 377
378 OMacAddress source; 378 OMacAddress source;
379 OMacAddress dest; 379 OMacAddress dest;
380 380
381 //TODO: WEP check here 381 //TODO: WEP check here
382 382
383 // check for a wireless data frame 383 // check for a wireless data frame
384 OWaveLanDataPacket* wlan = static_cast<OWaveLanDataPacket*>( childIfToParse( p, "802.11 Data" ) ); 384 OWaveLanDataPacket* wlan = static_cast<OWaveLanDataPacket*>( childIfToParse( p, "802.11 Data" ) );
385 if ( wlan ) 385 if ( wlan )
386 { 386 {
387 handleWlanData( p, wlan, source, dest ); 387 handleWlanData( p, wlan, source, dest );
388 } 388 }
389 389
390 // check for a wired data frame 390 // check for a wired data frame
391 OEthernetPacket* eth = static_cast<OEthernetPacket*>( childIfToParse( p, "Ethernet" ) ); 391 OEthernetPacket* eth = static_cast<OEthernetPacket*>( childIfToParse( p, "Ethernet" ) );
392 if ( eth ) 392 if ( eth )
393 { 393 {
394 handleEthernetData( p, eth, source, dest ); 394 handleEthernetData( p, eth, source, dest );
395 } 395 }
396 396
397 // check for an arp frame since arp frames come in two flavours: 397 // check for an arp frame since arp frames come in two flavours:
398 // 802.11 encapsulates ARP data within IP packets while wired ethernet doesn't. 398 // 802.11 encapsulates ARP data within IP packets while wired ethernet doesn't.
399 OARPPacket* arp = static_cast<OARPPacket*>( childIfToParse( p, "ARP" ) ); 399 OARPPacket* arp = static_cast<OARPPacket*>( childIfToParse( p, "ARP" ) );
400 if ( arp ) 400 if ( arp )
401 { 401 {
402 handleARPData( p, arp, source, dest ); 402 handleARPData( p, arp, source, dest );
403 } 403 }
404 404
405 // check for a ip frame 405 // check for a ip frame
406 OIPPacket* ip = static_cast<OIPPacket*>( childIfToParse( p, "IP" ) ); 406 OIPPacket* ip = static_cast<OIPPacket*>( childIfToParse( p, "IP" ) );
407 if ( ip ) 407 if ( ip )
408 { 408 {
409 handleIPData( p, ip, source, dest ); 409 handleIPData( p, ip, source, dest );
410 } 410 }
411 411
412 //handleNotification( p ); 412 //handleNotification( p );
413 413
414} 414}
415 415
416 416
417void Wellenreiter::stopClicked() 417void Wellenreiter::stopClicked()
418{ 418{
419 if ( iface ) 419 if ( iface )
420 { 420 {
421 disconnect( SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) ); 421 disconnect( SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) );
422 disconnect( SIGNAL( hopped(int) ), this, SLOT( channelHopped(int) ) ); 422 disconnect( SIGNAL( hopped(int) ), this, SLOT( channelHopped(int) ) );
423 iface->setChannelHopping(); // stop hopping channels 423 iface->setChannelHopping(); // stop hopping channels
424 } 424 }
425 else 425 else
426 killTimers(); 426 killTimers();
427 427
428 pcap->close(); 428 pcap->close();
429 sniffing = false; 429 sniffing = false;
430 430
431 if ( iface ) 431 if ( iface )
432 { 432 {
433 // switch off monitor mode 433 // switch off monitor mode
434 iface->setMode( "managed" ); 434 iface->setMode( "managed" );
435 // switch off promisc flag 435 // switch off promisc flag
436 iface->setPromiscuousMode( false ); 436 iface->setPromiscuousMode( false );
437 437
438 system( "cardctl reset; sleep 1" ); //FIXME: Use OProcess 438 system( "cardctl reset; sleep 1" ); //FIXME: Use OProcess
439 } 439 }
440 440
441 logwindow->log( "(i) Stopped Scanning." ); 441 logwindow->log( "(i) Stopped Scanning." );
442 assert( parent() ); 442 assert( parent() );
443 ( (QMainWindow*) parent() )->setCaption( "Wellenreiter II" ); 443 ( (QMainWindow*) parent() )->setCaption( "Wellenreiter II" );
444 444
445 // message the user 445 // message the user
446 QMessageBox::information( this, "Wellenreiter II", 446 QMessageBox::information( this, "Wellenreiter II",
447 tr( "Your wireless card\nshould now be usable again." ) ); 447 tr( "Your wireless card\nshould now be usable again." ) );
448 448
449 sniffing = false; 449 sniffing = false;
450 emit( stoppedSniffing() ); 450 emit( stoppedSniffing() );
451 451
452 #ifdef QWS 452 #ifdef QWS
453 if ( WellenreiterConfigWindow::instance()->disablePM->isChecked() ) 453 if ( WellenreiterConfigWindow::instance()->disablePM->isChecked() )
454 { 454 {
455 QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable; 455 QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable;
456 } 456 }
457 #else 457 #else
458 #warning FIXME: setScreenSaverMode is not operational on the X11 build 458 #warning FIXME: setScreenSaverMode is not operational on the X11 build
459 #endif 459 #endif
460 460
461 // print out statistics 461 // print out statistics
462 for( QMap<QString,int>::ConstIterator it = pcap->statistics().begin(); it != pcap->statistics().end(); ++it ) 462 for( QMap<QString,int>::ConstIterator it = pcap->statistics().begin(); it != pcap->statistics().end(); ++it )
463 statwindow->updateCounter( it.key(), it.data() ); 463 statwindow->updateCounter( it.key(), it.data() );
464} 464}
465 465
466 466
467void Wellenreiter::startClicked() 467void Wellenreiter::startClicked()
468{ 468{
469 // get configuration from config window 469 // get configuration from config window
470 470
471 const QString& interface = configwindow->interfaceName->currentText(); 471 const QString& interface = configwindow->interfaceName->currentText();
472 const int cardtype = configwindow->driverType(); 472 const int cardtype = configwindow->driverType();
473 const int interval = configwindow->hoppingInterval(); 473 const int interval = configwindow->hoppingInterval();
474 474
475 if ( ( interface == "" ) || ( cardtype == 0 ) ) 475 if ( ( interface == "" ) || ( cardtype == 0 ) )
476 { 476 {
477 QMessageBox::information( this, "Wellenreiter II", 477 QMessageBox::information( this, "Wellenreiter II",
478 tr( "Your device is not\nproperly configured. Please reconfigure!" ) ); 478 tr( "Your device is not\nproperly configured. Please reconfigure!" ) );
479 return; 479 return;
480 } 480 }
481 481
482 // configure device 482 // configure device
483 ONetwork* net = ONetwork::instance(); 483 ONetwork* net = ONetwork::instance();
484 484
485 // TODO: check if interface is wireless and support sniffing for non-wireless interfaces 485 // TODO: check if interface is wireless and support sniffing for non-wireless interfaces
486 486
487 iface = static_cast<OWirelessNetworkInterface*>(net->interface( interface )); // fails if network is not wireless! 487 iface = static_cast<OWirelessNetworkInterface*>(net->interface( interface )); // fails if network is not wireless!
488 488
489 // bring device UP 489 // bring device UP
490 if ( cardtype != DEVTYPE_FILE ) 490 if ( cardtype != DEVTYPE_FILE )
491 { 491 {
492 iface->setUp( true ); 492 iface->setUp( true );
493 if ( !iface->isUp() ) 493 if ( !iface->isUp() )
494 { 494 {
495 QMessageBox::warning( this, "Wellenreiter II", 495 QMessageBox::warning( this, "Wellenreiter II",
496 tr( "Can't bring interface '%1' up:\n" ).arg( iface->name() ) + strerror( errno ) ); 496 tr( "Can't bring interface '%1' up:\n" ).arg( iface->name() ) + strerror( errno ) );
497 return; 497 return;
498 } 498 }
499 } 499 }
500 // set monitor mode 500 // set monitor mode
501 bool usePrism = configwindow->usePrismHeader(); 501 bool usePrism = configwindow->usePrismHeader();
502 502
503 switch ( cardtype ) 503 switch ( cardtype )
504 { 504 {
505 case DEVTYPE_CISCO: iface->setMonitoring( new OCiscoMonitoringInterface( iface, usePrism ) ); break; 505 case DEVTYPE_CISCO: iface->setMonitoring( new OCiscoMonitoringInterface( iface, usePrism ) ); break;
506 case DEVTYPE_WLAN_NG: iface->setMonitoring( new OWlanNGMonitoringInterface( iface, usePrism ) ); break; 506 case DEVTYPE_WLAN_NG: iface->setMonitoring( new OWlanNGMonitoringInterface( iface, usePrism ) ); break;
507 case DEVTYPE_HOSTAP: iface->setMonitoring( new OHostAPMonitoringInterface( iface, usePrism ) ); break; 507 case DEVTYPE_HOSTAP: iface->setMonitoring( new OHostAPMonitoringInterface( iface, usePrism ) ); break;
508 case DEVTYPE_ORINOCO: iface->setMonitoring( new OOrinocoMonitoringInterface( iface, usePrism ) ); break; 508 case DEVTYPE_ORINOCO: iface->setMonitoring( new OOrinocoMonitoringInterface( iface, usePrism ) ); break;
509 case DEVTYPE_MANUAL: QMessageBox::information( this, "Wellenreiter II", tr( "Bring your device into\nmonitor mode now." ) ); break; 509 case DEVTYPE_MANUAL: QMessageBox::information( this, "Wellenreiter II", tr( "Bring your device into\nmonitor mode now." ) ); break;
510 case DEVTYPE_FILE: qDebug( "Wellenreiter: Capturing from file '%s'", (const char*) interface ); break; 510 case DEVTYPE_FILE: qDebug( "Wellenreiter: Capturing from file '%s'", (const char*) interface ); break;
511 default: assert( 0 ); // shouldn't reach this 511 default: assert( 0 ); // shouldn't reach this
512 } 512 }
513 513
514 // switch device into monitor mode 514 // switch device into monitor mode
515 if ( cardtype < DEVTYPE_FILE ) 515 if ( cardtype < DEVTYPE_FILE )
516 { 516 {
517 if ( cardtype != DEVTYPE_MANUAL ) 517 if ( cardtype != DEVTYPE_MANUAL )
518 iface->setMode( "monitor" ); 518 iface->setMode( "monitor" );
519 if ( iface->mode() != "monitor" ) 519 if ( iface->mode() != "monitor" )
520 { 520 {
521 if ( QMessageBox::warning( this, "Wellenreiter II", 521 if ( QMessageBox::warning( this, "Wellenreiter II",
522 tr( "Can't set interface '%1'\ninto monitor mode:\n" ).arg( iface->name() ) + strerror( errno ) + 522 tr( "Can't set interface '%1'\ninto monitor mode:\n" ).arg( iface->name() ) + strerror( errno ) +
523 tr( "\nContinue with limited functionality?" ), QMessageBox::Yes, QMessageBox::No ) == QMessageBox::No ) 523 tr( "\nContinue with limited functionality?" ), QMessageBox::Yes, QMessageBox::No ) == QMessageBox::No )
524 return; 524 return;
525 } 525 }
526 } 526 }
527 527
528 // open GPS device 528 // open GPS device
529 if ( configwindow->enableGPS->isChecked() ) 529 if ( configwindow->enableGPS->isChecked() )
530 { 530 {
531 qDebug( "Wellenreiter:GPS enabled @ %s:%d", (const char*) configwindow->gpsdHost->currentText(), configwindow->gpsdPort->value() ); 531 qDebug( "Wellenreiter:GPS enabled @ %s:%d", (const char*) configwindow->gpsdHost->currentText(), configwindow->gpsdPort->value() );
532 gps->open( configwindow->gpsdHost->currentText(), configwindow->gpsdPort->value() ); 532 gps->open( configwindow->gpsdHost->currentText(), configwindow->gpsdPort->value() );
533 } 533 }
534 534
535 // open pcap and start sniffing 535 // open pcap and start sniffing
536 536
537 if ( configwindow->writeCaptureFile->isChecked() ) // write to a user specified capture file? 537 if ( configwindow->writeCaptureFile->isChecked() ) // write to a user specified capture file?
538 { 538 {
539 dumpname = configwindow->captureFileName->text(); 539 dumpname = configwindow->captureFileName->text();
540 if ( dumpname.isEmpty() ) dumpname = "captureFile"; 540 if ( dumpname.isEmpty() ) dumpname = "captureFile";
541 dumpname.append( '-' ); 541 dumpname.append( '-' );
542 dumpname.append( QTime::currentTime().toString().replace( QRegExp( ":" ), "-" ) ); 542 dumpname.append( QTime::currentTime().toString().replace( QRegExp( ":" ), "-" ) );
543 dumpname.append( ".wellenreiter" ); 543 dumpname.append( ".wellenreiter" );
544 } 544 }
545 else // write it anyway ;) 545 else // write it anyway ;)
546 { 546 {
547 dumpname = "/var/log/dump.wellenreiter"; 547 dumpname = "/var/log/dump.wellenreiter";
548 } 548 }
549 549
550 if ( cardtype != DEVTYPE_FILE ) 550 if ( cardtype != DEVTYPE_FILE )
551 pcap->open( interface ); 551 pcap->open( interface );
552 else 552 else
553 pcap->open( QFile( interface ) ); 553 pcap->open( QFile( interface ) );
554 554
555 qDebug( "Wellenreiter:: dumping to %s", (const char*) dumpname ); 555 qDebug( "Wellenreiter:: dumping to %s", (const char*) dumpname );
556 pcap->openDumpFile( dumpname ); 556 pcap->openDumpFile( dumpname );
557 557
558 if ( !pcap->isOpen() ) 558 if ( !pcap->isOpen() )
559 { 559 {
560 QMessageBox::warning( this, "Wellenreiter II", tr( "Can't open packet capturer for\n'%1':\n" ).arg( 560 QMessageBox::warning( this, "Wellenreiter II", tr( "Can't open packet capturer for\n'%1':\n" ).arg(
561 cardtype == DEVTYPE_FILE ? (const char*) interface : iface->name() ) + QString(strerror( errno ) )); 561 cardtype == DEVTYPE_FILE ? (const char*) interface : iface->name() ) + QString(strerror( errno ) ));
562 return; 562 return;
563 } 563 }
564 564
565 // set capturer to non-blocking mode 565 // set capturer to non-blocking mode
566 pcap->setBlocking( false ); 566 pcap->setBlocking( false );
567 567
568 // start channel hopper 568 // start channel hopper
569 if ( cardtype != DEVTYPE_FILE ) 569 if ( cardtype != DEVTYPE_FILE )
570 { 570 {
571 logwindow->log( QString().sprintf( "(i) Starting channel hopper (d=%d ms)", configwindow->hopInterval->value() ) ); 571 logwindow->log( QString().sprintf( "(i) Starting channel hopper (d=%d ms)", configwindow->hopInterval->value() ) );
572 iface->setChannelHopping( configwindow->hopInterval->value() ); //use interval from config window 572 iface->setChannelHopping( configwindow->hopInterval->value() ); //use interval from config window
573 } 573 }
574 574
575 if ( cardtype != DEVTYPE_FILE ) 575 if ( cardtype != DEVTYPE_FILE )
576 { 576 {
577 // connect socket notifier and start channel hopper 577 // connect socket notifier and start channel hopper
578 connect( pcap, SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) ); 578 connect( pcap, SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) );
579 connect( iface->channelHopper(), SIGNAL( hopped(int) ), this, SLOT( channelHopped(int) ) ); 579 connect( iface->channelHopper(), SIGNAL( hopped(int) ), this, SLOT( channelHopped(int) ) );
580 } 580 }
581 else 581 else
582 { 582 {
583 // start timer for reading packets 583 // start timer for reading packets
584 startTimer( 100 ); 584 startTimer( 100 );
585 } 585 }
586 586
587 logwindow->log( "(i) Started Scanning." ); 587 logwindow->log( "(i) Started Scanning." );
588 sniffing = true; 588 sniffing = true;
589 589
590 #ifdef QWS 590 #ifdef QWS
591 if ( WellenreiterConfigWindow::instance()->disablePM->isChecked() ) 591 if ( WellenreiterConfigWindow::instance()->disablePM->isChecked() )
592 { 592 {
593 QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Disable; 593 QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Disable;
594 } 594 }
595 #else 595 #else
596 #warning FIXME: setScreenSaverMode is not operational on the X11 build 596 #warning FIXME: setScreenSaverMode is not operational on the X11 build
597 #endif 597 #endif
598 598
599 emit( startedSniffing() ); 599 emit( startedSniffing() );
600 if ( cardtype != DEVTYPE_FILE ) channelHopped( 6 ); // set title 600 if ( cardtype != DEVTYPE_FILE ) channelHopped( 6 ); // set title
601 else 601 else
602 { 602 {
603 assert( parent() ); 603 assert( parent() );
604 ( (QMainWindow*) parent() )->setCaption( tr( "Wellenreiter II - replaying capture file..." ) ); 604 ( (QMainWindow*) parent() )->setCaption( tr( "Wellenreiter II - replaying capture file..." ) );
605 } 605 }
606} 606}
607 607
608 608
609void Wellenreiter::timerEvent( QTimerEvent* ) 609void Wellenreiter::timerEvent( QTimerEvent* )
610{ 610{
611 qDebug( "Wellenreiter::timerEvent()" ); 611 qDebug( "Wellenreiter::timerEvent()" );
612 OPacket* p = pcap->next(); 612 OPacket* p = pcap->next();
613 if ( !p ) // no more packets available 613 if ( !p ) // no more packets available
614 { 614 {
615 stopClicked(); 615 stopClicked();
616 } 616 }
617 else 617 else
618 { 618 {
619 receivePacket( p ); 619 receivePacket( p );
620 delete p; 620 delete p;
621 } 621 }
622} 622}
623 623
624 624
625void Wellenreiter::doAction( const QString& action, const QString& protocol, OPacket* p ) 625void Wellenreiter::doAction( const QString& action, const QString& protocol, OPacket* p )
626{ 626{
627 #ifdef QWS 627 #ifdef QWS
628 if ( action == "TouchSound" ) 628 if ( action == "TouchSound" )
629 ODevice::inst()->touchSound(); 629 ODevice::inst()->touchSound();
630 else if ( action == "AlarmSound" ) 630 else if ( action == "AlarmSound" )
631 ODevice::inst()->alarmSound(); 631 ODevice::inst()->alarmSound();
632 else if ( action == "KeySound" ) 632 else if ( action == "KeySound" )
633 ODevice::inst()->keySound(); 633 ODevice::inst()->keySound();
634 else if ( action == "LedOn" ) 634 else if ( action == "LedOn" )
635 ODevice::inst()->setLedState( Led_Mail, Led_On ); 635 ODevice::inst()->setLedState( Led_Mail, Led_On );
636 else if ( action == "LedOff" ) 636 else if ( action == "LedOff" )
637 ODevice::inst()->setLedState( Led_Mail, Led_Off ); 637 ODevice::inst()->setLedState( Led_Mail, Led_Off );
638 else if ( action == "LogMessage" ) 638 else if ( action == "LogMessage" )
639 logwindow->log( QString().sprintf( "Got packet with protocol '%s'", (const char*) protocol ) ); 639 logwindow->log( QString().sprintf( "Got packet with protocol '%s'", (const char*) protocol ) );
640 else if ( action == "MessageBox" ) 640 else if ( action == "MessageBox" )
641 QMessageBox::information( this, "Notification!", 641 QMessageBox::information( this, "Notification!",
642 QString().sprintf( "Got packet with protocol '%s'", (const char*) protocol ) ); 642 QString().sprintf( "Got packet with protocol '%s'", (const char*) protocol ) );
643 #else 643 #else
644 #warning Actions do not work with Qt/X11 yet 644 #warning Actions do not work with Qt/X11 yet
645 #endif 645 #endif
646} 646}
647 647
diff --git a/noncore/net/wellenreiter/opie-wellenreiter.control b/noncore/net/wellenreiter/opie-wellenreiter.control
index 18bac98..1d8c482 100644
--- a/noncore/net/wellenreiter/opie-wellenreiter.control
+++ b/noncore/net/wellenreiter/opie-wellenreiter.control
@@ -1,10 +1,10 @@
1Package: opie-wellenreiter 1Package: opie-wellenreiter
2Files: bin/wellenreiter pics/wellenreiter apps/Applications/wellenreiter.desktop 2Files: bin/wellenreiter pics/wellenreiter apps/Applications/wellenreiter.desktop
3Priority: optional 3Priority: optional
4Section: opie/applications 4Section: opie/applications
5Maintainer: Michael 'Mickey' Lauer <mickeyl@handhelds.org> 5Maintainer: Michael 'Mickey' Lauer <mickeyl@handhelds.org>
6Architecture: arm 6Architecture: arm
7Version: 1.0.2-$SUB_VERSION 7Version: 1.0.2-$SUB_VERSION
8Depends: libqpe1, libpcap0 (0.7.2), libopiecore2, libopienet2, libopieui2 8Depends: libqpe1, libpcap0 (0.7.2), libopiecore2, libopienet2 (>=1.8.3), libopieui2
9Description: A WaveLAN Network Monitor 9Description: A WaveLAN Network Monitor
10 A WaveLAN Network Monitor/Sniffer for the Opie Environment. 10 A WaveLAN Network Monitor/Sniffer for the Opie Environment.