summaryrefslogtreecommitdiff
path: root/noncore
Unidiff
Diffstat (limited to 'noncore') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/README37
-rw-r--r--noncore/net/wellenreiter/config.in4
-rw-r--r--noncore/net/wellenreiter/contrib/.cvsignore4
-rw-r--r--noncore/net/wellenreiter/contrib/orinoco_hopper/.cvsignore4
-rw-r--r--noncore/net/wellenreiter/contrib/orinoco_hopper/Makefile.in101
-rw-r--r--noncore/net/wellenreiter/contrib/orinoco_hopper/orinoco_hopper.c118
-rw-r--r--noncore/net/wellenreiter/contrib/orinoco_hopper/orinoco_hopper.obin0 -> 35856 bytes
-rw-r--r--noncore/net/wellenreiter/contrib/orinoco_hopper/orinoco_hopper.pro11
-rw-r--r--noncore/net/wellenreiter/gui/configbase.ui307
-rw-r--r--noncore/net/wellenreiter/gui/gui.pro2
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiter.cpp24
-rw-r--r--noncore/net/wellenreiter/libwellenreiter/source/sniff.cc3
-rw-r--r--noncore/net/wellenreiter/opie-wellenreiter.control2
13 files changed, 605 insertions, 12 deletions
diff --git a/noncore/net/wellenreiter/README b/noncore/net/wellenreiter/README
new file mode 100644
index 0000000..4ed5c28
--- a/dev/null
+++ b/noncore/net/wellenreiter/README
@@ -0,0 +1,37 @@
1/*************************************************************************/
2/* W e l l e n r e i t e r I I */
3/* =============================== */
4/* */
5/* Version: Opie-ALPHA */
6/*************************************************************************/
7
8Release Notes for Opie-ALPHA Version December 2002
9--------------------------------------------------
10
11= Supported Devices =
12
13* low-level orinoco_cs-based (including prism2 and spectrum_cs)
14
15= Build =
16
17To compile Wellenreiter within the Opie build environment, add the
18following directories to $OPIEDIR/Makefile, e.g. to 'NONAPPS='
19
20noncore/net/wellenreiter/libwellenreiter \
21noncore/net/wellenreiter/daemon \
22noncore/net/wellenreiter/contrib/orinoco_hopper \
23noncore/net/wellenreiter/gui
24
25./configure and rebuild.
26
27= Run =
28
291. Place card in monitor mode: iwpriv <interface> 2 1
302. Start $OPIEDIR/bin/orinoco_hopper <interface>
313. Start Wellenreiter
32
33= Credits =
34
35Sniffer: Max Moser <max@remote-exploit.org>
36Communication and Protocol: Martin J. Muench <mjm@remote-exploit.org>
37GUI: Michael Lauer <mickeyl@handhelds.org>
diff --git a/noncore/net/wellenreiter/config.in b/noncore/net/wellenreiter/config.in
index d6b48d8..3c33b68 100644
--- a/noncore/net/wellenreiter/config.in
+++ b/noncore/net/wellenreiter/config.in
@@ -1,4 +1,4 @@
1# config #WELLENREITER 1# config WELLENREITER
2# boolean "wellenreiter" 2# boolean "wellenreiter"
3# default "y" 3# default "y"
4# depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE 4# depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE && LIBPCAP
diff --git a/noncore/net/wellenreiter/contrib/.cvsignore b/noncore/net/wellenreiter/contrib/.cvsignore
new file mode 100644
index 0000000..0e45b67
--- a/dev/null
+++ b/noncore/net/wellenreiter/contrib/.cvsignore
@@ -0,0 +1,4 @@
1*.o
2*~
3moc_*
4Makefile.*
diff --git a/noncore/net/wellenreiter/contrib/orinoco_hopper/.cvsignore b/noncore/net/wellenreiter/contrib/orinoco_hopper/.cvsignore
new file mode 100644
index 0000000..0e45b67
--- a/dev/null
+++ b/noncore/net/wellenreiter/contrib/orinoco_hopper/.cvsignore
@@ -0,0 +1,4 @@
1*.o
2*~
3moc_*
4Makefile.*
diff --git a/noncore/net/wellenreiter/contrib/orinoco_hopper/Makefile.in b/noncore/net/wellenreiter/contrib/orinoco_hopper/Makefile.in
new file mode 100644
index 0000000..c542a59
--- a/dev/null
+++ b/noncore/net/wellenreiter/contrib/orinoco_hopper/Makefile.in
@@ -0,0 +1,101 @@
1#############################################################################
2
3####### Compiler, tools and options
4
5 CXX =$(SYSCONF_CXX) $(QT_CXX_MT)
6 CXXFLAGS=$(SYSCONF_CXXFLAGS)
7 CC =$(SYSCONF_CC) $(QT_C_MT)
8 CFLAGS =$(SYSCONF_CFLAGS)
9 INCPATH =
10 LFLAGS =$(SYSCONF_LFLAGS) $(QT_LFLAGS_MT)
11 LIBS =$(SUBLIBS) $(SYSCONF_LIBS) $(SYSCONF_LIBS_QTAPP)
12 MOC =$(SYSCONF_MOC)
13 UIC =$(SYSCONF_UIC)
14
15####### Target
16
17DESTDIR = $(OPIEDIR)/bin/
18VER_MAJ = 1
19VER_MIN = 0
20VER_PATCH = 0
21 TARGET= orinoco_hopper
22TARGET1 = lib$(TARGET).so.$(VER_MAJ)
23
24####### Files
25
26 HEADERS =
27 SOURCES =orinoco_hopper.c
28 OBJECTS =orinoco_hopper.o
29INTERFACES =
30UICDECLS =
31UICIMPLS =
32 SRCMOC =
33 OBJMOC =
34
35
36####### Implicit rules
37
38.SUFFIXES: .cpp .cxx .cc .C .c
39
40.cpp.o:
41 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
42
43.cxx.o:
44 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
45
46.cc.o:
47 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
48
49.C.o:
50 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
51
52.c.o:
53 $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $<
54
55####### Build rules
56
57
58all: $(DESTDIR)$(TARGET)
59
60$(DESTDIR)$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) $(SUBLIBS)
61 $(SYSCONF_LINK) $(LFLAGS) -o $(DESTDIR)$(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS)
62
63moc: $(SRCMOC)
64
65tmake:
66 tmake orinoco_hopper.pro
67
68clean:
69 -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS)
70 -rm -f *~ core
71 -rm -f allmoc.cpp
72
73####### Extension Modules
74
75listpromodules:
76 @echo
77
78listallmodules:
79 @echo
80
81listaddonpromodules:
82 @echo
83
84listaddonentmodules:
85 @echo
86
87
88REQUIRES=
89
90####### Sub-libraries
91
92
93###### Combined headers
94
95
96
97####### Compile
98
99orinoco_hopper.o: orinoco_hopper.c
100
101
diff --git a/noncore/net/wellenreiter/contrib/orinoco_hopper/orinoco_hopper.c b/noncore/net/wellenreiter/contrib/orinoco_hopper/orinoco_hopper.c
new file mode 100644
index 0000000..78f0299
--- a/dev/null
+++ b/noncore/net/wellenreiter/contrib/orinoco_hopper/orinoco_hopper.c
@@ -0,0 +1,118 @@
1/* orinoco_hopper.c
2 * orinoco wireless nic channel scanning utility
3 *
4 * By Snax <snax@shmoo.com>
5 * Copyright (c) 2002 Snax
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * For a copy of the GNU General Public License write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 */
20
21#include <stdio.h>
22#include <stdlib.h>
23#include <sys/time.h>
24#include <signal.h>
25#include <string.h>
26#include <sys/ioctl.h>
27#include <sys/socket.h>
28#include <linux/wireless.h>
29#include <unistd.h>
30#include <getopt.h>
31
32#ifndef SIOCIWFIRSTPRIV
33#define SIOCIWFIRSTPRIV SIOCDEVPRIVATE
34#endif
35
36void changeChannel(int);
37int setChannel( unsigned char channel );
38
39int max = 11;
40int mode = 2;
41char dev[32];
42
43void changeChannel(int x) {
44 static int chan = 0;
45 chan = (chan % max) + 1;
46 setChannel(chan);
47}
48
49int setChannel( unsigned char channel )
50{
51 int result = 0;
52 int fd;
53 struct iwreq ireq; //for Orinoco
54 int *ptr;
55
56 /* get a socket */
57 fd = socket(AF_INET, SOCK_STREAM, 0);
58
59 if ( fd == -1 ) {
60 return -1;
61 }
62 ptr = (int *) ireq.u.name;
63 ptr[0] = mode;
64 ptr[1] = channel;
65 strcpy(ireq.ifr_ifrn.ifrn_name, dev);
66 result = ioctl( fd, SIOCIWFIRSTPRIV + 0x8, &ireq);
67 close(fd);
68 return result;
69}
70
71void usage(char *cmd) {
72 fprintf(stderr,
73 "Usage: %s <iface> [-p] [-i <interval millisec>] [-n]\n -n = international channels\n -p = keep prism headers\n", cmd);
74 exit(1);
75}
76
77int main (int argc, char *argv[])
78{
79 struct itimerval tval;
80 int ms, r;
81
82 //this will be the channel scanning interval, currently 0.2 sec
83 struct timeval interval = {0, 200000};
84
85 if (argc < 2) usage(argv[0]);
86 strncpy(dev, argv[1], 32);
87 dev[31] = 0;
88
89 while (1) {
90 r = getopt(argc,argv,"i:np");
91 if (r < 0) break;
92 switch (r) {
93 case 'n':
94 max = 14;
95 break;
96 case 'p':
97 mode = 1;
98 break;
99 case 'i':
100 ms = atoi(optarg);
101 interval.tv_sec = ms / 1000;
102 interval.tv_usec = (ms % 1000) * 1000;
103 break;
104 default:
105 usage(argv[0]);
106 }
107 }
108
109 //this sets up the kchannel scanning stuff
110 signal(SIGALRM, changeChannel);
111 tval.it_interval = interval;
112 tval.it_value = interval;
113 setitimer(ITIMER_REAL, &tval, NULL);
114 while (1) pause();
115
116 return 0;
117}
118
diff --git a/noncore/net/wellenreiter/contrib/orinoco_hopper/orinoco_hopper.o b/noncore/net/wellenreiter/contrib/orinoco_hopper/orinoco_hopper.o
new file mode 100644
index 0000000..dd90c62
--- a/dev/null
+++ b/noncore/net/wellenreiter/contrib/orinoco_hopper/orinoco_hopper.o
Binary files differ
diff --git a/noncore/net/wellenreiter/contrib/orinoco_hopper/orinoco_hopper.pro b/noncore/net/wellenreiter/contrib/orinoco_hopper/orinoco_hopper.pro
new file mode 100644
index 0000000..a85520c
--- a/dev/null
+++ b/noncore/net/wellenreiter/contrib/orinoco_hopper/orinoco_hopper.pro
@@ -0,0 +1,11 @@
1DESTDIR = $(OPIEDIR)/bin
2TEMPLATE = app
3CONFIG = warn_on debug
4#CONFIG = warn_on release
5HEADERS =
6SOURCES = orinoco_hopper.c
7INCLUDEPATH +=
8DEPENDPATH +=
9LIBS +=
10INTERFACES =
11TARGET = orinoco_hopper
diff --git a/noncore/net/wellenreiter/gui/configbase.ui b/noncore/net/wellenreiter/gui/configbase.ui
new file mode 100644
index 0000000..8f38252
--- a/dev/null
+++ b/noncore/net/wellenreiter/gui/configbase.ui
@@ -0,0 +1,307 @@
1<!DOCTYPE UI><UI>
2<class>Form1</class>
3<widget>
4 <class>QWidget</class>
5 <property stdset="1">
6 <name>name</name>
7 <cstring>Form1</cstring>
8 </property>
9 <property stdset="1">
10 <name>geometry</name>
11 <rect>
12 <x>0</x>
13 <y>0</y>
14 <width>226</width>
15 <height>300</height>
16 </rect>
17 </property>
18 <property stdset="1">
19 <name>caption</name>
20 <string>Form1</string>
21 </property>
22 <vbox>
23 <property stdset="1">
24 <name>margin</name>
25 <number>11</number>
26 </property>
27 <property stdset="1">
28 <name>spacing</name>
29 <number>6</number>
30 </property>
31 <widget>
32 <class>QGroupBox</class>
33 <property stdset="1">
34 <name>name</name>
35 <cstring>GroupBox1</cstring>
36 </property>
37 <property stdset="1">
38 <name>title</name>
39 <string>Sniffer Options</string>
40 </property>
41 <grid>
42 <property stdset="1">
43 <name>margin</name>
44 <number>11</number>
45 </property>
46 <property stdset="1">
47 <name>spacing</name>
48 <number>6</number>
49 </property>
50 <widget row="0" column="0" >
51 <class>QLayoutWidget</class>
52 <property stdset="1">
53 <name>name</name>
54 <cstring>Layout1</cstring>
55 </property>
56 <grid>
57 <property stdset="1">
58 <name>margin</name>
59 <number>0</number>
60 </property>
61 <property stdset="1">
62 <name>spacing</name>
63 <number>6</number>
64 </property>
65 <widget row="2" column="0" >
66 <class>QSpinBox</class>
67 <property stdset="1">
68 <name>name</name>
69 <cstring>hopInterval</cstring>
70 </property>
71 <property stdset="1">
72 <name>suffix</name>
73 <string> ms</string>
74 </property>
75 <property stdset="1">
76 <name>maxValue</name>
77 <number>2000</number>
78 </property>
79 <property stdset="1">
80 <name>minValue</name>
81 <number>100</number>
82 </property>
83 <property stdset="1">
84 <name>lineStep</name>
85 <number>100</number>
86 </property>
87 </widget>
88 <widget row="2" column="1" >
89 <class>QLabel</class>
90 <property stdset="1">
91 <name>name</name>
92 <cstring>TextLabel3</cstring>
93 </property>
94 <property stdset="1">
95 <name>text</name>
96 <string>Hop Interval</string>
97 </property>
98 </widget>
99 <widget row="0" column="0" >
100 <class>QComboBox</class>
101 <item>
102 <property>
103 <name>text</name>
104 <string>&lt;select&gt;</string>
105 </property>
106 </item>
107 <item>
108 <property>
109 <name>text</name>
110 <string>eth0</string>
111 </property>
112 </item>
113 <item>
114 <property>
115 <name>text</name>
116 <string>eth1</string>
117 </property>
118 </item>
119 <item>
120 <property>
121 <name>text</name>
122 <string>wlan0</string>
123 </property>
124 </item>
125 <item>
126 <property>
127 <name>text</name>
128 <string>wlan1</string>
129 </property>
130 </item>
131 <item>
132 <property>
133 <name>text</name>
134 <string>wifi0</string>
135 </property>
136 </item>
137 <item>
138 <property>
139 <name>text</name>
140 <string>wifi1</string>
141 </property>
142 </item>
143 <property stdset="1">
144 <name>name</name>
145 <cstring>interfaceName</cstring>
146 </property>
147 </widget>
148 <widget row="0" column="1" >
149 <class>QLabel</class>
150 <property stdset="1">
151 <name>name</name>
152 <cstring>TextLabel1</cstring>
153 </property>
154 <property stdset="1">
155 <name>text</name>
156 <string>Interface Name</string>
157 </property>
158 </widget>
159 <widget row="1" column="0" >
160 <class>QComboBox</class>
161 <item>
162 <property>
163 <name>text</name>
164 <string>&lt;select&gt;</string>
165 </property>
166 </item>
167 <item>
168 <property>
169 <name>text</name>
170 <string>cisco</string>
171 </property>
172 </item>
173 <item>
174 <property>
175 <name>text</name>
176 <string>orinoco</string>
177 </property>
178 </item>
179 <item>
180 <property>
181 <name>text</name>
182 <string>prism</string>
183 </property>
184 </item>
185 <item>
186 <property>
187 <name>text</name>
188 <string>&lt;manual&gt;</string>
189 </property>
190 </item>
191 <property stdset="1">
192 <name>name</name>
193 <cstring>deviceType</cstring>
194 </property>
195 </widget>
196 <widget row="1" column="1" >
197 <class>QLabel</class>
198 <property stdset="1">
199 <name>name</name>
200 <cstring>TextLabel2</cstring>
201 </property>
202 <property stdset="1">
203 <name>text</name>
204 <string>Device Type</string>
205 </property>
206 </widget>
207 </grid>
208 </widget>
209 </grid>
210 </widget>
211 <widget>
212 <class>QGroupBox</class>
213 <property stdset="1">
214 <name>name</name>
215 <cstring>GroupBox8</cstring>
216 </property>
217 <property stdset="1">
218 <name>title</name>
219 <string>Advanced Options</string>
220 </property>
221 <widget>
222 <class>QCheckBox</class>
223 <property stdset="1">
224 <name>name</name>
225 <cstring>additionalInfo</cstring>
226 </property>
227 <property stdset="1">
228 <name>geometry</name>
229 <rect>
230 <x>11</x>
231 <y>19</y>
232 <width>147</width>
233 <height>19</height>
234 </rect>
235 </property>
236 <property stdset="1">
237 <name>text</name>
238 <string>Gather Additional Info</string>
239 </property>
240 </widget>
241 <widget>
242 <class>QCheckBox</class>
243 <property stdset="1">
244 <name>name</name>
245 <cstring>activeScanning</cstring>
246 </property>
247 <property stdset="1">
248 <name>geometry</name>
249 <rect>
250 <x>11</x>
251 <y>44</y>
252 <width>175</width>
253 <height>19</height>
254 </rect>
255 </property>
256 <property stdset="1">
257 <name>text</name>
258 <string>Active Scanning (caution!)</string>
259 </property>
260 </widget>
261 </widget>
262 <widget>
263 <class>QGroupBox</class>
264 <property stdset="1">
265 <name>name</name>
266 <cstring>GroupBox3</cstring>
267 </property>
268 <property stdset="1">
269 <name>title</name>
270 <string>GUI Options</string>
271 </property>
272 <vbox>
273 <property stdset="1">
274 <name>margin</name>
275 <number>11</number>
276 </property>
277 <property stdset="1">
278 <name>spacing</name>
279 <number>6</number>
280 </property>
281 <widget>
282 <class>QCheckBox</class>
283 <property stdset="1">
284 <name>name</name>
285 <cstring>groupNetworks</cstring>
286 </property>
287 <property stdset="1">
288 <name>text</name>
289 <string>Group Detected Networks</string>
290 </property>
291 </widget>
292 <widget>
293 <class>QCheckBox</class>
294 <property stdset="1">
295 <name>name</name>
296 <cstring>enableActivity</cstring>
297 </property>
298 <property stdset="1">
299 <name>text</name>
300 <string>Enable Activity Display</string>
301 </property>
302 </widget>
303 </vbox>
304 </widget>
305 </vbox>
306</widget>
307</UI>
diff --git a/noncore/net/wellenreiter/gui/gui.pro b/noncore/net/wellenreiter/gui/gui.pro
index 8f14bc1..a047433 100644
--- a/noncore/net/wellenreiter/gui/gui.pro
+++ b/noncore/net/wellenreiter/gui/gui.pro
@@ -1,11 +1,11 @@
1DESTDIR = $(OPIEDIR)/bin 1DESTDIR = $(OPIEDIR)/bin
2TEMPLATE = app 2TEMPLATE = app
3CONFIG = qt warn_on debug 3CONFIG = qt warn_on debug
4#CONFIG = qt warn_on release 4#CONFIG = qt warn_on release
5HEADERS = wellenreiterbase.h wellenreiter.h scanlistitem.h scanlist.h logwindow.h hexwindow.h 5HEADERS = wellenreiterbase.h wellenreiter.h scanlistitem.h scanlist.h logwindow.h hexwindow.h
6SOURCES = main.cpp wellenreiterbase.cpp wellenreiter.cpp scanlistitem.cpp scanlist.cpp logwindow.cpp hexwindow.cpp 6SOURCES = main.cpp wellenreiterbase.cpp wellenreiter.cpp scanlistitem.cpp scanlist.cpp logwindow.cpp hexwindow.cpp
7INCLUDEPATH += $(OPIEDIR)/include ../daemon 7INCLUDEPATH += $(OPIEDIR)/include ../daemon
8DEPENDPATH += $(OPIEDIR)/include ../daemon 8DEPENDPATH += $(OPIEDIR)/include ../daemon
9LIBS += -lqpe -lopie -lwellenreiter 9LIBS += -lqpe -lopie -lwellenreiter
10INTERFACES = wellenreitertemplate.ui 10INTERFACES = configbase.ui
11TARGET = wellenreiter 11TARGET = wellenreiter
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp
index 6d62fa8..3453d18 100644
--- a/noncore/net/wellenreiter/gui/wellenreiter.cpp
+++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp
@@ -1,71 +1,73 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. 2** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved.
3** 3**
4** This file is part of Opie Environment. 4** This file is part of Opie Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14***********************************************************************/ 14***********************************************************************/
15 15
16// Qt 16// Qt
17 17
18#include <qpushbutton.h> 18#include <qpushbutton.h>
19 19
20// Standard 20// Standard
21 21
22#include <assert.h> 22#include <assert.h>
23#include <errno.h>
23#include <unistd.h> 24#include <unistd.h>
25#include <string.h>
24#include <sys/types.h> 26#include <sys/types.h>
25 27
26// Local 28// Local
27 29
28#include "wellenreiter.h" 30#include "wellenreiter.h"
29#include "scanlistitem.h" 31#include "scanlistitem.h"
30#include "logwindow.h" 32#include "logwindow.h"
31#include "hexwindow.h" 33#include "hexwindow.h"
32 34
33#include "../libwellenreiter/source/sock.hh" // <--- ugly path, FIX THIS! 35#include "../libwellenreiter/source/sock.hh" // <--- ugly path, FIX THIS!
34#include "../libwellenreiter/source/proto.hh" // <--- ugly path, FIX THIS! 36#include "../libwellenreiter/source/proto.hh" // <--- ugly path, FIX THIS!
35#include "../daemon/source/config.hh" // <--- ugly path, FIX THIS! 37#include "../daemon/source/config.hh" // <--- ugly path, FIX THIS!
36 38
37Wellenreiter::Wellenreiter( QWidget* parent, const char* name, WFlags fl ) 39Wellenreiter::Wellenreiter( QWidget* parent, const char* name, WFlags fl )
38 : WellenreiterBase( parent, name, fl ) 40 : WellenreiterBase( parent, name, fl )
39{ 41{
40 42
41 logwindow->log( "(i) Wellenreiter has been started." ); 43 logwindow->log( "(i) Wellenreiter has been started." );
42 44
43 connect( button, SIGNAL( clicked() ), this, SLOT( buttonClicked() ) ); 45 connect( button, SIGNAL( clicked() ), this, SLOT( buttonClicked() ) );
44 netview->setColumnWidthMode( 1, QListView::Manual ); 46 netview->setColumnWidthMode( 1, QListView::Manual );
45 47
46 // 48 //
47 // setup socket for daemon communication and start poller 49 // setup socket for daemon communication and start poller
48 // 50 //
49 51
50 daemon_fd = commsock( GUIADDR, GUIPORT ); 52 daemon_fd = commsock( GUIADDR, GUIPORT );
51 if ( daemon_fd == -1 ) 53 if ( daemon_fd == -1 )
52 { 54 {
53 logwindow->log( "(E) Couldn't get file descriptor for commsocket." ); 55 logwindow->log( "(E) Couldn't get file descriptor for commsocket." );
54 qDebug( "D'oh! Could not get file descriptor for daemon-->gui communication socket." ); 56 qDebug( "D'oh! Could not get file descriptor for daemon-->gui communication socket." );
55 } 57 }
56 else 58 else
57 startTimer( 700 ); 59 startTimer( 700 );
58 60
59} 61}
60 62
61Wellenreiter::~Wellenreiter() 63Wellenreiter::~Wellenreiter()
62{ 64{
63 // no need to delete child widgets, Qt does it all for us 65 // no need to delete child widgets, Qt does it all for us
64} 66}
65 67
66void Wellenreiter::handleMessage() 68void Wellenreiter::handleMessage()
67{ 69{
68 // FIXME: receive message and handle it 70 // FIXME: receive message and handle it
69 71
70 qDebug( "received message from daemon." ); 72 qDebug( "received message from daemon." );
71 73
@@ -86,113 +88,121 @@ typedef struct {
86*/ 88*/
87 89
88 // qDebug( "Sniffer sent: '%s'", (const char*) buffer ); 90 // qDebug( "Sniffer sent: '%s'", (const char*) buffer );
89 hexwindow->log( (const char*) &buffer ); 91 hexwindow->log( (const char*) &buffer );
90 92
91 if ( result == NETFOUND ) /* new network found */ 93 if ( result == NETFOUND ) /* new network found */
92 { 94 {
93 qDebug( "Sniffer said: new network found." ); 95 qDebug( "Sniffer said: new network found." );
94 wl_network_t n; 96 wl_network_t n;
95 get_network_found( &n, (char*) &buffer ); 97 get_network_found( &n, (char*) &buffer );
96 98
97 qDebug( "Sniffer said: net_type is %d.", n.net_type ); 99 qDebug( "Sniffer said: net_type is %d.", n.net_type );
98 qDebug( "Sniffer said: MAC is %s", (const char*) &n.mac ); 100 qDebug( "Sniffer said: MAC is %s", (const char*) &n.mac );
99 101
100 //n.bssid[n.ssid_len] = "\0"; 102 //n.bssid[n.ssid_len] = "\0";
101 103
102 QString type; 104 QString type;
103 105
104 if ( n.net_type == 1 ) 106 if ( n.net_type == 1 )
105 type = "managed"; 107 type = "managed";
106 else 108 else
107 type = "adhoc"; 109 type = "adhoc";
108 110
109 addNewItem( type, n.bssid, QString( (const char*) &n.mac ), n.wep, n.channel, 0 ); 111 addNewItem( type, n.bssid, QString( (const char*) &n.mac ), n.wep, n.channel, 0 );
110 112
111 } 113 }
112 114
113 else 115 else
114 116
115 { 117 {
116 qDebug( "unknown sniffer command." ); 118 qDebug( "unknown sniffer command." );
117 } 119 }
118 120
119} 121}
120 122
121 123
122bool Wellenreiter::hasMessage() 124bool Wellenreiter::hasMessage()
123{ 125{
124 126
125 // FIXME: do this in libwellenreiter, not here!!! 127 // FIXME: do this in libwellenreiter, not here!!!
126 128
127 fd_set rfds; 129 fd_set rfds;
128 FD_ZERO( &rfds ); 130 FD_ZERO( &rfds );
129 FD_SET( daemon_fd, &rfds ); 131 FD_SET( daemon_fd, &rfds );
130 struct timeval tv; 132 struct timeval tv;
131 tv.tv_sec = 0; 133 tv.tv_sec = 0;
132 tv.tv_usec = 10; 134 tv.tv_usec = 10;
133 int result = select( daemon_fd+1, &rfds, NULL, NULL, &tv ); 135 int result = select( daemon_fd+1, &rfds, NULL, NULL, &tv );
134 return FD_ISSET( daemon_fd, &rfds ); 136
137 if ( result == 0 )
138 {
139 return false;
140 }
141 else if ( result == -1 )
142 {
143 qDebug( "selected returned: %s", strerror( errno ) );
144 return false;
145 }
146 else
147 return true; //FD_ISSET( daemon_fd, &rfds ); gibbet 'eh nur einen Deskriptor
135} 148}
136 149
137void Wellenreiter::timerEvent( QTimerEvent* e ) 150void Wellenreiter::timerEvent( QTimerEvent* e )
138{ 151{
139 qDebug( "checking for message..." ); 152 qDebug( "checking for message..." );
140 153 if ( hasMessage() )
141 int result = hasMessage();
142 qDebug( "hasMessage() returned %d", result );
143
144 if ( result )
145 { 154 {
155 qDebug( "got message" );
146 handleMessage(); 156 handleMessage();
147 } 157 }
148 else 158 else
149 { 159 {
150 qDebug( "no message :(" ); 160 qDebug( "no message..." );
151 } 161 }
152} 162}
153 163
154void Wellenreiter::addNewItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal ) 164void Wellenreiter::addNewItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal )
155{ 165{
156 // FIXME: this code belongs in customized QListView, not into this class 166 // FIXME: this code belongs in customized QListView, not into this class
157 // FIXME: scanlistitem needs a proper encapsulation and not such a damn dealing with text(...) 167 // FIXME: scanlistitem needs a proper encapsulation and not such a damn dealing with text(...)
158 168
159 qDebug( "Wellenreiter::addNewItem( %s / %s / %s [%d]", 169 qDebug( "Wellenreiter::addNewItem( %s / %s / %s [%d]",
160 (const char*) type, 170 (const char*) type,
161 (const char*) essid, 171 (const char*) essid,
162 (const char*) macaddr, 172 (const char*) macaddr,
163 channel ); 173 channel );
164 174
165 // search, if we already have seen this net 175 // search, if we already have seen this net
166 176
167 QString s; 177 QString s;
168 MScanListItem* network; 178 MScanListItem* network;
169 MScanListItem* item = (MScanListItem*) netview->firstChild(); 179 MScanListItem* item = (MScanListItem*) netview->firstChild();
170 180
171 while ( item && ( item->text( 0 ) != essid ) ) 181 while ( item && ( item->text( 0 ) != essid ) )
172 { 182 {
173 qDebug( "itemtext: %s", (const char*) item->text( 0 ) ); 183 qDebug( "itemtext: %s", (const char*) item->text( 0 ) );
174 item = item->itemBelow(); 184 item = item->itemBelow();
175 } 185 }
176 if ( item ) 186 if ( item )
177 { 187 {
178 // we have already seen this net, check all childs if MAC exists 188 // we have already seen this net, check all childs if MAC exists
179 189
180 network = item; 190 network = item;
181 191
182 item = item->firstChild(); 192 item = item->firstChild();
183 assert( item ); // this shouldn't fail 193 assert( item ); // this shouldn't fail
184 194
185 while ( item && ( item->text( 2 ) != macaddr ) ) 195 while ( item && ( item->text( 2 ) != macaddr ) )
186 { 196 {
187 qDebug( "subitemtext: %s", (const char*) item->text( 2 ) ); 197 qDebug( "subitemtext: %s", (const char*) item->text( 2 ) );
188 item = item->itemBelow(); 198 item = item->itemBelow();
189 } 199 }
190 200
191 if ( item ) 201 if ( item )
192 { 202 {
193 // we have already seen this item, it's a dupe 203 // we have already seen this item, it's a dupe
194 qDebug( "%s is a dupe - ignoring...", (const char*) macaddr ); 204 qDebug( "%s is a dupe - ignoring...", (const char*) macaddr );
195 return; 205 return;
196 } 206 }
197 } 207 }
198 else 208 else
diff --git a/noncore/net/wellenreiter/libwellenreiter/source/sniff.cc b/noncore/net/wellenreiter/libwellenreiter/source/sniff.cc
index 6b0fffb..84caf12 100644
--- a/noncore/net/wellenreiter/libwellenreiter/source/sniff.cc
+++ b/noncore/net/wellenreiter/libwellenreiter/source/sniff.cc
@@ -49,97 +49,98 @@ void process_packets(const struct pcap_pkthdr *pkthdr, const unsigned char *pack
49 to hold a correct header of its type */ 49 to hold a correct header of its type */
50 pinfoptr->isvalid = 0; 50 pinfoptr->isvalid = 0;
51 return; 51 return;
52 } 52 }
53 53
54 /* Decode 802.11b header out of the packet */ 54 /* Decode 802.11b header out of the packet */
55 if (decode_80211b_hdr(packet,pinfoptr) == 0) 55 if (decode_80211b_hdr(packet,pinfoptr) == 0)
56 { 56 {
57 /* Justification of the ofset to further process the packet */ 57 /* Justification of the ofset to further process the packet */
58 length -= HEADER_LENGTH; 58 length -= HEADER_LENGTH;
59 caplen -= HEADER_LENGTH; 59 caplen -= HEADER_LENGTH;
60 packet += HEADER_LENGTH; 60 packet += HEADER_LENGTH;
61 } 61 }
62 else /* Something is wrong,could not be a correct packet */ 62 else /* Something is wrong,could not be a correct packet */
63 return; 63 return;
64 64
65 switch (FC_TYPE(fc)) 65 switch (FC_TYPE(fc))
66 { 66 {
67 /* Is it a managemnet frame? */ 67 /* Is it a managemnet frame? */
68 case T_MGMT: 68 case T_MGMT:
69 switch (FC_SUBTYPE(fc)) 69 switch (FC_SUBTYPE(fc))
70 { 70 {
71 case ST_BEACON: 71 case ST_BEACON:
72 if (handle_beacon(fc, packet,pinfoptr) ==0) 72 if (handle_beacon(fc, packet,pinfoptr) ==0)
73 { 73 {
74 if (!strcmp(pinfoptr->desthwaddr,"ff:ff:ff:ff:ff:ff") == 0) 74 if (!strcmp(pinfoptr->desthwaddr,"ff:ff:ff:ff:ff:ff") == 0)
75 { 75 {
76 /* Every beacon must have the broadcast as destination 76 /* Every beacon must have the broadcast as destination
77 so it must be a shitti packet */ 77 so it must be a shitti packet */
78 pinfoptr->isvalid = 0; 78 pinfoptr->isvalid = 0;
79 return; 79 return;
80 } 80 }
81 81
82 if (pinfoptr->cap_ESS == pinfoptr->cap_IBSS) 82 if (pinfoptr->cap_ESS == pinfoptr->cap_IBSS)
83 { 83 {
84 /* Only one of both are possible, so must be 84 /* Only one of both are possible, so must be
85 a noise packet, if this comes up */ 85 a noise packet, if this comes up */
86 pinfoptr->isvalid = 0; 86 pinfoptr->isvalid = 0;
87 return; 87 return;
88 } 88 }
89 if (pinfoptr->channel < 1 || pinfoptr->channel > 14) 89 if (pinfoptr->channel < 1 || pinfoptr->channel > 14)
90 { 90 {
91 /* Only channels between 1 and 14 are possible 91 /* Only channels between 1 and 14 are possible
92 others must be noise packets */ 92 others must be noise packets */
93 pinfoptr->isvalid = 0; 93 pinfoptr->isvalid = 0;
94 return; 94 return;
95 } 95 }
96 96
97 97 printf( "cap_ESS is %d, cap_IBSS is %d\n", pinfoptr->cap_ESS, pinfoptr->cap_IBSS );
98
98 /* Here should be the infos to the gui issued */ 99 /* Here should be the infos to the gui issued */
99 if (pinfoptr->cap_ESS == 1 &&pinfoptr->cap_IBSS ==0) 100 if (pinfoptr->cap_ESS == 1 &&pinfoptr->cap_IBSS ==0)
100 { 101 {
101 wl_loginfo("Found an access point"); 102 wl_loginfo("Found an access point");
102 wl_net.net_type=1; 103 wl_net.net_type=1;
103 } 104 }
104 else if(pinfoptr->cap_ESS == 0 && pinfoptr->cap_IBSS == 2) 105 else if(pinfoptr->cap_ESS == 0 && pinfoptr->cap_IBSS == 2)
105 { 106 {
106 wl_loginfo("Found an ad-hoc network"); 107 wl_loginfo("Found an ad-hoc network");
107 wl_net.net_type=2; 108 wl_net.net_type=2;
108 } 109 }
109 if (strcmp (pinfoptr->ssid,NONBROADCASTING) ==0) 110 if (strcmp (pinfoptr->ssid,NONBROADCASTING) ==0)
110 { 111 {
111 wl_loginfo("Net is a non-broadcasting network"); 112 wl_loginfo("Net is a non-broadcasting network");
112 } 113 }
113 else 114 else
114 { 115 {
115 wl_loginfo("SSID is: %s", pinfoptr->ssid); 116 wl_loginfo("SSID is: %s", pinfoptr->ssid);
116 // wl_net.bssid=pinfoptr->ssid; 117 // wl_net.bssid=pinfoptr->ssid;
117 } 118 }
118 119
119 wl_loginfo("SSID length is: %d", pinfoptr->ssid_len); 120 wl_loginfo("SSID length is: %d", pinfoptr->ssid_len);
120 wl_net.ssid_len=pinfoptr->ssid_len; 121 wl_net.ssid_len=pinfoptr->ssid_len;
121 122
122 wl_loginfo("Channel is: %d", pinfoptr->channel); 123 wl_loginfo("Channel is: %d", pinfoptr->channel);
123 wl_net.channel=pinfoptr->channel; 124 wl_net.channel=pinfoptr->channel;
124 wl_net.wep=pinfoptr->cap_WEP; 125 wl_net.wep=pinfoptr->cap_WEP;
125 126
126 wl_loginfo("Mac is: %s", pinfoptr->sndhwaddr); 127 wl_loginfo("Mac is: %s", pinfoptr->sndhwaddr);
127 memcpy(wl_net.mac, pinfoptr->sndhwaddr, sizeof(wl_net.mac)-1);; 128 memcpy(wl_net.mac, pinfoptr->sndhwaddr, sizeof(wl_net.mac)-1);;
128 wl_loginfo("SSID is: %s", pinfoptr->ssid); 129 wl_loginfo("SSID is: %s", pinfoptr->ssid);
129 memcpy(wl_net.bssid, pinfoptr->ssid, sizeof(wl_net.bssid)-1); 130 memcpy(wl_net.bssid, pinfoptr->ssid, sizeof(wl_net.bssid)-1);
130 131
131 // printf ("\n\tDest : %s\n",pinfoptr->desthwaddr); 132 // printf ("\n\tDest : %s\n",pinfoptr->desthwaddr);
132 send_network_found((char *)guihost, guiport, &wl_net); 133 send_network_found((char *)guihost, guiport, &wl_net);
133 wl_loginfo("Sent network to GUI '%s:%d'", guihost, guiport); 134 wl_loginfo("Sent network to GUI '%s:%d'", guihost, guiport);
134 } 135 }
135 break; 136 break;
136 default: 137 default:
137 wl_logerr("Unknown IEEE802.11 frame subtype (%d)", FC_SUBTYPE(fc)); 138 wl_logerr("Unknown IEEE802.11 frame subtype (%d)", FC_SUBTYPE(fc));
138 break; 139 break;
139 } /* End of switch over different mgt frame types */ 140 } /* End of switch over different mgt frame types */
140 141
141 break; 142 break;
142 143
143 case T_CTRL: 144 case T_CTRL:
144 wl_loginfo("Received control frame, not implemented yet"); 145 wl_loginfo("Received control frame, not implemented yet");
145 break; 146 break;
diff --git a/noncore/net/wellenreiter/opie-wellenreiter.control b/noncore/net/wellenreiter/opie-wellenreiter.control
index da83359..83bfd0e 100644
--- a/noncore/net/wellenreiter/opie-wellenreiter.control
+++ b/noncore/net/wellenreiter/opie-wellenreiter.control
@@ -1,9 +1,9 @@
1Files: bin/wellenreiter bin/wellenreiterd pics/wellenreiter $QTDIR/lib/libwellenreiter.* 1Files: bin/wellenreiter bin/wellenreiterd bin/orinoco_hopper pics/wellenreiter $QTDIR/lib/libwellenreiter.*
2Priority: optional 2Priority: optional
3Section: opie/applications 3Section: opie/applications
4Maintainer: Michael Lauer <mickeyl@handhelds.org> 4Maintainer: Michael Lauer <mickeyl@handhelds.org>
5Architecture: arm 5Architecture: arm
6Version: $QPE_VERSION-$SUB_VERSION 6Version: $QPE_VERSION-$SUB_VERSION
7Depends: opie-base ($QPE_VERSION) 7Depends: opie-base ($QPE_VERSION)
8Description: A wavelan network monitor 8Description: A wavelan network monitor
9 A wavelan network monitor/sniffer for the Opie environment. 9 A wavelan network monitor/sniffer for the Opie environment.