1 diff -urN kismet.dev/cursesfront.cc kismet.dev2/cursesfront.cc
2 --- kismet.dev/cursesfront.cc 2005-03-10 17:49:34.000000000 +0100
3 +++ kismet.dev2/cursesfront.cc 2006-04-14 19:31:55.000000000 +0200
5 // Enable the protocols we can use
6 void NCurseFront::AddClient(TcpClient *in_client) {
8 - client->EnableProtocol("GPS");
9 client->EnableProtocol("INFO");
10 client->EnableProtocol("REMOVE");
11 client->EnableProtocol("NETWORK");
13 mvwaddstr(netborder, 1, 2, " SSID T W Ch Data LLC Crypt Wk Flags");
17 - float lat, lon, alt, spd, heading;
20 - client->FetchLoc(&lat, &lon, &alt, &spd, &heading, &mode);
22 - if (!(lat == 0 && lon == 0 && alt == 0 && spd == 0 && mode == 0)) {
27 - snprintf(fix, 16, "No signal");
29 - snprintf(fix, 5, "2D");
31 - snprintf(fix, 5, "3D");
33 - snprintf(fix, 5, "NONE");
35 - snprintf(gpsdata, 1024, "Lat %.3f Lon %.3f Alt %.3f Spd %.3f Fix %s",
36 - lat, lon, alt, spd, fix);
38 - mvwaddstr(netborder, LINES-statheight-1, 2, gpsdata);
42 box(infoborder, '|', '-');
43 mvwaddstr(infoborder, 0, 2, "Info");
45 diff -urN kismet.dev/dronesource.cc kismet.dev2/dronesource.cc
46 --- kismet.dev/dronesource.cc 2005-05-26 16:51:45.000000000 +0200
47 +++ kismet.dev2/dronesource.cc 2006-04-14 19:31:55.000000000 +0200
52 - // Grab the GPS info
53 - gps_enabled = vpkt.gps_enabled;
55 stream_recv_bytes = 0;
57 // printf("debug - version packet valid\n\n");
59 packet->encoding = (encoding_type) phdr.encoding;
60 packet->datarate = (uint32_t) ntohl(phdr.datarate);
63 - // If the drone is sending us GPS data, use it
64 - packet->gps_lat = Pair2Float((int16_t) ntohs(phdr.gps_lat),
65 - (int64_t) kis_ntoh64(phdr.gps_lat_mant));
66 - packet->gps_lon = Pair2Float((int16_t) ntohs(phdr.gps_lon),
67 - (int64_t) kis_ntoh64(phdr.gps_lon_mant));
68 - packet->gps_alt = Pair2Float((int16_t) ntohs(phdr.gps_alt),
69 - (int64_t) kis_ntoh64(phdr.gps_alt_mant));
70 - packet->gps_spd = Pair2Float((int16_t) ntohs(phdr.gps_spd),
71 - (int64_t) kis_ntoh64(phdr.gps_spd_mant));
72 - packet->gps_heading = Pair2Float((int16_t) ntohs(phdr.gps_heading),
73 - (int64_t) kis_ntoh64(phdr.gps_heading_mant));
74 - packet->gps_fix = phdr.gps_fix;
75 - } else if (gpsd != NULL) {
77 - gpsd->FetchLoc(&packet->gps_lat, &packet->gps_lon, &packet->gps_alt,
78 - &packet->gps_spd, &packet->gps_heading, &packet->gps_fix);
82 packet->moddata = moddata;
84 diff -urN kismet.dev/dronesource.h kismet.dev2/dronesource.h
85 --- kismet.dev/dronesource.h 2005-05-26 16:51:45.000000000 +0200
86 +++ kismet.dev2/dronesource.h 2006-04-14 19:31:55.000000000 +0200
88 uint8_t databuf[MAX_PACKET_LEN];
90 unsigned int resyncing;
92 - // Is the drone pushing GPS data to us?
96 // Nothing but a registrant for us
97 diff -urN kismet.dev/frontend.cc kismet.dev2/frontend.cc
98 --- kismet.dev/frontend.cc 2005-06-29 20:04:43.000000000 +0200
99 +++ kismet.dev2/frontend.cc 2006-04-14 19:31:55.000000000 +0200
104 - // Aggregate the GPS data
105 - if (wnet->aggregate_points > 0) {
106 - dnet->virtnet->aggregate_lat += wnet->aggregate_lat;
107 - dnet->virtnet->aggregate_lon += wnet->aggregate_lon;
108 - dnet->virtnet->aggregate_alt += wnet->aggregate_alt;
109 - dnet->virtnet->aggregate_points += wnet->aggregate_points;
112 - if (wnet->gps_fixed > dnet->virtnet->gps_fixed)
113 - dnet->virtnet->gps_fixed = wnet->gps_fixed;
114 - if (wnet->min_lat < dnet->virtnet->min_lat || dnet->virtnet->min_lat == 0)
115 - dnet->virtnet->min_lat = wnet->min_lat;
116 - if (wnet->min_lon < dnet->virtnet->min_lon || dnet->virtnet->min_lon == 0)
117 - dnet->virtnet->min_lon = wnet->min_lon;
118 - if (wnet->min_alt < dnet->virtnet->min_alt || dnet->virtnet->min_alt == 0)
119 - dnet->virtnet->min_alt = wnet->min_alt;
120 - if (wnet->min_spd < dnet->virtnet->min_spd || dnet->virtnet->min_spd == 0)
121 - dnet->virtnet->min_spd = wnet->min_spd;
122 - if (wnet->max_lat > dnet->virtnet->max_lat || dnet->virtnet->max_lat == 0)
123 - dnet->virtnet->max_lat = wnet->max_lat;
124 - if (wnet->max_lon > dnet->virtnet->max_lon || dnet->virtnet->max_lon == 0)
125 - dnet->virtnet->max_lon = wnet->max_lon;
126 - if (wnet->max_alt > dnet->virtnet->max_alt || dnet->virtnet->max_alt == 0)
127 - dnet->virtnet->max_alt = wnet->max_alt;
128 - if (wnet->max_spd > dnet->virtnet->max_spd || dnet->virtnet->max_spd == 0)
129 - dnet->virtnet->max_spd = wnet->max_spd;
131 // Aggregate the carriers and encodings
132 dnet->virtnet->carrier_set |= wnet->carrier_set;
133 dnet->virtnet->encoding_set |= wnet->encoding_set;
134 diff -urN kismet.dev/kismet_client.cc kismet.dev2/kismet_client.cc
135 --- kismet.dev/kismet_client.cc 2005-06-10 04:02:24.000000000 +0200
136 +++ kismet.dev2/kismet_client.cc 2006-04-14 19:31:55.000000000 +0200
138 #include "cursesfront.h"
139 #include "panelfront.h"
140 #include "configfile.h"
152 -int speech_encoding = 0;
153 -string speech_sentence_encrypted, speech_sentence_unencrypted;
154 unsigned int metric = 0;
155 unsigned int reconnect = 0;
158 string configdir, groupfile;
159 FILE *group_file = NULL;
161 -// Pipe file descriptor pairs and fd's
164 -pid_t soundpid = -1, speechpid = -1;
166 // Catch our interrupt
167 void CatchShutdown(int sig) {
169 - // Kill our sound players
173 - kill(speechpid, 9);
176 if ((group_file = fopen(groupfile.c_str(), "w")) == NULL) {
177 fprintf(stderr, "WARNING: Unable to open '%s' for writing, groups will not be saved.\n",
178 @@ -116,215 +100,6 @@
182 -// Subprocess sound handler
183 -void SoundHandler(int *fds, const char *player, map<string, string> soundmap) {
184 - int read_sock = fds[0];
188 - signal(SIGPIPE, PipeHandler);
199 - FD_SET(read_sock, &rset);
202 - memset(data, 0, 1024);
204 - if (harvested == 0) {
205 - // We consider a wait error to be a sign that the child pid died
206 - // so we flag it as harvested and keep on going
207 - pid_t harvestpid = waitpid(sndpid, NULL, WNOHANG);
208 - if (harvestpid == -1 || harvestpid == sndpid)
212 - struct timeval tim;
216 - if (select(read_sock + 1, &rset, NULL, NULL, &tim) < 0) {
217 - if (errno != EINTR) {
222 - if (FD_ISSET(read_sock, &rset)) {
224 - ret = read(read_sock, data, 1024);
226 - // We'll die off if we get a read error, and we'll let kismet on the
227 - // other side detact that it died
228 - if (ret <= 0 && (errno != EAGAIN && errno != EPIPE))
231 - if ((end = strstr(data, "\n")) == NULL)
237 - if (data[0] == '\0')
240 - // If we've harvested the process, spawn a new one and watch it
241 - // instead. Otherwise, we just let go of the data we read
242 - if (harvested == 1) {
243 - // Only take the first line
245 - if ((nl = strchr(data, '\n')) != NULL)
250 - if (soundmap.size() == 0)
251 - snprintf(snd, 1024, "%s", data);
252 - if (soundmap.find(data) != soundmap.end())
253 - snprintf(snd, 1024, "%s", soundmap[data].c_str());
258 - snprintf(plr, 1024, "%s", player);
261 - if ((sndpid = fork()) == 0) {
263 - int nulfd = open("/dev/null", O_RDWR);
267 - char * const echoarg[] = { plr, snd, NULL };
268 - execve(echoarg[0], echoarg, NULL);
276 -// Subprocess speech handler
277 -void SpeechHandler(int *fds, const char *player) {
278 - int read_sock = fds[0];
290 - FD_SET(read_sock, &rset);
293 - memset(data, 0, 1024);
295 - struct timeval tim;
299 - if (select(read_sock + 1, &rset, NULL, NULL, &tim) < 0) {
300 - if (errno != EINTR) {
305 - if (harvested == 0) {
306 - // We consider a wait error to be a sign that the child pid died
307 - // so we flag it as harvested and keep on going
308 - pid_t harvestpid = waitpid(sndpid, NULL, WNOHANG);
309 - if (harvestpid == -1 || harvestpid == sndpid)
313 - if (FD_ISSET(read_sock, &rset)) {
315 - ret = read(read_sock, data, 1024);
317 - // We'll die off if we get a read error, and we'll let kismet on the
318 - // other side detact that it died
319 - if (ret <= 0 && (errno != EAGAIN && errno != EPIPE))
326 - if (data[0] == '\0')
329 - // If we've harvested the process, spawn a new one and watch it
330 - // instead. Otherwise, we just let go of the data we read
331 - if (harvested == 1) {
333 - if ((sndpid = fork()) == 0) {
334 - // Only take the first line
336 - if ((nl = strchr(data, '\n')) != NULL)
339 - // Make sure it's shell-clean
340 - MungeToShell(data, strlen(data));
341 - char spk_call[1024];
342 - snprintf(spk_call, 1024, "echo \"(%s\\\"%s\\\")\" | %s "
343 - ">/dev/null 2>/dev/null",
344 - flite ? "": "SayText ", data, player);
357 -int PlaySound(string in_sound) {
361 - snprintf(snd, 1024, "%s\n", in_sound.c_str());
363 - if (write(soundpair[1], snd, strlen(snd)) < 0) {
364 - char status[STATUS_MAX];
365 - snprintf(status, STATUS_MAX,
366 - "ERROR: Could not write to sound pipe. Stopping sound.");
367 - gui->WriteStatus(status);
375 -int SayText(string in_text) {
378 - snprintf(snd, 1024, "%s\n", in_text.c_str());
380 - if (write(speechpair[1], snd, strlen(snd)) < 0) {
381 - char status[STATUS_MAX];
382 - snprintf(status, STATUS_MAX,
383 - "ERROR: Could not write to speech pipe. Stopping speech.");
384 - gui->WriteStatus(status);
392 int main(int argc, char *argv[]) {
404 fprintf(stderr, "Using alternate UI config file: %s\n", uiconfigfile);
410 reqgui = strdup(optarg);
412 server = strdup(gui_conf->FetchOpt("host").c_str());
415 - if (gui_conf->FetchOpt("sound") == "true" && sound == -1) {
416 - if (gui_conf->FetchOpt("soundplay") != "") {
417 - sndplay = gui_conf->FetchOpt("soundplay");
420 - if (gui_conf->FetchOpt("soundopts") != "")
421 - sndplay += " " + gui_conf->FetchOpt("soundopts");
423 - if (gui_conf->FetchOpt("sound_new") != "")
424 - wav_map["new"] = gui_conf->FetchOpt("sound_new");
425 - if (gui_conf->FetchOpt("sound_new_wep") != "")
426 - wav_map["new_wep"] = gui_conf->FetchOpt("sound_new_wep");
427 - if (gui_conf->FetchOpt("sound_traffic") != "")
428 - wav_map["traffic"] = gui_conf->FetchOpt("sound_traffic");
429 - if (gui_conf->FetchOpt("sound_junktraffic") != "")
430 - wav_map["junktraffic"] = gui_conf->FetchOpt("sound_junktraffic");
431 - if (gui_conf->FetchOpt("sound_gpslock") != "")
432 - wav_map["gpslock"] = gui_conf->FetchOpt("sound_gpslock");
433 - if (gui_conf->FetchOpt("sound_gpslost") != "")
434 - wav_map["gpslost"] = gui_conf->FetchOpt("sound_gpslost");
435 - if (gui_conf->FetchOpt("sound_alert") != "")
436 - wav_map["alert"] = gui_conf->FetchOpt("sound_alert");
439 - fprintf(stderr, "ERROR: Sound alerts enabled but no sound playing binary specified.\n");
442 - } else if (sound == -1)
445 - /* Added by Shaw Innes 17/2/02 */
446 - if (gui_conf->FetchOpt("speech") == "true" && speech == -1) {
447 - if (gui_conf->FetchOpt("festival") != "") {
448 - festival = strdup(gui_conf->FetchOpt("festival").c_str());
451 - if (gui_conf->FetchOpt("flite") == "true")
454 - string speechtype = gui_conf->FetchOpt("speech_type");
456 - if (!strcasecmp(speechtype.c_str(), "nato"))
457 - speech_encoding = SPEECH_ENCODING_NATO;
458 - else if (!strcasecmp(speechtype.c_str(), "spell"))
459 - speech_encoding = SPEECH_ENCODING_SPELL;
461 - speech_encoding = SPEECH_ENCODING_NORMAL;
463 - // Make sure we have encrypted text lines
464 - if (gui_conf->FetchOpt("speech_encrypted") == "" || gui_conf->FetchOpt("speech_unencrypted") == "") {
465 - fprintf(stderr, "ERROR: Speech request but speech_encrypted or speech_unencrypted line missing.\n");
469 - speech_sentence_encrypted = gui_conf->FetchOpt("speech_encrypted");
470 - speech_sentence_unencrypted = gui_conf->FetchOpt("speech_unencrypted");
473 - fprintf(stderr, "ERROR: Speech alerts enabled but no path to festival has been specified.\n");
476 - } else if (speech == -1)
479 if (gui_conf->FetchOpt("decay") != "") {
480 if (sscanf(gui_conf->FetchOpt("decay").c_str(), "%d", &decay) != 1) {
481 fprintf(stderr, "FATAL: Illegal config file value for decay.\n");
486 - // Fork and find the sound options
488 - if (pipe(soundpair) == -1) {
489 - fprintf(stderr, "WARNING: Unable to create pipe for audio. Disabling sound.\n");
494 - if (soundpid < 0) {
495 - fprintf(stderr, "WARNING: Unable to fork for audio. Disabling sound.\n");
497 - } else if (soundpid == 0) {
498 - SoundHandler(soundpair, sndplay.c_str(), wav_map);
502 - close(soundpair[0]);
507 - if (pipe(speechpair) == -1) {
508 - fprintf(stderr, "WARNING: Unable to create pipe for speech. Disabling speech.\n");
511 - speechpid = fork();
513 - if (speechpid < 0) {
514 - fprintf(stderr, "WARNING: Unable to fork for speech. Disabling speech.\n");
516 - } else if (speechpid == 0) {
517 - SpeechHandler(speechpair, festival);
521 - close(speechpair[0]);
525 if (kismet_serv.Connect(guiport, guihost) < 0) {
526 fprintf(stderr, "FATAL: Could not connect to %s:%d.\n", guihost, guiport);
528 @@ -884,53 +553,13 @@
532 - if (pollret == CLIENT_ALERT)
534 - sound = PlaySound("alert");
536 if (strlen(tcpcli->FetchStatus()) != 0) {
537 gui->WriteStatus(tcpcli->FetchStatus());
538 // gui->DrawDisplay();
541 - // The GPS only gets updated for the primary client
542 - if (tcpcli == primary_client) {
543 - if (tcpcli->FetchMode() == 0 && gpsmode != 0) {
544 - if (sound == 1 && gpsmode != -1)
545 - sound = PlaySound("gpslost");
547 - } else if (tcpcli->FetchMode() != 0 && gpsmode == 0) {
548 - if (sound == 1 && gpsmode != -1)
549 - sound = PlaySound("gpslock");
554 if (tcpcli->FetchDeltaNumNetworks() > 0) {
555 wireless_network *newnet = tcpcli->FetchLastNewNetwork();
557 - if (sound == 1 && newnet != lastspoken) {
558 - if (newnet->crypt_set &&
559 - wav_map.find("new_wep") != wav_map.end())
560 - sound = PlaySound("new_wep");
562 - sound = PlaySound("new");
565 - if (speech == 1 && newnet != lastspoken) {
568 - if (newnet != NULL) {
569 - if (newnet->crypt_set)
570 - text = ExpandSpeechString(speech_sentence_encrypted, newnet, speech_encoding);
572 - text = ExpandSpeechString(speech_sentence_unencrypted, newnet, speech_encoding);
574 - speech = SayText(text.c_str());
578 - lastspoken = newnet;
581 num_networks += tcpcli->FetchNumNetworks();
583 num_noise += tcpcli->FetchNumNoise();
584 num_dropped += tcpcli->FetchNumDropped();
586 - if (tcpcli->FetchDeltaNumPackets() != 0) {
587 - if (time(0) - last_click >= decay && sound == 1) {
588 - if (tcpcli->FetchDeltaNumPackets() > tcpcli->FetchDeltaNumDropped()) {
589 - sound = PlaySound("traffic");
591 - sound = PlaySound("junktraffic");
594 - last_click = time(0);
597 + tcpcli->FetchDeltaNumPackets();
601 diff -urN kismet.dev/kismet_drone.cc kismet.dev2/kismet_drone.cc
602 --- kismet.dev/kismet_drone.cc 2006-04-13 00:42:59.000000000 +0200
603 +++ kismet.dev2/kismet_drone.cc 2006-04-14 20:21:46.000000000 +0200
607 #include "packetsource.h"
608 -#include "prism2source.h"
609 #include "pcapsource.h"
610 -#include "wtapfilesource.h"
611 -#include "wsp100source.h"
612 -#include "vihasource.h"
613 #include "dronesource.h"
614 #include "packetsourcetracker.h"
615 #include "kis_packsources.h"
618 #include "tcpstreamer.h"
619 #include "configfile.h"
623 const char *config_base = "kismet_drone.conf";
629 // Unused, only here to make packetsourcetracker link
630 int retain_monitor = 0;
636 -int GpsEvent(Timetracker::timer_event *evt, void *parm) {
637 - // The GPS only provides us a new update once per second we might
638 - // as well only update it here once a second
641 - gpsret = gps->Scan();
644 - fprintf(stderr, "GPS error fetching data: %s\n",
645 - gps->FetchError());
652 - // We want to be rescheduled
656 // Handle channel hopping... this is actually really simple.
657 int ChannelHopEvent(Timetracker::timer_event *evt, void *parm) {
658 sourcetracker.AdvanceChannel();
661 TcpStreamer streamer;
663 - char gpshost[1024];
666 int channel_hop = -1;
667 int channel_velocity = 1;
668 int channel_dwell = 0;
673 - if (conf->FetchOpt("gps") == "true") {
674 - if (sscanf(conf->FetchOpt("gpshost").c_str(), "%1023[^:]:%d", gpshost, &gpsport) != 2) {
675 - fprintf(stderr, "Invalid GPS host in config (host:port required)\n");
684 - if (gps_enable == 1) {
686 - gps = new GPSD(gpshost, gpsport);
688 - // Lock GPS position
689 - if (conf->FetchOpt("gpsmodelock") == "true") {
690 - fprintf(stderr, "Enabling GPS position lock override (broken GPS unit reports 0 always)\n");
691 - gps->SetOptions(GPSD_OPT_FORCEMODE);
694 - if (gps->OpenGPSD() < 0) {
695 - fprintf(stderr, "%s\n", gps->FetchError());
699 - fprintf(stderr, "Opened GPS connection to %s port %d\n",
705 - // Update GPS coordinates and handle signal loss if defined
706 - timetracker.RegisterTimer(SERVER_TIMESLICES_SEC, NULL, 1, &GpsEvent, NULL);
708 - // Add the GPS to the tcpstreamer
709 - streamer.AddGpstracker(gps);
711 - // Register the gps and timetracker with the sourcetracker
712 - sourcetracker.AddGpstracker(gps);
713 sourcetracker.AddTimetracker(&timetracker);
715 // Register the sources
716 diff -urN kismet.dev/kismet_server.cc kismet.dev2/kismet_server.cc
717 --- kismet.dev/kismet_server.cc 2006-04-13 00:42:59.000000000 +0200
718 +++ kismet.dev2/kismet_server.cc 2006-04-14 19:31:55.000000000 +0200
722 #include "packetsource.h"
723 -#include "prism2source.h"
724 #include "pcapsource.h"
725 -#include "wtapfilesource.h"
726 -#include "wsp100source.h"
727 -#include "vihasource.h"
728 #include "dronesource.h"
729 #include "packetsourcetracker.h"
730 #include "kis_packsources.h"
732 #include "wtaplocaldump.h"
733 #include "airsnortdump.h"
734 #include "fifodump.h"
735 -#include "gpsdump.h"
739 #include "packetracker.h"
740 #include "timetracker.h"
741 #include "alertracker.h"
744 #include "tcpserver.h"
745 #include "server_globals.h"
746 #include "kismet_server.h"
748 Alertracker alertracker;
749 Timetracker timetracker;
755 -// Last time we tried to reconnect to the gps
756 -time_t last_gpsd_reconnect = 0;
757 -int gpsd_reconnect_attempt = 0;
759 FifoDumpFile fifodump;
762 packet_info last_info;
764 channel_power channel_graph[CHANNEL_MAX];
767 macmap<wep_key_info *> bssid_wep_map;
769 -// Pipe file descriptor pairs and fd's
773 -pid_t soundpid = -1, speechpid = -1, chanpid = -1;
777 unsigned int max_alerts = 50;
782 -//const char *sndplay = NULL;
785 -const char *festival = NULL;
788 -int speech_encoding = 0;
789 -string speech_sentence_encrypted, speech_sentence_unencrypted;
791 -map<string, string> wav_map;
800 - if (gps_log == 1) {
801 - if (gpsdump.CloseDump(1) < 0)
802 - fprintf(stderr, "Didn't log any GPS coordinates, unlinking gps file\n");
805 - // Kill our sound players
809 - kill(speechpid, 9);
811 // Shut down the packet sources
812 sourcetracker.CloseSources();
814 @@ -369,228 +327,10 @@
818 -// Subprocess sound handler
819 -void SoundHandler(int *fds, const char *player, map<string, string> soundmap) {
820 - int read_sock = fds[0];
832 - FD_SET(read_sock, &rset);
835 - memset(data, 0, 1024);
841 - if (select(read_sock + 1, &rset, NULL, NULL, &tm) < 0) {
842 - if (errno != EINTR) {
847 - if (harvested == 0) {
848 - // We consider a wait error to be a sign that the child pid died
849 - // so we flag it as harvested and keep on going
850 - pid_t harvestpid = waitpid(sndpid, NULL, WNOHANG);
851 - if (harvestpid == -1 || harvestpid == sndpid)
855 - if (FD_ISSET(read_sock, &rset)) {
857 - ret = read(read_sock, data, 1024);
859 - // We'll die off if we get a read error, and we'll let kismet on the
860 - // other side detact that it died
861 - if (ret <= 0 && (errno != EAGAIN && errno != EPIPE))
864 - if ((end = strstr(data, "\n")) == NULL)
870 - if (data[0] == '\0')
874 - // If we've harvested the process, spawn a new one and watch it
875 - // instead. Otherwise, we just let go of the data we read
876 - if (harvested == 1) {
877 - // Only take the first line
879 - if ((nl = strchr(data, '\n')) != NULL)
882 - // Make sure it's shell-clean
886 - if (soundmap.size() == 0)
887 - snprintf(snd, 1024, "%s", data);
888 - if (soundmap.find(data) != soundmap.end())
889 - snprintf(snd, 1024, "%s", soundmap[data].c_str());
894 - snprintf(plr, 1024, "%s", player);
897 - if ((sndpid = fork()) == 0) {
900 - int nulfd = open("/dev/null", O_RDWR);
905 - char * const echoarg[] = { plr, snd, NULL };
906 - execve(echoarg[0], echoarg, NULL);
913 -// Subprocess speech handler
914 -void SpeechHandler(int *fds, const char *player) {
915 - int read_sock = fds[0];
927 - FD_SET(read_sock, &rset);
930 - memset(data, 0, 1024);
932 - if (harvested == 0) {
933 - // We consider a wait error to be a sign that the child pid died
934 - // so we flag it as harvested and keep on going
935 - pid_t harvestpid = waitpid(sndpid, NULL, WNOHANG);
936 - if (harvestpid == -1 || harvestpid == sndpid)
944 - if (select(read_sock + 1, &rset, NULL, NULL, &tm) < 0) {
945 - if (errno != EINTR) {
950 - if (FD_ISSET(read_sock, &rset)) {
952 - ret = read(read_sock, data, 1024);
954 - // We'll die off if we get a read error, and we'll let kismet on the
955 - // other side detact that it died
956 - if (ret <= 0 && (errno != EAGAIN && errno != EPIPE))
962 - if (data[0] == '\0')
965 - // If we've harvested the process, spawn a new one and watch it
966 - // instead. Otherwise, we just let go of the data we read
967 - if (harvested == 1) {
969 - if ((sndpid = fork()) == 0) {
970 - // Only take the first line
972 - if ((nl = strchr(data, '\n')) != NULL)
975 - // Make sure it's shell-clean
976 - MungeToShell(data, strlen(data));
977 - char spk_call[1024];
978 - snprintf(spk_call, 1024, "echo \"(%s\\\"%s\\\")\" | %s "
979 - ">/dev/null 2>/dev/null",
980 - flite ? "" : "SayText ", data, player);
992 -// Fork and run a system call to play a sound
993 -int PlaySound(string in_sound) {
997 - snprintf(snd, 1024, "%s\n", in_sound.c_str());
999 - if (write(soundpair[1], snd, strlen(snd)) < 0) {
1000 - char status[STATUS_MAX];
1002 - fprintf(stderr, "ERROR: Write error, closing sound pipe.\n");
1003 - snprintf(status, STATUS_MAX, "ERROR: Write error on sound pipe, closing sound connection");
1004 - NetWriteStatus(status);
1012 -int SayText(string in_text) {
1016 - snprintf(snd, 1024, "%s\n", in_text.c_str());
1017 - MungeToShell(snd, 1024);
1019 - if (write(speechpair[1], snd, strlen(snd)) < 0) {
1020 - char status[STATUS_MAX];
1022 - fprintf(stderr, "ERROR: Write error, closing speech pipe.\n");
1023 - snprintf(status, STATUS_MAX, "ERROR: Write error on speech pipe, closing speech connection");
1024 - NetWriteStatus(status);
1032 void KisLocalAlert(const char *in_text) {
1033 time_t now = time(0);
1035 fprintf(stderr, "ALERT %.24s %s\n", ctime(&now), in_text);
1038 - sound = PlaySound("alert");
1042 void KisLocalStatus(const char *in_status) {
1043 @@ -639,37 +379,6 @@
1050 - float lat, lon, alt, spd, hed;
1053 - gps->FetchLoc(&lat, &lon, &alt, &spd, &hed, &mode);
1055 - snprintf(tmpstr, 32, "%f", lat);
1056 - gdata.lat = tmpstr;
1057 - snprintf(tmpstr, 32, "%f", lon);
1058 - gdata.lon = tmpstr;
1059 - snprintf(tmpstr, 32, "%f", alt);
1060 - gdata.alt = tmpstr;
1061 - snprintf(tmpstr, 32, "%f", spd);
1062 - gdata.spd = tmpstr;
1063 - snprintf(tmpstr, 32, "%f", hed);
1064 - gdata.heading = tmpstr;
1065 - snprintf(tmpstr, 32, "%d", mode);
1066 - gdata.mode = tmpstr;
1068 - gdata.lat = "0.0";
1069 - gdata.lon = "0.0";
1070 - gdata.alt = "0.0";
1071 - gdata.spd = "0.0";
1072 - gdata.heading = "0.0";
1076 - ui_server.SendToAll(gps_ref, (void *) &gdata);
1079 snprintf(tmpstr, 32, "%d", tracker.FetchNumNetworks());
1080 idata.networks = tmpstr;
1081 @@ -790,81 +499,6 @@
1085 -int GpsEvent(Timetracker::timer_event *evt, void *parm) {
1086 - char status[STATUS_MAX];
1088 - // The GPS only provides us a new update once per second we might
1089 - // as well only update it here once a second
1091 - // If we're disconnected, try to reconnect.
1092 - if (gpsd_reconnect_attempt > 0) {
1093 - // Increment the time between connection attempts
1094 - if (last_gpsd_reconnect + ((gpsd_reconnect_attempt - 1) * 2) < time(0)) {
1095 - if (gps->OpenGPSD() < 0) {
1096 - last_gpsd_reconnect = time(0);
1098 - if (gpsd_reconnect_attempt < 20)
1099 - gpsd_reconnect_attempt++;
1101 - snprintf(status, STATUS_MAX, "Unable to reconnect to GPSD, trying "
1102 - "again in %d seconds.", ((gpsd_reconnect_attempt - 1) * 2));
1104 - if (!silent || NetWriteStatus(status) == 0)
1105 - fprintf(stderr, "WARNING: %s\n", status);
1109 - gpsd_reconnect_attempt = 0;
1111 - snprintf(status, STATUS_MAX, "Reopened connection to GPSD");
1112 - if (!silent || NetWriteStatus(status) == 0)
1113 - fprintf(stderr, "NOTICE: %s\n", status);
1116 - // Don't process more if we haven't woken up yet
1124 - gpsret = gps->Scan();
1127 - snprintf(status, STATUS_MAX, "GPS error requesting data: %s",
1128 - gps->FetchError());
1130 - if (!silent || NetWriteStatus(status) == 0)
1131 - fprintf(stderr, "WARNING: %s\n", status);
1133 - gpsd_reconnect_attempt = 1;
1136 - if (gpsret == 0 && gpsmode != 0) {
1137 - if (!silent || NetWriteStatus("Lost GPS signal.") == 0)
1138 - fprintf(stderr, "Lost GPS signal.\n");
1140 - sound = PlaySound("gpslost");
1143 - } else if (gpsret != 0 && gpsmode == 0) {
1144 - if (!silent || NetWriteStatus("Acquired GPS signal.") == 0)
1145 - fprintf(stderr, "Acquired GPS signal.\n");
1147 - sound = PlaySound("gpslock");
1153 - if (gps_log == 1 && gpsmode != 0 && gps != NULL) {
1154 - gpsdump.DumpTrack(gps);
1157 - // We want to be rescheduled
1161 // Simple redirect to the network info drawer. We don't want to change netwriteinfo to a
1162 // timer event since we call it un-timed too
1163 @@ -885,13 +519,6 @@
1167 -// Write the waypoints for gpsdrive
1168 -int WaypointSyncEvent(Timetracker::timer_event *evt, void *parm) {
1169 - tracker.WriteGpsdriveWaypt(waypoint_file);
1174 // Handle tracker maintenance
1175 int TrackerTickEvent(Timetracker::timer_event *evt, void *parm) {
1177 @@ -1160,11 +787,9 @@
1178 " -c, --capture-source <src> Packet capture source line (type,interface,name)\n"
1179 " -C, --enable-capture-sources Comma separated list of named packet sources to use.\n"
1180 " -l, --log-types <types> Comma separated list of types to log,\n"
1181 - " (ie, dump,cisco,weak,network,gps)\n"
1182 + " (ie, dump,cisco,weak,network)\n"
1183 " -d, --dump-type <type> Dumpfile type (wiretap)\n"
1184 " -m, --max-packets <num> Maximum number of packets before starting new dump\n"
1185 - " -q, --quiet Don't play sounds\n"
1186 - " -g, --gps <host:port> GPS server (host:port or off)\n"
1187 " -p, --port <port> TCPIP server port for GUI connections\n"
1188 " -a, --allowed-hosts <hosts> Comma separated list of hosts allowed to connect\n"
1189 " -b, --bind-address <address> Bind to this address. Default INADDR_ANY\n."
1190 @@ -1289,23 +914,6 @@
1195 - if (conf->FetchOpt("waypoints") == "true") {
1196 - if(conf->FetchOpt("waypointdata") == "") {
1197 - fprintf(stderr, "WARNING: Waypoint logging requested but no waypoint data file given.\n"
1198 - "Waypoint logging will be disabled.\n");
1201 - waypointfile = conf->ExpandLogPath(conf->FetchOpt("waypointdata"), "", "", 0, 1);
1204 - if(conf->FetchOpt("waypoint_essid") == "true") {
1205 - waypointformat = 1;
1207 - waypointformat = 0;
1211 if (conf->FetchOpt("metric") == "true") {
1212 fprintf(stderr, "Using metric measurements.\n");
1214 @@ -1423,26 +1031,6 @@
1219 - if (strstr(logtypes, "gps")) {
1220 - if (gps_log == 0) {
1221 - fprintf(stderr, "WARNING: Disabling GPS logging.\n");
1225 - if (conf->FetchOpt("logtemplate") == "") {
1226 - fprintf(stderr, "FATAL: Logging (gps coordinates) enabled but no logtemplate given in config.\n");
1233 - if (gps_log == 1 && !net_log) {
1234 - fprintf(stderr, "WARNING: Logging (gps coordinates) enabled but XML logging (networks) was not.\n"
1235 - "It will be enabled now.\n");
1240 if (conf->FetchOpt("decay") != "") {
1241 @@ -1563,72 +1151,6 @@
1242 legal_ipblock_vec.push_back(ipb);
1245 - // Process sound stuff
1246 - if (conf->FetchOpt("sound") == "true" && sound == -1) {
1247 - if (conf->FetchOpt("soundplay") != "") {
1248 - sndplay = conf->FetchOpt("soundplay");
1250 - if (conf->FetchOpt("soundopts") != "")
1251 - sndplay += " " + conf->FetchOpt("soundopts");
1255 - if (conf->FetchOpt("sound_new") != "")
1256 - wav_map["new"] = conf->FetchOpt("sound_new");
1257 - if (conf->FetchOpt("sound_new_wep") != "")
1258 - wav_map["new_wep"] = conf->FetchOpt("sound_new_wep");
1259 - if (conf->FetchOpt("sound_traffic") != "")
1260 - wav_map["traffic"] = conf->FetchOpt("sound_traffic");
1261 - if (conf->FetchOpt("sound_junktraffic") != "")
1262 - wav_map["junktraffic"] = conf->FetchOpt("sound_traffic");
1263 - if (conf->FetchOpt("sound_gpslock") != "")
1264 - wav_map["gpslock"] = conf->FetchOpt("sound_gpslock");
1265 - if (conf->FetchOpt("sound_gpslost") != "")
1266 - wav_map["gpslost"] = conf->FetchOpt("sound_gpslost");
1267 - if (conf->FetchOpt("sound_alert") != "")
1268 - wav_map["alert"] = conf->FetchOpt("sound_alert");
1271 - fprintf(stderr, "ERROR: Sound alerts enabled but no sound playing binary specified.\n");
1274 - } else if (sound == -1)
1277 - /* Added by Shaw Innes 17/2/02 */
1278 - /* Modified by Andrew Etter 15/9/02 */
1279 - if (conf->FetchOpt("speech") == "true" && speech == -1) {
1280 - if (conf->FetchOpt("festival") != "") {
1281 - festival = strdup(conf->FetchOpt("festival").c_str());
1284 - if (conf->FetchOpt("flite") == "true")
1287 - string speechtype = conf->FetchOpt("speech_type");
1289 - if (!strcasecmp(speechtype.c_str(), "nato"))
1290 - speech_encoding = SPEECH_ENCODING_NATO;
1291 - else if (!strcasecmp(speechtype.c_str(), "spell"))
1292 - speech_encoding = SPEECH_ENCODING_SPELL;
1294 - speech_encoding = SPEECH_ENCODING_NORMAL;
1296 - // Make sure we have encrypted text lines
1297 - if (conf->FetchOpt("speech_encrypted") == "" || conf->FetchOpt("speech_unencrypted") == "") {
1298 - fprintf(stderr, "ERROR: Speech request but speech_encrypted or speech_unencrypted line missing.\n");
1302 - speech_sentence_encrypted = conf->FetchOpt("speech_encrypted");
1303 - speech_sentence_unencrypted = conf->FetchOpt("speech_unencrypted");
1305 - fprintf(stderr, "ERROR: Speech alerts enabled but no path to festival has been specified.\n");
1308 - } else if (speech == -1)
1311 if (conf->FetchOpt("writeinterval") != "") {
1312 if (sscanf(conf->FetchOpt("writeinterval").c_str(), "%d", &datainterval) != 1) {
1313 fprintf(stderr, "FATAL: Illegal config file value for data interval.\n");
1314 @@ -1648,45 +1170,6 @@
1315 fprintf(stderr, "WARNING: No client_manuf file specified. Client manufacturers will not be detected.\n");
1318 - // Fork and find the sound options
1320 - if (pipe(soundpair) == -1) {
1321 - fprintf(stderr, "WARNING: Unable to create pipe for audio. Disabling sound.\n");
1324 - soundpid = fork();
1326 - if (soundpid < 0) {
1327 - fprintf(stderr, "WARNING: Unable to fork for audio. Disabling sound.\n");
1329 - } else if (soundpid == 0) {
1330 - SoundHandler(soundpair, sndplay.c_str(), wav_map);
1334 - close(soundpair[0]);
1339 - if (pipe(speechpair) == -1) {
1340 - fprintf(stderr, "WARNING: Unable to create pipe for speech. Disabling speech.\n");
1343 - speechpid = fork();
1345 - if (speechpid < 0) {
1346 - fprintf(stderr, "WARNING: Unable to fork for speech. Disabling speech.\n");
1348 - } else if (speechpid == 0) {
1349 - SpeechHandler(speechpair, festival);
1353 - close(speechpair[0]);
1357 // Grab the filtering
1360 @@ -1712,7 +1195,7 @@
1363 if ((filter_bit = conf->FetchOpt("filter_export")) != "") {
1364 - fprintf(stderr, "Enabling filtering on exported (csv, xml, network, gps) files.\n");
1365 + fprintf(stderr, "Enabling filtering on exported (csv, xml, network) files.\n");
1367 if (ConfigFile::ParseFilterLine(filter_bit, &filter_export_bssid, &filter_export_source,
1368 &filter_export_dest, &filter_export_bssid_invert,
1369 @@ -1818,14 +1301,6 @@
1374 - if ((waypoint_file = fopen(waypointfile.c_str(), "a")) == NULL) {
1375 - fprintf(stderr, "WARNING: Could not open waypoint file '%s' for writing: %s\n",
1376 - waypointfile.c_str(), strerror(errno));
1381 // Create all the logs and title/number them appropriately
1382 // We need to save this for after we toast the conf record
1383 int logfile_matched = 0;
1384 @@ -1873,13 +1348,6 @@
1388 - if (gps_log == 1) {
1389 - gpslogfile = conf->ExpandLogPath(conf->FetchOpt("logtemplate"), logname, "gps", run_num);
1391 - if (gpslogfile == "")
1395 // if we made it this far we're cool -- all the logfiles we're writing to matched
1397 logfile_matched = 1;
1398 @@ -1908,9 +1376,6 @@
1400 fprintf(stderr, "Logging cisco product information to %s\n", ciscologfile.c_str());
1403 - fprintf(stderr, "Logging gps coordinates to %s\n", gpslogfile.c_str());
1406 fprintf(stderr, "Logging data to %s\n", dumplogfile.c_str());
1408 @@ -2058,7 +1523,6 @@
1409 { "dump-type", required_argument, 0, 'd' },
1410 { "max-packets", required_argument, 0, 'm' },
1411 { "quiet", no_argument, 0, 'q' },
1412 - { "gps", required_argument, 0, 'g' },
1413 { "port", required_argument, 0, 'p' },
1414 { "allowed-hosts", required_argument, 0, 'a' },
1415 { "bind-address", required_argument, 0, 'b'},
1416 @@ -2140,18 +1604,6 @@
1422 - if (strcmp(optarg, "off") == 0) {
1425 - else if (sscanf(optarg, "%1023[^:]:%d", gpshost, &gpsport) < 2) {
1426 - fprintf(stderr, "Invalid GPS host '%s' (host:port or off required)\n",
1434 if (sscanf(optarg, "%d", &tcpport) != 1) {
1435 @@ -2173,7 +1625,6 @@
1443 @@ -2331,39 +1782,6 @@
1448 - // Set up the GPS object to give to the children
1449 - if (gpsport == -1 && gps_enable) {
1450 - if (conf->FetchOpt("gps") == "true") {
1451 - if (sscanf(conf->FetchOpt("gpshost").c_str(), "%1023[^:]:%d", gpshost,
1453 - fprintf(stderr, "Invalid GPS host in config (host:port required)\n");
1464 - if (gps_enable == 1) {
1465 - gps = new GPSD(gpshost, gpsport);
1467 - // Lock GPS position
1468 - if (conf->FetchOpt("gpsmodelock") == "true") {
1469 - fprintf(stderr, "Enabling GPS position lock override (broken GPS unit "
1470 - "reports 0 always)\n");
1471 - gps->SetOptions(GPSD_OPT_FORCEMODE);
1478 - // Register the gps and timetracker with the sourcetracker
1479 - sourcetracker.AddGpstracker(gps);
1480 sourcetracker.AddTimetracker(&timetracker);
1482 // Handle errors here maybe in the future
1483 @@ -2530,13 +1948,6 @@
1484 fprintf(stderr, "Dump file format: %s\n", dumpfile->FetchType());
1487 - if (gps_enable && gps_log == 1) {
1488 - if (gpsdump.OpenDump(gpslogfile.c_str(), xmllogfile.c_str()) < 0) {
1489 - fprintf(stderr, "FATAL: GPS dump error: %s\n", gpsdump.FetchError());
1494 // Open our files first to make sure we can, we'll unlink the empties later.
1495 FILE *testfile = NULL;
1497 @@ -2608,14 +2019,13 @@
1500 if (data_log || net_log || crypt_log) {
1501 - snprintf(status, STATUS_MAX, "Logging%s%s%s%s%s%s%s",
1502 + snprintf(status, STATUS_MAX, "Logging%s%s%s%s%s%s",
1503 data_log ? " data" : "" ,
1504 net_log ? " networks" : "" ,
1505 csv_log ? " CSV" : "" ,
1506 xml_log ? " XML" : "" ,
1507 crypt_log ? " weak" : "",
1508 - cisco_log ? " cisco" : "",
1509 - gps_log == 1 ? " gps" : "");
1510 + cisco_log ? " cisco" : "");
1511 fprintf(stderr, "%s\n", status);
1512 } else if (no_log) {
1513 snprintf(status, STATUS_MAX, "Not logging any data.");
1514 @@ -2633,23 +2043,6 @@
1520 - if (gps->OpenGPSD() < 0) {
1521 - fprintf(stderr, "%s\n", gps->FetchError());
1526 - fprintf(stderr, "Opened GPS connection to %s port %d\n",
1527 - gpshost, gpsport);
1529 - gpsmode = gps->FetchMode();
1531 - last_gpsd_reconnect = time(0);
1535 fprintf(stderr, "Listening on port %d.\n", tcpport);
1536 for (unsigned int ipvi = 0; ipvi < legal_ipblock_vec.size(); ipvi++) {
1537 char *netaddr = strdup(inet_ntoa(legal_ipblock_vec[ipvi]->network));
1538 @@ -2690,8 +2083,6 @@
1539 &Protocol_NETWORK, &ProtocolNetworkEnable);
1540 client_ref = ui_server.RegisterProtocol("CLIENT", 0, CLIENT_fields_text,
1541 &Protocol_CLIENT, &ProtocolClientEnable);
1542 - gps_ref = ui_server.RegisterProtocol("GPS", 0, GPS_fields_text,
1543 - &Protocol_GPS, NULL);
1544 info_ref = ui_server.RegisterProtocol("INFO", 0, INFO_fields_text,
1545 &Protocol_INFO, NULL);
1546 remove_ref = ui_server.RegisterProtocol("REMOVE", 0, REMOVE_fields_text,
1547 @@ -2746,14 +2137,9 @@
1548 // Write network info and tick the tracker once per second
1549 timetracker.RegisterTimer(SERVER_TIMESLICES_SEC, NULL, 1, &NetWriteEvent, NULL);
1550 timetracker.RegisterTimer(SERVER_TIMESLICES_SEC, NULL, 1, &TrackerTickEvent, NULL);
1551 - // Update GPS coordinates and handle signal loss if defined
1552 - timetracker.RegisterTimer(SERVER_TIMESLICES_SEC, NULL, 1, &GpsEvent, NULL);
1553 // Sync the data files if requested
1554 if (datainterval > 0 && no_log == 0)
1555 timetracker.RegisterTimer(datainterval * SERVER_TIMESLICES_SEC, NULL, 1, &ExportSyncEvent, NULL);
1556 - // Write waypoints if requested
1558 - timetracker.RegisterTimer(decay * SERVER_TIMESLICES_SEC, NULL, 1, &WaypointSyncEvent, NULL);
1559 // Channel hop if requested
1562 @@ -2777,7 +2163,6 @@
1563 snprintf(status, 1024, "%s", TIMESTAMP);
1564 kdata.timestamp = status;
1566 - time_t last_click = 0;
1567 int num_networks = 0, num_packets = 0, num_noise = 0, num_dropped = 0;
1570 @@ -2926,54 +2311,13 @@
1574 - if (gps_log == 1 && info.type != packet_noise &&
1575 - info.type != packet_unknown && info.type != packet_phy &&
1576 - info.corrupt == 0) {
1577 - if (gpsdump.DumpPacket(&info) < 0) {
1578 - snprintf(status, STATUS_MAX, "%s", gpsdump.FetchError());
1579 - if (!silent || NetWriteStatus(status) == 0)
1580 - fprintf(stderr, "%s\n", status);
1584 // tracker.ProcessPacket(info);
1585 tracker.ProcessPacket(&packet, &info, &bssid_wep_map,
1588 - if (tracker.FetchNumNetworks() > num_networks) {
1590 - if (info.crypt_set &&
1591 - wav_map.find("new_wep") != wav_map.end())
1592 - sound = PlaySound("new_wep");
1594 - sound = PlaySound("new");
1595 - if (speech == 1) {
1598 - if (info.crypt_set)
1599 - text = ExpandSpeechString(speech_sentence_encrypted, &info,
1602 - text = ExpandSpeechString(speech_sentence_unencrypted,
1603 - &info, speech_encoding);
1605 - speech = SayText(MungeToShell(text).c_str());
1608 num_networks = tracker.FetchNumNetworks();
1610 if (tracker.FetchNumPackets() != num_packets) {
1611 - if (cur_time - last_click >= decay && sound == 1) {
1612 - if (tracker.FetchNumPackets() - num_packets >
1613 - tracker.FetchNumDropped() + localdropnum - num_dropped) {
1614 - sound = PlaySound("traffic");
1616 - sound = PlaySound("junktraffic");
1619 - last_click = cur_time;
1622 num_packets = tracker.FetchNumPackets();
1623 num_noise = tracker.FetchNumNoise();
1624 num_dropped = tracker.FetchNumDropped() + localdropnum;
1625 diff -urN kismet.dev/kismet_server.h kismet.dev2/kismet_server.h
1626 --- kismet.dev/kismet_server.h 2004-03-07 22:28:01.000000000 +0100
1627 +++ kismet.dev2/kismet_server.h 2006-04-14 19:31:55.000000000 +0200
1629 void handle_command(TcpServer *tcps, client_command *cc);
1630 int NetWriteStatus(const char *in_status);
1631 void NetWriteInfo();
1632 -int SayText(string in_text);
1633 -int PlaySound(string in_sound);
1634 -void SpeechHandler(int *fds, const char *player);
1635 -void SoundHandler(int *fds, const char *player, map<string, string> soundmap);
1636 void ProtocolAlertEnable(int in_fd);
1637 void ProtocolNetworkEnable(int in_fd);
1638 void ProtocolClientEnable(int in_fd);
1639 diff -urN kismet.dev/kis_packsources.cc kismet.dev2/kis_packsources.cc
1640 --- kismet.dev/kis_packsources.cc 2006-04-14 23:43:01.694817572 +0200
1641 +++ kismet.dev2/kis_packsources.cc 2006-04-14 20:21:12.000000000 +0200
1643 pcapsource_11g_registrant,
1644 monitor_wext, unmonitor_wext,
1645 chancontrol_wext, 1);
1646 - sourcetracker->RegisterPacketsource("cisco", 1, "IEEE80211b", 6,
1647 - pcapsource_wext_registrant,
1648 - monitor_cisco, unmonitor_cisco,
1649 - chancontrol_wext, 1);
1650 - sourcetracker->RegisterPacketsource("cisco_wifix", 1, "IEEE80211b", 6,
1651 - pcapsource_ciscowifix_registrant,
1652 - monitor_cisco_wifix, NULL, NULL, 1);
1653 + REG_EMPTY_CARD(sourcetracker, "cisco");
1654 + REG_EMPTY_CARD(sourcetracker, "cisco_wifix");
1655 sourcetracker->RegisterPacketsource("hostap", 1, "IEEE80211b", 6,
1656 pcapsource_wext_registrant,
1657 monitor_hostap, unmonitor_hostap,
1659 pcapsource_wext_registrant,
1660 monitor_orinoco, unmonitor_orinoco,
1661 chancontrol_orinoco, 1);
1662 - sourcetracker->RegisterPacketsource("acx100", 1, "IEEE80211b", 6,
1663 - pcapsource_wext_registrant,
1664 - monitor_acx100, unmonitor_acx100,
1665 - chancontrol_wext, 1);
1666 - sourcetracker->RegisterPacketsource("admtek", 1, "IEEE80211b", 6,
1667 - pcapsource_wext_registrant,
1668 - monitor_admtek, unmonitor_admtek,
1669 - chancontrol_wext, 1);
1670 - sourcetracker->RegisterPacketsource("vtar5k", 1, "IEEE80211a", 36,
1671 - pcapsource_wext_registrant,
1672 - monitor_vtar5k, NULL, chancontrol_wext, 1);
1673 - sourcetracker->RegisterPacketsource("atmel_usb", 1, "IEEE80211b", 6,
1674 - pcapsource_wext_registrant,
1675 - monitor_wext, unmonitor_wext,
1676 - chancontrol_wext, 1);
1677 + REG_EMPTY_CARD(sourcetracker, "acx100");
1678 + REG_EMPTY_CARD(sourcetracker, "admtek");
1679 + REG_EMPTY_CARD(sourcetracker, "vtar5k");
1680 + REG_EMPTY_CARD(sourcetracker, "atmel_usb");
1682 sourcetracker->RegisterPacketsource("madwifi_a", 1, "IEEE80211a", 36,
1683 pcapsource_wextfcs_registrant,
1684 @@ -146,50 +130,17 @@
1685 monitor_prism54g, unmonitor_prism54g,
1686 chancontrol_prism54g, 1);
1688 - sourcetracker->RegisterPacketsource("wlanng_wext", 1, "IEEE80211b", 6,
1689 - pcapsource_wlanng_registrant,
1690 - monitor_wlanng_avs, NULL,
1691 - chancontrol_wext, 1);
1693 - sourcetracker->RegisterPacketsource("ipw2100", 1, "IEEE80211b", 6,
1694 - pcapsource_wext_registrant,
1695 - monitor_ipw2100, unmonitor_ipw2100,
1696 - chancontrol_ipw2100, 1);
1698 - sourcetracker->RegisterPacketsource("ipw2200", 1, "IEEE80211g", 6,
1699 - pcapsource_wext_registrant,
1700 - monitor_ipw2200, unmonitor_ipw2200,
1701 - chancontrol_ipw2200, 1);
1703 - sourcetracker->RegisterPacketsource("ipw2915", 1, "IEEE80211ab", 6,
1704 - pcapsource_wext_registrant,
1705 - monitor_ipw2200, unmonitor_ipw2200,
1706 - chancontrol_ipw2200, 1);
1708 - sourcetracker->RegisterPacketsource("ipw3945", 1, "IEEE80211ab", 6,
1709 - pcapsource_wext_registrant,
1710 - monitor_ipw3945, unmonitor_ipw3945,
1711 - chancontrol_ipw2200, 1);
1713 - sourcetracker->RegisterPacketsource("ipwlivetap", 1, "IEEE80211b", 0,
1714 - pcapsource_wext_registrant,
1715 - monitor_ipwlivetap,
1716 - unmonitor_ipwlivetap,
1719 - sourcetracker->RegisterPacketsource("rt2400", 1, "IEEE80211b", 6,
1720 - pcapsource_wext_registrant,
1721 - monitor_wext, unmonitor_wext,
1722 - chancontrol_wext, 1);
1723 - sourcetracker->RegisterPacketsource("rt2500", 1, "IEEE80211g", 6,
1724 - pcapsource_11g_registrant,
1725 - monitor_wext, unmonitor_wext,
1726 - chancontrol_wext, 1);
1727 - sourcetracker->RegisterPacketsource("rt8180", 1, "IEEE80211b", 6,
1728 - pcapsource_wext_registrant,
1729 - monitor_wext, unmonitor_wext,
1730 - chancontrol_wext, 1);
1731 + REG_EMPTY_CARD(sourcetracker, "wlanng_wext");
1732 + REG_EMPTY_CARD(sourcetracker, "ipw2100");
1733 + REG_EMPTY_CARD(sourcetracker, "ipw2200");
1734 + REG_EMPTY_CARD(sourcetracker, "ipw2915");
1735 + REG_EMPTY_CARD(sourcetracker, "ipw3945");
1736 + REG_EMPTY_CARD(sourcetracker, "ipwlivetap");
1738 + REG_EMPTY_CARD(sourcetracker, "rt2400");
1739 + REG_EMPTY_CARD(sourcetracker, "rt2500");
1740 + REG_EMPTY_CARD(sourcetracker, "rt8180");
1742 sourcetracker->RegisterPacketsource("zd1211", 1, "IEEE80211g", 6,
1743 pcapsource_wext_registrant,
1744 monitor_wext, unmonitor_wext,
1745 @@ -233,31 +184,13 @@
1746 REG_EMPTY_CARD(sourcetracker, "zd1211");
1749 -#if defined(HAVE_LIBPCAP) && defined(SYS_LINUX)
1750 - sourcetracker->RegisterPacketsource("wlanng", 1, "IEEE80211b", 6,
1751 - pcapsource_wlanng_registrant,
1752 - monitor_wlanng, NULL, chancontrol_wlanng, 1);
1753 - sourcetracker->RegisterPacketsource("wlanng_avs", 1, "IEEE80211b", 6,
1754 - pcapsource_wlanng_registrant,
1755 - monitor_wlanng_avs, NULL,
1756 - chancontrol_wlanng_avs, 1);
1757 sourcetracker->RegisterPacketsource("wrt54g", 1, "na", 0,
1758 pcapsource_wrt54g_registrant,
1759 - monitor_wrt54g, unmonitor_wrt54g, chancontrol_wext, 0);
1761 + monitor_wrt54g, unmonitor_wrt54g, chancontrol_wext, 0);
1763 REG_EMPTY_CARD(sourcetracker, "wlanng");
1764 REG_EMPTY_CARD(sourcetracker, "wlanng_avs");
1765 - REG_EMPTY_CARD(sourcetracker, "wrt54g");
1768 -#if defined(SYS_LINUX) && defined(HAVE_LINUX_NETLINK)
1769 - sourcetracker->RegisterPacketsource("wlanng_legacy", 1, "IEEE80211b", 6,
1770 - prism2source_registrant,
1771 - monitor_wlanng_legacy, NULL,
1772 - chancontrol_wlanng_legacy, 1);
1774 REG_EMPTY_CARD(sourcetracker, "wlanng_legacy");
1777 #if defined(HAVE_LIBPCAP) && defined(SYS_OPENBSD)
1778 sourcetracker->RegisterPacketsource("cisco_openbsd", 1, "IEEE80211b", 6,
1779 @@ -291,29 +224,11 @@
1780 REG_EMPTY_CARD(sourcetracker, "radiotap_bsd_b");
1783 -#if defined(HAVE_LIBWIRETAP)
1784 - sourcetracker->RegisterPacketsource("wtapfile", 0, "na", 0,
1785 - wtapfilesource_registrant,
1786 - NULL, NULL, NULL, 0);
1788 REG_EMPTY_CARD(sourcetracker, "wtapfile");
1791 -#if defined(HAVE_WSP100)
1792 - sourcetracker->RegisterPacketsource("wsp100", 0, "IEEE80211b", 6,
1793 - wsp100source_registrant,
1794 - monitor_wsp100, NULL, chancontrol_wsp100, 0);
1796 REG_EMPTY_CARD(sourcetracker, "wsp100");
1799 -#if defined(HAVE_VIHAHEADERS)
1800 - sourcetracker->RegisterPacketsource("viha", 1, "IEEE80211b", 6,
1801 - vihasource_registrant,
1802 - NULL, NULL, chancontrol_viha, 0);
1804 REG_EMPTY_CARD(sourcetracker, "viha");
1809 diff -urN kismet.dev/kis_packsources.h kismet.dev2/kis_packsources.h
1810 --- kismet.dev/kis_packsources.h 2004-06-09 21:09:29.000000000 +0200
1811 +++ kismet.dev2/kis_packsources.h 2006-04-14 19:31:55.000000000 +0200
1815 #include "packetsource.h"
1816 -#include "prism2source.h"
1817 #include "pcapsource.h"
1818 -#include "wtapfilesource.h"
1819 -#include "wsp100source.h"
1820 -#include "vihasource.h"
1821 #include "dronesource.h"
1822 #include "packetsourcetracker.h"
1824 diff -urN kismet.dev/Makefile.in kismet.dev2/Makefile.in
1825 --- kismet.dev/Makefile.in 2006-04-13 00:49:15.000000000 +0200
1826 +++ kismet.dev2/Makefile.in 2006-04-14 19:31:55.000000000 +0200
1831 -PSO = util.o ringbuf.o configfile.o speech.o ifcontrol.o iwcontrol.o packet.o \
1832 - pcapsource.o prism2source.o wtapfilesource.o wsp100source.o \
1833 - dronesource.o vihasource.o packetsourcetracker.o kis_packsources.o \
1834 - wtapdump.o wtaplocaldump.o gpsdump.o airsnortdump.o fifodump.o \
1836 +PSO = util.o ringbuf.o configfile.o ifcontrol.o iwcontrol.o packet.o \
1837 + pcapsource.o manuf.o \
1838 + dronesource.o packetsourcetracker.o kis_packsources.o \
1839 + wtapdump.o wtaplocaldump.o airsnortdump.o fifodump.o \
1840 packetracker.o timetracker.o alertracker.o finitestate.o \
1842 tcpserver.o server_protocols.o server_globals.o kismet_server.o
1845 DRONEO = util.o ringbuf.o configfile.o getopt.o ifcontrol.o iwcontrol.o packet.o \
1846 - tcpstreamer.o prism2source.o pcapsource.o wtapfilesource.o wsp100source.o \
1847 - dronesource.o vihasource.o packetsourcetracker.o kis_packsources.o \
1848 - timetracker.o gpsd.o server_globals.o kismet_drone.o
1849 + tcpstreamer.o pcapsource.o \
1850 + dronesource.o packetsourcetracker.o kis_packsources.o \
1851 + timetracker.o server_globals.o kismet_drone.o
1852 DRONE = kismet_drone
1854 -NCO = util.o configfile.o speech.o manuf.o tcpclient.o \
1855 +NCO = util.o configfile.o manuf.o tcpclient.o \
1856 frontend.o cursesfront.o \
1857 panelfront.o panelfront_display.o panelfront_input.o \
1858 - gpsd.o getopt.o kismet_client.o
1859 + getopt.o kismet_client.o
1862 GPSLO = getopt.o util.o configfile.o expat.o manuf.o \
1863 diff -urN kismet.dev/packetracker.cc kismet.dev2/packetracker.cc
1864 --- kismet.dev/packetracker.cc 2006-04-01 18:37:07.000000000 +0200
1865 +++ kismet.dev2/packetracker.cc 2006-04-14 19:31:55.000000000 +0200
1866 @@ -2443,23 +2443,3 @@
1870 -// Write a gpsdrive compatable waypoint file
1871 -int Packetracker::WriteGpsdriveWaypt(FILE *in_file) {
1872 - fseek(in_file, 0L, SEEK_SET);
1873 - ftruncate(fileno(in_file), 0);
1875 - // Convert the map to a vector and sort it
1876 - for (map<mac_addr, wireless_network *>::const_iterator i = bssid_map.begin();
1877 - i != bssid_map.end(); ++i) {
1878 - wireless_network *net = i->second;
1881 - lat = (net->min_lat + net->max_lat) / 2;
1882 - lon = (net->min_lon + net->max_lon) / 2;
1883 - fprintf(in_file, "%s\t%f %f\n", waypointformat == 1 ? net->ssid.c_str() : net->bssid.Mac2String().c_str(), lat, lon);
1890 diff -urN kismet.dev/packetracker.h kismet.dev2/packetracker.h
1891 --- kismet.dev/packetracker.h 2005-06-01 05:46:18.000000000 +0200
1892 +++ kismet.dev2/packetracker.h 2006-04-14 19:31:55.000000000 +0200
1899 #include "tracktypes.h"
1902 int WriteXMLNetworks(string in_fname);
1903 int WriteCisco(string in_fname);
1905 - int WriteGpsdriveWaypt(FILE *in_file);
1907 void WriteSSIDMap(FILE *in_file);
1908 void ReadSSIDMap(FILE *in_file);
1910 diff -urN kismet.dev/packetsourcetracker.cc kismet.dev2/packetsourcetracker.cc
1911 --- kismet.dev/packetsourcetracker.cc 2006-04-14 23:43:01.695817542 +0200
1912 +++ kismet.dev2/packetsourcetracker.cc 2006-04-14 19:31:55.000000000 +0200
1914 Packetsourcetracker::Packetsourcetracker() {
1915 next_packsource_id = 0;
1920 sockpair[0] = sockpair[1] = 0;
1923 // Register the trackers with it
1924 meta->capsource->AddTimetracker(timetracker);
1925 - meta->capsource->AddGpstracker(gpsd);
1928 fprintf(stderr, "Source %d (%s): Opening %s source interface %s...\n",
1929 diff -urN kismet.dev/packetsourcetracker.h kismet.dev2/packetsourcetracker.h
1930 --- kismet.dev/packetsourcetracker.h 2005-03-21 20:47:26.000000000 +0100
1931 +++ kismet.dev2/packetsourcetracker.h 2006-04-14 19:31:55.000000000 +0200
1935 #include "timetracker.h"
1937 #include "packetsource.h"
1939 // Sentinel for starting a new packet
1941 // Register a timer event handler for us to use
1942 void AddTimetracker(Timetracker *in_tracker) { timetracker = in_tracker; }
1944 - // Register the GPS server for us to use
1945 - void AddGpstracker(GPSD *in_gpsd) { gpsd = in_gpsd; }
1947 // Register a packet prototype source... Card type string, root binding requirement,
1948 // function to generate an instance of the source, and function to change channel
1949 // for this card type. This fills out the prototype. Sources that don't hop
1952 } chanchild_changepacket;
1955 Timetracker *timetracker;
1958 diff -urN kismet.dev/panelfront.cc kismet.dev2/panelfront.cc
1959 --- kismet.dev/panelfront.cc 2005-06-29 20:04:43.000000000 +0200
1960 +++ kismet.dev2/panelfront.cc 2006-04-14 19:31:55.000000000 +0200
1963 " e List Kismet servers",
1964 " z Toggle fullscreen zoom of network view",
1965 - " m Toggle muting of sound and speech",
1966 " t Tag (or untag) selected network",
1967 " g Group tagged networks",
1968 " u Ungroup current group",
1971 " e List Kismet servers",
1972 " z Toggle fullscreen net list",
1973 - " m Toggle muting",
1974 " t Tag (or untag) selected",
1975 " g Group tagged networks",
1976 " u Ungroup current group",
1977 @@ -237,19 +235,6 @@
1981 -char *KismetHelpGps[] = {
1982 - "KISMET NETWORK FOLLOW",
1983 - "This panel estimates the center of a network, the current",
1984 - "direction of travel, and the direction of the network center",
1985 - "and distance relative to the current direction of movement.",
1987 - " s Follow location of strongest packet",
1988 - " c Follow location of estimated network center",
1994 char *KismetHelpStats[] = {
1995 "KISMET NETWORK STATISTICS",
1996 "This panel displays overall statistics about the wireless",
2000 // Enable all the protocols we handle
2001 - in_client->EnableProtocol("GPS");
2002 in_client->EnableProtocol("INFO");
2003 in_client->EnableProtocol("REMOVE");
2004 in_client->EnableProtocol("NETWORK");
2005 @@ -1282,27 +1266,6 @@
2006 if (con->client == NULL)
2010 - float newlat, newlon, newalt, newspd, newheading;
2012 - con->client->FetchLoc(&newlat, &newlon, &newalt, &newspd, &newheading, &newfix);
2014 - if (GPSD::EarthDistance(newlat, newlon, last_lat, last_lon) > 10) {
2015 - con->last_lat = con->lat;
2016 - con->last_lon = con->lon;
2017 - con->last_spd = con->spd;
2018 - con->last_alt = con->alt;
2019 - con->last_fix = con->fix;
2020 - con->last_heading = con->heading;
2023 - con->lat = newlat;
2024 - con->lon = newlon;
2025 - con->alt = newalt;
2026 - con->spd = newspd;
2027 - con->heading = newheading;
2028 - con->fix = newfix;
2031 con->quality = con->client->FetchQuality();
2032 con->power = con->client->FetchPower();
2033 diff -urN kismet.dev/panelfront_display.cc kismet.dev2/panelfront_display.cc
2034 --- kismet.dev/panelfront_display.cc 2005-08-15 17:52:16.000000000 +0200
2035 +++ kismet.dev2/panelfront_display.cc 2006-04-14 19:31:55.000000000 +0200
2037 mvwaddstr(netwin, netwin->_maxy, netwin->_maxx - 14, ptxt);
2044 if (!(lat == 0 && lon == 0 && alt == 0 && spd == 0 && fix == 0)) {
2045 @@ -1496,51 +1496,6 @@
2046 snprintf(output, print_width, "Networks: %d", (int) details_network->networks.size());
2047 kwin->text.push_back(output);
2049 - if (details_network->virtnet->gps_fixed != -1) {
2050 - if ((details_network->virtnet->min_lat == 90) && (details_network->virtnet->min_lon == 180) &&
2051 - (details_network->virtnet->max_lat == -90) && (details_network->virtnet->max_lon == -180)) {
2052 - snprintf(output, print_width, "Min Loc : N/A");
2053 - kwin->text.push_back(output);
2054 - snprintf(output, print_width, "Max Loc : N/A");
2055 - kwin->text.push_back(output);
2056 - snprintf(output, print_width, "Range : N/A");
2057 - kwin->text.push_back(output);
2060 - snprintf(output, print_width, "Min Loc : Lat %f Lon %f Alt %f Spd %f",
2061 - details_network->virtnet->min_lat, details_network->virtnet->min_lon,
2062 - metric ? details_network->virtnet->min_alt / 3.3 : details_network->virtnet->min_alt,
2063 - metric ? details_network->virtnet->min_spd * 1.6093 : details_network->virtnet->min_spd);
2064 - kwin->text.push_back(output);
2065 - snprintf(output, print_width, "Max Loc : Lat %f Lon %f Alt %f Spd %f",
2066 - details_network->virtnet->max_lat, details_network->virtnet->max_lon,
2067 - metric ? details_network->virtnet->max_alt / 3.3 : details_network->virtnet->max_alt,
2068 - metric ? details_network->virtnet->max_spd * 1.6093 : details_network->virtnet->max_spd);
2069 - kwin->text.push_back(output);
2071 - double diagdist = GPSD::EarthDistance(details_network->virtnet->min_lat,
2072 - details_network->virtnet->min_lon,
2073 - details_network->virtnet->max_lat,
2074 - details_network->virtnet->max_lon);
2076 - if (finite(diagdist)) {
2078 - if (diagdist < 1000)
2079 - snprintf(output, print_width, "Range : %.3f meters", diagdist);
2081 - snprintf(output, print_width, "Range : %.3f kilometers", diagdist / 1000);
2084 - if (diagdist < 5280)
2085 - snprintf(output, print_width, "Range : %.3f feet", diagdist);
2087 - snprintf(output, print_width, "Range : %.3f miles", diagdist / 5280);
2089 - kwin->text.push_back(output);
2094 if (details_network->virtnet->carrier_set & (1 << (int) carrier_80211b)) {
2095 snprintf(output, print_width, "Carrier : IEEE 802.11b");
2096 kwin->text.push_back(output);
2097 @@ -1853,49 +1808,6 @@
2098 dnet->ipdata.range_ip[2], dnet->ipdata.range_ip[3]);
2099 kwin->text.push_back(output);
2102 - if (dnet->gps_fixed != -1) {
2103 - if ((dnet->min_lat == 90) && (dnet->min_lon == 180) &&
2104 - (dnet->max_lat == -90) && (dnet->max_lon == -180)) {
2105 - snprintf(output, print_width, "Min Loc : N/A");
2106 - kwin->text.push_back(output);
2107 - snprintf(output, print_width, "Max Loc : N/A");
2108 - kwin->text.push_back(output);
2109 - snprintf(output, print_width, "Range : N/A");
2110 - kwin->text.push_back(output);
2113 - snprintf(output, print_width, "Min Loc : Lat %f Lon %f Alt %f Spd %f",
2114 - dnet->min_lat, dnet->min_lon,
2115 - metric ? dnet->min_alt / 3.3 : dnet->min_alt,
2116 - metric ? dnet->min_spd * 1.6093 : dnet->min_spd);
2117 - kwin->text.push_back(output);
2118 - snprintf(output, print_width, "Max Loc : Lat %f Lon %f Alt %f Spd %f",
2119 - dnet->max_lat, dnet->max_lon,
2120 - metric ? dnet->max_alt / 3.3 : dnet->max_alt,
2121 - metric ? dnet->max_spd * 1.6093 : dnet->max_spd);
2122 - kwin->text.push_back(output);
2124 - double diagdist = GPSD::EarthDistance(dnet->min_lat, dnet->min_lon,
2125 - dnet->max_lat, dnet->max_lon);
2127 - if (finite(diagdist)) {
2129 - if (diagdist < 1000)
2130 - snprintf(output, print_width, "Range : %f meters", diagdist);
2132 - snprintf(output, print_width, "Range : %f kilometers", diagdist / 1000);
2135 - if (diagdist < 5280)
2136 - snprintf(output, print_width, "Range : %f feet", diagdist);
2138 - snprintf(output, print_width, "Range : %f miles", diagdist / 5280);
2140 - kwin->text.push_back(output);
2146 // Now we just use the text printer to handle the rest for us
2147 @@ -1903,184 +1815,6 @@
2148 return TextPrinter(in_window);
2151 -int PanelFront::GpsPrinter(void *in_window) {
2152 - kis_window *kwin = (kis_window *) in_window;
2154 - char output[1024];
2155 - kwin->text.clear();
2157 - if (details_network == NULL) {
2158 - kwin->text.push_back("The network or group being displayed");
2159 - kwin->text.push_back("has been deleted. Please select a ");
2160 - kwin->text.push_back("different network.");
2161 - return TextPrinter(in_window);
2164 - wireless_network *dnet = details_network->virtnet;
2166 - int print_width = kwin->print_width;
2167 - if (print_width > 1024)
2168 - print_width = 1023;
2170 - if (print_width < 32) {
2171 - kwin->text.push_back("Display not wide enough");
2172 - return TextPrinter(in_window);
2175 - if (dnet->aggregate_points == 0) {
2176 - kwin->text.push_back("No GPS data.");
2177 - return TextPrinter(in_window);
2180 - float center_lat, center_lon;
2182 - // We hijack the "selected" field as a toggle
2183 - if (kwin->selected == 1) {
2184 - center_lat = dnet->best_lat;
2185 - center_lon = dnet->best_lon;
2187 - center_lat = dnet->aggregate_lat / dnet->aggregate_points;
2188 - center_lon = dnet->aggregate_lon / dnet->aggregate_points;
2191 - // Get bearing to the center
2192 - float center_angle = GPSD::CalcHeading(center_lat, center_lon, lat, lon);
2194 - float difference_angle = heading - center_angle;
2195 - if (difference_angle < 0)
2196 - difference_angle += 360;
2198 - double diagdist = GPSD::EarthDistance(lat, lon, center_lat, center_lon);
2200 - // Now we know everything - where we are, where we are headed, where we SHOULD be headed
2201 - // to get to the supposed center of the network, how far it is, and the orientation on our
2202 - // compass to get to it. Time to start drawing our output.
2204 - char compass[5][10];
2205 - memset(compass, 0, sizeof(char) * 5 * 10);
2207 - // | 41.12345x-74.12345 .-|-/ |
2208 - // | Bearing: / |/ \ |
2209 - // | 123.23 degrees | O | |
2211 - // | Estimated center: '---\ |
2214 - // Find the orientation on our compass:
2215 - if (difference_angle > 330 || difference_angle <= 22) {
2216 - snprintf(compass[0], 10, " .-|-. ");
2217 - snprintf(compass[1], 10, " / | \\ ");
2218 - snprintf(compass[2], 10, "| O |");
2219 - snprintf(compass[3], 10, " \\ / ");
2220 - snprintf(compass[4], 10, " '---' ");
2221 - } else if (difference_angle > 22 && difference_angle <= 66) {
2222 - snprintf(compass[0], 10, " .---/ ");
2223 - snprintf(compass[1], 10, " / / \\ ");
2224 - snprintf(compass[2], 10, "| O |");
2225 - snprintf(compass[3], 10, " \\ / ");
2226 - snprintf(compass[4], 10, " '---' ");
2227 - } else if (difference_angle > 66 && difference_angle <= 110) {
2228 - snprintf(compass[0], 10, " .---. ");
2229 - snprintf(compass[1], 10, " / \\ ");
2230 - snprintf(compass[2], 10, "| O----");
2231 - snprintf(compass[3], 10, " \\ / ");
2232 - snprintf(compass[4], 10, " '---' ");
2233 - } else if (difference_angle > 110 && difference_angle <= 154) {
2234 - snprintf(compass[0], 10, " .---. ");
2235 - snprintf(compass[1], 10, " / \\ ");
2236 - snprintf(compass[2], 10, "| O |");
2237 - snprintf(compass[3], 10, " \\ \\ / ");
2238 - snprintf(compass[4], 10, " '---\\ ");
2239 - } else if (difference_angle > 154 && difference_angle <= 198) {
2240 - snprintf(compass[0], 10, " .---. ");
2241 - snprintf(compass[1], 10, " / \\ ");
2242 - snprintf(compass[2], 10, "| O |");
2243 - snprintf(compass[3], 10, " \\ | / ");
2244 - snprintf(compass[4], 10, " '-|-' ");
2245 - } else if (difference_angle > 198 && difference_angle <= 242) {
2246 - snprintf(compass[0], 10, " .---. ");
2247 - snprintf(compass[1], 10, " / \\ ");
2248 - snprintf(compass[2], 10, "| O |");
2249 - snprintf(compass[3], 10, " \\ / / ");
2250 - snprintf(compass[4], 10, " /---' ");
2251 - } else if (difference_angle > 242 && difference_angle <= 286) {
2252 - snprintf(compass[0], 10, " .---. ");
2253 - snprintf(compass[1], 10, " / \\ ");
2254 - snprintf(compass[2], 10, "----O |");
2255 - snprintf(compass[3], 10, " \\ / ");
2256 - snprintf(compass[4], 10, " '---' ");
2257 - } else if (difference_angle > 286 && difference_angle <= 330) {
2258 - snprintf(compass[0], 10, " \\---. ");
2259 - snprintf(compass[1], 10, " / \\ \\ ");
2260 - snprintf(compass[2], 10, "| O |");
2261 - snprintf(compass[3], 10, " \\ / ");
2262 - snprintf(compass[4], 10, " '---' ");
2264 - snprintf(compass[0], 10, "%f\n", difference_angle);
2268 - // - Network GPS ---------------------|
2270 - // | 41.12345x-74.12345 .-|-. |
2271 - // | Bearing: / | \ |
2272 - // | 123.23 degrees | O | |
2274 - // | Estimated center: '---\ |
2275 - // | -73.12345x43.12345 |
2277 - // ------------------------------------
2278 - char textfrag[23];
2280 - snprintf(output, print_width, "Current:");
2281 - kwin->text.push_back(output);
2283 - snprintf(textfrag, 23, "%.3f x %.3f", lat, lon);
2284 - snprintf(output, print_width, "%-22s%s", textfrag, compass[0]);
2285 - kwin->text.push_back(output);
2287 - snprintf(textfrag, 23, " Bearing:");
2288 - snprintf(output, print_width, "%-22s%s", textfrag, compass[1]);
2289 - kwin->text.push_back(output);
2291 - snprintf(textfrag, 23, " %.2f*", heading);
2292 - snprintf(output, print_width, "%-22s%s", textfrag, compass[2]);
2293 - kwin->text.push_back(output);
2295 - snprintf(textfrag, 23, " ");
2296 - snprintf(output, print_width, "%-22s%s", textfrag, compass[3]);
2297 - kwin->text.push_back(output);
2299 - if (kwin->selected == 1)
2300 - snprintf(textfrag, 23, "Strongest signal:");
2302 - snprintf(textfrag, 23, "Estimated Center:");
2303 - snprintf(output, print_width, "%-22s%s", textfrag, compass[4]);
2304 - kwin->text.push_back(output);
2306 - snprintf(textfrag, 23, "%.3f x %.3f", center_lat, center_lon);
2307 - snprintf(output, print_width, "%-22s%.2f*", textfrag, difference_angle);
2308 - kwin->text.push_back(output);
2311 - if (diagdist < 1000)
2312 - snprintf(textfrag, 23, "%.2f m", diagdist);
2314 - snprintf(textfrag, 23, "%.2f km", diagdist / 1000);
2317 - if (diagdist < 5280)
2318 - snprintf(textfrag, 23, "%.2f ft", diagdist);
2320 - snprintf(textfrag, 23, "%.2f mi", diagdist / 5280);
2323 - snprintf(output, print_width, "%-22s%s", "", textfrag);
2324 - kwin->text.push_back(output);
2326 - return TextPrinter(in_window);
2329 int PanelFront::PackPrinter(void *in_window) {
2330 kis_window *kwin = (kis_window *) in_window;
2332 @@ -3049,53 +2783,6 @@
2333 details_client->ipdata.ip[2], details_client->ipdata.ip[3]);
2334 kwin->text.push_back(output);
2336 - if (details_client->gps_fixed != -1) {
2337 - kwin->text.push_back("");
2339 - if ((details_client->min_lat == 90) && (details_client->min_lon == 180) &&
2340 - (details_client->max_lat == -90) && (details_client->max_lon == -180)) {
2341 - snprintf(output, print_width, "Min Loc : N/A");
2342 - kwin->text.push_back(output);
2343 - snprintf(output, print_width, "Max Loc : N/A");
2344 - kwin->text.push_back(output);
2345 - snprintf(output, print_width, "Range : N/A");
2346 - kwin->text.push_back(output);
2349 - snprintf(output, print_width, "Min Loc : Lat %f Lon %f Alt %f Spd %f",
2350 - details_client->min_lat, details_client->min_lon,
2351 - metric ? details_client->min_alt / 3.3 : details_client->min_alt,
2352 - metric ? details_client->min_spd * 1.6093 : details_client->min_spd);
2353 - kwin->text.push_back(output);
2354 - snprintf(output, print_width, "Max Loc : Lat %f Lon %f Alt %f Spd %f",
2355 - details_client->max_lat, details_client->max_lon,
2356 - metric ? details_client->max_alt / 3.3 : details_client->max_alt,
2357 - metric ? details_client->max_spd * 1.6093 : details_client->max_spd);
2358 - kwin->text.push_back(output);
2360 - double diagdist = GPSD::EarthDistance(details_client->min_lat,
2361 - details_client->min_lon,
2362 - details_client->max_lat,
2363 - details_client->max_lon);
2365 - if (finite(diagdist)) {
2367 - if (diagdist < 1000)
2368 - snprintf(output, print_width, "Range : %f meters", diagdist);
2370 - snprintf(output, print_width, "Range : %f kilometers", diagdist / 1000);
2373 - if (diagdist < 5280)
2374 - snprintf(output, print_width, "Range : %f feet", diagdist);
2376 - snprintf(output, print_width, "Range : %f miles", diagdist / 5280);
2378 - kwin->text.push_back(output);
2381 - kwin->text.push_back("");
2384 snprintf(output, print_width, "Packets :");
2385 kwin->text.push_back(output);
2386 diff -urN kismet.dev/panelfront.h kismet.dev2/panelfront.h
2387 --- kismet.dev/panelfront.h 2005-06-29 14:50:09.000000000 +0200
2388 +++ kismet.dev2/panelfront.h 2006-04-14 19:31:55.000000000 +0200
2390 #define SORT_SIZE 10
2391 extern char *KismetHelpPower[];
2392 extern char *KismetHelpRate[];
2393 -extern char *KismetHelpGps[];
2394 extern char *KismetHelpStats[];
2395 extern char *KismetHelpDump[];
2396 extern char *KismetHelpPack[];
2398 int RatePrinter(void *in_window);
2399 int StatsPrinter(void *in_window);
2400 int PackPrinter(void *in_window);
2401 - int GpsPrinter(void *in_window);
2402 int AlertPrinter(void *in_window);
2404 int MainClientPrinter(void *in_window);
2406 int PackInput(void *in_window, int in_chr);
2407 // Help has a generic handler
2408 int TextInput(void *in_window, int in_chr);
2409 - int GpsInput(void *in_window, int in_chr);
2410 int AlertInput(void *in_window, int in_chr);
2412 int MainClientInput(void *in_window, int in_chr);
2413 diff -urN kismet.dev/panelfront_input.cc kismet.dev2/panelfront_input.cc
2414 --- kismet.dev/panelfront_input.cc 2005-06-29 14:50:09.000000000 +0200
2415 +++ kismet.dev2/panelfront_input.cc 2006-04-14 19:31:56.000000000 +0200
2416 @@ -300,16 +300,9 @@
2420 - if (sortby != sort_auto && last_displayed.size() > 0) {
2421 - details_network = last_displayed[kwin->selected];
2422 - SpawnWindow("Network Location", &PanelFront::GpsPrinter, &PanelFront::GpsInput, 8, 34);
2424 - WriteStatus("Cannot view network GPS info in autofit sort mode. Sort by a different method.");
2441 @@ -546,33 +538,6 @@
2445 -int PanelFront::GpsInput(void *in_window, int in_chr) {
2446 - kis_window *kwin = (kis_window *) in_window;
2451 - kwin->selected = 1;
2455 - kwin->selected = 0;
2459 - SpawnHelp(KismetHelpGps);
2472 int PanelFront::RateInput(void *in_window, int in_chr) {
2475 @@ -645,24 +610,6 @@
2479 -void PanelFront::MuteToggle() {
2481 - speech = old_speech;
2482 - sound = old_sound;
2484 - WriteStatus("Restoring sound");
2485 - } else if (sound != 0 || speech != 0) {
2486 - old_speech = speech;
2487 - old_sound = sound;
2491 - WriteStatus("Muting sound");
2492 - } else if (sound == 0 && speech == 0) {
2493 - WriteStatus("Sound not enabled.");
2497 int PanelFront::AlertInput(void *in_window, int in_chr) {
2498 kis_window *kwin = (kis_window *) in_window;
2500 diff -urN kismet.dev/pcapsource.cc kismet.dev2/pcapsource.cc
2501 --- kismet.dev/pcapsource.cc 2006-04-14 23:43:01.697817483 +0200
2502 +++ kismet.dev2/pcapsource.cc 2006-04-14 20:25:06.000000000 +0200
2503 @@ -343,11 +343,6 @@
2504 packet->moddata = moddata;
2505 packet->modified = 0;
2507 - if (gpsd != NULL) {
2508 - gpsd->FetchLoc(&packet->gps_lat, &packet->gps_lon, &packet->gps_alt,
2509 - &packet->gps_spd, &packet->gps_heading, &packet->gps_fix);
2512 if (datalink_type == DLT_PRISM_HEADER) {
2513 ret = Prism2KisPack(packet, data, moddata);
2514 } else if (datalink_type == KDLT_BSD802_11) {
2515 @@ -1157,133 +1152,6 @@
2518 #ifdef HAVE_LINUX_WIRELESS
2519 -// Cisco uses its own config file in /proc to control modes
2520 -int monitor_cisco(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
2521 - FILE *cisco_config;
2522 - char cisco_path[128];
2524 - linux_ifparm *ifparm = (linux_ifparm *) malloc(sizeof(linux_ifparm));
2525 - (*in_if) = ifparm;
2527 - if (Ifconfig_Get_Flags(in_dev, in_err, &ifparm->flags) < 0) {
2531 - if (Iwconfig_Get_SSID(in_dev, in_err, ifparm->essid) < 0)
2534 - if ((ifparm->channel = Iwconfig_Get_Channel(in_dev, in_err)) < 0)
2537 - if (Iwconfig_Get_Mode(in_dev, in_err, &ifparm->mode) < 0)
2540 - if (Ifconfig_Delta_Flags(in_dev, in_err, IFF_UP | IFF_RUNNING | IFF_PROMISC) < 0)
2544 - if (Iwconfig_Set_IntPriv(in_dev, "setRFMonitor", 1, 0, in_err) >= 0) {
2548 - // Zero the ssid - nonfatal
2549 - Iwconfig_Set_SSID(in_dev, in_err, NULL);
2551 - // Build the proc control path
2552 - snprintf(cisco_path, 128, "/proc/driver/aironet/%s/Config", in_dev);
2554 - if ((cisco_config = fopen(cisco_path, "w")) == NULL) {
2555 - snprintf(in_err, STATUS_MAX, "Unable to open cisco control file '%s' %d:%s",
2556 - cisco_path, errno, strerror(errno));
2560 - fprintf(cisco_config, "Mode: r\n");
2561 - fprintf(cisco_config, "Mode: y\n");
2562 - fprintf(cisco_config, "XmitPower: 1\n");
2564 - fclose(cisco_config);
2566 - // Channel can't be set on cisco with these drivers.
2571 -int unmonitor_cisco(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
2572 - linux_ifparm *ifparm = (linux_ifparm *) (*in_if);
2576 - if (Iwconfig_Set_IntPriv(in_dev, "setRFMonitor", 0, 0, in_err) >= 0) {
2577 - // If we're the new drivers, unmonitor
2578 - if (Ifconfig_Set_Flags(in_dev, in_err, ifparm->flags) < 0) {
2582 - // Reset the SSID since monitor mode nukes it
2583 - if (Iwconfig_Set_SSID(in_dev, in_err, ifparm->essid) < 0)
2586 - if (ifparm->channel > 0) {
2587 - if (Iwconfig_Set_Channel(in_dev, ifparm->channel, in_err) < 0)
2599 -// Cisco uses its own config file in /proc to control modes
2601 -// I was doing this with ioctls but that seems to cause lockups while
2602 -// this method doesn't. I don't think I like these drivers.
2603 -int monitor_cisco_wifix(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
2604 - FILE *cisco_config;
2605 - char cisco_path[128];
2606 - vector<string> devbits = StrTokenize(in_dev, ":");
2608 - if (devbits.size() < 2) {
2609 - snprintf(in_err, STATUS_MAX, "Invalid device pair '%s'. Proper device "
2610 - "for cisco_wifix is eth?:wifi?.", in_dev);
2614 - // Bring the device up, zero its ip, and set promisc
2615 - if (Ifconfig_Delta_Flags(devbits[0].c_str(), in_err,
2616 - IFF_UP | IFF_RUNNING | IFF_PROMISC) < 0)
2618 - if (Ifconfig_Delta_Flags(devbits[1].c_str(), in_err,
2619 - IFF_UP | IFF_RUNNING | IFF_PROMISC) < 0)
2622 - // Zero the ssid, nonfatally
2623 - Iwconfig_Set_SSID(devbits[0].c_str(), in_err, NULL);
2624 - Iwconfig_Set_SSID(devbits[1].c_str(), in_err, NULL);
2626 - // Build the proc control path
2627 - snprintf(cisco_path, 128, "/proc/driver/aironet/%s/Config", devbits[0].c_str());
2629 - if ((cisco_config = fopen(cisco_path, "w")) == NULL) {
2630 - snprintf(in_err, STATUS_MAX, "Unable to open cisco control file '%s' %d:%s",
2631 - cisco_path, errno, strerror(errno));
2635 - fprintf(cisco_config, "Mode: r\n");
2636 - fprintf(cisco_config, "Mode: y\n");
2637 - fprintf(cisco_config, "XmitPower: 1\n");
2639 - fclose(cisco_config);
2641 - // Channel can't be set on cisco with these drivers.
2646 // Hostap uses iwpriv and iwcontrol settings to control monitor mode
2647 int monitor_hostap(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
2649 @@ -1433,132 +1301,6 @@
2653 -// Acx100 uses the packhdr iwpriv control to set link state, rest is normal
2654 -int monitor_acx100(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
2657 - // Allocate a tracking record for the interface settings and remember our
2659 - linux_ifparm *ifparm = (linux_ifparm *) malloc(sizeof(linux_ifparm));
2660 - (*in_if) = ifparm;
2662 - if (Ifconfig_Get_Flags(in_dev, in_err, &ifparm->flags) < 0) {
2666 - if (Iwconfig_Get_SSID(in_dev, in_err, ifparm->essid) < 0)
2669 - if ((ifparm->channel = Iwconfig_Get_Channel(in_dev, in_err)) < 0)
2672 - if (Iwconfig_Get_Mode(in_dev, in_err, &ifparm->mode) < 0)
2675 - // it looks like an orinoco now, apparently
2676 - if ((ret = Iwconfig_Set_IntPriv(in_dev, "monitor", 1, initch, in_err)) < 0) {
2678 - snprintf(in_err, 1024, "Could not find 'monitor' private ioctl "
2679 - "Make sure you have the latest ACX100 development release.");
2683 - if (chancontrol_wext(in_dev, initch, in_err, NULL) < 0)
2689 -int unmonitor_acx100(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
2690 - // Restore the IP settings
2691 - linux_ifparm *ifparm = (linux_ifparm *) (*in_if);
2693 - if (Ifconfig_Set_Flags(in_dev, in_err, ifparm->flags) < 0) {
2697 - Iwconfig_Set_IntPriv(in_dev, "monitor", 0, ifparm->channel, in_err);
2698 - Iwconfig_Set_Mode(in_dev, in_err, ifparm->mode);
2700 - if (Iwconfig_Set_SSID(in_dev, in_err, ifparm->essid) < 0)
2708 -int monitor_admtek(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
2709 - // Allocate a tracking record for the interface settings and remember our
2711 - linux_ifparm *ifparm = (linux_ifparm *) malloc(sizeof(linux_ifparm));
2712 - (*in_if) = ifparm;
2714 - // Try to figure out the name so we know if we have fcs bytes or not
2715 - char iwname[IFNAMSIZ+1];
2716 - if (Iwconfig_Get_Name(in_dev, in_err, iwname) < 0)
2719 - if (strncmp(iwname, "IEEE 802.11b", IFNAMSIZ) == 0) {
2720 - // Looks like the GPL driver, we need to adjust the fcsbytes
2721 - PcapSource *psrc = (PcapSource *) in_ext;
2722 - psrc->fcsbytes = 4;
2725 - if (Ifconfig_Get_Flags(in_dev, in_err, &ifparm->flags) < 0) {
2729 - if ((ifparm->flags & IFF_UP)) {
2730 - if ((ifparm->channel = Iwconfig_Get_Channel(in_dev, in_err)) < 0)
2733 - if (Iwconfig_Get_Mode(in_dev, in_err, &ifparm->mode) < 0)
2736 - if (Iwconfig_Get_SSID(in_dev, in_err, ifparm->essid) < 0)
2740 - ifparm->channel = -1;
2741 - ifparm->mode = -1;
2744 - int ret = monitor_wext(in_dev, initch, in_err, in_if, in_ext);
2746 - if (ret < 0 && ret != -2)
2749 - if (Iwconfig_Set_SSID(in_dev, in_err, "") < 0)
2755 -int unmonitor_admtek(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
2756 - linux_ifparm *ifparm = (linux_ifparm *) (*in_if);
2758 - if (unmonitor_wext(in_dev, initch, in_err, in_if, in_ext))
2761 - if (Iwconfig_Set_SSID(in_dev, in_err, ifparm->essid) < 0)
2766 -// vtar5k iwpriv control to set link state, rest is normal
2767 -int monitor_vtar5k(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
2768 - // Set the prism iwpriv control to 1
2769 - if (Iwconfig_Set_IntPriv(in_dev, "prism", 1, 0, in_err) < 0) {
2773 - // The rest is standard wireless extensions
2774 - if (monitor_wext(in_dev, initch, in_err, in_if, in_ext) < 0)
2780 /* Madwifi NG ioctls from net80211 */
2781 #define SIOC80211IFCREATE (SIOCDEVPRIVATE+7)
2782 @@ -1927,249 +1669,6 @@
2783 return unmonitor_wext(in_dev, initch, in_err, in_if, in_ext);
2786 -int monitor_ipw2100(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
2787 - // Allocate a tracking record for the interface settings and remember our
2789 - linux_ifparm *ifparm = (linux_ifparm *) malloc(sizeof(linux_ifparm));
2790 - (*in_if) = ifparm;
2792 - if (Ifconfig_Get_Flags(in_dev, in_err, &ifparm->flags) < 0) {
2796 - if ((ifparm->channel = Iwconfig_Get_Channel(in_dev, in_err)) < 0)
2799 - if (Iwconfig_Get_Mode(in_dev, in_err, &ifparm->mode) < 0)
2802 - // Call the normal monitor mode
2803 - return (monitor_wext(in_dev, initch, in_err, in_if, in_ext));
2806 -int unmonitor_ipw2100(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
2807 - // Restore initial monitor header
2808 - // linux_ifparm *ifparm = (linux_ifparm *) (*in_if);
2810 - linux_ifparm *ifparm = (linux_ifparm *) (*in_if);
2812 - if (Ifconfig_Set_Flags(in_dev, in_err, ifparm->flags) < 0) {
2816 - if (Iwconfig_Set_Mode(in_dev, in_err, ifparm->mode) < 0)
2824 -int monitor_ipw2200(const char *in_dev, int initch, char *in_err,
2825 - void **in_if, void *in_ext) {
2826 - // Allocate a tracking record for the interface settings and remember our
2828 - linux_ifparm *ifparm = (linux_ifparm *) malloc(sizeof(linux_ifparm));
2829 - (*in_if) = ifparm;
2831 - if (Ifconfig_Get_Flags(in_dev, in_err, &ifparm->flags) < 0) {
2835 - if ((ifparm->channel = Iwconfig_Get_Channel(in_dev, in_err)) < 0)
2838 - if (Iwconfig_Get_Mode(in_dev, in_err, &ifparm->mode) < 0)
2841 - // Call the normal monitor mode
2842 - return (monitor_wext(in_dev, initch, in_err, in_if, in_ext));
2845 -int unmonitor_ipw2200(const char *in_dev, int initch, char *in_err,
2846 - void **in_if, void *in_ext) {
2847 - // Restore initial monitor header
2848 - // linux_ifparm *ifparm = (linux_ifparm *) (*in_if);
2850 - linux_ifparm *ifparm = (linux_ifparm *) (*in_if);
2852 - if (Ifconfig_Set_Flags(in_dev, in_err, ifparm->flags) < 0) {
2856 - if (Iwconfig_Set_Mode(in_dev, in_err, ifparm->mode) < 0)
2859 - // James says this wants to be set to channel 0 for proper scanning operation
2860 - if (Iwconfig_Set_Channel(in_dev, 0, in_err) < 0)
2868 -// (Unless we learn different) the 3945 in full rfmon acts the same as
2869 -// an ipw2200, so we'll use the same control mechanisms
2870 -int monitor_ipw3945(const char *in_dev, int initch, char *in_err,
2871 - void **in_if, void *in_ext) {
2872 - // Allocate a tracking record for the interface settings and remember our
2874 - linux_ifparm *ifparm = (linux_ifparm *) malloc(sizeof(linux_ifparm));
2875 - (*in_if) = ifparm;
2877 - if (Ifconfig_Get_Flags(in_dev, in_err, &ifparm->flags) < 0) {
2881 - if ((ifparm->channel = Iwconfig_Get_Channel(in_dev, in_err)) < 0)
2884 - if (Iwconfig_Get_Mode(in_dev, in_err, &ifparm->mode) < 0)
2887 - // Call the normal monitor mode
2888 - return (monitor_wext(in_dev, initch, in_err, in_if, in_ext));
2891 -int unmonitor_ipw3945(const char *in_dev, int initch, char *in_err,
2892 - void **in_if, void *in_ext) {
2893 - // Restore initial monitor header
2894 - // linux_ifparm *ifparm = (linux_ifparm *) (*in_if);
2896 - linux_ifparm *ifparm = (linux_ifparm *) (*in_if);
2898 - if (Ifconfig_Set_Flags(in_dev, in_err, ifparm->flags) < 0) {
2902 - if (Iwconfig_Set_Mode(in_dev, in_err, ifparm->mode) < 0)
2905 - // James says this wants to be set to channel 0 for proper scanning operation
2906 - if (Iwconfig_Set_Channel(in_dev, 0, in_err) < 0)
2914 -// The 3945 in "parasite" mode (until James names it) is a different
2915 -// beast entirely. It uses a dynamically added tap interface to give us
2916 -// realtime rtap formatted frames off the interface, so we need to
2917 -// turn it on via sysfs and then push the new rtapX interface into the source
2918 -// before the open happens
2919 -int monitor_ipwlivetap(const char *in_dev, int initch, char *in_err,
2920 - void **in_if, void *in_ext) {
2921 - // We don't try to remember settings because we aren't going to do
2922 - // anything with them, we're leeching off a dynamic interface made
2927 - short int ifflags;
2929 - // Try to get the flags off the master interface
2930 - if (Ifconfig_Get_Flags(in_dev, in_err, &ifflags) < 0) {
2934 - // If the master interface isn't even up, blow up.
2935 - if ((ifflags & IFF_UP) == 0) {
2936 - snprintf(in_err, 1024, "The ipw control interface (%s) is not "
2937 - "configured as 'up'. The ipwlivetap mode reports "
2938 - "traffic from a currently running interface. For pure "
2939 - "rfmon monitor mode, use ipwXXXX instead.", in_dev);
2943 - // Use the .../net/foo/device symlink into the .../bus/pci/drivers/
2944 - // ipw3945/foo/ pci bus interface
2945 - snprintf(path, 1024, "/sys/class/net/%s/device/rtap_iface",
2948 - // Open it in RO mode first and get the current state. I'm not sure
2949 - // how well frewind works on a dynamic system file so we'll just
2950 - // close it off and re-open it when we go to set modes, if we need
2952 - if ((sysf = fopen(path, "r")) == NULL) {
2953 - snprintf(in_err, 1024, "Failed to open ipw sysfs tap control file, "
2954 - "check that the version of the ipw drivers you are running "
2955 - "is recent enough, and that your system has sysfs properly "
2960 - fgets(dynif, 32, sysf);
2962 - // We're done with the RO
2965 - // If it's -1, we aren't turned on and we need to.
2966 - if (strncmp(dynif, "-1", 32) == 0) {
2967 - if ((sysf = fopen(path, "w")) == NULL) {
2968 - snprintf(in_err, 1024, "Failed to open the ipw sysfs tap control "
2969 - "file for writing (%s). Check that Kismet has the proper "
2970 - "privilege levels and that you are running a version of the "
2971 - "ipw drivers which supports associated rfmon.", strerror(errno));
2975 - fprintf(sysf, "1\n");
2978 - // Reopen it again for reading for the last time, and get the
2979 - // interface we changed to. Do some minor error checking to make
2980 - // sure the new interface isn't called -1, 0, or 1, which I'm going
2981 - // to guess would imply an older driver
2982 - if ((sysf = fopen(path, "r")) == NULL) {
2983 - snprintf(in_err, 1024, "Failed to open the ipw sysfs tap "
2984 - "control to find the interface allocated. Something strange "
2985 - "has happened, because the control file was available "
2986 - "previously for setting. Check your system messages.");
2990 - fgets(dynif, 32, sysf);
2994 - // Wait for the distro to settle if its going to rename an interface
2998 - // Sanity check the interface we were told to use. A 0, 1, -1 probably
2999 - // means a bad driver version.
3000 - if (strncmp(dynif, "-1", 32) == 0 || strncmp(dynif, "0", 32) == 0 ||
3001 - strncmp(dynif, "1", 32) == 0) {
3002 - snprintf(in_err, 1024, "Got a nonsense interface from the ipw "
3003 - "sysfs tap control file. This probably means your ipw "
3004 - "drivers are out of date, or that there is something strange "
3005 - "happening in the drivers. Check your system messages.");
3009 - // Now that we've gone through that nonsense, make sure the
3010 - // dynamic rtap interface is up
3011 - if (Ifconfig_Delta_Flags(dynif, in_err, IFF_UP | IFF_RUNNING | IFF_PROMISC) < 0)
3014 - // And push the config into the packetsoure
3015 - ((KisPacketSource *) in_ext)->SetInterface(dynif);
3020 -int unmonitor_ipwlivetap(const char *in_dev, int initch, char *in_err,
3021 - void **in_if, void *in_ext) {
3022 - // Actually there isn't anything to do here. Right now, I don't
3023 - // think I care if we leave the parasite rtap interface hanging around.
3024 - // Newcore might do this better, but this isn't newcore.
3029 // "standard" wireless extension monitor mode
3030 int monitor_wext(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
3032 @@ -2231,108 +1730,6 @@
3036 -// wlan-ng modern standard
3037 -int monitor_wlanng(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
3038 - // I really didn't want to do this...
3039 - char cmdline[2048];
3041 - // Sanitize the device just to be safe. The ifconfig should fail if
3042 - // the device is invalid, but why take risks
3043 - for (unsigned int x = 0; x < strlen(in_dev); x++) {
3044 - if (!isalnum(in_dev[x])) {
3045 - snprintf(in_err, STATUS_MAX, "Invalid device '%s'", in_dev);
3050 - if (Ifconfig_Delta_Flags(in_dev, in_err, IFF_UP | IFF_RUNNING | IFF_PROMISC) < 0)
3053 - // Enable the interface
3054 - snprintf(cmdline, 2048, "wlanctl-ng %s lnxreq_ifstate ifstate=enable >/dev/null 2>/dev/null", in_dev);
3055 - if (RunSysCmd(cmdline) < 0) {
3056 - snprintf(in_err, 1024, "Unable to execute '%s'", cmdline);
3061 - snprintf(cmdline, 2048, "wlanctl-ng %s dot11req_mibset "
3062 - "mibattribute=dot11PrivacyInvoked=false >/dev/null 2>/dev/null", in_dev);
3063 - if (RunSysCmd(cmdline) < 0) {
3064 - snprintf(in_err, 1024, "Unable to execute '%s'", cmdline);
3068 - // Don't exclude packets
3069 - snprintf(cmdline, 2048, "wlanctl-ng %s dot11req_mibset "
3070 - "mibattribute=dot11ExcludeUnencrypted=false >/dev/null 2>/dev/null", in_dev);
3071 - if (RunSysCmd(cmdline) < 0) {
3072 - snprintf(in_err, 1024, "Unable to execute '%s'", cmdline);
3076 - // Turn on rfmon on the initial channel
3077 - snprintf(cmdline, 2048, "wlanctl-ng %s lnxreq_wlansniff channel=%d "
3078 - "enable=true prismheader=true >/dev/null 2>/dev/null", in_dev, initch);
3079 - if (RunSysCmd(cmdline) < 0) {
3080 - snprintf(in_err, 1024, "Unable to execute '%s'", cmdline);
3088 -int monitor_wlanng_avs(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
3089 - // I really didn't want to do this...
3090 - char cmdline[2048];
3092 - // Sanitize the device just to be safe. The ifconfig should fail if
3093 - // the device is invalid, but why take risks
3094 - for (unsigned int x = 0; x < strlen(in_dev); x++) {
3095 - if (!isalnum(in_dev[x])) {
3096 - snprintf(in_err, STATUS_MAX, "Invalid device '%s'", in_dev);
3101 - if (Ifconfig_Delta_Flags(in_dev, in_err, IFF_UP | IFF_RUNNING | IFF_PROMISC) < 0)
3104 - // Enable the interface
3105 - snprintf(cmdline, 2048, "wlanctl-ng %s lnxreq_ifstate ifstate=enable >/dev/null 2>/dev/null", in_dev);
3106 - if (RunSysCmd(cmdline) < 0) {
3107 - snprintf(in_err, 1024, "Unable to execute '%s'", cmdline);
3112 - snprintf(cmdline, 2048, "wlanctl-ng %s dot11req_mibset "
3113 - "mibattribute=dot11PrivacyInvoked=false >/dev/null 2>/dev/null", in_dev);
3114 - if (RunSysCmd(cmdline) < 0) {
3115 - snprintf(in_err, 1024, "Unable to execute '%s'", cmdline);
3119 - // Don't exclude packets
3120 - snprintf(cmdline, 2048, "wlanctl-ng %s dot11req_mibset "
3121 - "mibattribute=dot11ExcludeUnencrypted=false >/dev/null 2>/dev/null", in_dev);
3122 - if (RunSysCmd(cmdline) < 0) {
3123 - snprintf(in_err, 1024, "Unable to execute '%s'", cmdline);
3127 - // Turn on rfmon on the initial channel
3128 - snprintf(cmdline, 2048, "wlanctl-ng %s lnxreq_wlansniff channel=%d prismheader=false "
3129 - "wlanheader=true stripfcs=false keepwepflags=false enable=true >/dev/null 2>/dev/null", in_dev, initch);
3130 - if (RunSysCmd(cmdline) < 0) {
3131 - snprintf(in_err, 1024, "Unable to execute '%s'", cmdline);
3138 int monitor_wrt54g(const char *in_dev, int initch, char *in_err, void **in_if,
3141 @@ -2342,7 +1739,7 @@
3142 snprintf(in_err, 1024, "Unable to set mode using 'iwpriv %s set_monitor 1'. "
3143 "Some custom firmware images require you to specify the origial "
3144 "device and a new dynamic device and use the iwconfig controls. "
3145 - "see the README for how to configure your capture source.");
3146 + "see the README for how to configure your capture source.", in_dev);
3150 @@ -2359,7 +1756,7 @@
3151 snprintf(in_err, 1024, "Unable to set mode using 'iwpriv %s set_monitor 0'. "
3152 "Some custom firmware images require you to specify the origial "
3153 "device and a new dynamic device and use the iwconfig controls. "
3154 - "see the README for how to configure your capture source.");
3155 + "see the README for how to configure your capture source.", in_dev);
3159 @@ -2607,75 +2004,6 @@
3163 -int chancontrol_ipw2100(const char *in_dev, int in_ch, char *in_err, void *in_ext) {
3164 - // Introduce a slight delay to let the driver settle, a la orinoco. I don't
3165 - // like doing this at all since it introduces hiccups into the channel control
3166 - // process, but....
3170 - ret = chancontrol_wext(in_dev, in_ch, in_err, in_ext);
3176 -int chancontrol_ipw2200(const char *in_dev, int in_ch, char *in_err, void *in_ext) {
3177 - // Lets see if this really needs the channel change delay like the 2100 did
3180 - ret = chancontrol_wext(in_dev, in_ch, in_err, in_ext);
3181 - // Drop a tiny sleep in here to let the channel set settle, otherwise we
3182 - // run the risk of the card freaking out
3191 -int chancontrol_wlanng(const char *in_dev, int in_ch, char *in_err, void *in_ext) {
3192 - // I really didn't want to do this...
3193 - char cmdline[2048];
3195 - // Turn on rfmon on the initial channel
3196 - snprintf(cmdline, 2048, "wlanctl-ng %s lnxreq_wlansniff channel=%d enable=true "
3197 - "prismheader=true >/dev/null 2>&1", in_dev, in_ch);
3198 - if (RunSysCmd(cmdline) < 0) {
3199 - snprintf(in_err, 1024, "Unable to execute '%s'", cmdline);
3203 - if (in_ext != NULL) {
3204 - PcapSourceWlanng *src = (PcapSourceWlanng *) in_ext;
3205 - src->last_channel = in_ch;
3211 -int chancontrol_wlanng_avs(const char *in_dev, int in_ch, char *in_err, void *in_ext) {
3212 - // I really didn't want to do this...
3213 - char cmdline[2048];
3215 - // Turn on rfmon on the initial channel
3216 - snprintf(cmdline, 2048, "wlanctl-ng %s lnxreq_wlansniff channel=%d "
3217 - "prismheader=false wlanheader=true stripfcs=false keepwepflags=false "
3218 - "enable=true >/dev/null 2>&1", in_dev, in_ch);
3220 - if (RunSysCmd(cmdline) < 0) {
3221 - snprintf(in_err, 1024, "Unable to execute '%s'", cmdline);
3225 - if (in_ext != NULL) {
3226 - PcapSourceWlanng *src = (PcapSourceWlanng *) in_ext;
3227 - src->last_channel = in_ch;
3235 diff -urN kismet.dev/tcpstreamer.cc kismet.dev2/tcpstreamer.cc
3236 --- kismet.dev/tcpstreamer.cc 2005-05-26 16:51:45.000000000 +0200
3237 +++ kismet.dev2/tcpstreamer.cc 2006-04-14 19:31:56.000000000 +0200
3246 TcpStreamer::~TcpStreamer()
3247 @@ -287,10 +285,6 @@
3248 hdr.frame_len = (uint32_t) htonl(sizeof(struct stream_version_packet));
3250 vpkt.drone_version = (uint16_t) htons(STREAM_DRONE_VERSION);
3252 - vpkt.gps_enabled = 1;
3254 - vpkt.gps_enabled = 0;
3256 if (!FD_ISSET(in_fd, &client_fds))
3258 diff -urN kismet.dev/tcpstreamer.h kismet.dev2/tcpstreamer.h
3259 --- kismet.dev/tcpstreamer.h 2005-05-26 16:51:45.000000000 +0200
3260 +++ kismet.dev2/tcpstreamer.h 2006-04-14 19:31:56.000000000 +0200
3262 #include "ringbuf.h"
3264 #include "packetstream.h"
3267 // Global in kismet_drone.cc
3271 int FetchDescriptor() { return serv_fd; }
3273 - // Register the GPS server for us to use
3274 - void AddGpstracker(GPSD *in_gpsd) { gpsd = in_gpsd; }
3276 void Kill(int in_fd);
3278 int Poll(fd_set& in_rset, fd_set& in_wset);
3282 unsigned int max_fd;