if (sscanf(ptr, "*NETWORK: %s %d %d %d %d", bssid, &crypted, &weak, &signal, &noise) != 5) {
printf("Couldn't parse NETWORK packet\n");
} else {
- if (strcmp(bssid, "00:0D:54:A0:27:7F") == 0) {
+ if (strcmp(bssid, "00:18:39:0A:97:C9") == 0) {
+ //if (strcmp(bssid, "00:13:10:1F:2A:1C") == 0) {
static int last_crypted = 0;
char str1[64], str2[64], str3[64], str4[64], str5[64], str6[64];
short len;
for (i = 0; i < bytes_read; ++i)
printf("0x%02x ", buf[i]);
printf("]\n");
+
+ // don't bother with any sophisticated parsing
+ while (bytes_read > 4) {
+ int command = (buf[0] << 8) | buf[1];
+ int len = (buf[2] << 8) | buf[3];
+
+ // menu item
+ if (command == 3) {
+ int no = (buf[4] << 8) | buf[5];
+ if (no == 5) {
+ system("killall kismet_client");
+ exit(0);
+ }
+ }
+
+ memmove(buf, buf + len + 4, bytes_read - (len + 4));
+ bytes_read -= len + 4;
+ }
}
// read from kismet