mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-11-26 06:34:05 +02:00
add default kismet client configuration and remove some unnecessary packet sources
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@735 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
1d2a72e342
commit
1d6ffef18f
@ -81,6 +81,7 @@ $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared
|
|||||||
--sbindir=/usr/sbin \
|
--sbindir=/usr/sbin \
|
||||||
--sysconfdir=/etc \
|
--sysconfdir=/etc \
|
||||||
--enable-syspcap=yes \
|
--enable-syspcap=yes \
|
||||||
|
--disable-wsp100 \
|
||||||
$(DISABLE_NLS) \
|
$(DISABLE_NLS) \
|
||||||
$(DISABLE_LARGEFILE) \
|
$(DISABLE_LARGEFILE) \
|
||||||
);
|
);
|
||||||
@ -124,6 +125,7 @@ $(IPKG_CLIENT): $(PKG_BUILD_DIR)/kismet_client
|
|||||||
$(SCRIPT_DIR)/make-ipkg-dir.sh $(IDIR_CLIENT) kismet-client.control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
|
$(SCRIPT_DIR)/make-ipkg-dir.sh $(IDIR_CLIENT) kismet-client.control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
|
||||||
mkdir -p $(IDIR_CLIENT)/etc
|
mkdir -p $(IDIR_CLIENT)/etc
|
||||||
cp ./files/kismet.conf $(IDIR_CLIENT)/etc/
|
cp ./files/kismet.conf $(IDIR_CLIENT)/etc/
|
||||||
|
cp ./files/kismet_ui.conf $(IDIR_CLIENT)/etc/
|
||||||
echo '/etc/kismet.conf' > $(IDIR_CLIENT)/CONTROL/conffiles
|
echo '/etc/kismet.conf' > $(IDIR_CLIENT)/CONTROL/conffiles
|
||||||
mkdir -p $(IDIR_CLIENT)/usr/sbin
|
mkdir -p $(IDIR_CLIENT)/usr/sbin
|
||||||
cp $< $(IDIR_CLIENT)/usr/sbin/
|
cp $< $(IDIR_CLIENT)/usr/sbin/
|
||||||
|
104
openwrt/package/kismet/files/kismet_ui.conf
Normal file
104
openwrt/package/kismet/files/kismet_ui.conf
Normal file
@ -0,0 +1,104 @@
|
|||||||
|
# Kismet GUI config file
|
||||||
|
|
||||||
|
# Version of Kismet config
|
||||||
|
version=2004.10.R1
|
||||||
|
|
||||||
|
# Do we show the intro window?
|
||||||
|
showintro=true
|
||||||
|
|
||||||
|
# Gui type to use
|
||||||
|
# Valid types: curses, panel
|
||||||
|
gui=panel
|
||||||
|
# Server to connect to (host:port)
|
||||||
|
host=localhost:2501
|
||||||
|
# Network traffic decay (active/recent/inactive) and packet click rate - increase
|
||||||
|
# this if you are doing prism2 channel hopping.
|
||||||
|
decay=3
|
||||||
|
# What columns do we display? Comma seperated. Read the documentation for what
|
||||||
|
# columns are valid.
|
||||||
|
columns=decay,name,type,wep,channel,packets,flags,ip,size
|
||||||
|
# What columns do we display for clients? Comma seperated.
|
||||||
|
clientcolumns=decay,type,mac,manuf,data,crypt,size,ip,signal,quality,noise
|
||||||
|
# Does the GUI use sound?
|
||||||
|
# NOT to be confused with "sound" option later, which is for the SERVER to make
|
||||||
|
# noise on whatever host it's running on.
|
||||||
|
sound=false
|
||||||
|
# Path to sound player
|
||||||
|
# soundplay=/usr/bin/play
|
||||||
|
# Optional parameters to pass to the player
|
||||||
|
# soundopts=--volume=.3
|
||||||
|
# New network found
|
||||||
|
# sound_new=/usr/share/kismet/wav/new_network.wav
|
||||||
|
# Wepped new network
|
||||||
|
# sound_new_wep=${prefix}/com/kismet/wav/new_wep_network.wav
|
||||||
|
# Network traffic sound
|
||||||
|
# sound_traffic=/usr/share/kismet/wav/traffic.wav
|
||||||
|
# Network junk traffic found
|
||||||
|
# sound_junktraffic=/usr/share/kismet/wav/junk_traffic.wav
|
||||||
|
# GPS lock aquired sound
|
||||||
|
# sound_gpslock=/usr/share/kismet/wav/foo.wav
|
||||||
|
# GPS lock lost sound
|
||||||
|
# sound_gpslost=/usr/share/kismet/wav/bar.wav
|
||||||
|
# Alert sound
|
||||||
|
# sound_alert=/usr/share/kismet/wav/alert.wav
|
||||||
|
|
||||||
|
# Do we auotmatically make a group for probed networks or do we show them
|
||||||
|
# amidst other networks?
|
||||||
|
autogroup_probe=true
|
||||||
|
# Do we autogroup data-only networks?
|
||||||
|
autogroup_data=true
|
||||||
|
|
||||||
|
# Display battery status?
|
||||||
|
apm=false
|
||||||
|
|
||||||
|
# Does the GUI talk to us with Festival?
|
||||||
|
speech=false
|
||||||
|
# Where is festival located for the GUI?
|
||||||
|
festival=/usr/bin/festival
|
||||||
|
# How do we speak? Valid options:
|
||||||
|
# speech Normal speech
|
||||||
|
# nato NATO spellings (alpha, bravo, charlie)
|
||||||
|
# spell Spell the letters out (aye, bee, sea)
|
||||||
|
speech_type=nato
|
||||||
|
# speech_encrypted and speech_unencrypted - Speech templates
|
||||||
|
# Similar to the logtemplate option, this lets you customize the speech output.
|
||||||
|
# speech_encrypted is used for an encrypted network spoken string
|
||||||
|
# speech_unencrypted is used for an unencrypted network spoken string
|
||||||
|
#
|
||||||
|
# %b is replaced by the BSSID (MAC) of the network
|
||||||
|
# %s is replaced by the SSID (name) of the network
|
||||||
|
# %c is replaced by the CHANNEL of the network
|
||||||
|
# %r is replaced by the MAX RATE of the network
|
||||||
|
speech_encrypted=New network detected, s.s.i.d. %s, channel %c, network encrypted.
|
||||||
|
speech_unencrypted=New network detected, s.s.i.d. %s, channel %c, network open.
|
||||||
|
|
||||||
|
# Simple borders (use - and | instead of smooth vertical and horizontal
|
||||||
|
# lines. This is required on Zaurus, and might be needed elsewhere if your
|
||||||
|
# terminal doesn't display the border characters correctly.
|
||||||
|
simpleborders=false
|
||||||
|
|
||||||
|
# Colors (front, back) of text in the panel front. Valid colors are:
|
||||||
|
# black, red, yellow, green, blue, magenta, cyan, white
|
||||||
|
# optionally prefixed with "hi-" for bold/bright colors, ie
|
||||||
|
# hi-red, hi-yellow, hi-green, etc.
|
||||||
|
|
||||||
|
# Enable colors?
|
||||||
|
color=true
|
||||||
|
# Background
|
||||||
|
backgroundcolor=black
|
||||||
|
# Default text
|
||||||
|
textcolor=white
|
||||||
|
# Window borders
|
||||||
|
bordercolor=green
|
||||||
|
# Titles
|
||||||
|
titlecolor=hi-white
|
||||||
|
# GPS and APM info
|
||||||
|
monitorcolor=hi-white
|
||||||
|
# WEP network color
|
||||||
|
wepcolor=hi-green
|
||||||
|
# Factory network color
|
||||||
|
factorycolor=hi-red
|
||||||
|
# Open color
|
||||||
|
opencolor=hi-yellow
|
||||||
|
# Decloaked network color
|
||||||
|
cloakcolor=hi-blue
|
347
openwrt/package/kismet/patches/remove-sources.patch
Normal file
347
openwrt/package/kismet/patches/remove-sources.patch
Normal file
@ -0,0 +1,347 @@
|
|||||||
|
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;
|
Loading…
Reference in New Issue
Block a user