use the source from Markus Becker
[openwrt.git] / openwrt / package / kismet / patches / 120-cleanup.patch
1 diff -urN kismet.dev/Makefile.in kismet.dev2/Makefile.in
2 --- kismet.dev/Makefile.in 2005-08-16 03:22:51.000000000 +0200
3 +++ kismet.dev2/Makefile.in 2005-08-23 01:59:25.643220248 +0200
4 @@ -39,26 +39,25 @@
5 DEPEND = .depend
6
7 # Objects
8 -PSO = util.o ringbuf.o configfile.o speech.o ifcontrol.o iwcontrol.o packet.o \
9 - pcapsource.o prism2source.o wtapfilesource.o wsp100source.o \
10 - dronesource.o vihasource.o packetsourcetracker.o kis_packsources.o \
11 - wtapdump.o wtaplocaldump.o gpsdump.o airsnortdump.o fifodump.o \
12 - gpsd.o manuf.o \
13 +PSO = util.o ringbuf.o configfile.o ifcontrol.o iwcontrol.o packet.o \
14 + pcapsource.o manuf.o \
15 + dronesource.o packetsourcetracker.o kis_packsources.o \
16 + wtapdump.o wtaplocaldump.o airsnortdump.o fifodump.o \
17 packetracker.o timetracker.o alertracker.o finitestate.o \
18 getopt.o \
19 tcpserver.o server_protocols.o server_globals.o kismet_server.o
20 PS = kismet_server
21
22 DRONEO = util.o ringbuf.o configfile.o getopt.o ifcontrol.o iwcontrol.o packet.o \
23 - tcpstreamer.o prism2source.o pcapsource.o wtapfilesource.o wsp100source.o \
24 - dronesource.o vihasource.o packetsourcetracker.o kis_packsources.o \
25 - timetracker.o gpsd.o server_globals.o kismet_drone.o
26 + tcpstreamer.o pcapsource.o \
27 + dronesource.o packetsourcetracker.o kis_packsources.o \
28 + timetracker.o server_globals.o kismet_drone.o
29 DRONE = kismet_drone
30
31 -NCO = util.o configfile.o speech.o manuf.o tcpclient.o \
32 +NCO = util.o configfile.o manuf.o tcpclient.o \
33 frontend.o cursesfront.o \
34 panelfront.o panelfront_display.o panelfront_input.o \
35 - gpsd.o getopt.o kismet_client.o
36 + getopt.o kismet_client.o
37 NC = kismet_client
38
39 GPSLO = getopt.o util.o configfile.o expat.o manuf.o \
40 diff -urN kismet.dev/cursesfront.cc kismet.dev2/cursesfront.cc
41 --- kismet.dev/cursesfront.cc 2005-08-16 03:22:51.000000000 +0200
42 +++ kismet.dev2/cursesfront.cc 2005-08-23 01:59:25.643220248 +0200
43 @@ -30,7 +30,6 @@
44 // Enable the protocols we can use
45 void NCurseFront::AddClient(TcpClient *in_client) {
46 client = in_client;
47 - client->EnableProtocol("GPS");
48 client->EnableProtocol("INFO");
49 client->EnableProtocol("REMOVE");
50 client->EnableProtocol("NETWORK");
51 @@ -88,32 +87,8 @@
52 mvwaddstr(netborder, 1, 2, " SSID T W Ch Data LLC Crypt Wk Flags");
53 }
54
55 - char gpsdata[1024];
56 - float lat, lon, alt, spd, heading;
57 int mode;
58
59 - client->FetchLoc(&lat, &lon, &alt, &spd, &heading, &mode);
60 -
61 - if (!(lat == 0 && lon == 0 && alt == 0 && spd == 0 && mode == 0)) {
62 -
63 - char fix[16];
64 -
65 - if (mode == -1)
66 - snprintf(fix, 16, "No signal");
67 - else if (mode == 2)
68 - snprintf(fix, 5, "2D");
69 - else if (mode == 3)
70 - snprintf(fix, 5, "3D");
71 - else
72 - snprintf(fix, 5, "NONE");
73 -
74 - snprintf(gpsdata, 1024, "Lat %.3f Lon %.3f Alt %.3f Spd %.3f Fix %s",
75 - lat, lon, alt, spd, fix);
76 -
77 - mvwaddstr(netborder, LINES-statheight-1, 2, gpsdata);
78 -
79 - }
80 -
81 box(infoborder, '|', '-');
82 mvwaddstr(infoborder, 0, 2, "Info");
83
84 diff -urN kismet.dev/dronesource.cc kismet.dev2/dronesource.cc
85 --- kismet.dev/dronesource.cc 2005-08-16 03:22:51.000000000 +0200
86 +++ kismet.dev2/dronesource.cc 2005-08-23 01:59:25.644220096 +0200
87 @@ -201,9 +201,6 @@
88 return -1;
89 }
90
91 - // Grab the GPS info
92 - gps_enabled = vpkt.gps_enabled;
93 -
94 stream_recv_bytes = 0;
95
96 // printf("debug - version packet valid\n\n");
97 @@ -336,25 +333,6 @@
98 packet->encoding = (encoding_type) phdr.encoding;
99 packet->datarate = (uint32_t) ntohl(phdr.datarate);
100
101 - if (gps_enabled) {
102 - // If the drone is sending us GPS data, use it
103 - packet->gps_lat = Pair2Float((int16_t) ntohs(phdr.gps_lat),
104 - (int64_t) kis_ntoh64(phdr.gps_lat_mant));
105 - packet->gps_lon = Pair2Float((int16_t) ntohs(phdr.gps_lon),
106 - (int64_t) kis_ntoh64(phdr.gps_lon_mant));
107 - packet->gps_alt = Pair2Float((int16_t) ntohs(phdr.gps_alt),
108 - (int64_t) kis_ntoh64(phdr.gps_alt_mant));
109 - packet->gps_spd = Pair2Float((int16_t) ntohs(phdr.gps_spd),
110 - (int64_t) kis_ntoh64(phdr.gps_spd_mant));
111 - packet->gps_heading = Pair2Float((int16_t) ntohs(phdr.gps_heading),
112 - (int64_t) kis_ntoh64(phdr.gps_heading_mant));
113 - packet->gps_fix = phdr.gps_fix;
114 - } else if (gpsd != NULL) {
115 - // Otherwise, no
116 - gpsd->FetchLoc(&packet->gps_lat, &packet->gps_lon, &packet->gps_alt,
117 - &packet->gps_spd, &packet->gps_heading, &packet->gps_fix);
118 - }
119 -
120 packet->data = data;
121 packet->moddata = moddata;
122 packet->modified = 0;
123 diff -urN kismet.dev/dronesource.h kismet.dev2/dronesource.h
124 --- kismet.dev/dronesource.h 2005-08-16 03:22:51.000000000 +0200
125 +++ kismet.dev2/dronesource.h 2005-08-23 01:59:25.644220096 +0200
126 @@ -79,9 +79,6 @@
127 uint8_t databuf[MAX_PACKET_LEN];
128
129 unsigned int resyncing;
130 -
131 - // Is the drone pushing GPS data to us?
132 - int gps_enabled;
133 };
134
135 // Nothing but a registrant for us
136 diff -urN kismet.dev/frontend.cc kismet.dev2/frontend.cc
137 --- kismet.dev/frontend.cc 2005-08-16 03:22:51.000000000 +0200
138 +++ kismet.dev2/frontend.cc 2005-08-23 01:59:25.645219944 +0200
139 @@ -248,33 +248,6 @@
140
141 }
142
143 - // Aggregate the GPS data
144 - if (wnet->aggregate_points > 0) {
145 - dnet->virtnet->aggregate_lat += wnet->aggregate_lat;
146 - dnet->virtnet->aggregate_lon += wnet->aggregate_lon;
147 - dnet->virtnet->aggregate_alt += wnet->aggregate_alt;
148 - dnet->virtnet->aggregate_points += wnet->aggregate_points;
149 - }
150 -
151 - if (wnet->gps_fixed > dnet->virtnet->gps_fixed)
152 - dnet->virtnet->gps_fixed = wnet->gps_fixed;
153 - if (wnet->min_lat < dnet->virtnet->min_lat || dnet->virtnet->min_lat == 0)
154 - dnet->virtnet->min_lat = wnet->min_lat;
155 - if (wnet->min_lon < dnet->virtnet->min_lon || dnet->virtnet->min_lon == 0)
156 - dnet->virtnet->min_lon = wnet->min_lon;
157 - if (wnet->min_alt < dnet->virtnet->min_alt || dnet->virtnet->min_alt == 0)
158 - dnet->virtnet->min_alt = wnet->min_alt;
159 - if (wnet->min_spd < dnet->virtnet->min_spd || dnet->virtnet->min_spd == 0)
160 - dnet->virtnet->min_spd = wnet->min_spd;
161 - if (wnet->max_lat > dnet->virtnet->max_lat || dnet->virtnet->max_lat == 0)
162 - dnet->virtnet->max_lat = wnet->max_lat;
163 - if (wnet->max_lon > dnet->virtnet->max_lon || dnet->virtnet->max_lon == 0)
164 - dnet->virtnet->max_lon = wnet->max_lon;
165 - if (wnet->max_alt > dnet->virtnet->max_alt || dnet->virtnet->max_alt == 0)
166 - dnet->virtnet->max_alt = wnet->max_alt;
167 - if (wnet->max_spd > dnet->virtnet->max_spd || dnet->virtnet->max_spd == 0)
168 - dnet->virtnet->max_spd = wnet->max_spd;
169 -
170 // Aggregate the carriers and encodings
171 dnet->virtnet->carrier_set |= wnet->carrier_set;
172 dnet->virtnet->encoding_set |= wnet->encoding_set;
173 diff -urN kismet.dev/kis_packsources.cc kismet.dev2/kis_packsources.cc
174 --- kismet.dev/kis_packsources.cc 2005-08-23 00:59:04.465379568 +0200
175 +++ kismet.dev2/kis_packsources.cc 2005-08-23 02:01:08.585570632 +0200
176 @@ -60,13 +60,8 @@
177
178 #if defined(HAVE_LIBPCAP) && defined(HAVE_LINUX_WIRELESS)
179 // Linux wext-driven cards
180 - sourcetracker->RegisterPacketsource("cisco", 1, "IEEE80211b", 6,
181 - pcapsource_wext_registrant,
182 - monitor_cisco, unmonitor_cisco,
183 - chancontrol_wext, 1);
184 - sourcetracker->RegisterPacketsource("cisco_wifix", 1, "IEEE80211b", 6,
185 - pcapsource_ciscowifix_registrant,
186 - monitor_cisco_wifix, NULL, NULL, 1);
187 + REG_EMPTY_CARD(sourcetracker, "cisco");
188 + REG_EMPTY_CARD(sourcetracker, "cisco_wifix");
189 sourcetracker->RegisterPacketsource("hostap", 1, "IEEE80211b", 6,
190 pcapsource_wext_registrant,
191 monitor_hostap, unmonitor_hostap,
192 @@ -79,21 +74,9 @@
193 pcapsource_wext_registrant,
194 monitor_orinoco, unmonitor_orinoco,
195 chancontrol_orinoco, 1);
196 - sourcetracker->RegisterPacketsource("acx100", 1, "IEEE80211b", 6,
197 - pcapsource_wextfcs_registrant,
198 - monitor_acx100, unmonitor_acx100,
199 - chancontrol_wext, 1);
200 - sourcetracker->RegisterPacketsource("admtek", 1, "IEEE80211b", 6,
201 - pcapsource_wext_registrant,
202 - monitor_admtek, unmonitor_admtek,
203 - chancontrol_wext, 1);
204 - sourcetracker->RegisterPacketsource("vtar5k", 1, "IEEE80211a", 36,
205 - pcapsource_wext_registrant,
206 - monitor_vtar5k, NULL, chancontrol_wext, 1);
207 - sourcetracker->RegisterPacketsource("atmel_usb", 1, "IEEE80211b", 6,
208 - pcapsource_wext_registrant,
209 - monitor_wext, unmonitor_wext,
210 - chancontrol_wext, 1);
211 + REG_EMPTY_CARD(sourcetracker, "acx100");
212 + REG_EMPTY_CARD(sourcetracker, "admtek");
213 + REG_EMPTY_CARD(sourcetracker, "vtar5k");
214
215 sourcetracker->RegisterPacketsource("madwifi_a", 1, "IEEE80211a", 36,
216 pcapsource_wextfcs_registrant,
217 @@ -121,38 +104,14 @@
218 monitor_prism54g, unmonitor_prism54g,
219 chancontrol_prism54g, 1);
220
221 - sourcetracker->RegisterPacketsource("wlanng_wext", 1, "IEEE80211b", 6,
222 - pcapsource_wlanng_registrant,
223 - monitor_wlanng_avs, NULL,
224 - chancontrol_wext, 1);
225 -
226 - sourcetracker->RegisterPacketsource("ipw2100", 1, "IEEE80211b", 6,
227 - pcapsource_wext_registrant,
228 - monitor_ipw2100, unmonitor_ipw2100,
229 - chancontrol_ipw2100, 1);
230 -
231 - sourcetracker->RegisterPacketsource("ipw2200", 1, "IEEE80211g", 6,
232 - pcapsource_wext_registrant,
233 - monitor_ipw2200, unmonitor_ipw2200,
234 - chancontrol_ipw2200, 1);
235 -
236 - sourcetracker->RegisterPacketsource("ipw2915", 1, "IEEE80211ab", 6,
237 - pcapsource_wext_registrant,
238 - monitor_ipw2200, unmonitor_ipw2200,
239 - chancontrol_ipw2200, 1);
240 + REG_EMPTY_CARD(sourcetracker, "wlanng_wext");
241 + REG_EMPTY_CARD(sourcetracker, "ipw2100");
242 + REG_EMPTY_CARD(sourcetracker, "ipw2200");
243 + REG_EMPTY_CARD(sourcetracker, "ipw2915");
244 + REG_EMPTY_CARD(sourcetracker, "rt2400");
245 + REG_EMPTY_CARD(sourcetracker, "rt2500");
246 + REG_EMPTY_CARD(sourcetracker, "rt8180");
247
248 - sourcetracker->RegisterPacketsource("rt2400", 1, "IEEE80211b", 6,
249 - pcapsource_wext_registrant,
250 - monitor_wext, unmonitor_wext,
251 - chancontrol_wext, 1);
252 - sourcetracker->RegisterPacketsource("rt2500", 1, "IEEE80211g", 6,
253 - pcapsource_11g_registrant,
254 - monitor_wext, unmonitor_wext,
255 - chancontrol_wext, 1);
256 - sourcetracker->RegisterPacketsource("rt8180", 1, "IEEE80211b", 6,
257 - pcapsource_wext_registrant,
258 - monitor_wext, unmonitor_wext,
259 - chancontrol_wext, 1);
260
261 #else
262 // Register the linuxwireless pcap stuff as null
263 @@ -182,31 +141,13 @@
264 REG_EMPTY_CARD(sourcetracker, "wlanng_wext");
265 #endif
266
267 -#if defined(HAVE_LIBPCAP) && defined(SYS_LINUX)
268 - sourcetracker->RegisterPacketsource("wlanng", 1, "IEEE80211b", 6,
269 - pcapsource_wlanng_registrant,
270 - monitor_wlanng, NULL, chancontrol_wlanng, 1);
271 - sourcetracker->RegisterPacketsource("wlanng_avs", 1, "IEEE80211b", 6,
272 - pcapsource_wlanng_registrant,
273 - monitor_wlanng_avs, NULL,
274 - chancontrol_wlanng_avs, 1);
275 sourcetracker->RegisterPacketsource("wrt54g", 1, "na", 0,
276 pcapsource_wrt54g_registrant,
277 - monitor_wrt54g, unmonitor_wrt54g, chancontrol_wext, 0);
278 -#else
279 + monitor_wrt54g, unmonitor_wrt54g, chancontrol_wext, 0);
280 +
281 REG_EMPTY_CARD(sourcetracker, "wlanng");
282 REG_EMPTY_CARD(sourcetracker, "wlanng_avs");
283 - REG_EMPTY_CARD(sourcetracker, "wrt54g");
284 -#endif
285 -
286 -#if defined(SYS_LINUX) && defined(HAVE_LINUX_NETLINK)
287 - sourcetracker->RegisterPacketsource("wlanng_legacy", 1, "IEEE80211b", 6,
288 - prism2source_registrant,
289 - monitor_wlanng_legacy, NULL,
290 - chancontrol_wlanng_legacy, 1);
291 -#else
292 REG_EMPTY_CARD(sourcetracker, "wlanng_legacy");
293 -#endif
294
295 #if defined(HAVE_LIBPCAP) && defined(SYS_OPENBSD)
296 sourcetracker->RegisterPacketsource("cisco_openbsd", 1, "IEEE80211b", 6,
297 @@ -240,29 +181,11 @@
298 REG_EMPTY_CARD(sourcetracker, "radiotap_bsd_b");
299 #endif
300
301 -#if defined(HAVE_LIBWIRETAP)
302 - sourcetracker->RegisterPacketsource("wtapfile", 0, "na", 0,
303 - wtapfilesource_registrant,
304 - NULL, NULL, NULL, 0);
305 -#else
306 REG_EMPTY_CARD(sourcetracker, "wtapfile");
307 -#endif
308
309 -#if defined(HAVE_WSP100)
310 - sourcetracker->RegisterPacketsource("wsp100", 0, "IEEE80211b", 6,
311 - wsp100source_registrant,
312 - monitor_wsp100, NULL, chancontrol_wsp100, 0);
313 -#else
314 REG_EMPTY_CARD(sourcetracker, "wsp100");
315 -#endif
316
317 -#if defined(HAVE_VIHAHEADERS)
318 - sourcetracker->RegisterPacketsource("viha", 1, "IEEE80211b", 6,
319 - vihasource_registrant,
320 - NULL, NULL, chancontrol_viha, 0);
321 -#else
322 REG_EMPTY_CARD(sourcetracker, "viha");
323 -#endif
324
325 return 1;
326 }
327 diff -urN kismet.dev/kis_packsources.h kismet.dev2/kis_packsources.h
328 --- kismet.dev/kis_packsources.h 2005-08-16 03:22:51.000000000 +0200
329 +++ kismet.dev2/kis_packsources.h 2005-08-23 01:59:25.646219792 +0200
330 @@ -22,11 +22,7 @@
331 #include "config.h"
332
333 #include "packetsource.h"
334 -#include "prism2source.h"
335 #include "pcapsource.h"
336 -#include "wtapfilesource.h"
337 -#include "wsp100source.h"
338 -#include "vihasource.h"
339 #include "dronesource.h"
340 #include "packetsourcetracker.h"
341
342 diff -urN kismet.dev/kismet_client.cc kismet.dev2/kismet_client.cc
343 --- kismet.dev/kismet_client.cc 2005-08-16 03:22:51.000000000 +0200
344 +++ kismet.dev2/kismet_client.cc 2005-08-23 01:59:25.648219488 +0200
345 @@ -28,7 +28,6 @@
346 #include "cursesfront.h"
347 #include "panelfront.h"
348 #include "configfile.h"
349 -#include "speech.h"
350
351 #ifndef exec_name
352 char *exec_name;
353 @@ -47,11 +46,7 @@
354 char *configfile;
355 char *uiconfigfile;
356 char *server = NULL;
357 -int sound = -1;
358 -int speech = -1;
359 int flite = 0;
360 -int speech_encoding = 0;
361 -string speech_sentence_encrypted, speech_sentence_unencrypted;
362 unsigned int metric = 0;
363 unsigned int reconnect = 0;
364
365 @@ -59,20 +54,9 @@
366 string configdir, groupfile;
367 FILE *group_file = NULL;
368
369 -// Pipe file descriptor pairs and fd's
370 -int soundpair[2];
371 -int speechpair[2];
372 -pid_t soundpid = -1, speechpid = -1;
373 -
374 // Catch our interrupt
375 void CatchShutdown(int sig) {
376
377 - // Kill our sound players
378 - if (soundpid > 0)
379 - kill(soundpid, 9);
380 - if (speechpid > 0)
381 - kill(speechpid, 9);
382 -
383 if (group_track) {
384 if ((group_file = fopen(groupfile.c_str(), "w")) == NULL) {
385 fprintf(stderr, "WARNING: Unable to open '%s' for writing, groups will not be saved.\n",
386 @@ -116,215 +100,6 @@
387 exit(0);
388 }
389
390 -// Subprocess sound handler
391 -void SoundHandler(int *fds, const char *player, map<string, string> soundmap) {
392 - int read_sock = fds[0];
393 -
394 - close(fds[1]);
395 -
396 - signal(SIGPIPE, PipeHandler);
397 -
398 - fd_set rset;
399 -
400 - char data[1024];
401 -
402 - pid_t sndpid = -1;
403 - int harvested = 1;
404 -
405 - while (1) {
406 - FD_ZERO(&rset);
407 - FD_SET(read_sock, &rset);
408 - char *end;
409 -
410 - memset(data, 0, 1024);
411 -
412 - if (harvested == 0) {
413 - // We consider a wait error to be a sign that the child pid died
414 - // so we flag it as harvested and keep on going
415 - pid_t harvestpid = waitpid(sndpid, NULL, WNOHANG);
416 - if (harvestpid == -1 || harvestpid == sndpid)
417 - harvested = 1;
418 - }
419 -
420 - struct timeval tim;
421 - tim.tv_sec = 1;
422 - tim.tv_usec = 0;
423 -
424 - if (select(read_sock + 1, &rset, NULL, NULL, &tim) < 0) {
425 - if (errno != EINTR) {
426 - exit(1);
427 - }
428 - }
429 -
430 - if (FD_ISSET(read_sock, &rset)) {
431 - int ret;
432 - ret = read(read_sock, data, 1024);
433 -
434 - // We'll die off if we get a read error, and we'll let kismet on the
435 - // other side detact that it died
436 - if (ret <= 0 && (errno != EAGAIN && errno != EPIPE))
437 - exit(1);
438 -
439 - if ((end = strstr(data, "\n")) == NULL)
440 - continue;
441 -
442 - end[0] = '\0';
443 - }
444 -
445 - if (data[0] == '\0')
446 - continue;
447 -
448 - // If we've harvested the process, spawn a new one and watch it
449 - // instead. Otherwise, we just let go of the data we read
450 - if (harvested == 1) {
451 - // Only take the first line
452 - char *nl;
453 - if ((nl = strchr(data, '\n')) != NULL)
454 - *nl = '\0';
455 -
456 - char snd[1024];
457 -
458 - if (soundmap.size() == 0)
459 - snprintf(snd, 1024, "%s", data);
460 - if (soundmap.find(data) != soundmap.end())
461 - snprintf(snd, 1024, "%s", soundmap[data].c_str());
462 - else
463 - continue;
464 -
465 - char plr[1024];
466 - snprintf(plr, 1024, "%s", player);
467 -
468 - harvested = 0;
469 - if ((sndpid = fork()) == 0) {
470 - // Suppress errors
471 - int nulfd = open("/dev/null", O_RDWR);
472 - dup2(nulfd, 1);
473 - dup2(nulfd, 2);
474 -
475 - char * const echoarg[] = { plr, snd, NULL };
476 - execve(echoarg[0], echoarg, NULL);
477 - }
478 - }
479 -
480 - data[0] = '\0';
481 - }
482 -}
483 -
484 -// Subprocess speech handler
485 -void SpeechHandler(int *fds, const char *player) {
486 - int read_sock = fds[0];
487 - close(fds[1]);
488 -
489 - fd_set rset;
490 -
491 - char data[1024];
492 -
493 - pid_t sndpid = -1;
494 - int harvested = 1;
495 -
496 - while (1) {
497 - FD_ZERO(&rset);
498 - FD_SET(read_sock, &rset);
499 - //char *end;
500 -
501 - memset(data, 0, 1024);
502 -
503 - struct timeval tim;
504 - tim.tv_sec = 1;
505 - tim.tv_usec = 0;
506 -
507 - if (select(read_sock + 1, &rset, NULL, NULL, &tim) < 0) {
508 - if (errno != EINTR) {
509 - exit(1);
510 - }
511 - }
512 -
513 - if (harvested == 0) {
514 - // We consider a wait error to be a sign that the child pid died
515 - // so we flag it as harvested and keep on going
516 - pid_t harvestpid = waitpid(sndpid, NULL, WNOHANG);
517 - if (harvestpid == -1 || harvestpid == sndpid)
518 - harvested = 1;
519 - }
520 -
521 - if (FD_ISSET(read_sock, &rset)) {
522 - int ret;
523 - ret = read(read_sock, data, 1024);
524 -
525 - // We'll die off if we get a read error, and we'll let kismet on the
526 - // other side detact that it died
527 - if (ret <= 0 && (errno != EAGAIN && errno != EPIPE))
528 - exit(1);
529 -
530 - data[ret] = '\0';
531 -
532 - }
533 -
534 - if (data[0] == '\0')
535 - continue;
536 -
537 - // If we've harvested the process, spawn a new one and watch it
538 - // instead. Otherwise, we just let go of the data we read
539 - if (harvested == 1) {
540 - harvested = 0;
541 - if ((sndpid = fork()) == 0) {
542 - // Only take the first line
543 - char *nl;
544 - if ((nl = strchr(data, '\n')) != NULL)
545 - *nl = '\0';
546 -
547 - // Make sure it's shell-clean
548 - MungeToShell(data, strlen(data));
549 - char spk_call[1024];
550 - snprintf(spk_call, 1024, "echo \"(%s\\\"%s\\\")\" | %s "
551 - ">/dev/null 2>/dev/null",
552 - flite ? "": "SayText ", data, player);
553 -
554 - system(spk_call);
555 -
556 - exit(0);
557 - }
558 - }
559 -
560 - data[0] = '\0';
561 - }
562 -}
563 -
564 -
565 -int PlaySound(string in_sound) {
566 -
567 - char snd[1024];
568 -
569 - snprintf(snd, 1024, "%s\n", in_sound.c_str());
570 -
571 - if (write(soundpair[1], snd, strlen(snd)) < 0) {
572 - char status[STATUS_MAX];
573 - snprintf(status, STATUS_MAX,
574 - "ERROR: Could not write to sound pipe. Stopping sound.");
575 - gui->WriteStatus(status);
576 -
577 - return 0;
578 - }
579 -
580 - return 1;
581 -}
582 -
583 -int SayText(string in_text) {
584 - char snd[1024];
585 -
586 - snprintf(snd, 1024, "%s\n", in_text.c_str());
587 -
588 - if (write(speechpair[1], snd, strlen(snd)) < 0) {
589 - char status[STATUS_MAX];
590 - snprintf(status, STATUS_MAX,
591 - "ERROR: Could not write to speech pipe. Stopping speech.");
592 - gui->WriteStatus(status);
593 -
594 - return 0;
595 - }
596 -
597 - return 1;
598 -}
599
600 int main(int argc, char *argv[]) {
601 exec_name = argv[0];
602 @@ -345,8 +120,6 @@
603 char guihost[1024];
604 int guiport = -1;
605
606 - int gpsmode = -1;
607 -
608 configfile = NULL;
609 uiconfigfile = NULL;
610
611 @@ -391,7 +164,6 @@
612 fprintf(stderr, "Using alternate UI config file: %s\n", uiconfigfile);
613 break;
614 case 'q':
615 - sound = 0;
616 break;
617 case 'g':
618 reqgui = strdup(optarg);
619 @@ -515,70 +287,6 @@
620 server = strdup(gui_conf->FetchOpt("host").c_str());
621 }
622
623 - if (gui_conf->FetchOpt("sound") == "true" && sound == -1) {
624 - if (gui_conf->FetchOpt("soundplay") != "") {
625 - sndplay = gui_conf->FetchOpt("soundplay");
626 - sound = 1;
627 -
628 - if (gui_conf->FetchOpt("soundopts") != "")
629 - sndplay += " " + gui_conf->FetchOpt("soundopts");
630 -
631 - if (gui_conf->FetchOpt("sound_new") != "")
632 - wav_map["new"] = gui_conf->FetchOpt("sound_new");
633 - if (gui_conf->FetchOpt("sound_new_wep") != "")
634 - wav_map["new_wep"] = gui_conf->FetchOpt("sound_new_wep");
635 - if (gui_conf->FetchOpt("sound_traffic") != "")
636 - wav_map["traffic"] = gui_conf->FetchOpt("sound_traffic");
637 - if (gui_conf->FetchOpt("sound_junktraffic") != "")
638 - wav_map["junktraffic"] = gui_conf->FetchOpt("sound_junktraffic");
639 - if (gui_conf->FetchOpt("sound_gpslock") != "")
640 - wav_map["gpslock"] = gui_conf->FetchOpt("sound_gpslock");
641 - if (gui_conf->FetchOpt("sound_gpslost") != "")
642 - wav_map["gpslost"] = gui_conf->FetchOpt("sound_gpslost");
643 - if (gui_conf->FetchOpt("sound_alert") != "")
644 - wav_map["alert"] = gui_conf->FetchOpt("sound_alert");
645 -
646 - } else {
647 - fprintf(stderr, "ERROR: Sound alerts enabled but no sound playing binary specified.\n");
648 - sound = 0;
649 - }
650 - } else if (sound == -1)
651 - sound = 0;
652 -
653 - /* Added by Shaw Innes 17/2/02 */
654 - if (gui_conf->FetchOpt("speech") == "true" && speech == -1) {
655 - if (gui_conf->FetchOpt("festival") != "") {
656 - festival = strdup(gui_conf->FetchOpt("festival").c_str());
657 - speech = 1;
658 -
659 - if (gui_conf->FetchOpt("flite") == "true")
660 - flite = 1;
661 -
662 - string speechtype = gui_conf->FetchOpt("speech_type");
663 -
664 - if (!strcasecmp(speechtype.c_str(), "nato"))
665 - speech_encoding = SPEECH_ENCODING_NATO;
666 - else if (!strcasecmp(speechtype.c_str(), "spell"))
667 - speech_encoding = SPEECH_ENCODING_SPELL;
668 - else
669 - speech_encoding = SPEECH_ENCODING_NORMAL;
670 -
671 - // Make sure we have encrypted text lines
672 - if (gui_conf->FetchOpt("speech_encrypted") == "" || gui_conf->FetchOpt("speech_unencrypted") == "") {
673 - fprintf(stderr, "ERROR: Speech request but speech_encrypted or speech_unencrypted line missing.\n");
674 - speech = 0;
675 - }
676 -
677 - speech_sentence_encrypted = gui_conf->FetchOpt("speech_encrypted");
678 - speech_sentence_unencrypted = gui_conf->FetchOpt("speech_unencrypted");
679 -
680 - } else {
681 - fprintf(stderr, "ERROR: Speech alerts enabled but no path to festival has been specified.\n");
682 - speech = 0;
683 - }
684 - } else if (speech == -1)
685 - speech = 0;
686 -
687 if (gui_conf->FetchOpt("decay") != "") {
688 if (sscanf(gui_conf->FetchOpt("decay").c_str(), "%d", &decay) != 1) {
689 fprintf(stderr, "FATAL: Illegal config file value for decay.\n");
690 @@ -636,45 +344,6 @@
691 }
692 }
693
694 - // Fork and find the sound options
695 - if (sound) {
696 - if (pipe(soundpair) == -1) {
697 - fprintf(stderr, "WARNING: Unable to create pipe for audio. Disabling sound.\n");
698 - sound = 0;
699 - } else {
700 - soundpid = fork();
701 -
702 - if (soundpid < 0) {
703 - fprintf(stderr, "WARNING: Unable to fork for audio. Disabling sound.\n");
704 - sound = 0;
705 - } else if (soundpid == 0) {
706 - SoundHandler(soundpair, sndplay.c_str(), wav_map);
707 - exit(0);
708 - }
709 -
710 - close(soundpair[0]);
711 - }
712 - }
713 -
714 - if (speech) {
715 - if (pipe(speechpair) == -1) {
716 - fprintf(stderr, "WARNING: Unable to create pipe for speech. Disabling speech.\n");
717 - speech = 0;
718 - } else {
719 - speechpid = fork();
720 -
721 - if (speechpid < 0) {
722 - fprintf(stderr, "WARNING: Unable to fork for speech. Disabling speech.\n");
723 - speech = 0;
724 - } else if (speechpid == 0) {
725 - SpeechHandler(speechpair, festival);
726 - exit(0);
727 - }
728 -
729 - close(speechpair[0]);
730 - }
731 - }
732 -
733 if (kismet_serv.Connect(guiport, guihost) < 0) {
734 fprintf(stderr, "FATAL: Could not connect to %s:%d.\n", guihost, guiport);
735 CatchShutdown(-1);
736 @@ -884,53 +553,13 @@
737 }
738
739 if (pollret != 0) {
740 - if (pollret == CLIENT_ALERT)
741 - if (sound == 1)
742 - sound = PlaySound("alert");
743 -
744 if (strlen(tcpcli->FetchStatus()) != 0) {
745 gui->WriteStatus(tcpcli->FetchStatus());
746 // gui->DrawDisplay();
747 }
748
749 - // The GPS only gets updated for the primary client
750 - if (tcpcli == primary_client) {
751 - if (tcpcli->FetchMode() == 0 && gpsmode != 0) {
752 - if (sound == 1 && gpsmode != -1)
753 - sound = PlaySound("gpslost");
754 - gpsmode = 0;
755 - } else if (tcpcli->FetchMode() != 0 && gpsmode == 0) {
756 - if (sound == 1 && gpsmode != -1)
757 - sound = PlaySound("gpslock");
758 - gpsmode = 1;
759 - }
760 - }
761 -
762 if (tcpcli->FetchDeltaNumNetworks() > 0) {
763 wireless_network *newnet = tcpcli->FetchLastNewNetwork();
764 -
765 - if (sound == 1 && newnet != lastspoken) {
766 - if (newnet->crypt_set &&
767 - wav_map.find("new_wep") != wav_map.end())
768 - sound = PlaySound("new_wep");
769 - else
770 - sound = PlaySound("new");
771 - }
772 -
773 - if (speech == 1 && newnet != lastspoken) {
774 - string text;
775 -
776 - if (newnet != NULL) {
777 - if (newnet->crypt_set)
778 - text = ExpandSpeechString(speech_sentence_encrypted, newnet, speech_encoding);
779 - else
780 - text = ExpandSpeechString(speech_sentence_unencrypted, newnet, speech_encoding);
781 -
782 - speech = SayText(text.c_str());
783 - }
784 - }
785 -
786 - lastspoken = newnet;
787 }
788
789 num_networks += tcpcli->FetchNumNetworks();
790 @@ -938,17 +567,7 @@
791 num_noise += tcpcli->FetchNumNoise();
792 num_dropped += tcpcli->FetchNumDropped();
793
794 - if (tcpcli->FetchDeltaNumPackets() != 0) {
795 - if (time(0) - last_click >= decay && sound == 1) {
796 - if (tcpcli->FetchDeltaNumPackets() > tcpcli->FetchDeltaNumDropped()) {
797 - sound = PlaySound("traffic");
798 - } else {
799 - sound = PlaySound("junktraffic");
800 - }
801 -
802 - last_click = time(0);
803 - }
804 - }
805 + tcpcli->FetchDeltaNumPackets();
806 }
807 }
808 } else {
809 diff -urN kismet.dev/kismet_drone.cc kismet.dev2/kismet_drone.cc
810 --- kismet.dev/kismet_drone.cc 2005-08-16 03:22:51.000000000 +0200
811 +++ kismet.dev2/kismet_drone.cc 2005-08-23 01:59:25.649219336 +0200
812 @@ -32,16 +32,11 @@
813 #include "packet.h"
814
815 #include "packetsource.h"
816 -#include "prism2source.h"
817 #include "pcapsource.h"
818 -#include "wtapfilesource.h"
819 -#include "wsp100source.h"
820 -#include "vihasource.h"
821 #include "dronesource.h"
822 #include "packetsourcetracker.h"
823 #include "kis_packsources.h"
824
825 -#include "gpsd.h"
826 #include "tcpstreamer.h"
827 #include "configfile.h"
828
829 @@ -53,10 +48,6 @@
830
831 const char *config_base = "kismet_drone.conf";
832
833 -GPSD *gps = NULL;
834 -int gpsmode = 0;
835 -int gps_enable = 0;
836 -
837 // Timetracker
838 Timetracker timetracker;
839
840 @@ -81,26 +72,6 @@
841 exit(0);
842 }
843
844 -int GpsEvent(Timetracker::timer_event *evt, void *parm) {
845 - // The GPS only provides us a new update once per second we might
846 - // as well only update it here once a second
847 - if (gps_enable) {
848 - int gpsret;
849 - gpsret = gps->Scan();
850 - if (gpsret < 0) {
851 - if (!silent)
852 - fprintf(stderr, "GPS error fetching data: %s\n",
853 - gps->FetchError());
854 -
855 - gps_enable = 0;
856 - }
857 -
858 - }
859 -
860 - // We want to be rescheduled
861 - return 1;
862 -}
863 -
864 // Handle channel hopping... this is actually really simple.
865 int ChannelHopEvent(Timetracker::timer_event *evt, void *parm) {
866 sourcetracker.AdvanceChannel();
867 @@ -148,9 +119,6 @@
868
869 TcpStreamer streamer;
870
871 - char gpshost[1024];
872 - int gpsport = -1;
873 -
874 int channel_hop = -1;
875 int channel_velocity = 1;
876 int channel_dwell = 0;
877 @@ -351,46 +319,6 @@
878 exit(1);
879 }
880
881 - if (conf->FetchOpt("gps") == "true") {
882 - if (sscanf(conf->FetchOpt("gpshost").c_str(), "%1023[^:]:%d", gpshost, &gpsport) != 2) {
883 - fprintf(stderr, "Invalid GPS host in config (host:port required)\n");
884 - exit(1);
885 - }
886 -
887 - gps_enable = 1;
888 - } else {
889 - gps_enable = 0;
890 - }
891 -
892 - if (gps_enable == 1) {
893 - // Open the GPS
894 - gps = new GPSD(gpshost, gpsport);
895 -
896 - // Lock GPS position
897 - if (conf->FetchOpt("gpsmodelock") == "true") {
898 - fprintf(stderr, "Enabling GPS position lock override (broken GPS unit reports 0 always)\n");
899 - gps->SetOptions(GPSD_OPT_FORCEMODE);
900 - }
901 -
902 - if (gps->OpenGPSD() < 0) {
903 - fprintf(stderr, "%s\n", gps->FetchError());
904 -
905 - gps_enable = 0;
906 - } else {
907 - fprintf(stderr, "Opened GPS connection to %s port %d\n",
908 - gpshost, gpsport);
909 -
910 - }
911 - }
912 -
913 - // Update GPS coordinates and handle signal loss if defined
914 - timetracker.RegisterTimer(SERVER_TIMESLICES_SEC, NULL, 1, &GpsEvent, NULL);
915 -
916 - // Add the GPS to the tcpstreamer
917 - streamer.AddGpstracker(gps);
918 -
919 - // Register the gps and timetracker with the sourcetracker
920 - sourcetracker.AddGpstracker(gps);
921 sourcetracker.AddTimetracker(&timetracker);
922
923 // Register the sources
924 diff -urN kismet.dev/kismet_server.cc kismet.dev2/kismet_server.cc
925 --- kismet.dev/kismet_server.cc 2005-08-16 03:22:51.000000000 +0200
926 +++ kismet.dev2/kismet_server.cc 2005-08-23 01:59:25.653218728 +0200
927 @@ -37,11 +37,7 @@
928 #include "packet.h"
929
930 #include "packetsource.h"
931 -#include "prism2source.h"
932 #include "pcapsource.h"
933 -#include "wtapfilesource.h"
934 -#include "wsp100source.h"
935 -#include "vihasource.h"
936 #include "dronesource.h"
937 #include "packetsourcetracker.h"
938 #include "kis_packsources.h"
939 @@ -51,15 +47,11 @@
940 #include "wtaplocaldump.h"
941 #include "airsnortdump.h"
942 #include "fifodump.h"
943 -#include "gpsdump.h"
944 -
945 -#include "gpsd.h"
946
947 #include "packetracker.h"
948 #include "timetracker.h"
949 #include "alertracker.h"
950
951 -#include "speech.h"
952 #include "tcpserver.h"
953 #include "server_globals.h"
954 #include "kismet_server.h"
955 @@ -89,17 +81,8 @@
956 Alertracker alertracker;
957 Timetracker timetracker;
958
959 -GPSD *gps = NULL;
960 -int gpsmode = 0;
961 -GPSDump gpsdump;
962 -
963 -// Last time we tried to reconnect to the gps
964 -time_t last_gpsd_reconnect = 0;
965 -int gpsd_reconnect_attempt = 0;
966 -
967 FifoDumpFile fifodump;
968 TcpServer ui_server;
969 -int sound = -1;
970 packet_info last_info;
971 int decay;
972 channel_power channel_graph[CHANNEL_MAX];
973 @@ -112,11 +95,8 @@
974 // Wep keys
975 macmap<wep_key_info *> bssid_wep_map;
976
977 -// Pipe file descriptor pairs and fd's
978 -int soundpair[2];
979 -int speechpair[2];
980 int chanpair[2];
981 -pid_t soundpid = -1, speechpid = -1, chanpid = -1;
982 +pid_t chanpid = -1;
983
984 // Past alerts
985 unsigned int max_alerts = 50;
986 @@ -177,17 +157,6 @@
987 int tcpport = -1;
988 int tcpmax;
989
990 -//const char *sndplay = NULL;
991 -string sndplay;
992 -
993 -const char *festival = NULL;
994 -int speech = -1;
995 -int flite = 0;
996 -int speech_encoding = 0;
997 -string speech_sentence_encrypted, speech_sentence_unencrypted;
998 -
999 -map<string, string> wav_map;
1000 -
1001 int beacon_log = 1;
1002 int phy_log = 1;
1003 int mangle_log = 0;
1004 @@ -347,17 +316,6 @@
1005 // delete cryptfile;
1006 }
1007
1008 - if (gps_log == 1) {
1009 - if (gpsdump.CloseDump(1) < 0)
1010 - fprintf(stderr, "Didn't log any GPS coordinates, unlinking gps file\n");
1011 - }
1012 -
1013 - // Kill our sound players
1014 - if (soundpid > 0)
1015 - kill(soundpid, 9);
1016 - if (speechpid > 0)
1017 - kill(speechpid, 9);
1018 -
1019 // Shut down the packet sources
1020 sourcetracker.CloseSources();
1021
1022 @@ -368,228 +326,10 @@
1023 exit(0);
1024 }
1025
1026 -// Subprocess sound handler
1027 -void SoundHandler(int *fds, const char *player, map<string, string> soundmap) {
1028 - int read_sock = fds[0];
1029 - close(fds[1]);
1030 -
1031 - fd_set rset;
1032 -
1033 - char data[1024];
1034 -
1035 - pid_t sndpid = -1;
1036 - int harvested = 1;
1037 -
1038 - while (1) {
1039 - FD_ZERO(&rset);
1040 - FD_SET(read_sock, &rset);
1041 - char *end;
1042 -
1043 - memset(data, 0, 1024);
1044 -
1045 - struct timeval tm;
1046 - tm.tv_sec = 1;
1047 - tm.tv_usec = 0;
1048 -
1049 - if (select(read_sock + 1, &rset, NULL, NULL, &tm) < 0) {
1050 - if (errno != EINTR) {
1051 - exit(1);
1052 - }
1053 - }
1054 -
1055 - if (harvested == 0) {
1056 - // We consider a wait error to be a sign that the child pid died
1057 - // so we flag it as harvested and keep on going
1058 - pid_t harvestpid = waitpid(sndpid, NULL, WNOHANG);
1059 - if (harvestpid == -1 || harvestpid == sndpid)
1060 - harvested = 1;
1061 - }
1062 -
1063 - if (FD_ISSET(read_sock, &rset)) {
1064 - int ret;
1065 - ret = read(read_sock, data, 1024);
1066 -
1067 - // We'll die off if we get a read error, and we'll let kismet on the
1068 - // other side detact that it died
1069 - if (ret <= 0 && (errno != EAGAIN && errno != EPIPE))
1070 - exit(1);
1071 -
1072 - if ((end = strstr(data, "\n")) == NULL)
1073 - continue;
1074 -
1075 - end[0] = '\0';
1076 - }
1077 -
1078 - if (data[0] == '\0')
1079 - continue;
1080 -
1081 -
1082 - // If we've harvested the process, spawn a new one and watch it
1083 - // instead. Otherwise, we just let go of the data we read
1084 - if (harvested == 1) {
1085 - // Only take the first line
1086 - char *nl;
1087 - if ((nl = strchr(data, '\n')) != NULL)
1088 - *nl = '\0';
1089 -
1090 - // Make sure it's shell-clean
1091 -
1092 - char snd[1024];
1093 -
1094 - if (soundmap.size() == 0)
1095 - snprintf(snd, 1024, "%s", data);
1096 - if (soundmap.find(data) != soundmap.end())
1097 - snprintf(snd, 1024, "%s", soundmap[data].c_str());
1098 - else
1099 - continue;
1100 -
1101 - char plr[1024];
1102 - snprintf(plr, 1024, "%s", player);
1103 -
1104 - harvested = 0;
1105 - if ((sndpid = fork()) == 0) {
1106 - // Suppress errors
1107 - if (silent) {
1108 - int nulfd = open("/dev/null", O_RDWR);
1109 - dup2(nulfd, 1);
1110 - dup2(nulfd, 2);
1111 - }
1112 -
1113 - char * const echoarg[] = { plr, snd, NULL };
1114 - execve(echoarg[0], echoarg, NULL);
1115 - }
1116 - }
1117 - data[0] = '\0';
1118 - }
1119 -}
1120 -
1121 -// Subprocess speech handler
1122 -void SpeechHandler(int *fds, const char *player) {
1123 - int read_sock = fds[0];
1124 - close(fds[1]);
1125 -
1126 - fd_set rset;
1127 -
1128 - char data[1024];
1129 -
1130 - pid_t sndpid = -1;
1131 - int harvested = 1;
1132 -
1133 - while (1) {
1134 - FD_ZERO(&rset);
1135 - FD_SET(read_sock, &rset);
1136 - //char *end;
1137 -
1138 - memset(data, 0, 1024);
1139 -
1140 - if (harvested == 0) {
1141 - // We consider a wait error to be a sign that the child pid died
1142 - // so we flag it as harvested and keep on going
1143 - pid_t harvestpid = waitpid(sndpid, NULL, WNOHANG);
1144 - if (harvestpid == -1 || harvestpid == sndpid)
1145 - harvested = 1;
1146 - }
1147 -
1148 - struct timeval tm;
1149 - tm.tv_sec = 1;
1150 - tm.tv_usec = 0;
1151 -
1152 - if (select(read_sock + 1, &rset, NULL, NULL, &tm) < 0) {
1153 - if (errno != EINTR) {
1154 - exit(1);
1155 - }
1156 - }
1157 -
1158 - if (FD_ISSET(read_sock, &rset)) {
1159 - int ret;
1160 - ret = read(read_sock, data, 1024);
1161 -
1162 - // We'll die off if we get a read error, and we'll let kismet on the
1163 - // other side detact that it died
1164 - if (ret <= 0 && (errno != EAGAIN && errno != EPIPE))
1165 - exit(1);
1166 -
1167 - data[ret] = '\0';
1168 - }
1169 -
1170 - if (data[0] == '\0')
1171 - continue;
1172 -
1173 - // If we've harvested the process, spawn a new one and watch it
1174 - // instead. Otherwise, we just let go of the data we read
1175 - if (harvested == 1) {
1176 - harvested = 0;
1177 - if ((sndpid = fork()) == 0) {
1178 - // Only take the first line
1179 - char *nl;
1180 - if ((nl = strchr(data, '\n')) != NULL)
1181 - *nl = '\0';
1182 -
1183 - // Make sure it's shell-clean
1184 - MungeToShell(data, strlen(data));
1185 - char spk_call[1024];
1186 - snprintf(spk_call, 1024, "echo \"(%s\\\"%s\\\")\" | %s "
1187 - ">/dev/null 2>/dev/null",
1188 - flite ? "" : "SayText ", data, player);
1189 - system(spk_call);
1190 -
1191 - exit(0);
1192 - }
1193 - }
1194 -
1195 - data[0] = '\0';
1196 - }
1197 -}
1198 -
1199 -
1200 -// Fork and run a system call to play a sound
1201 -int PlaySound(string in_sound) {
1202 -
1203 - char snd[1024];
1204 -
1205 - snprintf(snd, 1024, "%s\n", in_sound.c_str());
1206 -
1207 - if (write(soundpair[1], snd, strlen(snd)) < 0) {
1208 - char status[STATUS_MAX];
1209 - if (!silent)
1210 - fprintf(stderr, "ERROR: Write error, closing sound pipe.\n");
1211 - snprintf(status, STATUS_MAX, "ERROR: Write error on sound pipe, closing sound connection");
1212 - NetWriteStatus(status);
1213 -
1214 - return 0;
1215 - }
1216 -
1217 - return 1;
1218 -}
1219 -
1220 -int SayText(string in_text) {
1221 -
1222 - char snd[1024];
1223 -
1224 - snprintf(snd, 1024, "%s\n", in_text.c_str());
1225 - MungeToShell(snd, 1024);
1226 -
1227 - if (write(speechpair[1], snd, strlen(snd)) < 0) {
1228 - char status[STATUS_MAX];
1229 - if (!silent)
1230 - fprintf(stderr, "ERROR: Write error, closing speech pipe.\n");
1231 - snprintf(status, STATUS_MAX, "ERROR: Write error on speech pipe, closing speech connection");
1232 - NetWriteStatus(status);
1233 -
1234 - return 0;
1235 - }
1236 -
1237 - return 1;
1238 -}
1239 -
1240 void KisLocalAlert(const char *in_text) {
1241 time_t now = time(0);
1242 if (!silent)
1243 fprintf(stderr, "ALERT %.24s %s\n", ctime(&now), in_text);
1244 -
1245 - if (sound == 1)
1246 - sound = PlaySound("alert");
1247 -
1248 }
1249
1250 void KisLocalStatus(const char *in_status) {
1251 @@ -638,37 +378,6 @@
1252
1253 char tmpstr[32];
1254
1255 - GPS_data gdata;
1256 -
1257 - if (gps_enable) {
1258 - float lat, lon, alt, spd, hed;
1259 - int mode;
1260 -
1261 - gps->FetchLoc(&lat, &lon, &alt, &spd, &hed, &mode);
1262 -
1263 - snprintf(tmpstr, 32, "%f", lat);
1264 - gdata.lat = tmpstr;
1265 - snprintf(tmpstr, 32, "%f", lon);
1266 - gdata.lon = tmpstr;
1267 - snprintf(tmpstr, 32, "%f", alt);
1268 - gdata.alt = tmpstr;
1269 - snprintf(tmpstr, 32, "%f", spd);
1270 - gdata.spd = tmpstr;
1271 - snprintf(tmpstr, 32, "%f", hed);
1272 - gdata.heading = tmpstr;
1273 - snprintf(tmpstr, 32, "%d", mode);
1274 - gdata.mode = tmpstr;
1275 - } else {
1276 - gdata.lat = "0.0";
1277 - gdata.lon = "0.0";
1278 - gdata.alt = "0.0";
1279 - gdata.spd = "0.0";
1280 - gdata.heading = "0.0";
1281 - gdata.mode = "0";
1282 - }
1283 -
1284 - ui_server.SendToAll(gps_ref, (void *) &gdata);
1285 -
1286 INFO_data idata;
1287 snprintf(tmpstr, 32, "%d", tracker.FetchNumNetworks());
1288 idata.networks = tmpstr;
1289 @@ -789,81 +498,6 @@
1290 }
1291 }
1292
1293 -int GpsEvent(Timetracker::timer_event *evt, void *parm) {
1294 - char status[STATUS_MAX];
1295 -
1296 - // The GPS only provides us a new update once per second we might
1297 - // as well only update it here once a second
1298 -
1299 - // If we're disconnected, try to reconnect.
1300 - if (gpsd_reconnect_attempt > 0) {
1301 - // Increment the time between connection attempts
1302 - if (last_gpsd_reconnect + ((gpsd_reconnect_attempt - 1) * 2) < time(0)) {
1303 - if (gps->OpenGPSD() < 0) {
1304 - last_gpsd_reconnect = time(0);
1305 -
1306 - if (gpsd_reconnect_attempt < 20)
1307 - gpsd_reconnect_attempt++;
1308 -
1309 - snprintf(status, STATUS_MAX, "Unable to reconnect to GPSD, trying "
1310 - "again in %d seconds.", ((gpsd_reconnect_attempt - 1) * 2));
1311 -
1312 - if (!silent || NetWriteStatus(status) == 0)
1313 - fprintf(stderr, "WARNING: %s\n", status);
1314 -
1315 - return 1;
1316 - } else {
1317 - gpsd_reconnect_attempt = 0;
1318 -
1319 - snprintf(status, STATUS_MAX, "Reopened connection to GPSD");
1320 - if (!silent || NetWriteStatus(status) == 0)
1321 - fprintf(stderr, "NOTICE: %s\n", status);
1322 - }
1323 - } else {
1324 - // Don't process more if we haven't woken up yet
1325 - return 1;
1326 - }
1327 -
1328 - }
1329 -
1330 - if (gps_enable) {
1331 - int gpsret;
1332 - gpsret = gps->Scan();
1333 -
1334 - if (gpsret < 0) {
1335 - snprintf(status, STATUS_MAX, "GPS error requesting data: %s",
1336 - gps->FetchError());
1337 -
1338 - if (!silent || NetWriteStatus(status) == 0)
1339 - fprintf(stderr, "WARNING: %s\n", status);
1340 -
1341 - gpsd_reconnect_attempt = 1;
1342 - }
1343 -
1344 - if (gpsret == 0 && gpsmode != 0) {
1345 - if (!silent || NetWriteStatus("Lost GPS signal.") == 0)
1346 - fprintf(stderr, "Lost GPS signal.\n");
1347 - if (sound == 1)
1348 - sound = PlaySound("gpslost");
1349 -
1350 - gpsmode = 0;
1351 - } else if (gpsret != 0 && gpsmode == 0) {
1352 - if (!silent || NetWriteStatus("Acquired GPS signal.") == 0)
1353 - fprintf(stderr, "Acquired GPS signal.\n");
1354 - if (sound == 1)
1355 - sound = PlaySound("gpslock");
1356 -
1357 - gpsmode = 1;
1358 - }
1359 - }
1360 -
1361 - if (gps_log == 1 && gpsmode != 0 && gps != NULL) {
1362 - gpsdump.DumpTrack(gps);
1363 - }
1364 -
1365 - // We want to be rescheduled
1366 - return 1;
1367 -}
1368
1369 // Simple redirect to the network info drawer. We don't want to change netwriteinfo to a
1370 // timer event since we call it un-timed too
1371 @@ -884,13 +518,6 @@
1372 return 1;
1373 }
1374
1375 -// Write the waypoints for gpsdrive
1376 -int WaypointSyncEvent(Timetracker::timer_event *evt, void *parm) {
1377 - tracker.WriteGpsdriveWaypt(waypoint_file);
1378 -
1379 - return 1;
1380 -}
1381 -
1382 // Handle tracker maintenance
1383 int TrackerTickEvent(Timetracker::timer_event *evt, void *parm) {
1384 tracker.Tick();
1385 @@ -1159,11 +786,9 @@
1386 " -c, --capture-source <src> Packet capture source line (type,interface,name)\n"
1387 " -C, --enable-capture-sources Comma separated list of named packet sources to use.\n"
1388 " -l, --log-types <types> Comma separated list of types to log,\n"
1389 - " (ie, dump,cisco,weak,network,gps)\n"
1390 + " (ie, dump,cisco,weak,network)\n"
1391 " -d, --dump-type <type> Dumpfile type (wiretap)\n"
1392 " -m, --max-packets <num> Maximum number of packets before starting new dump\n"
1393 - " -q, --quiet Don't play sounds\n"
1394 - " -g, --gps <host:port> GPS server (host:port or off)\n"
1395 " -p, --port <port> TCPIP server port for GUI connections\n"
1396 " -a, --allowed-hosts <hosts> Comma separated list of hosts allowed to connect\n"
1397 " -b, --bind-address <address> Bind to this address. Default INADDR_ANY\n."
1398 @@ -1287,23 +912,6 @@
1399 ip_track = 1;
1400 }
1401
1402 -
1403 - if (conf->FetchOpt("waypoints") == "true") {
1404 - if(conf->FetchOpt("waypointdata") == "") {
1405 - fprintf(stderr, "WARNING: Waypoint logging requested but no waypoint data file given.\n"
1406 - "Waypoint logging will be disabled.\n");
1407 - waypoint = 0;
1408 - } else {
1409 - waypointfile = conf->ExpandLogPath(conf->FetchOpt("waypointdata"), "", "", 0, 1);
1410 - waypoint = 1;
1411 - }
1412 - if(conf->FetchOpt("waypoint_essid") == "true") {
1413 - waypointformat = 1;
1414 - } else {
1415 - waypointformat = 0;
1416 - }
1417 - }
1418 -
1419 if (conf->FetchOpt("metric") == "true") {
1420 fprintf(stderr, "Using metric measurements.\n");
1421 metric = 1;
1422 @@ -1421,26 +1029,6 @@
1423 }
1424
1425 }
1426 -
1427 - if (strstr(logtypes, "gps")) {
1428 - if (gps_log == 0) {
1429 - fprintf(stderr, "WARNING: Disabling GPS logging.\n");
1430 - } else {
1431 - gps_log = 1;
1432 -
1433 - if (conf->FetchOpt("logtemplate") == "") {
1434 - fprintf(stderr, "FATAL: Logging (gps coordinates) enabled but no logtemplate given in config.\n");
1435 - ErrorShutdown();
1436 - }
1437 - }
1438 -
1439 - }
1440 -
1441 - if (gps_log == 1 && !net_log) {
1442 - fprintf(stderr, "WARNING: Logging (gps coordinates) enabled but XML logging (networks) was not.\n"
1443 - "It will be enabled now.\n");
1444 - xml_log = 1;
1445 - }
1446 }
1447
1448 if (conf->FetchOpt("decay") != "") {
1449 @@ -1561,72 +1149,6 @@
1450 legal_ipblock_vec.push_back(ipb);
1451 }
1452
1453 - // Process sound stuff
1454 - if (conf->FetchOpt("sound") == "true" && sound == -1) {
1455 - if (conf->FetchOpt("soundplay") != "") {
1456 - sndplay = conf->FetchOpt("soundplay");
1457 -
1458 - if (conf->FetchOpt("soundopts") != "")
1459 - sndplay += " " + conf->FetchOpt("soundopts");
1460 -
1461 - sound = 1;
1462 -
1463 - if (conf->FetchOpt("sound_new") != "")
1464 - wav_map["new"] = conf->FetchOpt("sound_new");
1465 - if (conf->FetchOpt("sound_new_wep") != "")
1466 - wav_map["new_wep"] = conf->FetchOpt("sound_new_wep");
1467 - if (conf->FetchOpt("sound_traffic") != "")
1468 - wav_map["traffic"] = conf->FetchOpt("sound_traffic");
1469 - if (conf->FetchOpt("sound_junktraffic") != "")
1470 - wav_map["junktraffic"] = conf->FetchOpt("sound_traffic");
1471 - if (conf->FetchOpt("sound_gpslock") != "")
1472 - wav_map["gpslock"] = conf->FetchOpt("sound_gpslock");
1473 - if (conf->FetchOpt("sound_gpslost") != "")
1474 - wav_map["gpslost"] = conf->FetchOpt("sound_gpslost");
1475 - if (conf->FetchOpt("sound_alert") != "")
1476 - wav_map["alert"] = conf->FetchOpt("sound_alert");
1477 -
1478 - } else {
1479 - fprintf(stderr, "ERROR: Sound alerts enabled but no sound playing binary specified.\n");
1480 - sound = 0;
1481 - }
1482 - } else if (sound == -1)
1483 - sound = 0;
1484 -
1485 - /* Added by Shaw Innes 17/2/02 */
1486 - /* Modified by Andrew Etter 15/9/02 */
1487 - if (conf->FetchOpt("speech") == "true" && speech == -1) {
1488 - if (conf->FetchOpt("festival") != "") {
1489 - festival = strdup(conf->FetchOpt("festival").c_str());
1490 - speech = 1;
1491 -
1492 - if (conf->FetchOpt("flite") == "true")
1493 - flite = 1;
1494 -
1495 - string speechtype = conf->FetchOpt("speech_type");
1496 -
1497 - if (!strcasecmp(speechtype.c_str(), "nato"))
1498 - speech_encoding = SPEECH_ENCODING_NATO;
1499 - else if (!strcasecmp(speechtype.c_str(), "spell"))
1500 - speech_encoding = SPEECH_ENCODING_SPELL;
1501 - else
1502 - speech_encoding = SPEECH_ENCODING_NORMAL;
1503 -
1504 - // Make sure we have encrypted text lines
1505 - if (conf->FetchOpt("speech_encrypted") == "" || conf->FetchOpt("speech_unencrypted") == "") {
1506 - fprintf(stderr, "ERROR: Speech request but speech_encrypted or speech_unencrypted line missing.\n");
1507 - speech = 0;
1508 - }
1509 -
1510 - speech_sentence_encrypted = conf->FetchOpt("speech_encrypted");
1511 - speech_sentence_unencrypted = conf->FetchOpt("speech_unencrypted");
1512 - } else {
1513 - fprintf(stderr, "ERROR: Speech alerts enabled but no path to festival has been specified.\n");
1514 - speech = 0;
1515 - }
1516 - } else if (speech == -1)
1517 - speech = 0;
1518 -
1519 if (conf->FetchOpt("writeinterval") != "") {
1520 if (sscanf(conf->FetchOpt("writeinterval").c_str(), "%d", &datainterval) != 1) {
1521 fprintf(stderr, "FATAL: Illegal config file value for data interval.\n");
1522 @@ -1646,45 +1168,6 @@
1523 fprintf(stderr, "WARNING: No client_manuf file specified. Client manufacturers will not be detected.\n");
1524 }
1525
1526 - // Fork and find the sound options
1527 - if (sound) {
1528 - if (pipe(soundpair) == -1) {
1529 - fprintf(stderr, "WARNING: Unable to create pipe for audio. Disabling sound.\n");
1530 - sound = 0;
1531 - } else {
1532 - soundpid = fork();
1533 -
1534 - if (soundpid < 0) {
1535 - fprintf(stderr, "WARNING: Unable to fork for audio. Disabling sound.\n");
1536 - sound = 0;
1537 - } else if (soundpid == 0) {
1538 - SoundHandler(soundpair, sndplay.c_str(), wav_map);
1539 - exit(0);
1540 - }
1541 -
1542 - close(soundpair[0]);
1543 - }
1544 - }
1545 -
1546 - if (speech) {
1547 - if (pipe(speechpair) == -1) {
1548 - fprintf(stderr, "WARNING: Unable to create pipe for speech. Disabling speech.\n");
1549 - speech = 0;
1550 - } else {
1551 - speechpid = fork();
1552 -
1553 - if (speechpid < 0) {
1554 - fprintf(stderr, "WARNING: Unable to fork for speech. Disabling speech.\n");
1555 - speech = 0;
1556 - } else if (speechpid == 0) {
1557 - SpeechHandler(speechpair, festival);
1558 - exit(0);
1559 - }
1560 -
1561 - close(speechpair[0]);
1562 - }
1563 - }
1564 -
1565 // Grab the filtering
1566 string filter_bit;
1567
1568 @@ -1710,7 +1193,7 @@
1569 }
1570
1571 if ((filter_bit = conf->FetchOpt("filter_export")) != "") {
1572 - fprintf(stderr, "Enabling filtering on exported (csv, xml, network, gps) files.\n");
1573 + fprintf(stderr, "Enabling filtering on exported (csv, xml, network) files.\n");
1574 filter_export = 1;
1575 if (ConfigFile::ParseFilterLine(filter_bit, &filter_export_bssid, &filter_export_source,
1576 &filter_export_dest, &filter_export_bssid_invert,
1577 @@ -1816,14 +1299,6 @@
1578
1579 }
1580
1581 - if (waypoint) {
1582 - if ((waypoint_file = fopen(waypointfile.c_str(), "a")) == NULL) {
1583 - fprintf(stderr, "WARNING: Could not open waypoint file '%s' for writing: %s\n",
1584 - waypointfile.c_str(), strerror(errno));
1585 - waypoint = 0;
1586 - }
1587 - }
1588 -
1589 // Create all the logs and title/number them appropriately
1590 // We need to save this for after we toast the conf record
1591 int logfile_matched = 0;
1592 @@ -1871,13 +1346,6 @@
1593 continue;
1594 }
1595
1596 - if (gps_log == 1) {
1597 - gpslogfile = conf->ExpandLogPath(conf->FetchOpt("logtemplate"), logname, "gps", run_num);
1598 -
1599 - if (gpslogfile == "")
1600 - continue;
1601 - }
1602 -
1603 // if we made it this far we're cool -- all the logfiles we're writing to matched
1604 // this number
1605 logfile_matched = 1;
1606 @@ -1906,9 +1374,6 @@
1607 if (cisco_log)
1608 fprintf(stderr, "Logging cisco product information to %s\n", ciscologfile.c_str());
1609
1610 - if (gps_log == 1)
1611 - fprintf(stderr, "Logging gps coordinates to %s\n", gpslogfile.c_str());
1612 -
1613 if (data_log)
1614 fprintf(stderr, "Logging data to %s\n", dumplogfile.c_str());
1615
1616 @@ -2055,7 +1520,6 @@
1617 { "dump-type", required_argument, 0, 'd' },
1618 { "max-packets", required_argument, 0, 'm' },
1619 { "quiet", no_argument, 0, 'q' },
1620 - { "gps", required_argument, 0, 'g' },
1621 { "port", required_argument, 0, 'p' },
1622 { "allowed-hosts", required_argument, 0, 'a' },
1623 { "bind-address", required_argument, 0, 'b'},
1624 @@ -2136,18 +1600,6 @@
1625 Usage(argv[0]);
1626 }
1627 break;
1628 - case 'g':
1629 - // GPS
1630 - if (strcmp(optarg, "off") == 0) {
1631 - gps_enable = 0;
1632 - }
1633 - else if (sscanf(optarg, "%1023[^:]:%d", gpshost, &gpsport) < 2) {
1634 - fprintf(stderr, "Invalid GPS host '%s' (host:port or off required)\n",
1635 - optarg);
1636 - gps_enable = 1;
1637 - Usage(argv[0]);
1638 - }
1639 - break;
1640 case 'p':
1641 // Port
1642 if (sscanf(optarg, "%d", &tcpport) != 1) {
1643 @@ -2169,7 +1621,6 @@
1644 break;
1645 case 'q':
1646 // Quiet
1647 - sound = 0;
1648 break;
1649 case 'v':
1650 // version
1651 @@ -2323,39 +1774,6 @@
1652 // And we're done
1653 fclose(pid_file);
1654
1655 -
1656 - // Set up the GPS object to give to the children
1657 - if (gpsport == -1 && gps_enable) {
1658 - if (conf->FetchOpt("gps") == "true") {
1659 - if (sscanf(conf->FetchOpt("gpshost").c_str(), "%1023[^:]:%d", gpshost,
1660 - &gpsport) != 2) {
1661 - fprintf(stderr, "Invalid GPS host in config (host:port required)\n");
1662 - exit(1);
1663 - }
1664 -
1665 - gps_enable = 1;
1666 - } else {
1667 - gps_enable = 0;
1668 - gps_log = 0;
1669 - }
1670 - }
1671 -
1672 - if (gps_enable == 1) {
1673 - gps = new GPSD(gpshost, gpsport);
1674 -
1675 - // Lock GPS position
1676 - if (conf->FetchOpt("gpsmodelock") == "true") {
1677 - fprintf(stderr, "Enabling GPS position lock override (broken GPS unit "
1678 - "reports 0 always)\n");
1679 - gps->SetOptions(GPSD_OPT_FORCEMODE);
1680 - }
1681 -
1682 - } else {
1683 - gps_log = 0;
1684 - }
1685 -
1686 - // Register the gps and timetracker with the sourcetracker
1687 - sourcetracker.AddGpstracker(gps);
1688 sourcetracker.AddTimetracker(&timetracker);
1689
1690 // Handle errors here maybe in the future
1691 @@ -2522,13 +1940,6 @@
1692 fprintf(stderr, "Dump file format: %s\n", dumpfile->FetchType());
1693 }
1694
1695 - if (gps_enable && gps_log == 1) {
1696 - if (gpsdump.OpenDump(gpslogfile.c_str(), xmllogfile.c_str()) < 0) {
1697 - fprintf(stderr, "FATAL: GPS dump error: %s\n", gpsdump.FetchError());
1698 - ErrorShutdown();
1699 - }
1700 - }
1701 -
1702 // Open our files first to make sure we can, we'll unlink the empties later.
1703 FILE *testfile = NULL;
1704 if (net_log) {
1705 @@ -2600,14 +2011,13 @@
1706 */
1707
1708 if (data_log || net_log || crypt_log) {
1709 - snprintf(status, STATUS_MAX, "Logging%s%s%s%s%s%s%s",
1710 + snprintf(status, STATUS_MAX, "Logging%s%s%s%s%s%s",
1711 data_log ? " data" : "" ,
1712 net_log ? " networks" : "" ,
1713 csv_log ? " CSV" : "" ,
1714 xml_log ? " XML" : "" ,
1715 crypt_log ? " weak" : "",
1716 - cisco_log ? " cisco" : "",
1717 - gps_log == 1 ? " gps" : "");
1718 + cisco_log ? " cisco" : "");
1719 fprintf(stderr, "%s\n", status);
1720 } else if (no_log) {
1721 snprintf(status, STATUS_MAX, "Not logging any data.");
1722 @@ -2625,23 +2035,6 @@
1723 }
1724 }
1725
1726 - if (gps_enable) {
1727 - // Open the GPS
1728 - if (gps->OpenGPSD() < 0) {
1729 - fprintf(stderr, "%s\n", gps->FetchError());
1730 -
1731 - gps_enable = 0;
1732 - gps_log = 0;
1733 - } else {
1734 - fprintf(stderr, "Opened GPS connection to %s port %d\n",
1735 - gpshost, gpsport);
1736 -
1737 - gpsmode = gps->FetchMode();
1738 -
1739 - last_gpsd_reconnect = time(0);
1740 - }
1741 - }
1742 -
1743 fprintf(stderr, "Listening on port %d.\n", tcpport);
1744 for (unsigned int ipvi = 0; ipvi < legal_ipblock_vec.size(); ipvi++) {
1745 char *netaddr = strdup(inet_ntoa(legal_ipblock_vec[ipvi]->network));
1746 @@ -2682,8 +2075,6 @@
1747 &Protocol_NETWORK, &ProtocolNetworkEnable);
1748 client_ref = ui_server.RegisterProtocol("CLIENT", 0, CLIENT_fields_text,
1749 &Protocol_CLIENT, &ProtocolClientEnable);
1750 - gps_ref = ui_server.RegisterProtocol("GPS", 0, GPS_fields_text,
1751 - &Protocol_GPS, NULL);
1752 info_ref = ui_server.RegisterProtocol("INFO", 0, INFO_fields_text,
1753 &Protocol_INFO, NULL);
1754 remove_ref = ui_server.RegisterProtocol("REMOVE", 0, REMOVE_fields_text,
1755 @@ -2738,14 +2129,9 @@
1756 // Write network info and tick the tracker once per second
1757 timetracker.RegisterTimer(SERVER_TIMESLICES_SEC, NULL, 1, &NetWriteEvent, NULL);
1758 timetracker.RegisterTimer(SERVER_TIMESLICES_SEC, NULL, 1, &TrackerTickEvent, NULL);
1759 - // Update GPS coordinates and handle signal loss if defined
1760 - timetracker.RegisterTimer(SERVER_TIMESLICES_SEC, NULL, 1, &GpsEvent, NULL);
1761 // Sync the data files if requested
1762 if (datainterval > 0 && no_log == 0)
1763 timetracker.RegisterTimer(datainterval * SERVER_TIMESLICES_SEC, NULL, 1, &ExportSyncEvent, NULL);
1764 - // Write waypoints if requested
1765 - if (waypoint)
1766 - timetracker.RegisterTimer(decay * SERVER_TIMESLICES_SEC, NULL, 1, &WaypointSyncEvent, NULL);
1767 // Channel hop if requested
1768 if (channel_hop) {
1769 if (channel_dwell)
1770 @@ -2769,7 +2155,6 @@
1771 snprintf(status, 1024, "%s", TIMESTAMP);
1772 kdata.timestamp = status;
1773
1774 - time_t last_click = 0;
1775 int num_networks = 0, num_packets = 0, num_noise = 0, num_dropped = 0;
1776
1777
1778 @@ -2918,54 +2303,13 @@
1779
1780 }
1781
1782 - if (gps_log == 1 && info.type != packet_noise &&
1783 - info.type != packet_unknown && info.type != packet_phy &&
1784 - info.corrupt == 0) {
1785 - if (gpsdump.DumpPacket(&info) < 0) {
1786 - snprintf(status, STATUS_MAX, "%s", gpsdump.FetchError());
1787 - if (!silent || NetWriteStatus(status) == 0)
1788 - fprintf(stderr, "%s\n", status);
1789 - }
1790 - }
1791 -
1792 // tracker.ProcessPacket(info);
1793 tracker.ProcessPacket(&packet, &info, &bssid_wep_map,
1794 wep_identity);
1795
1796 - if (tracker.FetchNumNetworks() > num_networks) {
1797 - if (sound == 1)
1798 - if (info.crypt_set &&
1799 - wav_map.find("new_wep") != wav_map.end())
1800 - sound = PlaySound("new_wep");
1801 - else
1802 - sound = PlaySound("new");
1803 - if (speech == 1) {
1804 - string text;
1805 -
1806 - if (info.crypt_set)
1807 - text = ExpandSpeechString(speech_sentence_encrypted, &info,
1808 - speech_encoding);
1809 - else
1810 - text = ExpandSpeechString(speech_sentence_unencrypted,
1811 - &info, speech_encoding);
1812 -
1813 - speech = SayText(MungeToShell(text).c_str());
1814 - }
1815 - }
1816 num_networks = tracker.FetchNumNetworks();
1817
1818 if (tracker.FetchNumPackets() != num_packets) {
1819 - if (cur_time - last_click >= decay && sound == 1) {
1820 - if (tracker.FetchNumPackets() - num_packets >
1821 - tracker.FetchNumDropped() + localdropnum - num_dropped) {
1822 - sound = PlaySound("traffic");
1823 - } else {
1824 - sound = PlaySound("junktraffic");
1825 - }
1826 -
1827 - last_click = cur_time;
1828 - }
1829 -
1830 num_packets = tracker.FetchNumPackets();
1831 num_noise = tracker.FetchNumNoise();
1832 num_dropped = tracker.FetchNumDropped() + localdropnum;
1833 diff -urN kismet.dev/kismet_server.h kismet.dev2/kismet_server.h
1834 --- kismet.dev/kismet_server.h 2005-08-16 03:22:51.000000000 +0200
1835 +++ kismet.dev2/kismet_server.h 2005-08-23 01:59:25.653218728 +0200
1836 @@ -33,10 +33,6 @@
1837 void handle_command(TcpServer *tcps, client_command *cc);
1838 int NetWriteStatus(const char *in_status);
1839 void NetWriteInfo();
1840 -int SayText(string in_text);
1841 -int PlaySound(string in_sound);
1842 -void SpeechHandler(int *fds, const char *player);
1843 -void SoundHandler(int *fds, const char *player, map<string, string> soundmap);
1844 void ProtocolAlertEnable(int in_fd);
1845 void ProtocolNetworkEnable(int in_fd);
1846 void ProtocolClientEnable(int in_fd);
1847 diff -urN kismet.dev/packetracker.cc kismet.dev2/packetracker.cc
1848 --- kismet.dev/packetracker.cc 2005-08-16 03:22:51.000000000 +0200
1849 +++ kismet.dev2/packetracker.cc 2005-08-23 01:59:25.656218272 +0200
1850 @@ -2439,23 +2439,3 @@
1851
1852 }
1853
1854 -// Write a gpsdrive compatable waypoint file
1855 -int Packetracker::WriteGpsdriveWaypt(FILE *in_file) {
1856 - fseek(in_file, 0L, SEEK_SET);
1857 - ftruncate(fileno(in_file), 0);
1858 -
1859 - // Convert the map to a vector and sort it
1860 - for (map<mac_addr, wireless_network *>::const_iterator i = bssid_map.begin();
1861 - i != bssid_map.end(); ++i) {
1862 - wireless_network *net = i->second;
1863 -
1864 - float lat, lon;
1865 - lat = (net->min_lat + net->max_lat) / 2;
1866 - lon = (net->min_lon + net->max_lon) / 2;
1867 - fprintf(in_file, "%s\t%f %f\n", waypointformat == 1 ? net->ssid.c_str() : net->bssid.Mac2String().c_str(), lat, lon);
1868 - }
1869 -
1870 - fflush(in_file);
1871 -
1872 - return 1;
1873 -}
1874 diff -urN kismet.dev/packetracker.h kismet.dev2/packetracker.h
1875 --- kismet.dev/packetracker.h 2005-08-16 03:22:51.000000000 +0200
1876 +++ kismet.dev2/packetracker.h 2005-08-23 01:59:25.656218272 +0200
1877 @@ -30,7 +30,6 @@
1878 #include <string>
1879
1880 #include "util.h"
1881 -#include "gpsd.h"
1882 #include "packet.h"
1883 #include "tracktypes.h"
1884 #include "manuf.h"
1885 @@ -85,8 +84,6 @@
1886 int WriteXMLNetworks(string in_fname);
1887 int WriteCisco(string in_fname);
1888
1889 - int WriteGpsdriveWaypt(FILE *in_file);
1890 -
1891 void WriteSSIDMap(FILE *in_file);
1892 void ReadSSIDMap(FILE *in_file);
1893
1894 diff -urN kismet.dev/packetsourcetracker.cc kismet.dev2/packetsourcetracker.cc
1895 --- kismet.dev/packetsourcetracker.cc 2005-08-23 00:59:39.969982048 +0200
1896 +++ kismet.dev2/packetsourcetracker.cc 2005-08-23 01:59:25.657218120 +0200
1897 @@ -24,7 +24,6 @@
1898 Packetsourcetracker::Packetsourcetracker() {
1899 next_packsource_id = 0;
1900 next_meta_id = 0;
1901 - gpsd = NULL;
1902 timetracker = NULL;
1903 chanchild_pid = 0;
1904 sockpair[0] = sockpair[1] = 0;
1905 @@ -691,7 +690,6 @@
1906
1907 // Register the trackers with it
1908 meta->capsource->AddTimetracker(timetracker);
1909 - meta->capsource->AddGpstracker(gpsd);
1910
1911 // Open it
1912 fprintf(stderr, "Source %d (%s): Opening %s source interface %s...\n",
1913 diff -urN kismet.dev/packetsourcetracker.h kismet.dev2/packetsourcetracker.h
1914 --- kismet.dev/packetsourcetracker.h 2005-08-16 03:22:51.000000000 +0200
1915 +++ kismet.dev2/packetsourcetracker.h 2005-08-23 01:59:25.658217968 +0200
1916 @@ -30,7 +30,6 @@
1917 #include <string>
1918
1919 #include "timetracker.h"
1920 -#include "gpsd.h"
1921 #include "packetsource.h"
1922
1923 // Sentinel for starting a new packet
1924 @@ -144,9 +143,6 @@
1925 // Register a timer event handler for us to use
1926 void AddTimetracker(Timetracker *in_tracker) { timetracker = in_tracker; }
1927
1928 - // Register the GPS server for us to use
1929 - void AddGpstracker(GPSD *in_gpsd) { gpsd = in_gpsd; }
1930 -
1931 // Register a packet prototype source... Card type string, root binding requirement,
1932 // function to generate an instance of the source, and function to change channel
1933 // for this card type. This fills out the prototype. Sources that don't hop
1934 @@ -221,7 +217,6 @@
1935 uint16_t channel;
1936 } chanchild_changepacket;
1937
1938 - GPSD *gpsd;
1939 Timetracker *timetracker;
1940
1941 char errstr[1024];
1942 diff -urN kismet.dev/panelfront.cc kismet.dev2/panelfront.cc
1943 --- kismet.dev/panelfront.cc 2005-08-16 03:22:51.000000000 +0200
1944 +++ kismet.dev2/panelfront.cc 2005-08-23 01:59:25.659217816 +0200
1945 @@ -37,7 +37,6 @@
1946 " Key Action",
1947 " e List Kismet servers",
1948 " z Toggle fullscreen zoom of network view",
1949 - " m Toggle muting of sound and speech",
1950 " t Tag (or untag) selected network",
1951 " g Group tagged networks",
1952 " u Ungroup current group",
1953 @@ -121,7 +120,6 @@
1954 "Key Action",
1955 " e List Kismet servers",
1956 " z Toggle fullscreen net list",
1957 - " m Toggle muting",
1958 " t Tag (or untag) selected",
1959 " g Group tagged networks",
1960 " u Ungroup current group",
1961 @@ -237,19 +235,6 @@
1962 };
1963
1964
1965 -char *KismetHelpGps[] = {
1966 - "KISMET NETWORK FOLLOW",
1967 - "This panel estimates the center of a network, the current",
1968 - "direction of travel, and the direction of the network center",
1969 - "and distance relative to the current direction of movement.",
1970 - " Key Action",
1971 - " s Follow location of strongest packet",
1972 - " c Follow location of estimated network center",
1973 - " q Close popup",
1974 - NULL
1975 -};
1976 -
1977 -
1978 char *KismetHelpStats[] = {
1979 "KISMET NETWORK STATISTICS",
1980 "This panel displays overall statistics about the wireless",
1981 @@ -678,7 +663,6 @@
1982 }
1983
1984 // Enable all the protocols we handle
1985 - in_client->EnableProtocol("GPS");
1986 in_client->EnableProtocol("INFO");
1987 in_client->EnableProtocol("REMOVE");
1988 in_client->EnableProtocol("NETWORK");
1989 @@ -1282,27 +1266,6 @@
1990 if (con->client == NULL)
1991 continue;
1992
1993 - // Update GPS
1994 - float newlat, newlon, newalt, newspd, newheading;
1995 - int newfix;
1996 - con->client->FetchLoc(&newlat, &newlon, &newalt, &newspd, &newheading, &newfix);
1997 -
1998 - if (GPSD::EarthDistance(newlat, newlon, last_lat, last_lon) > 10) {
1999 - con->last_lat = con->lat;
2000 - con->last_lon = con->lon;
2001 - con->last_spd = con->spd;
2002 - con->last_alt = con->alt;
2003 - con->last_fix = con->fix;
2004 - con->last_heading = con->heading;
2005 - }
2006 -
2007 - con->lat = newlat;
2008 - con->lon = newlon;
2009 - con->alt = newalt;
2010 - con->spd = newspd;
2011 - con->heading = newheading;
2012 - con->fix = newfix;
2013 -
2014 // Update quality
2015 con->quality = con->client->FetchQuality();
2016 con->power = con->client->FetchPower();
2017 diff -urN kismet.dev/panelfront.h kismet.dev2/panelfront.h
2018 --- kismet.dev/panelfront.h 2005-08-16 03:22:51.000000000 +0200
2019 +++ kismet.dev2/panelfront.h 2005-08-23 01:59:25.660217664 +0200
2020 @@ -65,7 +65,6 @@
2021 #define SORT_SIZE 10
2022 extern char *KismetHelpPower[];
2023 extern char *KismetHelpRate[];
2024 -extern char *KismetHelpGps[];
2025 extern char *KismetHelpStats[];
2026 extern char *KismetHelpDump[];
2027 extern char *KismetHelpPack[];
2028 @@ -269,7 +268,6 @@
2029 int RatePrinter(void *in_window);
2030 int StatsPrinter(void *in_window);
2031 int PackPrinter(void *in_window);
2032 - int GpsPrinter(void *in_window);
2033 int AlertPrinter(void *in_window);
2034
2035 int MainClientPrinter(void *in_window);
2036 @@ -298,7 +296,6 @@
2037 int PackInput(void *in_window, int in_chr);
2038 // Help has a generic handler
2039 int TextInput(void *in_window, int in_chr);
2040 - int GpsInput(void *in_window, int in_chr);
2041 int AlertInput(void *in_window, int in_chr);
2042
2043 int MainClientInput(void *in_window, int in_chr);
2044 diff -urN kismet.dev/panelfront_display.cc kismet.dev2/panelfront_display.cc
2045 --- kismet.dev/panelfront_display.cc 2005-08-16 03:22:51.000000000 +0200
2046 +++ kismet.dev2/panelfront_display.cc 2005-08-23 01:59:25.663217208 +0200
2047 @@ -727,7 +727,7 @@
2048 mvwaddstr(netwin, netwin->_maxy, netwin->_maxx - 14, ptxt);
2049 }
2050
2051 -#ifdef HAVE_GPS
2052 +#if 0
2053
2054
2055 if (!(lat == 0 && lon == 0 && alt == 0 && spd == 0 && fix == 0)) {
2056 @@ -1496,51 +1496,6 @@
2057 snprintf(output, print_width, "Networks: %d", (int) details_network->networks.size());
2058 kwin->text.push_back(output);
2059
2060 - if (details_network->virtnet->gps_fixed != -1) {
2061 - if ((details_network->virtnet->min_lat == 90) && (details_network->virtnet->min_lon == 180) &&
2062 - (details_network->virtnet->max_lat == -90) && (details_network->virtnet->max_lon == -180)) {
2063 - snprintf(output, print_width, "Min Loc : N/A");
2064 - kwin->text.push_back(output);
2065 - snprintf(output, print_width, "Max Loc : N/A");
2066 - kwin->text.push_back(output);
2067 - snprintf(output, print_width, "Range : N/A");
2068 - kwin->text.push_back(output);
2069 - }
2070 - else {
2071 - snprintf(output, print_width, "Min Loc : Lat %f Lon %f Alt %f Spd %f",
2072 - details_network->virtnet->min_lat, details_network->virtnet->min_lon,
2073 - metric ? details_network->virtnet->min_alt / 3.3 : details_network->virtnet->min_alt,
2074 - metric ? details_network->virtnet->min_spd * 1.6093 : details_network->virtnet->min_spd);
2075 - kwin->text.push_back(output);
2076 - snprintf(output, print_width, "Max Loc : Lat %f Lon %f Alt %f Spd %f",
2077 - details_network->virtnet->max_lat, details_network->virtnet->max_lon,
2078 - metric ? details_network->virtnet->max_alt / 3.3 : details_network->virtnet->max_alt,
2079 - metric ? details_network->virtnet->max_spd * 1.6093 : details_network->virtnet->max_spd);
2080 - kwin->text.push_back(output);
2081 -
2082 - double diagdist = GPSD::EarthDistance(details_network->virtnet->min_lat,
2083 - details_network->virtnet->min_lon,
2084 - details_network->virtnet->max_lat,
2085 - details_network->virtnet->max_lon);
2086 -
2087 - if (finite(diagdist)) {
2088 - if (metric) {
2089 - if (diagdist < 1000)
2090 - snprintf(output, print_width, "Range : %.3f meters", diagdist);
2091 - else
2092 - snprintf(output, print_width, "Range : %.3f kilometers", diagdist / 1000);
2093 - } else {
2094 - diagdist *= 3.3;
2095 - if (diagdist < 5280)
2096 - snprintf(output, print_width, "Range : %.3f feet", diagdist);
2097 - else
2098 - snprintf(output, print_width, "Range : %.3f miles", diagdist / 5280);
2099 - }
2100 - kwin->text.push_back(output);
2101 - }
2102 - }
2103 - }
2104 -
2105 if (details_network->virtnet->carrier_set & (1 << (int) carrier_80211b)) {
2106 snprintf(output, print_width, "Carrier : IEEE 802.11b");
2107 kwin->text.push_back(output);
2108 @@ -1853,49 +1808,6 @@
2109 dnet->ipdata.range_ip[2], dnet->ipdata.range_ip[3]);
2110 kwin->text.push_back(output);
2111 }
2112 -
2113 - if (dnet->gps_fixed != -1) {
2114 - if ((dnet->min_lat == 90) && (dnet->min_lon == 180) &&
2115 - (dnet->max_lat == -90) && (dnet->max_lon == -180)) {
2116 - snprintf(output, print_width, "Min Loc : N/A");
2117 - kwin->text.push_back(output);
2118 - snprintf(output, print_width, "Max Loc : N/A");
2119 - kwin->text.push_back(output);
2120 - snprintf(output, print_width, "Range : N/A");
2121 - kwin->text.push_back(output);
2122 - }
2123 - else {
2124 - snprintf(output, print_width, "Min Loc : Lat %f Lon %f Alt %f Spd %f",
2125 - dnet->min_lat, dnet->min_lon,
2126 - metric ? dnet->min_alt / 3.3 : dnet->min_alt,
2127 - metric ? dnet->min_spd * 1.6093 : dnet->min_spd);
2128 - kwin->text.push_back(output);
2129 - snprintf(output, print_width, "Max Loc : Lat %f Lon %f Alt %f Spd %f",
2130 - dnet->max_lat, dnet->max_lon,
2131 - metric ? dnet->max_alt / 3.3 : dnet->max_alt,
2132 - metric ? dnet->max_spd * 1.6093 : dnet->max_spd);
2133 - kwin->text.push_back(output);
2134 -
2135 - double diagdist = GPSD::EarthDistance(dnet->min_lat, dnet->min_lon,
2136 - dnet->max_lat, dnet->max_lon);
2137 -
2138 - if (finite(diagdist)) {
2139 - if (metric) {
2140 - if (diagdist < 1000)
2141 - snprintf(output, print_width, "Range : %f meters", diagdist);
2142 - else
2143 - snprintf(output, print_width, "Range : %f kilometers", diagdist / 1000);
2144 - } else {
2145 - diagdist *= 3.3;
2146 - if (diagdist < 5280)
2147 - snprintf(output, print_width, "Range : %f feet", diagdist);
2148 - else
2149 - snprintf(output, print_width, "Range : %f miles", diagdist / 5280);
2150 - }
2151 - kwin->text.push_back(output);
2152 - }
2153 - }
2154 - }
2155 }
2156
2157 // Now we just use the text printer to handle the rest for us
2158 @@ -1903,184 +1815,6 @@
2159 return TextPrinter(in_window);
2160 }
2161
2162 -int PanelFront::GpsPrinter(void *in_window) {
2163 - kis_window *kwin = (kis_window *) in_window;
2164 -
2165 - char output[1024];
2166 - kwin->text.clear();
2167 -
2168 - if (details_network == NULL) {
2169 - kwin->text.push_back("The network or group being displayed");
2170 - kwin->text.push_back("has been deleted. Please select a ");
2171 - kwin->text.push_back("different network.");
2172 - return TextPrinter(in_window);
2173 - }
2174 -
2175 - wireless_network *dnet = details_network->virtnet;
2176 -
2177 - int print_width = kwin->print_width;
2178 - if (print_width > 1024)
2179 - print_width = 1023;
2180 -
2181 - if (print_width < 32) {
2182 - kwin->text.push_back("Display not wide enough");
2183 - return TextPrinter(in_window);
2184 - }
2185 -
2186 - if (dnet->aggregate_points == 0) {
2187 - kwin->text.push_back("No GPS data.");
2188 - return TextPrinter(in_window);
2189 - }
2190 -
2191 - float center_lat, center_lon;
2192 -
2193 - // We hijack the "selected" field as a toggle
2194 - if (kwin->selected == 1) {
2195 - center_lat = dnet->best_lat;
2196 - center_lon = dnet->best_lon;
2197 - } else {
2198 - center_lat = dnet->aggregate_lat / dnet->aggregate_points;
2199 - center_lon = dnet->aggregate_lon / dnet->aggregate_points;
2200 - }
2201 -
2202 - // Get bearing to the center
2203 - float center_angle = GPSD::CalcHeading(center_lat, center_lon, lat, lon);
2204 -
2205 - float difference_angle = heading - center_angle;
2206 - if (difference_angle < 0)
2207 - difference_angle += 360;
2208 -
2209 - double diagdist = GPSD::EarthDistance(lat, lon, center_lat, center_lon);
2210 -
2211 - // Now we know everything - where we are, where we are headed, where we SHOULD be headed
2212 - // to get to the supposed center of the network, how far it is, and the orientation on our
2213 - // compass to get to it. Time to start drawing our output.
2214 -
2215 - char compass[5][10];
2216 - memset(compass, 0, sizeof(char) * 5 * 10);
2217 -
2218 - // | 41.12345x-74.12345 .-|-/ |
2219 - // | Bearing: / |/ \ |
2220 - // | 123.23 degrees | O | |
2221 - // | \ \ / |
2222 - // | Estimated center: '---\ |
2223 -
2224 -
2225 - // Find the orientation on our compass:
2226 - if (difference_angle > 330 || difference_angle <= 22) {
2227 - snprintf(compass[0], 10, " .-|-. ");
2228 - snprintf(compass[1], 10, " / | \\ ");
2229 - snprintf(compass[2], 10, "| O |");
2230 - snprintf(compass[3], 10, " \\ / ");
2231 - snprintf(compass[4], 10, " '---' ");
2232 - } else if (difference_angle > 22 && difference_angle <= 66) {
2233 - snprintf(compass[0], 10, " .---/ ");
2234 - snprintf(compass[1], 10, " / / \\ ");
2235 - snprintf(compass[2], 10, "| O |");
2236 - snprintf(compass[3], 10, " \\ / ");
2237 - snprintf(compass[4], 10, " '---' ");
2238 - } else if (difference_angle > 66 && difference_angle <= 110) {
2239 - snprintf(compass[0], 10, " .---. ");
2240 - snprintf(compass[1], 10, " / \\ ");
2241 - snprintf(compass[2], 10, "| O----");
2242 - snprintf(compass[3], 10, " \\ / ");
2243 - snprintf(compass[4], 10, " '---' ");
2244 - } else if (difference_angle > 110 && difference_angle <= 154) {
2245 - snprintf(compass[0], 10, " .---. ");
2246 - snprintf(compass[1], 10, " / \\ ");
2247 - snprintf(compass[2], 10, "| O |");
2248 - snprintf(compass[3], 10, " \\ \\ / ");
2249 - snprintf(compass[4], 10, " '---\\ ");
2250 - } else if (difference_angle > 154 && difference_angle <= 198) {
2251 - snprintf(compass[0], 10, " .---. ");
2252 - snprintf(compass[1], 10, " / \\ ");
2253 - snprintf(compass[2], 10, "| O |");
2254 - snprintf(compass[3], 10, " \\ | / ");
2255 - snprintf(compass[4], 10, " '-|-' ");
2256 - } else if (difference_angle > 198 && difference_angle <= 242) {
2257 - snprintf(compass[0], 10, " .---. ");
2258 - snprintf(compass[1], 10, " / \\ ");
2259 - snprintf(compass[2], 10, "| O |");
2260 - snprintf(compass[3], 10, " \\ / / ");
2261 - snprintf(compass[4], 10, " /---' ");
2262 - } else if (difference_angle > 242 && difference_angle <= 286) {
2263 - snprintf(compass[0], 10, " .---. ");
2264 - snprintf(compass[1], 10, " / \\ ");
2265 - snprintf(compass[2], 10, "----O |");
2266 - snprintf(compass[3], 10, " \\ / ");
2267 - snprintf(compass[4], 10, " '---' ");
2268 - } else if (difference_angle > 286 && difference_angle <= 330) {
2269 - snprintf(compass[0], 10, " \\---. ");
2270 - snprintf(compass[1], 10, " / \\ \\ ");
2271 - snprintf(compass[2], 10, "| O |");
2272 - snprintf(compass[3], 10, " \\ / ");
2273 - snprintf(compass[4], 10, " '---' ");
2274 - } else {
2275 - snprintf(compass[0], 10, "%f\n", difference_angle);
2276 - }
2277 -
2278 -
2279 - // - Network GPS ---------------------|
2280 - // | Current: |
2281 - // | 41.12345x-74.12345 .-|-. |
2282 - // | Bearing: / | \ |
2283 - // | 123.23 degrees | O | |
2284 - // | \ \ / |
2285 - // | Estimated center: '---\ |
2286 - // | -73.12345x43.12345 |
2287 - // | 120 feet |
2288 - // ------------------------------------
2289 - char textfrag[23];
2290 -
2291 - snprintf(output, print_width, "Current:");
2292 - kwin->text.push_back(output);
2293 -
2294 - snprintf(textfrag, 23, "%.3f x %.3f", lat, lon);
2295 - snprintf(output, print_width, "%-22s%s", textfrag, compass[0]);
2296 - kwin->text.push_back(output);
2297 -
2298 - snprintf(textfrag, 23, " Bearing:");
2299 - snprintf(output, print_width, "%-22s%s", textfrag, compass[1]);
2300 - kwin->text.push_back(output);
2301 -
2302 - snprintf(textfrag, 23, " %.2f*", heading);
2303 - snprintf(output, print_width, "%-22s%s", textfrag, compass[2]);
2304 - kwin->text.push_back(output);
2305 -
2306 - snprintf(textfrag, 23, " ");
2307 - snprintf(output, print_width, "%-22s%s", textfrag, compass[3]);
2308 - kwin->text.push_back(output);
2309 -
2310 - if (kwin->selected == 1)
2311 - snprintf(textfrag, 23, "Strongest signal:");
2312 - else
2313 - snprintf(textfrag, 23, "Estimated Center:");
2314 - snprintf(output, print_width, "%-22s%s", textfrag, compass[4]);
2315 - kwin->text.push_back(output);
2316 -
2317 - snprintf(textfrag, 23, "%.3f x %.3f", center_lat, center_lon);
2318 - snprintf(output, print_width, "%-22s%.2f*", textfrag, difference_angle);
2319 - kwin->text.push_back(output);
2320 -
2321 - if (metric) {
2322 - if (diagdist < 1000)
2323 - snprintf(textfrag, 23, "%.2f m", diagdist);
2324 - else
2325 - snprintf(textfrag, 23, "%.2f km", diagdist / 1000);
2326 - } else {
2327 - diagdist *= 3.3;
2328 - if (diagdist < 5280)
2329 - snprintf(textfrag, 23, "%.2f ft", diagdist);
2330 - else
2331 - snprintf(textfrag, 23, "%.2f mi", diagdist / 5280);
2332 - }
2333 -
2334 - snprintf(output, print_width, "%-22s%s", "", textfrag);
2335 - kwin->text.push_back(output);
2336 -
2337 - return TextPrinter(in_window);
2338 -}
2339 -
2340 int PanelFront::PackPrinter(void *in_window) {
2341 kis_window *kwin = (kis_window *) in_window;
2342
2343 @@ -3049,53 +2783,6 @@
2344 details_client->ipdata.ip[2], details_client->ipdata.ip[3]);
2345 kwin->text.push_back(output);
2346
2347 - if (details_client->gps_fixed != -1) {
2348 - kwin->text.push_back("");
2349 -
2350 - if ((details_client->min_lat == 90) && (details_client->min_lon == 180) &&
2351 - (details_client->max_lat == -90) && (details_client->max_lon == -180)) {
2352 - snprintf(output, print_width, "Min Loc : N/A");
2353 - kwin->text.push_back(output);
2354 - snprintf(output, print_width, "Max Loc : N/A");
2355 - kwin->text.push_back(output);
2356 - snprintf(output, print_width, "Range : N/A");
2357 - kwin->text.push_back(output);
2358 - }
2359 - else {
2360 - snprintf(output, print_width, "Min Loc : Lat %f Lon %f Alt %f Spd %f",
2361 - details_client->min_lat, details_client->min_lon,
2362 - metric ? details_client->min_alt / 3.3 : details_client->min_alt,
2363 - metric ? details_client->min_spd * 1.6093 : details_client->min_spd);
2364 - kwin->text.push_back(output);
2365 - snprintf(output, print_width, "Max Loc : Lat %f Lon %f Alt %f Spd %f",
2366 - details_client->max_lat, details_client->max_lon,
2367 - metric ? details_client->max_alt / 3.3 : details_client->max_alt,
2368 - metric ? details_client->max_spd * 1.6093 : details_client->max_spd);
2369 - kwin->text.push_back(output);
2370 -
2371 - double diagdist = GPSD::EarthDistance(details_client->min_lat,
2372 - details_client->min_lon,
2373 - details_client->max_lat,
2374 - details_client->max_lon);
2375 -
2376 - if (finite(diagdist)) {
2377 - if (metric) {
2378 - if (diagdist < 1000)
2379 - snprintf(output, print_width, "Range : %f meters", diagdist);
2380 - else
2381 - snprintf(output, print_width, "Range : %f kilometers", diagdist / 1000);
2382 - } else {
2383 - diagdist *= 3.3;
2384 - if (diagdist < 5280)
2385 - snprintf(output, print_width, "Range : %f feet", diagdist);
2386 - else
2387 - snprintf(output, print_width, "Range : %f miles", diagdist / 5280);
2388 - }
2389 - kwin->text.push_back(output);
2390 - }
2391 - }
2392 - kwin->text.push_back("");
2393 - }
2394
2395 snprintf(output, print_width, "Packets :");
2396 kwin->text.push_back(output);
2397 diff -urN kismet.dev/panelfront_input.cc kismet.dev2/panelfront_input.cc
2398 --- kismet.dev/panelfront_input.cc 2005-08-16 03:22:51.000000000 +0200
2399 +++ kismet.dev2/panelfront_input.cc 2005-08-23 01:59:25.665216904 +0200
2400 @@ -300,16 +300,9 @@
2401 break;
2402 case 'f':
2403 case 'F':
2404 - if (sortby != sort_auto && last_displayed.size() > 0) {
2405 - details_network = last_displayed[kwin->selected];
2406 - SpawnWindow("Network Location", &PanelFront::GpsPrinter, &PanelFront::GpsInput, 8, 34);
2407 - } else {
2408 - WriteStatus("Cannot view network GPS info in autofit sort mode. Sort by a different method.");
2409 - }
2410 break;
2411 case 'm':
2412 case 'M':
2413 - MuteToggle();
2414 break;
2415 case 'e':
2416 case 'E':
2417 @@ -447,7 +440,6 @@
2418 switch(in_chr) {
2419 case 'm':
2420 case 'M':
2421 - MuteToggle();
2422 break;
2423 case 'p':
2424 case 'P':
2425 @@ -546,33 +538,6 @@
2426 return 1;
2427 }
2428
2429 -int PanelFront::GpsInput(void *in_window, int in_chr) {
2430 - kis_window *kwin = (kis_window *) in_window;
2431 -
2432 - switch (in_chr) {
2433 - case 's':
2434 - case 'S':
2435 - kwin->selected = 1;
2436 - break;
2437 - case 'c':
2438 - case 'C':
2439 - kwin->selected = 0;
2440 - break;
2441 - case 'h':
2442 - case 'H':
2443 - SpawnHelp(KismetHelpGps);
2444 - break;
2445 - case 'x':
2446 - case 'X':
2447 - case 'q':
2448 - case 'Q':
2449 - return 0;
2450 - break;
2451 - }
2452 -
2453 - return 1;
2454 -}
2455 -
2456 int PanelFront::RateInput(void *in_window, int in_chr) {
2457 switch (in_chr) {
2458 case 'h':
2459 @@ -645,24 +610,6 @@
2460 return 1;
2461 }
2462
2463 -void PanelFront::MuteToggle() {
2464 - if (muted) {
2465 - speech = old_speech;
2466 - sound = old_sound;
2467 - muted = 0;
2468 - WriteStatus("Restoring sound");
2469 - } else if (sound != 0 || speech != 0) {
2470 - old_speech = speech;
2471 - old_sound = sound;
2472 - sound = 0;
2473 - speech = 0;
2474 - muted = 1;
2475 - WriteStatus("Muting sound");
2476 - } else if (sound == 0 && speech == 0) {
2477 - WriteStatus("Sound not enabled.");
2478 - }
2479 -}
2480 -
2481 int PanelFront::AlertInput(void *in_window, int in_chr) {
2482 kis_window *kwin = (kis_window *) in_window;
2483
2484 diff -urN kismet.dev/pcapsource.cc kismet.dev2/pcapsource.cc
2485 --- kismet.dev/pcapsource.cc 2005-08-23 01:03:45.652632608 +0200
2486 +++ kismet.dev2/pcapsource.cc 2005-08-23 01:59:25.667216600 +0200
2487 @@ -343,11 +343,6 @@
2488 packet->moddata = moddata;
2489 packet->modified = 0;
2490
2491 - if (gpsd != NULL) {
2492 - gpsd->FetchLoc(&packet->gps_lat, &packet->gps_lon, &packet->gps_alt,
2493 - &packet->gps_spd, &packet->gps_heading, &packet->gps_fix);
2494 - }
2495 -
2496 if (datalink_type == DLT_PRISM_HEADER) {
2497 ret = Prism2KisPack(packet, data, moddata);
2498 } else if (datalink_type == KDLT_BSD802_11) {
2499 @@ -1146,133 +1141,6 @@
2500
2501 // Monitor commands
2502 #ifdef HAVE_LINUX_WIRELESS
2503 -// Cisco uses its own config file in /proc to control modes
2504 -int monitor_cisco(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
2505 - FILE *cisco_config;
2506 - char cisco_path[128];
2507 -
2508 - linux_ifparm *ifparm = (linux_ifparm *) malloc(sizeof(linux_ifparm));
2509 - (*in_if) = ifparm;
2510 -
2511 - if (Ifconfig_Get_Flags(in_dev, in_err, &ifparm->flags) < 0) {
2512 - return -1;
2513 - }
2514 -
2515 - if (Iwconfig_Get_SSID(in_dev, in_err, ifparm->essid) < 0)
2516 - return -1;
2517 -
2518 - if ((ifparm->channel = Iwconfig_Get_Channel(in_dev, in_err)) < 0)
2519 - return -1;
2520 -
2521 - if (Iwconfig_Get_Mode(in_dev, in_err, &ifparm->mode) < 0)
2522 - return -1;
2523 -
2524 - if (Ifconfig_Delta_Flags(in_dev, in_err, IFF_UP | IFF_RUNNING | IFF_PROMISC) < 0)
2525 - return -1;
2526 -
2527 - // Try the iwpriv
2528 - if (Iwconfig_Set_IntPriv(in_dev, "setRFMonitor", 1, 0, in_err) >= 0) {
2529 - return 0;
2530 - }
2531 -
2532 - // Zero the ssid - nonfatal
2533 - Iwconfig_Set_SSID(in_dev, in_err, NULL);
2534 -
2535 - // Build the proc control path
2536 - snprintf(cisco_path, 128, "/proc/driver/aironet/%s/Config", in_dev);
2537 -
2538 - if ((cisco_config = fopen(cisco_path, "w")) == NULL) {
2539 - snprintf(in_err, STATUS_MAX, "Unable to open cisco control file '%s' %d:%s",
2540 - cisco_path, errno, strerror(errno));
2541 - return -1;
2542 - }
2543 -
2544 - fprintf(cisco_config, "Mode: r\n");
2545 - fprintf(cisco_config, "Mode: y\n");
2546 - fprintf(cisco_config, "XmitPower: 1\n");
2547 -
2548 - fclose(cisco_config);
2549 -
2550 - // Channel can't be set on cisco with these drivers.
2551 -
2552 - return 0;
2553 -}
2554 -
2555 -int unmonitor_cisco(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
2556 - linux_ifparm *ifparm = (linux_ifparm *) (*in_if);
2557 - int ret = -1;
2558 -
2559 - // Try the iwpriv
2560 - if (Iwconfig_Set_IntPriv(in_dev, "setRFMonitor", 0, 0, in_err) >= 0) {
2561 - // If we're the new drivers, unmonitor
2562 - if (Ifconfig_Set_Flags(in_dev, in_err, ifparm->flags) < 0) {
2563 - return -1;
2564 - }
2565 -
2566 - // Reset the SSID since monitor mode nukes it
2567 - if (Iwconfig_Set_SSID(in_dev, in_err, ifparm->essid) < 0)
2568 - return -1;
2569 -
2570 - if (ifparm->channel > 0) {
2571 - if (Iwconfig_Set_Channel(in_dev, ifparm->channel, in_err) < 0)
2572 - return -1;
2573 - }
2574 -
2575 - ret = 1;
2576 - }
2577 -
2578 - free(ifparm);
2579 -
2580 - return ret;
2581 -}
2582 -
2583 -// Cisco uses its own config file in /proc to control modes
2584 -//
2585 -// I was doing this with ioctls but that seems to cause lockups while
2586 -// this method doesn't. I don't think I like these drivers.
2587 -int monitor_cisco_wifix(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
2588 - FILE *cisco_config;
2589 - char cisco_path[128];
2590 - vector<string> devbits = StrTokenize(in_dev, ":");
2591 -
2592 - if (devbits.size() < 2) {
2593 - snprintf(in_err, STATUS_MAX, "Invalid device pair '%s'. Proper device "
2594 - "for cisco_wifix is eth?:wifi?.", in_dev);
2595 - return -1;
2596 - }
2597 -
2598 - // Bring the device up, zero its ip, and set promisc
2599 - if (Ifconfig_Delta_Flags(devbits[0].c_str(), in_err,
2600 - IFF_UP | IFF_RUNNING | IFF_PROMISC) < 0)
2601 - return -1;
2602 - if (Ifconfig_Delta_Flags(devbits[1].c_str(), in_err,
2603 - IFF_UP | IFF_RUNNING | IFF_PROMISC) < 0)
2604 - return -1;
2605 -
2606 - // Zero the ssid, nonfatally
2607 - Iwconfig_Set_SSID(devbits[0].c_str(), in_err, NULL);
2608 - Iwconfig_Set_SSID(devbits[1].c_str(), in_err, NULL);
2609 -
2610 - // Build the proc control path
2611 - snprintf(cisco_path, 128, "/proc/driver/aironet/%s/Config", devbits[0].c_str());
2612 -
2613 - if ((cisco_config = fopen(cisco_path, "w")) == NULL) {
2614 - snprintf(in_err, STATUS_MAX, "Unable to open cisco control file '%s' %d:%s",
2615 - cisco_path, errno, strerror(errno));
2616 - return -1;
2617 - }
2618 -
2619 - fprintf(cisco_config, "Mode: r\n");
2620 - fprintf(cisco_config, "Mode: y\n");
2621 - fprintf(cisco_config, "XmitPower: 1\n");
2622 -
2623 - fclose(cisco_config);
2624 -
2625 - // Channel can't be set on cisco with these drivers.
2626 -
2627 - return 0;
2628 -}
2629 -
2630 // Hostap uses iwpriv and iwcontrol settings to control monitor mode
2631 int monitor_hostap(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
2632 int ret;
2633 @@ -1421,134 +1289,6 @@
2634 return 1;
2635
2636 }
2637 -
2638 -// Acx100 uses the packhdr iwpriv control to set link state, rest is normal
2639 -int monitor_acx100(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
2640 - int ret;
2641 -
2642 - // Allocate a tracking record for the interface settings and remember our
2643 - // setup
2644 - linux_ifparm *ifparm = (linux_ifparm *) malloc(sizeof(linux_ifparm));
2645 - (*in_if) = ifparm;
2646 -
2647 - if (Ifconfig_Get_Flags(in_dev, in_err, &ifparm->flags) < 0) {
2648 - return -1;
2649 - }
2650 -
2651 - if (Iwconfig_Get_SSID(in_dev, in_err, ifparm->essid) < 0)
2652 - return -1;
2653 -
2654 - if ((ifparm->channel = Iwconfig_Get_Channel(in_dev, in_err)) < 0)
2655 - return -1;
2656 -
2657 - if (Iwconfig_Get_Mode(in_dev, in_err, &ifparm->mode) < 0)
2658 - return -1;
2659 -
2660 - // it looks like an orinoco now, apparently
2661 - if ((ret = Iwconfig_Set_IntPriv(in_dev, "monitor", 1, initch, in_err)) < 0) {
2662 - if (ret == -2)
2663 - snprintf(in_err, 1024, "Could not find 'monitor' private ioctl "
2664 - "Make sure you have the latest ACX100 development release.");
2665 - return -1;
2666 - }
2667 -
2668 - if (chancontrol_wext(in_dev, initch, in_err, NULL) < 0)
2669 - return -1;
2670 -
2671 - return 0;
2672 -}
2673 -
2674 -int unmonitor_acx100(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
2675 - // Restore the IP settings
2676 - linux_ifparm *ifparm = (linux_ifparm *) (*in_if);
2677 -
2678 - if (Ifconfig_Set_Flags(in_dev, in_err, ifparm->flags) < 0) {
2679 - return -1;
2680 - }
2681 -
2682 - Iwconfig_Set_IntPriv(in_dev, "monitor", 0, ifparm->channel, in_err);
2683 - Iwconfig_Set_Mode(in_dev, in_err, ifparm->mode);
2684 -
2685 - if (Iwconfig_Set_SSID(in_dev, in_err, ifparm->essid) < 0)
2686 - return -1;
2687 -
2688 - free(ifparm);
2689 -
2690 - return 1;
2691 -}
2692 -
2693 -int monitor_admtek(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
2694 - // Allocate a tracking record for the interface settings and remember our
2695 - // setup
2696 - linux_ifparm *ifparm = (linux_ifparm *) malloc(sizeof(linux_ifparm));
2697 - (*in_if) = ifparm;
2698 -
2699 - // Try to figure out the name so we know if we have fcs bytes or not
2700 - char iwname[IFNAMSIZ+1];
2701 - if (Iwconfig_Get_Name(in_dev, in_err, iwname) < 0)
2702 - return -1;
2703 -
2704 - if (strncmp(iwname, "IEEE 802.11b", IFNAMSIZ) == 0) {
2705 - // Looks like the GPL driver, we need to adjust the fcsbytes
2706 - PcapSource *psrc = (PcapSource *) in_ext;
2707 - psrc->fcsbytes = 4;
2708 - }
2709 -
2710 - if (Ifconfig_Get_Flags(in_dev, in_err, &ifparm->flags) < 0) {
2711 - return -1;
2712 - }
2713 -
2714 - if ((ifparm->flags & IFF_UP)) {
2715 - if ((ifparm->channel = Iwconfig_Get_Channel(in_dev, in_err)) < 0)
2716 - return -1;
2717 -
2718 - if (Iwconfig_Get_Mode(in_dev, in_err, &ifparm->mode) < 0)
2719 - return -1;
2720 -
2721 - if (Iwconfig_Get_SSID(in_dev, in_err, ifparm->essid) < 0)
2722 - return -1;
2723 -
2724 - } else {
2725 - ifparm->channel = -1;
2726 - ifparm->mode = -1;
2727 - }
2728 -
2729 - int ret = monitor_wext(in_dev, initch, in_err, in_if, in_ext);
2730 -
2731 - if (ret < 0 && ret != -2)
2732 - return ret;
2733 -
2734 - if (Iwconfig_Set_SSID(in_dev, in_err, "") < 0)
2735 - return -1;
2736 -
2737 - return 0;
2738 -}
2739 -
2740 -int unmonitor_admtek(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
2741 - linux_ifparm *ifparm = (linux_ifparm *) (*in_if);
2742 -
2743 - if (unmonitor_wext(in_dev, initch, in_err, in_if, in_ext))
2744 - return -1;
2745 -
2746 - if (Iwconfig_Set_SSID(in_dev, in_err, ifparm->essid) < 0)
2747 - return -1;
2748 -
2749 - return 1;
2750 -}
2751 -// vtar5k iwpriv control to set link state, rest is normal
2752 -int monitor_vtar5k(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
2753 - // Set the prism iwpriv control to 1
2754 - if (Iwconfig_Set_IntPriv(in_dev, "prism", 1, 0, in_err) < 0) {
2755 - return -1;
2756 - }
2757 -
2758 - // The rest is standard wireless extensions
2759 - if (monitor_wext(in_dev, initch, in_err, in_if, in_ext) < 0)
2760 - return -1;
2761 -
2762 - return 0;
2763 -}
2764 -
2765 // Madwifi stuff uses iwpriv mode
2766 int monitor_madwifi_a(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
2767 // Allocate a tracking record for the interface settings and remember our
2768 @@ -1726,89 +1466,6 @@
2769
2770 return unmonitor_wext(in_dev, initch, in_err, in_if, in_ext);
2771 }
2772 -
2773 -int monitor_ipw2100(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
2774 - // Allocate a tracking record for the interface settings and remember our
2775 - // setup
2776 - linux_ifparm *ifparm = (linux_ifparm *) malloc(sizeof(linux_ifparm));
2777 - (*in_if) = ifparm;
2778 -
2779 - if (Ifconfig_Get_Flags(in_dev, in_err, &ifparm->flags) < 0) {
2780 - return -1;
2781 - }
2782 -
2783 - if ((ifparm->channel = Iwconfig_Get_Channel(in_dev, in_err)) < 0)
2784 - return -1;
2785 -
2786 - if (Iwconfig_Get_Mode(in_dev, in_err, &ifparm->mode) < 0)
2787 - return -1;
2788 -
2789 - // Call the normal monitor mode
2790 - return (monitor_wext(in_dev, initch, in_err, in_if, in_ext));
2791 -}
2792 -
2793 -int unmonitor_ipw2100(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
2794 - // Restore initial monitor header
2795 - // linux_ifparm *ifparm = (linux_ifparm *) (*in_if);
2796 -
2797 - linux_ifparm *ifparm = (linux_ifparm *) (*in_if);
2798 -
2799 - if (Ifconfig_Set_Flags(in_dev, in_err, ifparm->flags) < 0) {
2800 - return -1;
2801 - }
2802 -
2803 - if (Iwconfig_Set_Mode(in_dev, in_err, ifparm->mode) < 0)
2804 - return -1;
2805 -
2806 - free(ifparm);
2807 -
2808 - return 1;
2809 -}
2810 -
2811 -int monitor_ipw2200(const char *in_dev, int initch, char *in_err,
2812 - void **in_if, void *in_ext) {
2813 - // Allocate a tracking record for the interface settings and remember our
2814 - // setup
2815 - linux_ifparm *ifparm = (linux_ifparm *) malloc(sizeof(linux_ifparm));
2816 - (*in_if) = ifparm;
2817 -
2818 - if (Ifconfig_Get_Flags(in_dev, in_err, &ifparm->flags) < 0) {
2819 - return -1;
2820 - }
2821 -
2822 - if ((ifparm->channel = Iwconfig_Get_Channel(in_dev, in_err)) < 0)
2823 - return -1;
2824 -
2825 - if (Iwconfig_Get_Mode(in_dev, in_err, &ifparm->mode) < 0)
2826 - return -1;
2827 -
2828 - // Call the normal monitor mode
2829 - return (monitor_wext(in_dev, initch, in_err, in_if, in_ext));
2830 -}
2831 -
2832 -int unmonitor_ipw2200(const char *in_dev, int initch, char *in_err,
2833 - void **in_if, void *in_ext) {
2834 - // Restore initial monitor header
2835 - // linux_ifparm *ifparm = (linux_ifparm *) (*in_if);
2836 -
2837 - linux_ifparm *ifparm = (linux_ifparm *) (*in_if);
2838 -
2839 - if (Ifconfig_Set_Flags(in_dev, in_err, ifparm->flags) < 0) {
2840 - return -1;
2841 - }
2842 -
2843 - if (Iwconfig_Set_Mode(in_dev, in_err, ifparm->mode) < 0)
2844 - return -1;
2845 -
2846 - // James says this wants to be set to channel 0 for proper scanning operation
2847 - if (Iwconfig_Set_Channel(in_dev, 0, in_err) < 0)
2848 - return -1;
2849 -
2850 - free(ifparm);
2851 -
2852 - return 1;
2853 -}
2854 -
2855 // "standard" wireless extension monitor mode
2856 int monitor_wext(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
2857 int mode;
2858 @@ -1870,108 +1527,6 @@
2859 #endif
2860
2861 #ifdef SYS_LINUX
2862 -// wlan-ng modern standard
2863 -int monitor_wlanng(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
2864 - // I really didn't want to do this...
2865 - char cmdline[2048];
2866 -
2867 - // Sanitize the device just to be safe. The ifconfig should fail if
2868 - // the device is invalid, but why take risks
2869 - for (unsigned int x = 0; x < strlen(in_dev); x++) {
2870 - if (!isalnum(in_dev[x])) {
2871 - snprintf(in_err, STATUS_MAX, "Invalid device '%s'", in_dev);
2872 - return -1;
2873 - }
2874 - }
2875 -
2876 - if (Ifconfig_Delta_Flags(in_dev, in_err, IFF_UP | IFF_RUNNING | IFF_PROMISC) < 0)
2877 - return -1;
2878 -
2879 - // Enable the interface
2880 - snprintf(cmdline, 2048, "wlanctl-ng %s lnxreq_ifstate ifstate=enable >/dev/null 2>/dev/null", in_dev);
2881 - if (RunSysCmd(cmdline) < 0) {
2882 - snprintf(in_err, 1024, "Unable to execute '%s'", cmdline);
2883 - return -1;
2884 - }
2885 -
2886 - // Turn off WEP
2887 - snprintf(cmdline, 2048, "wlanctl-ng %s dot11req_mibset "
2888 - "mibattribute=dot11PrivacyInvoked=false >/dev/null 2>/dev/null", in_dev);
2889 - if (RunSysCmd(cmdline) < 0) {
2890 - snprintf(in_err, 1024, "Unable to execute '%s'", cmdline);
2891 - return -1;
2892 - }
2893 -
2894 - // Don't exclude packets
2895 - snprintf(cmdline, 2048, "wlanctl-ng %s dot11req_mibset "
2896 - "mibattribute=dot11ExcludeUnencrypted=false >/dev/null 2>/dev/null", in_dev);
2897 - if (RunSysCmd(cmdline) < 0) {
2898 - snprintf(in_err, 1024, "Unable to execute '%s'", cmdline);
2899 - return -1;
2900 - }
2901 -
2902 - // Turn on rfmon on the initial channel
2903 - snprintf(cmdline, 2048, "wlanctl-ng %s lnxreq_wlansniff channel=%d "
2904 - "enable=true prismheader=true >/dev/null 2>/dev/null", in_dev, initch);
2905 - if (RunSysCmd(cmdline) < 0) {
2906 - snprintf(in_err, 1024, "Unable to execute '%s'", cmdline);
2907 - return -1;
2908 - }
2909 -
2910 - return 0;
2911 -}
2912 -
2913 -// wlan-ng avs
2914 -int monitor_wlanng_avs(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
2915 - // I really didn't want to do this...
2916 - char cmdline[2048];
2917 -
2918 - // Sanitize the device just to be safe. The ifconfig should fail if
2919 - // the device is invalid, but why take risks
2920 - for (unsigned int x = 0; x < strlen(in_dev); x++) {
2921 - if (!isalnum(in_dev[x])) {
2922 - snprintf(in_err, STATUS_MAX, "Invalid device '%s'", in_dev);
2923 - return -1;
2924 - }
2925 - }
2926 -
2927 - if (Ifconfig_Delta_Flags(in_dev, in_err, IFF_UP | IFF_RUNNING | IFF_PROMISC) < 0)
2928 - return -1;
2929 -
2930 - // Enable the interface
2931 - snprintf(cmdline, 2048, "wlanctl-ng %s lnxreq_ifstate ifstate=enable >/dev/null 2>/dev/null", in_dev);
2932 - if (RunSysCmd(cmdline) < 0) {
2933 - snprintf(in_err, 1024, "Unable to execute '%s'", cmdline);
2934 - return -1;
2935 - }
2936 -
2937 - // Turn off WEP
2938 - snprintf(cmdline, 2048, "wlanctl-ng %s dot11req_mibset "
2939 - "mibattribute=dot11PrivacyInvoked=false >/dev/null 2>/dev/null", in_dev);
2940 - if (RunSysCmd(cmdline) < 0) {
2941 - snprintf(in_err, 1024, "Unable to execute '%s'", cmdline);
2942 - return -1;
2943 - }
2944 -
2945 - // Don't exclude packets
2946 - snprintf(cmdline, 2048, "wlanctl-ng %s dot11req_mibset "
2947 - "mibattribute=dot11ExcludeUnencrypted=false >/dev/null 2>/dev/null", in_dev);
2948 - if (RunSysCmd(cmdline) < 0) {
2949 - snprintf(in_err, 1024, "Unable to execute '%s'", cmdline);
2950 - return -1;
2951 - }
2952 -
2953 - // Turn on rfmon on the initial channel
2954 - snprintf(cmdline, 2048, "wlanctl-ng %s lnxreq_wlansniff channel=%d prismheader=false "
2955 - "wlanheader=true stripfcs=false keepwepflags=false enable=true >/dev/null 2>/dev/null", in_dev, initch);
2956 - if (RunSysCmd(cmdline) < 0) {
2957 - snprintf(in_err, 1024, "Unable to execute '%s'", cmdline);
2958 - return -1;
2959 - }
2960 -
2961 - return 0;
2962 -}
2963 -
2964 int monitor_wrt54g(const char *in_dev, int initch, char *in_err, void **in_if,
2965 void *in_ext) {
2966 char cmdline[2048];
2967 @@ -1981,7 +1536,7 @@
2968 snprintf(in_err, 1024, "Unable to set mode using 'iwpriv %s set_monitor 1'. "
2969 "Some custom firmware images require you to specify the origial "
2970 "device and a new dynamic device and use the iwconfig controls. "
2971 - "see the README for how to configure your capture source.");
2972 + "see the README for how to configure your capture source.", in_dev);
2973 return -1;
2974 }
2975
2976 @@ -1998,7 +1553,7 @@
2977 snprintf(in_err, 1024, "Unable to set mode using 'iwpriv %s set_monitor 0'. "
2978 "Some custom firmware images require you to specify the origial "
2979 "device and a new dynamic device and use the iwconfig controls. "
2980 - "see the README for how to configure your capture source.");
2981 + "see the README for how to configure your capture source.", in_dev);
2982 return -1;
2983 }
2984
2985 @@ -2244,75 +1799,6 @@
2986 return 0;
2987 }
2988
2989 -int chancontrol_ipw2100(const char *in_dev, int in_ch, char *in_err, void *in_ext) {
2990 - // Introduce a slight delay to let the driver settle, a la orinoco. I don't
2991 - // like doing this at all since it introduces hiccups into the channel control
2992 - // process, but....
2993 -
2994 - int ret = 0;
2995 -
2996 - ret = chancontrol_wext(in_dev, in_ch, in_err, in_ext);
2997 - usleep(5000);
2998 -
2999 - return ret;
3000 -}
3001 -
3002 -int chancontrol_ipw2200(const char *in_dev, int in_ch, char *in_err, void *in_ext) {
3003 - // Lets see if this really needs the channel change delay like the 2100 did
3004 - int ret = 0;
3005 -
3006 - ret = chancontrol_wext(in_dev, in_ch, in_err, in_ext);
3007 - // Drop a tiny sleep in here to let the channel set settle, otherwise we
3008 - // run the risk of the card freaking out
3009 - usleep(7000);
3010 -
3011 - return ret;
3012 -}
3013 -
3014 -#endif
3015 -
3016 -#ifdef SYS_LINUX
3017 -int chancontrol_wlanng(const char *in_dev, int in_ch, char *in_err, void *in_ext) {
3018 - // I really didn't want to do this...
3019 - char cmdline[2048];
3020 -
3021 - // Turn on rfmon on the initial channel
3022 - snprintf(cmdline, 2048, "wlanctl-ng %s lnxreq_wlansniff channel=%d enable=true "
3023 - "prismheader=true >/dev/null 2>&1", in_dev, in_ch);
3024 - if (RunSysCmd(cmdline) < 0) {
3025 - snprintf(in_err, 1024, "Unable to execute '%s'", cmdline);
3026 - return -1;
3027 - }
3028 -
3029 - if (in_ext != NULL) {
3030 - PcapSourceWlanng *src = (PcapSourceWlanng *) in_ext;
3031 - src->last_channel = in_ch;
3032 - }
3033 -
3034 - return 0;
3035 -}
3036 -
3037 -int chancontrol_wlanng_avs(const char *in_dev, int in_ch, char *in_err, void *in_ext) {
3038 - // I really didn't want to do this...
3039 - char cmdline[2048];
3040 -
3041 - // Turn on rfmon on the initial channel
3042 - snprintf(cmdline, 2048, "wlanctl-ng %s lnxreq_wlansniff channel=%d "
3043 - "prismheader=false wlanheader=true stripfcs=false keepwepflags=false "
3044 - "enable=true >/dev/null 2>&1", in_dev, in_ch);
3045 -
3046 - if (RunSysCmd(cmdline) < 0) {
3047 - snprintf(in_err, 1024, "Unable to execute '%s'", cmdline);
3048 - return -1;
3049 - }
3050 -
3051 - if (in_ext != NULL) {
3052 - PcapSourceWlanng *src = (PcapSourceWlanng *) in_ext;
3053 - src->last_channel = in_ch;
3054 - }
3055 -
3056 - return 0;
3057 -}
3058 #endif
3059
3060 #ifdef SYS_OPENBSD
3061 diff -urN kismet.dev/tcpstreamer.cc kismet.dev2/tcpstreamer.cc
3062 --- kismet.dev/tcpstreamer.cc 2005-08-16 03:22:51.000000000 +0200
3063 +++ kismet.dev2/tcpstreamer.cc 2005-08-23 01:59:25.668216448 +0200
3064 @@ -30,8 +30,6 @@
3065 serv_fd = 0;
3066
3067 max_fd = 0;
3068 -
3069 - gpsd = NULL;
3070 }
3071
3072 TcpStreamer::~TcpStreamer()
3073 @@ -287,10 +285,6 @@
3074 hdr.frame_len = (uint32_t) htonl(sizeof(struct stream_version_packet));
3075
3076 vpkt.drone_version = (uint16_t) htons(STREAM_DRONE_VERSION);
3077 - if (gpsd != NULL)
3078 - vpkt.gps_enabled = 1;
3079 - else
3080 - vpkt.gps_enabled = 0;
3081
3082 if (!FD_ISSET(in_fd, &client_fds))
3083 return -1;
3084 diff -urN kismet.dev/tcpstreamer.h kismet.dev2/tcpstreamer.h
3085 --- kismet.dev/tcpstreamer.h 2005-08-16 03:22:51.000000000 +0200
3086 +++ kismet.dev2/tcpstreamer.h 2005-08-23 01:59:25.669216296 +0200
3087 @@ -42,7 +42,6 @@
3088 #include "ringbuf.h"
3089 #include "packet.h"
3090 #include "packetstream.h"
3091 -#include "gpsd.h"
3092
3093 // Global in kismet_drone.cc
3094 extern int silent;
3095 @@ -76,9 +75,6 @@
3096
3097 int FetchDescriptor() { return serv_fd; }
3098
3099 - // Register the GPS server for us to use
3100 - void AddGpstracker(GPSD *in_gpsd) { gpsd = in_gpsd; }
3101 -
3102 void Kill(int in_fd);
3103
3104 int Poll(fd_set& in_rset, fd_set& in_wset);
3105 @@ -124,8 +120,6 @@
3106 fd_set client_fds;
3107
3108 unsigned int max_fd;
3109 -
3110 - GPSD *gpsd;
3111 };
3112
3113 #endif
This page took 0.207443 seconds and 5 git commands to generate.