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
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 \
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 \
19 tcpserver.o server_protocols.o server_globals.o kismet_server.o
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
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
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
44 // Enable the protocols we can use
45 void NCurseFront::AddClient(TcpClient *in_client) {
47 - client->EnableProtocol("GPS");
48 client->EnableProtocol("INFO");
49 client->EnableProtocol("REMOVE");
50 client->EnableProtocol("NETWORK");
52 mvwaddstr(netborder, 1, 2, " SSID T W Ch Data LLC Crypt Wk Flags");
56 - float lat, lon, alt, spd, heading;
59 - client->FetchLoc(&lat, &lon, &alt, &spd, &heading, &mode);
61 - if (!(lat == 0 && lon == 0 && alt == 0 && spd == 0 && mode == 0)) {
66 - snprintf(fix, 16, "No signal");
68 - snprintf(fix, 5, "2D");
70 - snprintf(fix, 5, "3D");
72 - snprintf(fix, 5, "NONE");
74 - snprintf(gpsdata, 1024, "Lat %.3f Lon %.3f Alt %.3f Spd %.3f Fix %s",
75 - lat, lon, alt, spd, fix);
77 - mvwaddstr(netborder, LINES-statheight-1, 2, gpsdata);
81 box(infoborder, '|', '-');
82 mvwaddstr(infoborder, 0, 2, "Info");
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
91 - // Grab the GPS info
92 - gps_enabled = vpkt.gps_enabled;
94 stream_recv_bytes = 0;
96 // printf("debug - version packet valid\n\n");
98 packet->encoding = (encoding_type) phdr.encoding;
99 packet->datarate = (uint32_t) ntohl(phdr.datarate);
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) {
116 - gpsd->FetchLoc(&packet->gps_lat, &packet->gps_lon, &packet->gps_alt,
117 - &packet->gps_spd, &packet->gps_heading, &packet->gps_fix);
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
127 uint8_t databuf[MAX_PACKET_LEN];
129 unsigned int resyncing;
131 - // Is the drone pushing GPS data to us?
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
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;
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;
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
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,
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");
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);
221 - sourcetracker->RegisterPacketsource("wlanng_wext", 1, "IEEE80211b", 6,
222 - pcapsource_wlanng_registrant,
223 - monitor_wlanng_avs, NULL,
224 - chancontrol_wext, 1);
226 - sourcetracker->RegisterPacketsource("ipw2100", 1, "IEEE80211b", 6,
227 - pcapsource_wext_registrant,
228 - monitor_ipw2100, unmonitor_ipw2100,
229 - chancontrol_ipw2100, 1);
231 - sourcetracker->RegisterPacketsource("ipw2200", 1, "IEEE80211g", 6,
232 - pcapsource_wext_registrant,
233 - monitor_ipw2200, unmonitor_ipw2200,
234 - chancontrol_ipw2200, 1);
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");
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);
262 // Register the linuxwireless pcap stuff as null
263 @@ -182,31 +141,13 @@
264 REG_EMPTY_CARD(sourcetracker, "wlanng_wext");
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);
279 + monitor_wrt54g, unmonitor_wrt54g, chancontrol_wext, 0);
281 REG_EMPTY_CARD(sourcetracker, "wlanng");
282 REG_EMPTY_CARD(sourcetracker, "wlanng_avs");
283 - REG_EMPTY_CARD(sourcetracker, "wrt54g");
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);
292 REG_EMPTY_CARD(sourcetracker, "wlanng_legacy");
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");
301 -#if defined(HAVE_LIBWIRETAP)
302 - sourcetracker->RegisterPacketsource("wtapfile", 0, "na", 0,
303 - wtapfilesource_registrant,
304 - NULL, NULL, NULL, 0);
306 REG_EMPTY_CARD(sourcetracker, "wtapfile");
309 -#if defined(HAVE_WSP100)
310 - sourcetracker->RegisterPacketsource("wsp100", 0, "IEEE80211b", 6,
311 - wsp100source_registrant,
312 - monitor_wsp100, NULL, chancontrol_wsp100, 0);
314 REG_EMPTY_CARD(sourcetracker, "wsp100");
317 -#if defined(HAVE_VIHAHEADERS)
318 - sourcetracker->RegisterPacketsource("viha", 1, "IEEE80211b", 6,
319 - vihasource_registrant,
320 - NULL, NULL, chancontrol_viha, 0);
322 REG_EMPTY_CARD(sourcetracker, "viha");
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
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"
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
346 #include "cursesfront.h"
347 #include "panelfront.h"
348 #include "configfile.h"
360 -int speech_encoding = 0;
361 -string speech_sentence_encrypted, speech_sentence_unencrypted;
362 unsigned int metric = 0;
363 unsigned int reconnect = 0;
366 string configdir, groupfile;
367 FILE *group_file = NULL;
369 -// Pipe file descriptor pairs and fd's
372 -pid_t soundpid = -1, speechpid = -1;
374 // Catch our interrupt
375 void CatchShutdown(int sig) {
377 - // Kill our sound players
381 - kill(speechpid, 9);
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 @@
390 -// Subprocess sound handler
391 -void SoundHandler(int *fds, const char *player, map<string, string> soundmap) {
392 - int read_sock = fds[0];
396 - signal(SIGPIPE, PipeHandler);
407 - FD_SET(read_sock, &rset);
410 - memset(data, 0, 1024);
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)
420 - struct timeval tim;
424 - if (select(read_sock + 1, &rset, NULL, NULL, &tim) < 0) {
425 - if (errno != EINTR) {
430 - if (FD_ISSET(read_sock, &rset)) {
432 - ret = read(read_sock, data, 1024);
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))
439 - if ((end = strstr(data, "\n")) == NULL)
445 - if (data[0] == '\0')
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
453 - if ((nl = strchr(data, '\n')) != NULL)
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());
466 - snprintf(plr, 1024, "%s", player);
469 - if ((sndpid = fork()) == 0) {
471 - int nulfd = open("/dev/null", O_RDWR);
475 - char * const echoarg[] = { plr, snd, NULL };
476 - execve(echoarg[0], echoarg, NULL);
484 -// Subprocess speech handler
485 -void SpeechHandler(int *fds, const char *player) {
486 - int read_sock = fds[0];
498 - FD_SET(read_sock, &rset);
501 - memset(data, 0, 1024);
503 - struct timeval tim;
507 - if (select(read_sock + 1, &rset, NULL, NULL, &tim) < 0) {
508 - if (errno != EINTR) {
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)
521 - if (FD_ISSET(read_sock, &rset)) {
523 - ret = read(read_sock, data, 1024);
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))
534 - if (data[0] == '\0')
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) {
541 - if ((sndpid = fork()) == 0) {
542 - // Only take the first line
544 - if ((nl = strchr(data, '\n')) != NULL)
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);
565 -int PlaySound(string in_sound) {
569 - snprintf(snd, 1024, "%s\n", in_sound.c_str());
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);
583 -int SayText(string in_text) {
586 - snprintf(snd, 1024, "%s\n", in_text.c_str());
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);
600 int main(int argc, char *argv[]) {
612 fprintf(stderr, "Using alternate UI config file: %s\n", uiconfigfile);
618 reqgui = strdup(optarg);
620 server = strdup(gui_conf->FetchOpt("host").c_str());
623 - if (gui_conf->FetchOpt("sound") == "true" && sound == -1) {
624 - if (gui_conf->FetchOpt("soundplay") != "") {
625 - sndplay = gui_conf->FetchOpt("soundplay");
628 - if (gui_conf->FetchOpt("soundopts") != "")
629 - sndplay += " " + gui_conf->FetchOpt("soundopts");
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");
647 - fprintf(stderr, "ERROR: Sound alerts enabled but no sound playing binary specified.\n");
650 - } else if (sound == -1)
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());
659 - if (gui_conf->FetchOpt("flite") == "true")
662 - string speechtype = gui_conf->FetchOpt("speech_type");
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;
669 - speech_encoding = SPEECH_ENCODING_NORMAL;
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");
677 - speech_sentence_encrypted = gui_conf->FetchOpt("speech_encrypted");
678 - speech_sentence_unencrypted = gui_conf->FetchOpt("speech_unencrypted");
681 - fprintf(stderr, "ERROR: Speech alerts enabled but no path to festival has been specified.\n");
684 - } else if (speech == -1)
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");
694 - // Fork and find the sound options
696 - if (pipe(soundpair) == -1) {
697 - fprintf(stderr, "WARNING: Unable to create pipe for audio. Disabling sound.\n");
702 - if (soundpid < 0) {
703 - fprintf(stderr, "WARNING: Unable to fork for audio. Disabling sound.\n");
705 - } else if (soundpid == 0) {
706 - SoundHandler(soundpair, sndplay.c_str(), wav_map);
710 - close(soundpair[0]);
715 - if (pipe(speechpair) == -1) {
716 - fprintf(stderr, "WARNING: Unable to create pipe for speech. Disabling speech.\n");
719 - speechpid = fork();
721 - if (speechpid < 0) {
722 - fprintf(stderr, "WARNING: Unable to fork for speech. Disabling speech.\n");
724 - } else if (speechpid == 0) {
725 - SpeechHandler(speechpair, festival);
729 - close(speechpair[0]);
733 if (kismet_serv.Connect(guiport, guihost) < 0) {
734 fprintf(stderr, "FATAL: Could not connect to %s:%d.\n", guihost, guiport);
736 @@ -884,53 +553,13 @@
740 - if (pollret == CLIENT_ALERT)
742 - sound = PlaySound("alert");
744 if (strlen(tcpcli->FetchStatus()) != 0) {
745 gui->WriteStatus(tcpcli->FetchStatus());
746 // gui->DrawDisplay();
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");
755 - } else if (tcpcli->FetchMode() != 0 && gpsmode == 0) {
756 - if (sound == 1 && gpsmode != -1)
757 - sound = PlaySound("gpslock");
762 if (tcpcli->FetchDeltaNumNetworks() > 0) {
763 wireless_network *newnet = tcpcli->FetchLastNewNetwork();
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");
770 - sound = PlaySound("new");
773 - if (speech == 1 && newnet != lastspoken) {
776 - if (newnet != NULL) {
777 - if (newnet->crypt_set)
778 - text = ExpandSpeechString(speech_sentence_encrypted, newnet, speech_encoding);
780 - text = ExpandSpeechString(speech_sentence_unencrypted, newnet, speech_encoding);
782 - speech = SayText(text.c_str());
786 - lastspoken = newnet;
789 num_networks += tcpcli->FetchNumNetworks();
791 num_noise += tcpcli->FetchNumNoise();
792 num_dropped += tcpcli->FetchNumDropped();
794 - if (tcpcli->FetchDeltaNumPackets() != 0) {
795 - if (time(0) - last_click >= decay && sound == 1) {
796 - if (tcpcli->FetchDeltaNumPackets() > tcpcli->FetchDeltaNumDropped()) {
797 - sound = PlaySound("traffic");
799 - sound = PlaySound("junktraffic");
802 - last_click = time(0);
805 + tcpcli->FetchDeltaNumPackets();
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
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"
826 #include "tcpstreamer.h"
827 #include "configfile.h"
831 const char *config_base = "kismet_drone.conf";
838 Timetracker timetracker;
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
849 - gpsret = gps->Scan();
852 - fprintf(stderr, "GPS error fetching data: %s\n",
853 - gps->FetchError());
860 - // We want to be rescheduled
864 // Handle channel hopping... this is actually really simple.
865 int ChannelHopEvent(Timetracker::timer_event *evt, void *parm) {
866 sourcetracker.AdvanceChannel();
869 TcpStreamer streamer;
871 - char gpshost[1024];
874 int channel_hop = -1;
875 int channel_velocity = 1;
876 int channel_dwell = 0;
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");
892 - if (gps_enable == 1) {
894 - gps = new GPSD(gpshost, gpsport);
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);
902 - if (gps->OpenGPSD() < 0) {
903 - fprintf(stderr, "%s\n", gps->FetchError());
907 - fprintf(stderr, "Opened GPS connection to %s port %d\n",
913 - // Update GPS coordinates and handle signal loss if defined
914 - timetracker.RegisterTimer(SERVER_TIMESLICES_SEC, NULL, 1, &GpsEvent, NULL);
916 - // Add the GPS to the tcpstreamer
917 - streamer.AddGpstracker(gps);
919 - // Register the gps and timetracker with the sourcetracker
920 - sourcetracker.AddGpstracker(gps);
921 sourcetracker.AddTimetracker(&timetracker);
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
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"
940 #include "wtaplocaldump.h"
941 #include "airsnortdump.h"
942 #include "fifodump.h"
943 -#include "gpsdump.h"
947 #include "packetracker.h"
948 #include "timetracker.h"
949 #include "alertracker.h"
952 #include "tcpserver.h"
953 #include "server_globals.h"
954 #include "kismet_server.h"
956 Alertracker alertracker;
957 Timetracker timetracker;
963 -// Last time we tried to reconnect to the gps
964 -time_t last_gpsd_reconnect = 0;
965 -int gpsd_reconnect_attempt = 0;
967 FifoDumpFile fifodump;
970 packet_info last_info;
972 channel_power channel_graph[CHANNEL_MAX];
975 macmap<wep_key_info *> bssid_wep_map;
977 -// Pipe file descriptor pairs and fd's
981 -pid_t soundpid = -1, speechpid = -1, chanpid = -1;
985 unsigned int max_alerts = 50;
990 -//const char *sndplay = NULL;
993 -const char *festival = NULL;
996 -int speech_encoding = 0;
997 -string speech_sentence_encrypted, speech_sentence_unencrypted;
999 -map<string, string> wav_map;
1004 @@ -347,17 +316,6 @@
1005 // delete cryptfile;
1008 - if (gps_log == 1) {
1009 - if (gpsdump.CloseDump(1) < 0)
1010 - fprintf(stderr, "Didn't log any GPS coordinates, unlinking gps file\n");
1013 - // Kill our sound players
1015 - kill(soundpid, 9);
1016 - if (speechpid > 0)
1017 - kill(speechpid, 9);
1019 // Shut down the packet sources
1020 sourcetracker.CloseSources();
1022 @@ -368,228 +326,10 @@
1026 -// Subprocess sound handler
1027 -void SoundHandler(int *fds, const char *player, map<string, string> soundmap) {
1028 - int read_sock = fds[0];
1035 - pid_t sndpid = -1;
1036 - int harvested = 1;
1040 - FD_SET(read_sock, &rset);
1043 - memset(data, 0, 1024);
1045 - struct timeval tm;
1049 - if (select(read_sock + 1, &rset, NULL, NULL, &tm) < 0) {
1050 - if (errno != EINTR) {
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)
1063 - if (FD_ISSET(read_sock, &rset)) {
1065 - ret = read(read_sock, data, 1024);
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))
1072 - if ((end = strstr(data, "\n")) == NULL)
1078 - if (data[0] == '\0')
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
1087 - if ((nl = strchr(data, '\n')) != NULL)
1090 - // Make sure it's shell-clean
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());
1102 - snprintf(plr, 1024, "%s", player);
1105 - if ((sndpid = fork()) == 0) {
1106 - // Suppress errors
1108 - int nulfd = open("/dev/null", O_RDWR);
1113 - char * const echoarg[] = { plr, snd, NULL };
1114 - execve(echoarg[0], echoarg, NULL);
1121 -// Subprocess speech handler
1122 -void SpeechHandler(int *fds, const char *player) {
1123 - int read_sock = fds[0];
1130 - pid_t sndpid = -1;
1131 - int harvested = 1;
1135 - FD_SET(read_sock, &rset);
1138 - memset(data, 0, 1024);
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)
1148 - struct timeval tm;
1152 - if (select(read_sock + 1, &rset, NULL, NULL, &tm) < 0) {
1153 - if (errno != EINTR) {
1158 - if (FD_ISSET(read_sock, &rset)) {
1160 - ret = read(read_sock, data, 1024);
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))
1170 - if (data[0] == '\0')
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) {
1177 - if ((sndpid = fork()) == 0) {
1178 - // Only take the first line
1180 - if ((nl = strchr(data, '\n')) != NULL)
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);
1200 -// Fork and run a system call to play a sound
1201 -int PlaySound(string in_sound) {
1205 - snprintf(snd, 1024, "%s\n", in_sound.c_str());
1207 - if (write(soundpair[1], snd, strlen(snd)) < 0) {
1208 - char status[STATUS_MAX];
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);
1220 -int SayText(string in_text) {
1224 - snprintf(snd, 1024, "%s\n", in_text.c_str());
1225 - MungeToShell(snd, 1024);
1227 - if (write(speechpair[1], snd, strlen(snd)) < 0) {
1228 - char status[STATUS_MAX];
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);
1240 void KisLocalAlert(const char *in_text) {
1241 time_t now = time(0);
1243 fprintf(stderr, "ALERT %.24s %s\n", ctime(&now), in_text);
1246 - sound = PlaySound("alert");
1250 void KisLocalStatus(const char *in_status) {
1251 @@ -638,37 +378,6 @@
1258 - float lat, lon, alt, spd, hed;
1261 - gps->FetchLoc(&lat, &lon, &alt, &spd, &hed, &mode);
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;
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";
1284 - ui_server.SendToAll(gps_ref, (void *) &gdata);
1287 snprintf(tmpstr, 32, "%d", tracker.FetchNumNetworks());
1288 idata.networks = tmpstr;
1289 @@ -789,81 +498,6 @@
1293 -int GpsEvent(Timetracker::timer_event *evt, void *parm) {
1294 - char status[STATUS_MAX];
1296 - // The GPS only provides us a new update once per second we might
1297 - // as well only update it here once a second
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);
1306 - if (gpsd_reconnect_attempt < 20)
1307 - gpsd_reconnect_attempt++;
1309 - snprintf(status, STATUS_MAX, "Unable to reconnect to GPSD, trying "
1310 - "again in %d seconds.", ((gpsd_reconnect_attempt - 1) * 2));
1312 - if (!silent || NetWriteStatus(status) == 0)
1313 - fprintf(stderr, "WARNING: %s\n", status);
1317 - gpsd_reconnect_attempt = 0;
1319 - snprintf(status, STATUS_MAX, "Reopened connection to GPSD");
1320 - if (!silent || NetWriteStatus(status) == 0)
1321 - fprintf(stderr, "NOTICE: %s\n", status);
1324 - // Don't process more if we haven't woken up yet
1332 - gpsret = gps->Scan();
1335 - snprintf(status, STATUS_MAX, "GPS error requesting data: %s",
1336 - gps->FetchError());
1338 - if (!silent || NetWriteStatus(status) == 0)
1339 - fprintf(stderr, "WARNING: %s\n", status);
1341 - gpsd_reconnect_attempt = 1;
1344 - if (gpsret == 0 && gpsmode != 0) {
1345 - if (!silent || NetWriteStatus("Lost GPS signal.") == 0)
1346 - fprintf(stderr, "Lost GPS signal.\n");
1348 - sound = PlaySound("gpslost");
1351 - } else if (gpsret != 0 && gpsmode == 0) {
1352 - if (!silent || NetWriteStatus("Acquired GPS signal.") == 0)
1353 - fprintf(stderr, "Acquired GPS signal.\n");
1355 - sound = PlaySound("gpslock");
1361 - if (gps_log == 1 && gpsmode != 0 && gps != NULL) {
1362 - gpsdump.DumpTrack(gps);
1365 - // We want to be rescheduled
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 @@
1375 -// Write the waypoints for gpsdrive
1376 -int WaypointSyncEvent(Timetracker::timer_event *evt, void *parm) {
1377 - tracker.WriteGpsdriveWaypt(waypoint_file);
1382 // Handle tracker maintenance
1383 int TrackerTickEvent(Timetracker::timer_event *evt, void *parm) {
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 @@
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");
1409 - waypointfile = conf->ExpandLogPath(conf->FetchOpt("waypointdata"), "", "", 0, 1);
1412 - if(conf->FetchOpt("waypoint_essid") == "true") {
1413 - waypointformat = 1;
1415 - waypointformat = 0;
1419 if (conf->FetchOpt("metric") == "true") {
1420 fprintf(stderr, "Using metric measurements.\n");
1422 @@ -1421,26 +1029,6 @@
1427 - if (strstr(logtypes, "gps")) {
1428 - if (gps_log == 0) {
1429 - fprintf(stderr, "WARNING: Disabling GPS logging.\n");
1433 - if (conf->FetchOpt("logtemplate") == "") {
1434 - fprintf(stderr, "FATAL: Logging (gps coordinates) enabled but no logtemplate given in config.\n");
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");
1448 if (conf->FetchOpt("decay") != "") {
1449 @@ -1561,72 +1149,6 @@
1450 legal_ipblock_vec.push_back(ipb);
1453 - // Process sound stuff
1454 - if (conf->FetchOpt("sound") == "true" && sound == -1) {
1455 - if (conf->FetchOpt("soundplay") != "") {
1456 - sndplay = conf->FetchOpt("soundplay");
1458 - if (conf->FetchOpt("soundopts") != "")
1459 - sndplay += " " + conf->FetchOpt("soundopts");
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");
1479 - fprintf(stderr, "ERROR: Sound alerts enabled but no sound playing binary specified.\n");
1482 - } else if (sound == -1)
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());
1492 - if (conf->FetchOpt("flite") == "true")
1495 - string speechtype = conf->FetchOpt("speech_type");
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;
1502 - speech_encoding = SPEECH_ENCODING_NORMAL;
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");
1510 - speech_sentence_encrypted = conf->FetchOpt("speech_encrypted");
1511 - speech_sentence_unencrypted = conf->FetchOpt("speech_unencrypted");
1513 - fprintf(stderr, "ERROR: Speech alerts enabled but no path to festival has been specified.\n");
1516 - } else if (speech == -1)
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");
1526 - // Fork and find the sound options
1528 - if (pipe(soundpair) == -1) {
1529 - fprintf(stderr, "WARNING: Unable to create pipe for audio. Disabling sound.\n");
1532 - soundpid = fork();
1534 - if (soundpid < 0) {
1535 - fprintf(stderr, "WARNING: Unable to fork for audio. Disabling sound.\n");
1537 - } else if (soundpid == 0) {
1538 - SoundHandler(soundpair, sndplay.c_str(), wav_map);
1542 - close(soundpair[0]);
1547 - if (pipe(speechpair) == -1) {
1548 - fprintf(stderr, "WARNING: Unable to create pipe for speech. Disabling speech.\n");
1551 - speechpid = fork();
1553 - if (speechpid < 0) {
1554 - fprintf(stderr, "WARNING: Unable to fork for speech. Disabling speech.\n");
1556 - } else if (speechpid == 0) {
1557 - SpeechHandler(speechpair, festival);
1561 - close(speechpair[0]);
1565 // Grab the filtering
1568 @@ -1710,7 +1193,7 @@
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");
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 @@
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));
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 @@
1596 - if (gps_log == 1) {
1597 - gpslogfile = conf->ExpandLogPath(conf->FetchOpt("logtemplate"), logname, "gps", run_num);
1599 - if (gpslogfile == "")
1603 // if we made it this far we're cool -- all the logfiles we're writing to matched
1605 logfile_matched = 1;
1606 @@ -1906,9 +1374,6 @@
1608 fprintf(stderr, "Logging cisco product information to %s\n", ciscologfile.c_str());
1611 - fprintf(stderr, "Logging gps coordinates to %s\n", gpslogfile.c_str());
1614 fprintf(stderr, "Logging data to %s\n", dumplogfile.c_str());
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 @@
1630 - if (strcmp(optarg, "off") == 0) {
1633 - else if (sscanf(optarg, "%1023[^:]:%d", gpshost, &gpsport) < 2) {
1634 - fprintf(stderr, "Invalid GPS host '%s' (host:port or off required)\n",
1642 if (sscanf(optarg, "%d", &tcpport) != 1) {
1643 @@ -2169,7 +1621,6 @@
1651 @@ -2323,39 +1774,6 @@
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,
1661 - fprintf(stderr, "Invalid GPS host in config (host:port required)\n");
1672 - if (gps_enable == 1) {
1673 - gps = new GPSD(gpshost, gpsport);
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);
1686 - // Register the gps and timetracker with the sourcetracker
1687 - sourcetracker.AddGpstracker(gps);
1688 sourcetracker.AddTimetracker(&timetracker);
1690 // Handle errors here maybe in the future
1691 @@ -2522,13 +1940,6 @@
1692 fprintf(stderr, "Dump file format: %s\n", dumpfile->FetchType());
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());
1702 // Open our files first to make sure we can, we'll unlink the empties later.
1703 FILE *testfile = NULL;
1705 @@ -2600,14 +2011,13 @@
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 @@
1728 - if (gps->OpenGPSD() < 0) {
1729 - fprintf(stderr, "%s\n", gps->FetchError());
1734 - fprintf(stderr, "Opened GPS connection to %s port %d\n",
1735 - gpshost, gpsport);
1737 - gpsmode = gps->FetchMode();
1739 - last_gpsd_reconnect = time(0);
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
1766 - timetracker.RegisterTimer(decay * SERVER_TIMESLICES_SEC, NULL, 1, &WaypointSyncEvent, NULL);
1767 // Channel hop if requested
1770 @@ -2769,7 +2155,6 @@
1771 snprintf(status, 1024, "%s", TIMESTAMP);
1772 kdata.timestamp = status;
1774 - time_t last_click = 0;
1775 int num_networks = 0, num_packets = 0, num_noise = 0, num_dropped = 0;
1778 @@ -2918,54 +2303,13 @@
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);
1792 // tracker.ProcessPacket(info);
1793 tracker.ProcessPacket(&packet, &info, &bssid_wep_map,
1796 - if (tracker.FetchNumNetworks() > num_networks) {
1798 - if (info.crypt_set &&
1799 - wav_map.find("new_wep") != wav_map.end())
1800 - sound = PlaySound("new_wep");
1802 - sound = PlaySound("new");
1803 - if (speech == 1) {
1806 - if (info.crypt_set)
1807 - text = ExpandSpeechString(speech_sentence_encrypted, &info,
1810 - text = ExpandSpeechString(speech_sentence_unencrypted,
1811 - &info, speech_encoding);
1813 - speech = SayText(MungeToShell(text).c_str());
1816 num_networks = tracker.FetchNumNetworks();
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");
1824 - sound = PlaySound("junktraffic");
1827 - last_click = cur_time;
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
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 @@
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);
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;
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);
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
1883 #include "tracktypes.h"
1886 int WriteXMLNetworks(string in_fname);
1887 int WriteCisco(string in_fname);
1889 - int WriteGpsdriveWaypt(FILE *in_file);
1891 void WriteSSIDMap(FILE *in_file);
1892 void ReadSSIDMap(FILE *in_file);
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
1898 Packetsourcetracker::Packetsourcetracker() {
1899 next_packsource_id = 0;
1904 sockpair[0] = sockpair[1] = 0;
1907 // Register the trackers with it
1908 meta->capsource->AddTimetracker(timetracker);
1909 - meta->capsource->AddGpstracker(gpsd);
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
1919 #include "timetracker.h"
1921 #include "packetsource.h"
1923 // Sentinel for starting a new packet
1925 // Register a timer event handler for us to use
1926 void AddTimetracker(Timetracker *in_tracker) { timetracker = in_tracker; }
1928 - // Register the GPS server for us to use
1929 - void AddGpstracker(GPSD *in_gpsd) { gpsd = in_gpsd; }
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
1936 } chanchild_changepacket;
1939 Timetracker *timetracker;
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
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",
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 @@
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.",
1971 - " s Follow location of strongest packet",
1972 - " c Follow location of estimated network center",
1978 char *KismetHelpStats[] = {
1979 "KISMET NETWORK STATISTICS",
1980 "This panel displays overall statistics about the wireless",
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)
1994 - float newlat, newlon, newalt, newspd, newheading;
1996 - con->client->FetchLoc(&newlat, &newlon, &newalt, &newspd, &newheading, &newfix);
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;
2007 - con->lat = newlat;
2008 - con->lon = newlon;
2009 - con->alt = newalt;
2010 - con->spd = newspd;
2011 - con->heading = newheading;
2012 - con->fix = newfix;
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
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[];
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);
2035 int MainClientPrinter(void *in_window);
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);
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
2048 mvwaddstr(netwin, netwin->_maxy, netwin->_maxx - 14, ptxt);
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);
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);
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);
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);
2087 - if (finite(diagdist)) {
2089 - if (diagdist < 1000)
2090 - snprintf(output, print_width, "Range : %.3f meters", diagdist);
2092 - snprintf(output, print_width, "Range : %.3f kilometers", diagdist / 1000);
2095 - if (diagdist < 5280)
2096 - snprintf(output, print_width, "Range : %.3f feet", diagdist);
2098 - snprintf(output, print_width, "Range : %.3f miles", diagdist / 5280);
2100 - kwin->text.push_back(output);
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);
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);
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);
2135 - double diagdist = GPSD::EarthDistance(dnet->min_lat, dnet->min_lon,
2136 - dnet->max_lat, dnet->max_lon);
2138 - if (finite(diagdist)) {
2140 - if (diagdist < 1000)
2141 - snprintf(output, print_width, "Range : %f meters", diagdist);
2143 - snprintf(output, print_width, "Range : %f kilometers", diagdist / 1000);
2146 - if (diagdist < 5280)
2147 - snprintf(output, print_width, "Range : %f feet", diagdist);
2149 - snprintf(output, print_width, "Range : %f miles", diagdist / 5280);
2151 - kwin->text.push_back(output);
2157 // Now we just use the text printer to handle the rest for us
2158 @@ -1903,184 +1815,6 @@
2159 return TextPrinter(in_window);
2162 -int PanelFront::GpsPrinter(void *in_window) {
2163 - kis_window *kwin = (kis_window *) in_window;
2165 - char output[1024];
2166 - kwin->text.clear();
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);
2175 - wireless_network *dnet = details_network->virtnet;
2177 - int print_width = kwin->print_width;
2178 - if (print_width > 1024)
2179 - print_width = 1023;
2181 - if (print_width < 32) {
2182 - kwin->text.push_back("Display not wide enough");
2183 - return TextPrinter(in_window);
2186 - if (dnet->aggregate_points == 0) {
2187 - kwin->text.push_back("No GPS data.");
2188 - return TextPrinter(in_window);
2191 - float center_lat, center_lon;
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;
2198 - center_lat = dnet->aggregate_lat / dnet->aggregate_points;
2199 - center_lon = dnet->aggregate_lon / dnet->aggregate_points;
2202 - // Get bearing to the center
2203 - float center_angle = GPSD::CalcHeading(center_lat, center_lon, lat, lon);
2205 - float difference_angle = heading - center_angle;
2206 - if (difference_angle < 0)
2207 - difference_angle += 360;
2209 - double diagdist = GPSD::EarthDistance(lat, lon, center_lat, center_lon);
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.
2215 - char compass[5][10];
2216 - memset(compass, 0, sizeof(char) * 5 * 10);
2218 - // | 41.12345x-74.12345 .-|-/ |
2219 - // | Bearing: / |/ \ |
2220 - // | 123.23 degrees | O | |
2222 - // | Estimated center: '---\ |
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, " '---' ");
2275 - snprintf(compass[0], 10, "%f\n", difference_angle);
2279 - // - Network GPS ---------------------|
2281 - // | 41.12345x-74.12345 .-|-. |
2282 - // | Bearing: / | \ |
2283 - // | 123.23 degrees | O | |
2285 - // | Estimated center: '---\ |
2286 - // | -73.12345x43.12345 |
2288 - // ------------------------------------
2289 - char textfrag[23];
2291 - snprintf(output, print_width, "Current:");
2292 - kwin->text.push_back(output);
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);
2298 - snprintf(textfrag, 23, " Bearing:");
2299 - snprintf(output, print_width, "%-22s%s", textfrag, compass[1]);
2300 - kwin->text.push_back(output);
2302 - snprintf(textfrag, 23, " %.2f*", heading);
2303 - snprintf(output, print_width, "%-22s%s", textfrag, compass[2]);
2304 - kwin->text.push_back(output);
2306 - snprintf(textfrag, 23, " ");
2307 - snprintf(output, print_width, "%-22s%s", textfrag, compass[3]);
2308 - kwin->text.push_back(output);
2310 - if (kwin->selected == 1)
2311 - snprintf(textfrag, 23, "Strongest signal:");
2313 - snprintf(textfrag, 23, "Estimated Center:");
2314 - snprintf(output, print_width, "%-22s%s", textfrag, compass[4]);
2315 - kwin->text.push_back(output);
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);
2322 - if (diagdist < 1000)
2323 - snprintf(textfrag, 23, "%.2f m", diagdist);
2325 - snprintf(textfrag, 23, "%.2f km", diagdist / 1000);
2328 - if (diagdist < 5280)
2329 - snprintf(textfrag, 23, "%.2f ft", diagdist);
2331 - snprintf(textfrag, 23, "%.2f mi", diagdist / 5280);
2334 - snprintf(output, print_width, "%-22s%s", "", textfrag);
2335 - kwin->text.push_back(output);
2337 - return TextPrinter(in_window);
2340 int PanelFront::PackPrinter(void *in_window) {
2341 kis_window *kwin = (kis_window *) in_window;
2343 @@ -3049,53 +2783,6 @@
2344 details_client->ipdata.ip[2], details_client->ipdata.ip[3]);
2345 kwin->text.push_back(output);
2347 - if (details_client->gps_fixed != -1) {
2348 - kwin->text.push_back("");
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);
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);
2371 - double diagdist = GPSD::EarthDistance(details_client->min_lat,
2372 - details_client->min_lon,
2373 - details_client->max_lat,
2374 - details_client->max_lon);
2376 - if (finite(diagdist)) {
2378 - if (diagdist < 1000)
2379 - snprintf(output, print_width, "Range : %f meters", diagdist);
2381 - snprintf(output, print_width, "Range : %f kilometers", diagdist / 1000);
2384 - if (diagdist < 5280)
2385 - snprintf(output, print_width, "Range : %f feet", diagdist);
2387 - snprintf(output, print_width, "Range : %f miles", diagdist / 5280);
2389 - kwin->text.push_back(output);
2392 - kwin->text.push_back("");
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 @@
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);
2408 - WriteStatus("Cannot view network GPS info in autofit sort mode. Sort by a different method.");
2425 @@ -546,33 +538,6 @@
2429 -int PanelFront::GpsInput(void *in_window, int in_chr) {
2430 - kis_window *kwin = (kis_window *) in_window;
2435 - kwin->selected = 1;
2439 - kwin->selected = 0;
2443 - SpawnHelp(KismetHelpGps);
2456 int PanelFront::RateInput(void *in_window, int in_chr) {
2459 @@ -645,24 +610,6 @@
2463 -void PanelFront::MuteToggle() {
2465 - speech = old_speech;
2466 - sound = old_sound;
2468 - WriteStatus("Restoring sound");
2469 - } else if (sound != 0 || speech != 0) {
2470 - old_speech = speech;
2471 - old_sound = sound;
2475 - WriteStatus("Muting sound");
2476 - } else if (sound == 0 && speech == 0) {
2477 - WriteStatus("Sound not enabled.");
2481 int PanelFront::AlertInput(void *in_window, int in_chr) {
2482 kis_window *kwin = (kis_window *) in_window;
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;
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);
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 @@
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];
2508 - linux_ifparm *ifparm = (linux_ifparm *) malloc(sizeof(linux_ifparm));
2509 - (*in_if) = ifparm;
2511 - if (Ifconfig_Get_Flags(in_dev, in_err, &ifparm->flags) < 0) {
2515 - if (Iwconfig_Get_SSID(in_dev, in_err, ifparm->essid) < 0)
2518 - if ((ifparm->channel = Iwconfig_Get_Channel(in_dev, in_err)) < 0)
2521 - if (Iwconfig_Get_Mode(in_dev, in_err, &ifparm->mode) < 0)
2524 - if (Ifconfig_Delta_Flags(in_dev, in_err, IFF_UP | IFF_RUNNING | IFF_PROMISC) < 0)
2528 - if (Iwconfig_Set_IntPriv(in_dev, "setRFMonitor", 1, 0, in_err) >= 0) {
2532 - // Zero the ssid - nonfatal
2533 - Iwconfig_Set_SSID(in_dev, in_err, NULL);
2535 - // Build the proc control path
2536 - snprintf(cisco_path, 128, "/proc/driver/aironet/%s/Config", in_dev);
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));
2544 - fprintf(cisco_config, "Mode: r\n");
2545 - fprintf(cisco_config, "Mode: y\n");
2546 - fprintf(cisco_config, "XmitPower: 1\n");
2548 - fclose(cisco_config);
2550 - // Channel can't be set on cisco with these drivers.
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);
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) {
2566 - // Reset the SSID since monitor mode nukes it
2567 - if (Iwconfig_Set_SSID(in_dev, in_err, ifparm->essid) < 0)
2570 - if (ifparm->channel > 0) {
2571 - if (Iwconfig_Set_Channel(in_dev, ifparm->channel, in_err) < 0)
2583 -// Cisco uses its own config file in /proc to control modes
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, ":");
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);
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)
2602 - if (Ifconfig_Delta_Flags(devbits[1].c_str(), in_err,
2603 - IFF_UP | IFF_RUNNING | IFF_PROMISC) < 0)
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);
2610 - // Build the proc control path
2611 - snprintf(cisco_path, 128, "/proc/driver/aironet/%s/Config", devbits[0].c_str());
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));
2619 - fprintf(cisco_config, "Mode: r\n");
2620 - fprintf(cisco_config, "Mode: y\n");
2621 - fprintf(cisco_config, "XmitPower: 1\n");
2623 - fclose(cisco_config);
2625 - // Channel can't be set on cisco with these drivers.
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) {
2633 @@ -1421,134 +1289,6 @@
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) {
2642 - // Allocate a tracking record for the interface settings and remember our
2644 - linux_ifparm *ifparm = (linux_ifparm *) malloc(sizeof(linux_ifparm));
2645 - (*in_if) = ifparm;
2647 - if (Ifconfig_Get_Flags(in_dev, in_err, &ifparm->flags) < 0) {
2651 - if (Iwconfig_Get_SSID(in_dev, in_err, ifparm->essid) < 0)
2654 - if ((ifparm->channel = Iwconfig_Get_Channel(in_dev, in_err)) < 0)
2657 - if (Iwconfig_Get_Mode(in_dev, in_err, &ifparm->mode) < 0)
2660 - // it looks like an orinoco now, apparently
2661 - if ((ret = Iwconfig_Set_IntPriv(in_dev, "monitor", 1, initch, in_err)) < 0) {
2663 - snprintf(in_err, 1024, "Could not find 'monitor' private ioctl "
2664 - "Make sure you have the latest ACX100 development release.");
2668 - if (chancontrol_wext(in_dev, initch, in_err, NULL) < 0)
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);
2678 - if (Ifconfig_Set_Flags(in_dev, in_err, ifparm->flags) < 0) {
2682 - Iwconfig_Set_IntPriv(in_dev, "monitor", 0, ifparm->channel, in_err);
2683 - Iwconfig_Set_Mode(in_dev, in_err, ifparm->mode);
2685 - if (Iwconfig_Set_SSID(in_dev, in_err, ifparm->essid) < 0)
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
2696 - linux_ifparm *ifparm = (linux_ifparm *) malloc(sizeof(linux_ifparm));
2697 - (*in_if) = ifparm;
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)
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;
2710 - if (Ifconfig_Get_Flags(in_dev, in_err, &ifparm->flags) < 0) {
2714 - if ((ifparm->flags & IFF_UP)) {
2715 - if ((ifparm->channel = Iwconfig_Get_Channel(in_dev, in_err)) < 0)
2718 - if (Iwconfig_Get_Mode(in_dev, in_err, &ifparm->mode) < 0)
2721 - if (Iwconfig_Get_SSID(in_dev, in_err, ifparm->essid) < 0)
2725 - ifparm->channel = -1;
2726 - ifparm->mode = -1;
2729 - int ret = monitor_wext(in_dev, initch, in_err, in_if, in_ext);
2731 - if (ret < 0 && ret != -2)
2734 - if (Iwconfig_Set_SSID(in_dev, in_err, "") < 0)
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);
2743 - if (unmonitor_wext(in_dev, initch, in_err, in_if, in_ext))
2746 - if (Iwconfig_Set_SSID(in_dev, in_err, ifparm->essid) < 0)
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) {
2758 - // The rest is standard wireless extensions
2759 - if (monitor_wext(in_dev, initch, in_err, in_if, in_ext) < 0)
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 @@
2770 return unmonitor_wext(in_dev, initch, in_err, in_if, in_ext);
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
2776 - linux_ifparm *ifparm = (linux_ifparm *) malloc(sizeof(linux_ifparm));
2777 - (*in_if) = ifparm;
2779 - if (Ifconfig_Get_Flags(in_dev, in_err, &ifparm->flags) < 0) {
2783 - if ((ifparm->channel = Iwconfig_Get_Channel(in_dev, in_err)) < 0)
2786 - if (Iwconfig_Get_Mode(in_dev, in_err, &ifparm->mode) < 0)
2789 - // Call the normal monitor mode
2790 - return (monitor_wext(in_dev, initch, in_err, in_if, in_ext));
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);
2797 - linux_ifparm *ifparm = (linux_ifparm *) (*in_if);
2799 - if (Ifconfig_Set_Flags(in_dev, in_err, ifparm->flags) < 0) {
2803 - if (Iwconfig_Set_Mode(in_dev, in_err, ifparm->mode) < 0)
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
2815 - linux_ifparm *ifparm = (linux_ifparm *) malloc(sizeof(linux_ifparm));
2816 - (*in_if) = ifparm;
2818 - if (Ifconfig_Get_Flags(in_dev, in_err, &ifparm->flags) < 0) {
2822 - if ((ifparm->channel = Iwconfig_Get_Channel(in_dev, in_err)) < 0)
2825 - if (Iwconfig_Get_Mode(in_dev, in_err, &ifparm->mode) < 0)
2828 - // Call the normal monitor mode
2829 - return (monitor_wext(in_dev, initch, in_err, in_if, in_ext));
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);
2837 - linux_ifparm *ifparm = (linux_ifparm *) (*in_if);
2839 - if (Ifconfig_Set_Flags(in_dev, in_err, ifparm->flags) < 0) {
2843 - if (Iwconfig_Set_Mode(in_dev, in_err, ifparm->mode) < 0)
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)
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) {
2858 @@ -1870,108 +1527,6 @@
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];
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);
2876 - if (Ifconfig_Delta_Flags(in_dev, in_err, IFF_UP | IFF_RUNNING | IFF_PROMISC) < 0)
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);
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);
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);
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);
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];
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);
2927 - if (Ifconfig_Delta_Flags(in_dev, in_err, IFF_UP | IFF_RUNNING | IFF_PROMISC) < 0)
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);
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);
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);
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);
2964 int monitor_wrt54g(const char *in_dev, int initch, char *in_err, void **in_if,
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);
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);
2985 @@ -2244,75 +1799,6 @@
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....
2996 - ret = chancontrol_wext(in_dev, in_ch, in_err, in_ext);
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
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
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];
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);
3029 - if (in_ext != NULL) {
3030 - PcapSourceWlanng *src = (PcapSourceWlanng *) in_ext;
3031 - src->last_channel = in_ch;
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];
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);
3046 - if (RunSysCmd(cmdline) < 0) {
3047 - snprintf(in_err, 1024, "Unable to execute '%s'", cmdline);
3051 - if (in_ext != NULL) {
3052 - PcapSourceWlanng *src = (PcapSourceWlanng *) in_ext;
3053 - src->last_channel = in_ch;
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
3072 TcpStreamer::~TcpStreamer()
3073 @@ -287,10 +285,6 @@
3074 hdr.frame_len = (uint32_t) htonl(sizeof(struct stream_version_packet));
3076 vpkt.drone_version = (uint16_t) htons(STREAM_DRONE_VERSION);
3078 - vpkt.gps_enabled = 1;
3080 - vpkt.gps_enabled = 0;
3082 if (!FD_ISSET(in_fd, &client_fds))
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
3088 #include "ringbuf.h"
3090 #include "packetstream.h"
3093 // Global in kismet_drone.cc
3097 int FetchDescriptor() { return serv_fd; }
3099 - // Register the GPS server for us to use
3100 - void AddGpstracker(GPSD *in_gpsd) { gpsd = in_gpsd; }
3102 void Kill(int in_fd);
3104 int Poll(fd_set& in_rset, fd_set& in_wset);
3108 unsigned int max_fd;