mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-12-21 12:49:32 +02:00
348 lines
12 KiB
Diff
348 lines
12 KiB
Diff
|
diff -urN kismet-2005-04-R1.old/kismet_drone.cc kismet-2005-04-R1.dev/kismet_drone.cc
|
||
|
--- kismet-2005-04-R1.old/kismet_drone.cc 2005-04-03 07:33:42.000000000 +0200
|
||
|
+++ kismet-2005-04-R1.dev/kismet_drone.cc 2005-04-27 17:10:22.000000000 +0200
|
||
|
@@ -32,11 +32,8 @@
|
||
|
#include "packet.h"
|
||
|
|
||
|
#include "packetsource.h"
|
||
|
-#include "prism2source.h"
|
||
|
#include "pcapsource.h"
|
||
|
#include "wtapfilesource.h"
|
||
|
-#include "wsp100source.h"
|
||
|
-#include "vihasource.h"
|
||
|
#include "dronesource.h"
|
||
|
#include "packetsourcetracker.h"
|
||
|
#include "kis_packsources.h"
|
||
|
diff -urN kismet-2005-04-R1.old/kismet_server.cc kismet-2005-04-R1.dev/kismet_server.cc
|
||
|
--- kismet-2005-04-R1.old/kismet_server.cc 2005-04-03 07:33:42.000000000 +0200
|
||
|
+++ kismet-2005-04-R1.dev/kismet_server.cc 2005-04-27 17:10:35.000000000 +0200
|
||
|
@@ -37,11 +37,8 @@
|
||
|
#include "packet.h"
|
||
|
|
||
|
#include "packetsource.h"
|
||
|
-#include "prism2source.h"
|
||
|
#include "pcapsource.h"
|
||
|
#include "wtapfilesource.h"
|
||
|
-#include "wsp100source.h"
|
||
|
-#include "vihasource.h"
|
||
|
#include "dronesource.h"
|
||
|
#include "packetsourcetracker.h"
|
||
|
#include "kis_packsources.h"
|
||
|
diff -urN kismet-2005-04-R1.old/kis_packsources.cc kismet-2005-04-R1.dev/kis_packsources.cc
|
||
|
--- kismet-2005-04-R1.old/kis_packsources.cc 2005-04-03 07:33:42.000000000 +0200
|
||
|
+++ kismet-2005-04-R1.dev/kis_packsources.cc 2005-04-27 17:11:22.000000000 +0200
|
||
|
@@ -58,15 +58,10 @@
|
||
|
REG_EMPTY_CARD(sourcetracker, "pcapfile");
|
||
|
#endif
|
||
|
|
||
|
+ REG_EMPTY_CARD(sourcetracker, "cisco");
|
||
|
+ REG_EMPTY_CARD(sourcetracker, "cisco_wifix");
|
||
|
#if defined(HAVE_LIBPCAP) && defined(HAVE_LINUX_WIRELESS)
|
||
|
// Linux wext-driven cards
|
||
|
- sourcetracker->RegisterPacketsource("cisco", 1, "IEEE80211b", 6,
|
||
|
- pcapsource_wext_registrant,
|
||
|
- monitor_cisco, unmonitor_cisco,
|
||
|
- chancontrol_wext, 1);
|
||
|
- sourcetracker->RegisterPacketsource("cisco_wifix", 1, "IEEE80211b", 6,
|
||
|
- pcapsource_ciscowifix_registrant,
|
||
|
- monitor_cisco_wifix, NULL, NULL, 1);
|
||
|
sourcetracker->RegisterPacketsource("hostap", 1, "IEEE80211b", 6,
|
||
|
pcapsource_wext_registrant,
|
||
|
monitor_hostap, unmonitor_hostap,
|
||
|
@@ -142,8 +137,6 @@
|
||
|
|
||
|
#else
|
||
|
// Register the linuxwireless pcap stuff as null
|
||
|
- REG_EMPTY_CARD(sourcetracker, "cisco");
|
||
|
- REG_EMPTY_CARD(sourcetracker, "cisco_wifix");
|
||
|
REG_EMPTY_CARD(sourcetracker, "hostap");
|
||
|
REG_EMPTY_CARD(sourcetracker, "orinoco");
|
||
|
REG_EMPTY_CARD(sourcetracker, "acx100");
|
||
|
@@ -179,14 +172,7 @@
|
||
|
REG_EMPTY_CARD(sourcetracker, "wrt54g");
|
||
|
#endif
|
||
|
|
||
|
-#if defined(SYS_LINUX) && defined(HAVE_LINUX_NETLINK)
|
||
|
- sourcetracker->RegisterPacketsource("wlanng_legacy", 1, "IEEE80211b", 6,
|
||
|
- prism2source_registrant,
|
||
|
- monitor_wlanng_legacy, NULL,
|
||
|
- chancontrol_wlanng_legacy, 1);
|
||
|
-#else
|
||
|
REG_EMPTY_CARD(sourcetracker, "wlanng_legacy");
|
||
|
-#endif
|
||
|
|
||
|
#if defined(HAVE_LIBPCAP) && defined(SYS_OPENBSD)
|
||
|
sourcetracker->RegisterPacketsource("cisco_openbsd", 1, "IEEE80211b", 6,
|
||
|
@@ -228,21 +214,8 @@
|
||
|
REG_EMPTY_CARD(sourcetracker, "wtapfile");
|
||
|
#endif
|
||
|
|
||
|
-#if defined(HAVE_WSP100)
|
||
|
- sourcetracker->RegisterPacketsource("wsp100", 0, "IEEE80211b", 6,
|
||
|
- wsp100source_registrant,
|
||
|
- monitor_wsp100, NULL, chancontrol_wsp100, 0);
|
||
|
-#else
|
||
|
REG_EMPTY_CARD(sourcetracker, "wsp100");
|
||
|
-#endif
|
||
|
-
|
||
|
-#if defined(HAVE_VIHAHEADERS)
|
||
|
- sourcetracker->RegisterPacketsource("viha", 1, "IEEE80211b", 6,
|
||
|
- vihasource_registrant,
|
||
|
- NULL, NULL, chancontrol_viha, 0);
|
||
|
-#else
|
||
|
REG_EMPTY_CARD(sourcetracker, "viha");
|
||
|
-#endif
|
||
|
|
||
|
return 1;
|
||
|
}
|
||
|
diff -urN kismet-2005-04-R1.old/kis_packsources.h kismet-2005-04-R1.dev/kis_packsources.h
|
||
|
--- kismet-2005-04-R1.old/kis_packsources.h 2005-04-03 07:33:42.000000000 +0200
|
||
|
+++ kismet-2005-04-R1.dev/kis_packsources.h 2005-04-27 17:10:43.000000000 +0200
|
||
|
@@ -22,11 +22,8 @@
|
||
|
#include "config.h"
|
||
|
|
||
|
#include "packetsource.h"
|
||
|
-#include "prism2source.h"
|
||
|
#include "pcapsource.h"
|
||
|
#include "wtapfilesource.h"
|
||
|
-#include "wsp100source.h"
|
||
|
-#include "vihasource.h"
|
||
|
#include "dronesource.h"
|
||
|
#include "packetsourcetracker.h"
|
||
|
|
||
|
diff -urN kismet-2005-04-R1.old/Makefile.in kismet-2005-04-R1.dev/Makefile.in
|
||
|
--- kismet-2005-04-R1.old/Makefile.in 2005-04-03 07:33:42.000000000 +0200
|
||
|
+++ kismet-2005-04-R1.dev/Makefile.in 2005-04-27 17:10:09.000000000 +0200
|
||
|
@@ -40,8 +40,8 @@
|
||
|
|
||
|
# Objects
|
||
|
PSO = util.o ringbuf.o configfile.o speech.o ifcontrol.o iwcontrol.o packet.o \
|
||
|
- pcapsource.o prism2source.o wtapfilesource.o wsp100source.o \
|
||
|
- dronesource.o vihasource.o packetsourcetracker.o kis_packsources.o \
|
||
|
+ pcapsource.o wtapfilesource.o \
|
||
|
+ dronesource.o packetsourcetracker.o kis_packsources.o \
|
||
|
wtapdump.o wtaplocaldump.o gpsdump.o airsnortdump.o fifodump.o \
|
||
|
gpsd.o manuf.o \
|
||
|
packetracker.o timetracker.o alertracker.o finitestate.o \
|
||
|
@@ -50,8 +50,8 @@
|
||
|
PS = kismet_server
|
||
|
|
||
|
DRONEO = util.o ringbuf.o configfile.o getopt.o ifcontrol.o iwcontrol.o packet.o \
|
||
|
- tcpstreamer.o prism2source.o pcapsource.o wtapfilesource.o wsp100source.o \
|
||
|
- dronesource.o vihasource.o packetsourcetracker.o kis_packsources.o \
|
||
|
+ tcpstreamer.o pcapsource.o wtapfilesource.o \
|
||
|
+ dronesource.o packetsourcetracker.o kis_packsources.o \
|
||
|
timetracker.o gpsd.o server_globals.o kismet_drone.o
|
||
|
DRONE = kismet_drone
|
||
|
|
||
|
diff -urN kismet-2005-04-R1.old/pcapsource.cc kismet-2005-04-R1.dev/pcapsource.cc
|
||
|
--- kismet-2005-04-R1.old/pcapsource.cc 2005-04-03 07:33:42.000000000 +0200
|
||
|
+++ kismet-2005-04-R1.dev/pcapsource.cc 2005-04-27 16:58:10.000000000 +0200
|
||
|
@@ -282,8 +282,6 @@
|
||
|
|
||
|
if (datalink_type == DLT_PRISM_HEADER) {
|
||
|
ret = Prism2KisPack(packet, data, moddata);
|
||
|
- } else if (datalink_type == KDLT_BSD802_11) {
|
||
|
- ret = BSD2KisPack(packet, data, moddata);
|
||
|
#ifdef HAVE_RADIOTAP
|
||
|
} else if (datalink_type == DLT_IEEE802_11_RADIO) {
|
||
|
ret = Radiotap2KisPack(packet, data, moddata);
|
||
|
@@ -418,46 +416,6 @@
|
||
|
|
||
|
}
|
||
|
|
||
|
-int PcapSource::BSD2KisPack(kis_packet *packet, uint8_t *data, uint8_t *moddata) {
|
||
|
- int callback_offset = 0;
|
||
|
-
|
||
|
- // Process our hacked in BSD type
|
||
|
- if (callback_header.caplen < sizeof(bsd_80211_header)) {
|
||
|
- snprintf(errstr, 1024, "pcap bsd converter saw undersized capture frame for bsd header.");
|
||
|
- packet->len = 0;
|
||
|
- packet->caplen = 0;
|
||
|
- return 0;
|
||
|
- }
|
||
|
-
|
||
|
- packet->caplen = kismin(callback_header.caplen - sizeof(bsd_80211_header),
|
||
|
- (uint32_t) MAX_PACKET_LEN);
|
||
|
- packet->len = packet->caplen;
|
||
|
-
|
||
|
- bsd_80211_header *bsdhead = (bsd_80211_header *) callback_data;
|
||
|
-
|
||
|
- packet->signal = bsdhead->wi_signal;
|
||
|
- packet->noise = bsdhead->wi_silence;
|
||
|
-
|
||
|
- // Set our offset
|
||
|
- callback_offset = sizeof(bsd_80211_header);
|
||
|
- memcpy(packet->data, callback_data + callback_offset, 24);
|
||
|
-
|
||
|
- // Adjust for driver appended headers
|
||
|
- if (packet->data[0] > 0x08) {
|
||
|
- packet->len -= 22;
|
||
|
- packet->caplen -= 22;
|
||
|
- memcpy(packet->data + 24, callback_data + callback_offset + 46,
|
||
|
- packet->caplen - 2);
|
||
|
- } else {
|
||
|
- packet->len -= 30;
|
||
|
- packet->caplen -= 30;
|
||
|
- memcpy(packet->data + 24, callback_data + callback_offset + 46,
|
||
|
- packet->caplen - 2);
|
||
|
- }
|
||
|
-
|
||
|
- return 1;
|
||
|
-}
|
||
|
-
|
||
|
#ifdef HAVE_RADIOTAP
|
||
|
/*
|
||
|
* Convert MHz frequency to IEEE channel number.
|
||
|
@@ -949,17 +907,6 @@
|
||
|
return new PcapSourceWextFCS(in_name, in_device);
|
||
|
}
|
||
|
|
||
|
-KisPacketSource *pcapsource_ciscowifix_registrant(string in_name, string in_device, char *in_err) {
|
||
|
- vector<string> devbits = StrTokenize(in_device, ":");
|
||
|
-
|
||
|
- if (devbits.size() < 2) {
|
||
|
- snprintf(in_err, STATUS_MAX, "Invalid device pair '%s'", in_device.c_str());
|
||
|
- return NULL;
|
||
|
- }
|
||
|
-
|
||
|
- return new PcapSourceWext(in_name, devbits[1]);
|
||
|
-}
|
||
|
-
|
||
|
KisPacketSource *pcapsource_11g_registrant(string in_name, string in_device,
|
||
|
char *in_err) {
|
||
|
return new PcapSource11G(in_name, in_device);
|
||
|
@@ -1004,132 +951,6 @@
|
||
|
|
||
|
// Monitor commands
|
||
|
#ifdef HAVE_LINUX_WIRELESS
|
||
|
-// Cisco uses its own config file in /proc to control modes
|
||
|
-int monitor_cisco(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
|
||
|
- FILE *cisco_config;
|
||
|
- char cisco_path[128];
|
||
|
-
|
||
|
- linux_ifparm *ifparm = (linux_ifparm *) malloc(sizeof(linux_ifparm));
|
||
|
- (*in_if) = ifparm;
|
||
|
-
|
||
|
- if (Ifconfig_Get_Flags(in_dev, in_err, &ifparm->flags) < 0) {
|
||
|
- return -1;
|
||
|
- }
|
||
|
-
|
||
|
- if (Iwconfig_Get_SSID(in_dev, in_err, ifparm->essid) < 0)
|
||
|
- return -1;
|
||
|
-
|
||
|
- if ((ifparm->channel = Iwconfig_Get_Channel(in_dev, in_err)) < 0)
|
||
|
- return -1;
|
||
|
-
|
||
|
- if (Iwconfig_Get_Mode(in_dev, in_err, &ifparm->mode) < 0)
|
||
|
- return -1;
|
||
|
-
|
||
|
- if (Ifconfig_Delta_Flags(in_dev, in_err, IFF_UP | IFF_RUNNING | IFF_PROMISC) < 0)
|
||
|
- return -1;
|
||
|
-
|
||
|
- // Try the iwpriv
|
||
|
- if (Iwconfig_Set_IntPriv(in_dev, "setRFMonitor", 1, 0, in_err) >= 0) {
|
||
|
- return 0;
|
||
|
- }
|
||
|
-
|
||
|
- // Zero the ssid - nonfatal
|
||
|
- Iwconfig_Set_SSID(in_dev, in_err, NULL);
|
||
|
-
|
||
|
- // Build the proc control path
|
||
|
- snprintf(cisco_path, 128, "/proc/driver/aironet/%s/Config", in_dev);
|
||
|
-
|
||
|
- if ((cisco_config = fopen(cisco_path, "w")) == NULL) {
|
||
|
- snprintf(in_err, STATUS_MAX, "Unable to open cisco control file '%s' %d:%s",
|
||
|
- cisco_path, errno, strerror(errno));
|
||
|
- return -1;
|
||
|
- }
|
||
|
-
|
||
|
- fprintf(cisco_config, "Mode: r\n");
|
||
|
- fprintf(cisco_config, "Mode: y\n");
|
||
|
- fprintf(cisco_config, "XmitPower: 1\n");
|
||
|
-
|
||
|
- fclose(cisco_config);
|
||
|
-
|
||
|
- // Channel can't be set on cisco with these drivers.
|
||
|
-
|
||
|
- return 0;
|
||
|
-}
|
||
|
-
|
||
|
-int unmonitor_cisco(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
|
||
|
- linux_ifparm *ifparm = (linux_ifparm *) (*in_if);
|
||
|
- int ret = -1;
|
||
|
-
|
||
|
- // Try the iwpriv
|
||
|
- if (Iwconfig_Set_IntPriv(in_dev, "setRFMonitor", 0, 0, in_err) >= 0) {
|
||
|
- // If we're the new drivers, unmonitor
|
||
|
- if (Ifconfig_Set_Flags(in_dev, in_err, ifparm->flags) < 0) {
|
||
|
- return -1;
|
||
|
- }
|
||
|
-
|
||
|
- // Reset the SSID since monitor mode nukes it
|
||
|
- if (Iwconfig_Set_SSID(in_dev, in_err, ifparm->essid) < 0)
|
||
|
- return -1;
|
||
|
-
|
||
|
- if (ifparm->channel > 0) {
|
||
|
- if (Iwconfig_Set_Channel(in_dev, ifparm->channel, in_err) < 0)
|
||
|
- return -1;
|
||
|
- }
|
||
|
-
|
||
|
- ret = 1;
|
||
|
- }
|
||
|
-
|
||
|
- free(ifparm);
|
||
|
-
|
||
|
- return ret;
|
||
|
-}
|
||
|
-
|
||
|
-// Cisco uses its own config file in /proc to control modes
|
||
|
-//
|
||
|
-// I was doing this with ioctls but that seems to cause lockups while
|
||
|
-// this method doesn't. I don't think I like these drivers.
|
||
|
-int monitor_cisco_wifix(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
|
||
|
- FILE *cisco_config;
|
||
|
- char cisco_path[128];
|
||
|
- vector<string> devbits = StrTokenize(in_dev, ":");
|
||
|
-
|
||
|
- if (devbits.size() < 2) {
|
||
|
- snprintf(in_err, STATUS_MAX, "Invalid device pair '%s'", in_dev);
|
||
|
- return -1;
|
||
|
- }
|
||
|
-
|
||
|
- // Bring the device up, zero its ip, and set promisc
|
||
|
- if (Ifconfig_Delta_Flags(devbits[0].c_str(), in_err,
|
||
|
- IFF_UP | IFF_RUNNING | IFF_PROMISC) < 0)
|
||
|
- return -1;
|
||
|
- if (Ifconfig_Delta_Flags(devbits[1].c_str(), in_err,
|
||
|
- IFF_UP | IFF_RUNNING | IFF_PROMISC) < 0)
|
||
|
- return -1;
|
||
|
-
|
||
|
- // Zero the ssid, nonfatally
|
||
|
- Iwconfig_Set_SSID(devbits[0].c_str(), in_err, NULL);
|
||
|
- Iwconfig_Set_SSID(devbits[1].c_str(), in_err, NULL);
|
||
|
-
|
||
|
- // Build the proc control path
|
||
|
- snprintf(cisco_path, 128, "/proc/driver/aironet/%s/Config", devbits[0].c_str());
|
||
|
-
|
||
|
- if ((cisco_config = fopen(cisco_path, "w")) == NULL) {
|
||
|
- snprintf(in_err, STATUS_MAX, "Unable to open cisco control file '%s' %d:%s",
|
||
|
- cisco_path, errno, strerror(errno));
|
||
|
- return -1;
|
||
|
- }
|
||
|
-
|
||
|
- fprintf(cisco_config, "Mode: r\n");
|
||
|
- fprintf(cisco_config, "Mode: y\n");
|
||
|
- fprintf(cisco_config, "XmitPower: 1\n");
|
||
|
-
|
||
|
- fclose(cisco_config);
|
||
|
-
|
||
|
- // Channel can't be set on cisco with these drivers.
|
||
|
-
|
||
|
- return 0;
|
||
|
-}
|
||
|
-
|
||
|
// Hostap uses iwpriv and iwcontrol settings to control monitor mode
|
||
|
int monitor_hostap(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
|
||
|
int ret;
|