author | max <max> | 2003-03-04 14:04:52 (UTC) |
---|---|---|
committer | max <max> | 2003-03-04 14:04:52 (UTC) |
commit | 3adca473d5440b00e15781627e00465350e9118b (patch) (unidiff) | |
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 | |||
@@ -29,54 +29,56 @@ typedef unsigned long long u64; | |||
29 | #include <linux/wireless.h> | 29 | #include <linux/wireless.h> |
30 | 30 | ||
31 | #ifndef SIOCIWFIRSTPRIV | 31 | #ifndef SIOCIWFIRSTPRIV |
32 | #define SIOCIWFIRSTPRIV SIOCDEVPRIVATE | 32 | #define SIOCIWFIRSTPRIV SIOCDEVPRIVATE |
33 | #endif | 33 | #endif |
34 | 34 | ||
35 | extern "C" | 35 | extern "C" |
36 | { | 36 | { |
37 | #include <net/bpf.h> | 37 | #include <net/bpf.h> |
38 | #include <pcap.h> | 38 | #include <pcap.h> |
39 | } | 39 | } |
40 | 40 | ||
41 | extern pcap_t *handletopcap; | ||
42 | |||
41 | /* Defines, used for the card setup */ | 43 | /* Defines, used for the card setup */ |
42 | #define DEFAULT_PATH "/proc/driver/aironet/%s/Config" | 44 | #define DEFAULT_PATH "/proc/driver/aironet/%s/Config" |
43 | #define CISCO_STATUS "/proc/driver/aironet/%s/Status" | 45 | #define CISCO_STATUS "/proc/driver/aironet/%s/Status" |
44 | #define CARD_TYPE_CISCO 1 | 46 | #define CARD_TYPE_CISCO 1 |
45 | #define CARD_TYPE_NG 2 | 47 | #define CARD_TYPE_NG 2 |
46 | #define CARD_TYPE_HOSTAP 3 | 48 | #define CARD_TYPE_HOSTAP 3 |
47 | #define CARD_TYPE_ORINOCCO 4 | 49 | #define CARD_TYPE_ORINOCCO 4 |
48 | 50 | ||
49 | /* Some usefull constants for frequencies */ | 51 | /* Some usefull constants for frequencies */ |
50 | #define KILO 1e3 | 52 | #define KILO 1e3 |
51 | #define MEGA 1e6 | 53 | #define MEGA 1e6 |
52 | #define GIGA 1e9 | 54 | #define GIGA 1e9 |
53 | 55 | ||
54 | 56 | ||
55 | /* only for now, until we have the daemon running */ | 57 | /* only for now, until we have the daemon running */ |
56 | /*the config file should provide these information */ | 58 | /*the config file should provide these information */ |
57 | #define CARD_TYPE CARD_TYPE_HOSTAP | 59 | #define CARD_TYPE CARD_TYPE_HOSTAP |
58 | 60 | ||
59 | /* Prototypes */ | 61 | /* Prototypes */ |
60 | int card_check_rfmon_datalink (const char *device); | 62 | int card_check_rfmon_datalink (const char *device); |
61 | int card_into_monitormode (pcap_t **, const char *, int); | 63 | int card_into_monitormode (const char *, int); |
64 | int check_loopback(); | ||
62 | int card_set_promisc_up (const char *device); | 65 | int card_set_promisc_up (const char *device); |
63 | int card_remove_promisc (const char *device); | 66 | int card_remove_promisc (const char *device); |
64 | int card_set_channel (const char *device, int channel,int cardtype); | 67 | int card_set_channel (const char *device, int channel,int cardtype); |
65 | int iw_get_range_info(int skfd, const char * ifname, struct iw_range * range); | 68 | int iw_get_range_info(int skfd, const char * ifname, struct iw_range * range); |
66 | double iw_freq2float(iw_freq * in); | 69 | double iw_freq2float(iw_freq * in); |
67 | void iw_float2freq(double in, iw_freq *out); | 70 | void iw_float2freq(double in, iw_freq *out); |
68 | int card_detect_channels (char * device); | 71 | int card_detect_channels (char * device); |
69 | 72 | ||
70 | |||
71 | /*------------------------------------------------------------------*/ | 73 | /*------------------------------------------------------------------*/ |
72 | /* | 74 | /* |
73 | * Wrapper to push some Wireless Parameter in the driver | 75 | * Wrapper to push some Wireless Parameter in the driver |
74 | */ | 76 | */ |
75 | static inline int | 77 | static inline int |
76 | iw_set_ext(int skfd, /* Socket to the kernel */ | 78 | iw_set_ext(int skfd, /* Socket to the kernel */ |
77 | char * ifname, /* Device name */ | 79 | char * ifname, /* Device name */ |
78 | int request,/* WE ID */ | 80 | int request,/* WE ID */ |
79 | struct iwreq * pwrq) /* Fixed part of the request */ | 81 | struct iwreq * pwrq) /* Fixed part of the request */ |
80 | { | 82 | { |
81 | /* Set device name */ | 83 | /* Set device name */ |
82 | strncpy(pwrq->ifr_name, ifname, IFNAMSIZ); | 84 | strncpy(pwrq->ifr_name, ifname, IFNAMSIZ); |