summaryrefslogtreecommitdiff
path: root/noncore/net/wellenreiter/daemon/source/cardmode.cc
Unidiff
Diffstat (limited to 'noncore/net/wellenreiter/daemon/source/cardmode.cc') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/daemon/source/cardmode.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/noncore/net/wellenreiter/daemon/source/cardmode.cc b/noncore/net/wellenreiter/daemon/source/cardmode.cc
index f84ce23..8069edc 100644
--- a/noncore/net/wellenreiter/daemon/source/cardmode.cc
+++ b/noncore/net/wellenreiter/daemon/source/cardmode.cc
@@ -1,31 +1,32 @@
1/* $Id$ */ 1/* $Id$ */
2 2
3#include "config.hh"
3#include "cardmode.hh" 4#include "cardmode.hh"
4 5
5int card_into_monitormode (char *device, int cardtype) 6int card_into_monitormode (char *device, int cardtype)
6{ 7{
7 8
8 int datalink; /* used for getting the pcap datalink type */ 9 int datalink; /* used for getting the pcap datalink type */
9 char CiscoRFMON[35] = "/proc/driver/aironet/"; 10 char CiscoRFMON[35] = "/proc/driver/aironet/";
10 FILE *CISCO_CONFIG_FILE; 11 FILE *CISCO_CONFIG_FILE;
11 char errbuf[PCAP_ERRBUF_SIZE]; 12 char errbuf[PCAP_ERRBUF_SIZE];
12 pcap_t *handle; 13 pcap_t *handle;
13 14
14 /* Checks if we have a device to sniff on */ 15 /* Checks if we have a device to sniff on */
15 if(device == NULL) 16 if(device == NULL)
16 { 17 {
17 printf ("Fatal error i did not have any interfaces to sniff on\n"); 18 printf ("Fatal error i did not have any interfaces to sniff on\n");
18 return 0; 19 return 0;
19 } 20 }
20 21
21 /* Setting the prmiscous and up flag to the interface */ 22 /* Setting the prmiscous and up flag to the interface */
22 if (card_set_promisc_up (device) == 0) 23 if (card_set_promisc_up (device) == 0)
23 { 24 {
24 printf ("Interface flags correctly set using ifconfig\n"); 25 printf ("Interface flags correctly set using ifconfig\n");
25 } 26 }
26 27
27 /* Check the cardtype and executes the commands to go into monitor mode */ 28 /* Check the cardtype and executes the commands to go into monitor mode */
28 if (cardtype == CARD_TYPE_CISCO) /* I got a cisco card */ 29 if (cardtype == CARD_TYPE_CISCO) /* I got a cisco card */
29 { 30 {
30 /* bring the sniffer into rfmon mode */ 31 /* bring the sniffer into rfmon mode */
31 snprintf(CiscoRFMON, sizeof(CiscoRFMON),DEFAULT_PATH, device); 32 snprintf(CiscoRFMON, sizeof(CiscoRFMON),DEFAULT_PATH, device);