author | max <max> | 2003-03-04 14:04:52 (UTC) |
---|---|---|
committer | max <max> | 2003-03-04 14:04:52 (UTC) |
commit | 3adca473d5440b00e15781627e00465350e9118b (patch) (side-by-side diff) | |
tree | e60e57f10c8297eee39f9e31974f9199013c4930 /noncore/net/wellenreiter/libwellenreiter/source/cardmode.hh | |
parent | 7cf53b4030437bdbd405b8b16684ba9f68e2891d (diff) | |
download | opie-3adca473d5440b00e15781627e00465350e9118b.zip opie-3adca473d5440b00e15781627e00465350e9118b.tar.gz opie-3adca473d5440b00e15781627e00465350e9118b.tar.bz2 |
start_sniff
Diffstat (limited to 'noncore/net/wellenreiter/libwellenreiter/source/cardmode.hh') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/libwellenreiter/source/cardmode.hh | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/noncore/net/wellenreiter/libwellenreiter/source/cardmode.hh b/noncore/net/wellenreiter/libwellenreiter/source/cardmode.hh index 58e99ac..73e0ae1 100644 --- a/noncore/net/wellenreiter/libwellenreiter/source/cardmode.hh +++ b/noncore/net/wellenreiter/libwellenreiter/source/cardmode.hh @@ -1,105 +1,107 @@ /* $Id$ */ #ifndef CARDMODE_HH #define CARDMODE_HH #include <string.h> #include <stdlib.h> #include <errno.h> #include <sys/types.h> #include <sys/time.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <sys/ioctl.h> #include <unistd.h> #include <linux/if.h> /* Following typedefs are needed here, because linux/wireless.h includes linux/ethertool.h which is using them */ typedef signed char s8; typedef unsigned char u8; typedef signed short s16; typedef unsigned short u16; typedef signed int s32; typedef unsigned int u32; typedef signed long long s64; typedef unsigned long long u64; #include <linux/wireless.h> #ifndef SIOCIWFIRSTPRIV #define SIOCIWFIRSTPRIV SIOCDEVPRIVATE #endif extern "C" { #include <net/bpf.h> #include <pcap.h> } +extern pcap_t *handletopcap; + /* Defines, used for the card setup */ #define DEFAULT_PATH "/proc/driver/aironet/%s/Config" #define CISCO_STATUS "/proc/driver/aironet/%s/Status" #define CARD_TYPE_CISCO 1 #define CARD_TYPE_NG 2 #define CARD_TYPE_HOSTAP 3 #define CARD_TYPE_ORINOCCO 4 /* Some usefull constants for frequencies */ #define KILO 1e3 #define MEGA 1e6 #define GIGA 1e9 /* only for now, until we have the daemon running */ /*the config file should provide these information */ #define CARD_TYPE CARD_TYPE_HOSTAP /* Prototypes */ int card_check_rfmon_datalink (const char *device); -int card_into_monitormode (pcap_t **, const char *, int); +int card_into_monitormode (const char *, int); +int check_loopback(); int card_set_promisc_up (const char *device); int card_remove_promisc (const char *device); int card_set_channel (const char *device, int channel,int cardtype); int iw_get_range_info(int skfd, const char * ifname, struct iw_range * range); double iw_freq2float(iw_freq * in); void iw_float2freq(double in, iw_freq * out); int card_detect_channels (char * device); - /*------------------------------------------------------------------*/ /* * Wrapper to push some Wireless Parameter in the driver */ static inline int iw_set_ext(int skfd, /* Socket to the kernel */ char * ifname, /* Device name */ int request, /* WE ID */ struct iwreq * pwrq) /* Fixed part of the request */ { /* Set device name */ strncpy(pwrq->ifr_name, ifname, IFNAMSIZ); /* Do the request */ return(ioctl(skfd, request, pwrq)); } /*------------------------------------------------------------------*/ /* * Wrapper to extract some Wireless Parameter out of the driver */ static inline int iw_get_ext(int skfd, /* Socket to the kernel */ char * ifname, /* Device name */ int request, /* WE ID */ struct iwreq * pwrq) /* Fixed part of the request */ { /* Set device name */ strncpy(pwrq->ifr_name, ifname, IFNAMSIZ); /* Do the request */ return(ioctl(skfd, request, pwrq)); } #endif /* CARDMODE_HH */ |