Only in kismet-2004-10-R1-modified-v2/conf: kismet.conf Only in kismet-2004-10-R1-modified-v2/conf: kismet_ui.conf Only in kismet-2004-10-R1-modified-v2: config.h Only in kismet-2004-10-R1-modified-v2: config.log Only in kismet-2004-10-R1-modified-v2: config.status Only in kismet-2004-10-R1-modified-v2: .depend diff -ru kismet-2004-10-R1/dronesource.cc kismet-2004-10-R1-modified-v2/dronesource.cc --- kismet-2004-10-R1/dronesource.cc 2004-10-25 21:11:36.000000000 +0200 +++ kismet-2004-10-R1-modified-v2/dronesource.cc 2005-06-20 11:30:07.000000000 +0200 @@ -229,6 +229,14 @@ } stream_recv_bytes += ret; + + //modified by DD @ INRIA + + //printf("reading something"); + + // end of modifications + + // Leave if we aren't done if ((stream_recv_bytes - offset) < sizeof(struct stream_packet_header)) return 0; @@ -325,7 +333,18 @@ packet->ts.tv_sec = (uint64_t) kis_ntoh64(phdr.tv_sec); packet->ts.tv_usec = (uint64_t) kis_ntoh64(phdr.tv_usec); packet->quality = (uint16_t) ntohs(phdr.quality); +//modified by DD @ INRIA + packet->signal = (uint16_t) ntohs(phdr.signal); + +//end of modifications + + //modified by DD @ INRIA + + //printf("packet->signal %d",packet->signal); + + // end of modifications + packet->noise = (uint16_t) ntohs(phdr.noise); packet->channel = phdr.channel; packet->carrier = (carrier_type) phdr.carrier; @@ -333,6 +352,12 @@ packet->encoding = (encoding_type) phdr.encoding; packet->datarate = (uint32_t) ntohl(phdr.datarate); + //modified by DD @ INRIA + + //printf("packet->noise %d",packet->noise); + + // end of modifications + packet->gps_lat = Pair2Float((int16_t) ntohs(phdr.gps_lat), (int64_t) kis_ntoh64(phdr.gps_lat_mant)); packet->gps_lon = Pair2Float((int16_t) ntohs(phdr.gps_lon), Only in kismet-2004-10-R1-modified-v2: dronesource.cc~ Only in kismet-2004-10-R1-modified-v2/extra/buzzme: Makefile Only in kismet-2004-10-R1-modified-v2/extra: Makefile diff -ru kismet-2004-10-R1/kismet_drone.cc kismet-2004-10-R1-modified-v2/kismet_drone.cc --- kismet-2004-10-R1/kismet_drone.cc 2004-10-25 21:11:36.000000000 +0200 +++ kismet-2004-10-R1-modified-v2/kismet_drone.cc 2005-06-28 11:18:45.000000000 +0200 @@ -156,6 +156,8 @@ char gpshost[1024]; int gpsport = -1; #endif + + char ap_mac[40]=""; int channel_hop = -1; int channel_velocity = 1; @@ -386,11 +388,31 @@ } } + // Update GPS coordinates and handle signal loss if defined timetracker.RegisterTimer(SERVER_TIMESLICES_SEC, NULL, 1, &GpsEvent, NULL); #endif +// modified by DD @ INRIA + + + if (conf->FetchOpt("APMAC") != "") + { + strcpy(ap_mac,conf->FetchOpt("APMAC").c_str()); + fprintf(stderr,"Using Reference Mac Address: %s \n",conf->FetchOpt("APMAC").c_str()); + + } +//exit(1); + + +// end of modifications + + + + + + // Register the gps and timetracker with the sourcetracker sourcetracker.AddGpstracker(gps); sourcetracker.AddTimetracker(&timetracker); @@ -750,8 +772,113 @@ // len = psrc->FetchPacket(&packet, data, moddata); ret = packet_sources[src]->FetchPacket(&packet, data, moddata); - + + +// modified by DD @ INRIA +// for debugging purposes + +// printf("packet.datarate=%d\n",packet.datarate); + +//end of modifications + + if (ret > 0) { + +/* added code for time syncronization */ +/* DD @ INRIA */ + + static packet_info info; + // dummy variables just to call GetPacketInfo. Not used. + macmap bssid_wep_map; + unsigned char wep_identity[256]; + uint64_t timestamp_beacon; + //struct timeval packet_timestamp; + uint64_t packet_timestamp_oneblock; + static int64_t packet_timestamp_difference=0,packet_timestamp_current; + timeval temp_timestamp; + // Initialize the identity field + for (unsigned int wi = 0; wi < 256; wi++) + wep_identity[wi] = wi; + + GetPacketInfo(&packet, &info, &bssid_wep_map, wep_identity); + + //identify a beacon + // important: we are not checking if the packet is corrupt + // we must identify the beacon sender ap. + // idea: put it in the config file afterwards + // now it will be hardcoded for testing reasons + + //packet_timestamp_oneblock=info.timestamp; + + /* packet_timestamp_oneblock=((uint64_t)(info.ts.tv_sec))<<32+ + ((uint64_t)(info.ts.tv_usec)); */ + + packet_timestamp_oneblock=((uint64_t)(info.ts.tv_sec))*1000000+ + ((uint64_t)(info.ts.tv_usec)); + //fprintf(stderr,"Timestamp_oneblock high:%lx, low:%lx \n",(info.ts.tv_sec) ,(info.ts.tv_usec)); + + //debug show-changes + + //fprintf(stderr,"Timestamp_original: %llu \n",packet_timestamp_oneblock); + + + //fprintf(stderr,"Caught a packet"); + if (info.type==packet_management && + info.subtype==packet_sub_beacon && + //info.bssid_mac==mac_addr("00:02:2D:09:66:21")){ + info.bssid_mac==mac_addr(ap_mac)){ + // debugging + // fprintf(stderr,"Caught a beacon"); + + timestamp_beacon=info.timestamp; + // debugging + //temp_timestamp.tv_sec=(long)(timestamp_beacon>>32); + //temp_timestamp.tv_usec=(long)(timestamp_beacon & 0xFFFFFFFF); + temp_timestamp.tv_sec=(long)(timestamp_beacon/1000000); + temp_timestamp.tv_usec=(long)(timestamp_beacon%1000000); + //fprintf(stderr,"Timestamp low:%lu \n",((unsigned long)(timestamp_beacon & 0xFFFFFFFF))); + //fprintf(stderr,"Timestamp high:%lu, low:%lu \n",(temp_timestamp.tv_sec),(temp_timestamp.tv_usec)); + + + //debug show-changes + + //fprintf(stderr,"Timestamp beacon:%llu \n",timestamp_beacon); + + + + // build one block to compute difference - deprecated + /* packet_timestamp_oneblock=((uint64_t)(packet_timestamp.tv_sec))<<32+ + ((uint64_t)(packet_timestamp.tv_usec)); + */ + // compute difference + packet_timestamp_difference=timestamp_beacon-packet_timestamp_oneblock; + // add diference + packet_timestamp_current=timestamp_beacon; + //fprintf(stderr,"Timestamp diff low:%lu \n",((unsigned long)(packet_timestamp_difference & 0xFFFFFFFF))); + //fprintf(stderr,"Timestamp curr high:%lu, low:%lu \n",(temp_timestamp.tv_sec),(temp_timestamp.tv_usec)); + } + else { + // any other kind of packet + // add diference + packet_timestamp_current=packet_timestamp_oneblock+packet_timestamp_difference; + } + // load packet with sincronized timestamp + //info.ts.tv_sec=(long)(packet_timestamp_current>>32); + //info.ts.tv_usec=(long)(packet_timestamp_current && 0xFFFF); + + //info.ts.tv_sec=(long)(packet_timestamp_current/1000000); + //info.ts.tv_usec=(long)(packet_timestamp_current%1000000); + + packet.ts.tv_sec=(long)(packet_timestamp_current/1000000); + packet.ts.tv_usec=(long)(packet_timestamp_current%1000000); + + //debug show-changes + + //fprintf(stderr,"Timestamp_current:%llu \n",packet_timestamp_current); + //fprintf(stderr,"Timestamp curr high:%lu, low:%lu \n",(packet.ts.tv_sec),(packet.ts.tv_usec)); +/* end of added code */ + + if (streamer.WritePacket(&packet) < 0) { fprintf(stderr, "FATAL: Error writing packet to streamer: %s\n", streamer.FetchError()); Only in kismet-2004-10-R1-modified-v2: kismet_drone.cc~ diff -ru kismet-2004-10-R1/kismet_server.cc kismet-2004-10-R1-modified-v2/kismet_server.cc --- kismet-2004-10-R1/kismet_server.cc 2004-10-25 21:11:36.000000000 +0200 +++ kismet-2004-10-R1-modified-v2/kismet_server.cc 2005-06-28 11:28:29.000000000 +0200 @@ -2873,6 +2873,11 @@ GetPacketInfo(&packet, &info, &bssid_wep_map, wep_identity); +// modified by DD @ INRIA + //fprintf(stderr,"%s \n",moddata); + //printf("time high: %ld time low: %ld \n",info.ts.tv_sec,info.ts.tv_usec); + +// end of modifications last_info = info; // Discard it if we're filtering it at the tracker level Only in kismet-2004-10-R1-modified-v2: kismet_server.cc~ Only in kismet-2004-10-R1-modified-v2/libpcap-0.8.3: bpf_filter.c Only in kismet-2004-10-R1-modified-v2/libpcap-0.8.3: config.h Only in kismet-2004-10-R1-modified-v2/libpcap-0.8.3: config.log Only in kismet-2004-10-R1-modified-v2/libpcap-0.8.3: config.status Only in kismet-2004-10-R1-modified-v2/libpcap-0.8.3: Makefile Only in kismet-2004-10-R1-modified-v2/libpcap-0.8.3: net Only in kismet-2004-10-R1-modified-v2: Makefile diff -ru kismet-2004-10-R1/packet.cc kismet-2004-10-R1-modified-v2/packet.cc --- kismet-2004-10-R1/packet.cc 2004-10-25 21:13:23.000000000 +0200 +++ kismet-2004-10-R1-modified-v2/packet.cc 2005-06-28 11:21:32.000000000 +0200 @@ -209,7 +209,16 @@ ret_packinfo->ts.tv_usec = packet->ts.tv_usec; // Copy the signal values ret_packinfo->quality = packet->quality; - ret_packinfo->signal = packet->signal; + +// Modified by DD @ INRIA + + //ret_packinfo->signal = packet->signal; + // test the offset + ret_packinfo->signal = packet->signal/*+1000*/; + //printf("signal value:%d",ret_packinfo->signal); + +// end of modifications + ret_packinfo->noise = packet->noise; // Assign the carrier, encoding, and data rates @@ -217,6 +226,14 @@ ret_packinfo->encoding = packet->encoding; ret_packinfo->datarate = packet->datarate; +// modified by DD@Inria +// for denbugging purposes + + //printf("datarate:%d\n",packet->datarate); + +// end of modifications + + // Assign the location info ret_packinfo->gps_lat = packet->gps_lat; ret_packinfo->gps_lon = packet->gps_lon; @@ -246,6 +263,18 @@ return; } + + // modified DD @ INRIA + + //ret_packinfo->retry=(((unsigned int) (packet->data[0]))<<8)+(((unsigned int) (packet->data[1]))&& 0x00FF); // && 0x0020 o && 0x0800 ? + ret_packinfo->retry=fc->retry; + + //for throughput calculations + + ret_packinfo->fullsize=packet->caplen+4; //fcs in wifi is 4 bytes. + + // end of modifications + // Endian swap the 2 byte duration from a pointer memcpy(&duration, &packet->data[2], 2); duration = kis_ntoh16(duration); Only in kismet-2004-10-R1-modified-v2: packet.cc~ diff -ru kismet-2004-10-R1/packet.h kismet-2004-10-R1-modified-v2/packet.h --- kismet-2004-10-R1/packet.h 2004-10-25 21:11:36.000000000 +0200 +++ kismet-2004-10-R1-modified-v2/packet.h 2005-04-28 11:53:22.000000000 +0200 @@ -105,6 +105,7 @@ float gps_heading; int gps_fix; packet_parm parm; // Parameters from the packet source that trickle down + } kis_packet; #ifdef WORDS_BIGENDIAN @@ -504,6 +505,20 @@ // ICV and key number uint32_t ivset; + + // added by DD @ INRIA + // for statistical measurements + unsigned int retry; + // end of modifications + + // added by DD @ INRIA + // for statistical measurements + unsigned int fullsize; + // end of modifications + + + + } packet_info; typedef struct { diff -ru kismet-2004-10-R1/packetracker.cc kismet-2004-10-R1-modified-v2/packetracker.cc --- kismet-2004-10-R1/packetracker.cc 2004-10-25 21:11:36.000000000 +0200 +++ kismet-2004-10-R1-modified-v2/packetracker.cc 2005-06-16 12:52:54.000000000 +0200 @@ -420,6 +420,12 @@ if (info.source_mac == net->bssid) net->last_sequence = info.sequence_number; + //modified by DD @ INRIA + + net->signal = info.signal; + + //end of modifications + if (info.noise != 0 && info.signal != 0) { net->signal = info.signal; @@ -815,6 +821,8 @@ client->gps_fixed = 0; } + + if (info.quality >= 0 && info.signal >= 0) { client->quality = info.quality; if (info.quality > client->best_quality) @@ -841,6 +849,16 @@ client->maxrate = info.maxrate; } + // modified by DD @ INRIA + + client->maxrate = info.maxrate; + client->signal = info.signal; + //printf("client->signal %d",info.signal); + + // end of modifications + + + client->last_time = time(0); client->last_sequence = info.sequence_number; diff -ru kismet-2004-10-R1/pcapsource.cc kismet-2004-10-R1-modified-v2/pcapsource.cc --- kismet-2004-10-R1/pcapsource.cc 2004-10-25 21:11:36.000000000 +0200 +++ kismet-2004-10-R1-modified-v2/pcapsource.cc 2005-06-28 11:24:40.000000000 +0200 @@ -376,6 +376,12 @@ packet->encoding = (encoding_type) ntohl(v1hdr->encoding); packet->datarate = (int) ntohl(v1hdr->datarate); + +// modified by DD @ INRIA +// printf("datarate%d\n",packet->datarate); +// for debugging purposes +// end of modifications + } // See if we have a prism2 header @@ -398,11 +404,26 @@ callback_offset = sizeof(wlan_ng_prism2_header); // packet->quality = p2head->sq.data; - packet->signal = p2head->signal.data; + +// modified by DD @ INRIA +// we need sign on the power value + + packet->signal = (int) p2head->signal.data; + //printf("signal:%d\n",(int)p2head->signal.data); + +// end of modifications + packet->noise = p2head->noise.data; packet->channel = p2head->channel.data; +// modified by DD @ INRIA + + packet->datarate = p2head->rate.data; +// printf("signal:%ld\n",p2head->signal.data); + +// end of modifications + } if (header_found == 0) { Only in kismet-2004-10-R1-modified-v2: pcapsource.cc~ diff -ru kismet-2004-10-R1/prism2source.cc kismet-2004-10-R1-modified-v2/prism2source.cc --- kismet-2004-10-R1/prism2source.cc 2004-10-25 21:11:36.000000000 +0200 +++ kismet-2004-10-R1-modified-v2/prism2source.cc 2005-06-08 11:44:00.000000000 +0200 @@ -166,6 +166,13 @@ packet->carrier = carrier_80211b; +//modified by DD @ INRIA + + packet->datarate = sniff_info->rate.data; + printf("datarate:%d\n",sniff_info->rate.data); + +// end of modifications + return 1; } Only in kismet-2004-10-R1-modified-v2/scripts: kismet diff -ru kismet-2004-10-R1/server_protocols.cc kismet-2004-10-R1-modified-v2/server_protocols.cc --- kismet-2004-10-R1/server_protocols.cc 2004-10-25 21:11:36.000000000 +0200 +++ kismet-2004-10-R1-modified-v2/server_protocols.cc 2005-06-28 11:39:23.000000000 +0200 @@ -38,15 +38,27 @@ NULL }; + +// modified to enable access to packet microseconds +/* DD @ INRIA */ + +// added "timeusec" as data to return to the client +// added "signal" as data to return to the client +// added "retry" as data to return to the client +// added "datarate" as data to return to the client + char *PACKET_fields_text[] = { - "type", "subtype", "timesec", "encrypted", + "type", "subtype", "timesec", "timeusec", "encrypted", "weak", "beaconrate", "sourcemac", "destmac", "bssid", "ssid", "prototype", "sourceip", "destip", "sourceport", "destport", "nbtype", - "nbsource", "sourcename", + "nbsource", "sourcename","signal","retry","fullsize","datarate", NULL }; + +// end of modified section + char *STRING_fields_text[] = { "bssid", "sourcemac", "text", NULL @@ -615,12 +627,26 @@ snprintf(tmpstr, 128, "%2.1f", cli->maxrate); data->cdvec.push_back(tmpstr); +// modified by DD @ INRIA +// add the metric parameter to compy with tcpclient.cc + + snprintf(tmpstr, 128, "%d", 0); + data->cdvec.push_back(tmpstr); + +// end of modifications + snprintf(tmpstr, 128, "%d", cli->quality); data->cdvec.push_back(tmpstr); snprintf(tmpstr, 128, "%d", cli->signal); data->cdvec.push_back(tmpstr); +// modified by DD @ INRIA + +// printf("cli->signal= %d",cli->signal); + +//end of modifications + snprintf(tmpstr, 128, "%d", cli->noise); data->cdvec.push_back(tmpstr); @@ -741,6 +767,14 @@ snprintf(tmpstr, 128, "%d", (int) info->ts.tv_sec); data->pdvec.push_back(tmpstr); +//added to enable the microseconds to the client +/* DD @ INRIA */ + + snprintf(tmpstr, 128, "%d", (int) info->ts.tv_usec); + data->pdvec.push_back(tmpstr); + +// end of modification + snprintf(tmpstr, 128, "%d", info->encrypted); data->pdvec.push_back(tmpstr); @@ -787,6 +821,51 @@ snprintf(tmpstr, 128, "\001%s\001", strlen(info->sourcename) == 0 ? " " : info->sourcename); data->pdvec.push_back(tmpstr); + + //added to enable the signal to the client +/* DD @ INRIA */ + + snprintf(tmpstr, 128, "%d", (int) info->signal); + data->pdvec.push_back(tmpstr); + +// printf("signal %d\n",info->signal); + +// end of modification + +//added to enable the retry bit to the client +/* DD @ INRIA */ + + snprintf(tmpstr, 128, "%d", (int) info->retry); + data->pdvec.push_back(tmpstr); + + //printf("retry %d\n",info->retry); + +// end of modification + +//added to enable the retry bit to the client +/* DD @ INRIA */ + + snprintf(tmpstr, 128, "%d", (int) info->fullsize); + data->pdvec.push_back(tmpstr); + + //printf("fullsize %d\n",info->fullsize); + +// end of modification + +//added to enable the datarate info to the client +/* DD @ INRIA */ + + snprintf(tmpstr, 128, "%d", (int) info->datarate); + data->pdvec.push_back(tmpstr); + + //printf("datarate %d\n",info->datarate); + +// end of modification + + + + + } Only in kismet-2004-10-R1-modified-v2: server_protocols.cc~ diff -ru kismet-2004-10-R1/tcpserver.cc kismet-2004-10-R1-modified-v2/tcpserver.cc --- kismet-2004-10-R1/tcpserver.cc 2004-10-25 21:11:36.000000000 +0200 +++ kismet-2004-10-R1-modified-v2/tcpserver.cc 2005-04-19 11:42:59.000000000 +0200 @@ -314,6 +314,11 @@ char *outtext = new char[nlen]; snprintf(outtext, nlen, "*%s: %s\n", prot->header.c_str(), fieldtext.c_str()); RawSend(in_fd, outtext); + +// modified by DD @ INRIA +// printf("\n\n line sent: %s\n",outtext); + +// end of modifications delete[] outtext; return nlen; diff -ru kismet-2004-10-R1/tcpstreamer.cc kismet-2004-10-R1-modified-v2/tcpstreamer.cc --- kismet-2004-10-R1/tcpstreamer.cc 2004-10-25 21:11:36.000000000 +0200 +++ kismet-2004-10-R1-modified-v2/tcpstreamer.cc 2005-06-17 06:57:36.000000000 +0200 @@ -346,7 +346,13 @@ packhdr.tv_sec = (uint64_t) kis_hton64(in_packet->ts.tv_sec); packhdr.tv_usec = (uint64_t) kis_hton64(in_packet->ts.tv_usec); packhdr.quality = (uint16_t) htons(in_packet->quality); + +// modified by DD @ INRIA + + //packhdr.signal = (uint16_t) htons(in_packet->signal); packhdr.signal = (uint16_t) htons(in_packet->signal); + +// end of modifications packhdr.noise = (uint16_t) htons(in_packet->noise); packhdr.error = in_packet->error; packhdr.channel = in_packet->channel;