summaryrefslogtreecommitdiff
path: root/noncore/net/wellenreiter/libwellenreiter/source/cardmode.cc
Unidiff
Diffstat (limited to 'noncore/net/wellenreiter/libwellenreiter/source/cardmode.cc') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/wellenreiter/libwellenreiter/source/cardmode.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/noncore/net/wellenreiter/libwellenreiter/source/cardmode.cc b/noncore/net/wellenreiter/libwellenreiter/source/cardmode.cc
index a1c3945..3aaa4a7 100644
--- a/noncore/net/wellenreiter/libwellenreiter/source/cardmode.cc
+++ b/noncore/net/wellenreiter/libwellenreiter/source/cardmode.cc
@@ -1,31 +1,32 @@
1/* 1/*
2 * Set card modes for sniffing 2 * Set card modes for sniffing
3 * 3 *
4 * $Id$ 4 * $Id$
5 */ 5 */
6 6
7#include "cardmode.hh" 7#include "cardmode.hh"
8#include "log.hh"
8 9
9/* main card into monitor function */ 10/* main card into monitor function */
10int card_into_monitormode (pcap_t **orighandle, char *device, int cardtype) 11int card_into_monitormode (pcap_t **orighandle, char *device, int cardtype)
11{ 12{
12 char CiscoRFMON[35] = "/proc/driver/aironet/"; 13 char CiscoRFMON[35] = "/proc/driver/aironet/";
13 FILE *CISCO_CONFIG_FILE; 14 FILE *CISCO_CONFIG_FILE;
14 pcap_t *handle = (pcap_t*)orighandle; 15 pcap_t *handle = (pcap_t*)orighandle;
15 16
16 /* Checks if we have a device to sniff on */ 17 /* Checks if we have a device to sniff on */
17 if(device == NULL) 18 if(device == NULL)
18 { 19 {
19 wl_logerr("No device given"); 20 wl_logerr("No device given");
20 return 0; 21 return 0;
21 } 22 }
22 23
23 /* Setting the prmiscous and up flag to the interface */ 24 /* Setting the prmiscous and up flag to the interface */
24 if (!card_set_promisc_up(device)) 25 if (!card_set_promisc_up(device))
25 { 26 {
26 wl_logerr("Cannot set interface to promisc mode: %s", strerror(errno)); 27 wl_logerr("Cannot set interface to promisc mode: %s", strerror(errno));
27 return 0; 28 return 0;
28 } 29 }
29 wl_loginfo("Interface set to promisc mode"); 30 wl_loginfo("Interface set to promisc mode");
30 31
31 /* Check the cardtype and executes the commands to go into monitor mode */ 32 /* Check the cardtype and executes the commands to go into monitor mode */