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 | 107 |
1 files changed, 0 insertions, 107 deletions
diff --git a/noncore/net/wellenreiter/libwellenreiter/source/cardmode.hh b/noncore/net/wellenreiter/libwellenreiter/source/cardmode.hh deleted file mode 100644 index 73e0ae1..0000000 --- a/noncore/net/wellenreiter/libwellenreiter/source/cardmode.hh +++ b/dev/null | |||
@@ -1,107 +0,0 @@ | |||
1 | /* $Id$ */ | ||
2 | |||
3 | #ifndef CARDMODE_HH | ||
4 | #define CARDMODE_HH | ||
5 | |||
6 | #include <string.h> | ||
7 | #include <stdlib.h> | ||
8 | #include <errno.h> | ||
9 | #include <sys/types.h> | ||
10 | #include <sys/time.h> | ||
11 | #include <sys/socket.h> | ||
12 | #include <netinet/in.h> | ||
13 | #include <arpa/inet.h> | ||
14 | #include <sys/ioctl.h> | ||
15 | #include <unistd.h> | ||
16 | #include <linux/if.h> | ||
17 | |||
18 | /* Following typedefs are needed here, because linux/wireless.h | ||
19 | includes linux/ethertool.h which is using them */ | ||
20 | typedef signed char s8; | ||
21 | typedef unsigned char u8; | ||
22 | typedef signed short s16; | ||
23 | typedef unsigned short u16; | ||
24 | typedef signed int s32; | ||
25 | typedef unsigned int u32; | ||
26 | typedef signed long long s64; | ||
27 | typedef unsigned long long u64; | ||
28 | |||
29 | #include <linux/wireless.h> | ||
30 | |||
31 | #ifndef SIOCIWFIRSTPRIV | ||
32 | #define SIOCIWFIRSTPRIV SIOCDEVPRIVATE | ||
33 | #endif | ||
34 | |||
35 | extern "C" | ||
36 | { | ||
37 | #include <net/bpf.h> | ||
38 | #include <pcap.h> | ||
39 | } | ||
40 | |||
41 | extern pcap_t *handletopcap; | ||
42 | |||
43 | /* Defines, used for the card setup */ | ||
44 | #define DEFAULT_PATH "/proc/driver/aironet/%s/Config" | ||
45 | #define CISCO_STATUS "/proc/driver/aironet/%s/Status" | ||
46 | #define CARD_TYPE_CISCO 1 | ||
47 | #define CARD_TYPE_NG 2 | ||
48 | #define CARD_TYPE_HOSTAP 3 | ||
49 | #define CARD_TYPE_ORINOCCO 4 | ||
50 | |||
51 | /* Some usefull constants for frequencies */ | ||
52 | #define KILO 1e3 | ||
53 | #define MEGA 1e6 | ||
54 | #define GIGA 1e9 | ||
55 | |||
56 | |||
57 | /* only for now, until we have the daemon running */ | ||
58 | /*the config file should provide these information */ | ||
59 | #define CARD_TYPE CARD_TYPE_HOSTAP | ||
60 | |||
61 | /* Prototypes */ | ||
62 | int card_check_rfmon_datalink (const char *device); | ||
63 | int card_into_monitormode (const char *, int); | ||
64 | int check_loopback(); | ||
65 | int card_set_promisc_up (const char *device); | ||
66 | int card_remove_promisc (const char *device); | ||
67 | int card_set_channel (const char *device, int channel,int cardtype); | ||
68 | int iw_get_range_info(int skfd, const char * ifname, struct iw_range * range); | ||
69 | double iw_freq2float(iw_freq * in); | ||
70 | void iw_float2freq(double in, iw_freq *out); | ||
71 | int card_detect_channels (char * device); | ||
72 | |||
73 | /*------------------------------------------------------------------*/ | ||
74 | /* | ||
75 | * Wrapper to push some Wireless Parameter in the driver | ||
76 | */ | ||
77 | static inline int | ||
78 | iw_set_ext(int skfd, /* Socket to the kernel */ | ||
79 | char * ifname, /* Device name */ | ||
80 | int request,/* WE ID */ | ||
81 | struct iwreq * pwrq) /* Fixed part of the request */ | ||
82 | { | ||
83 | /* Set device name */ | ||
84 | strncpy(pwrq->ifr_name, ifname, IFNAMSIZ); | ||
85 | /* Do the request */ | ||
86 | return(ioctl(skfd, request, pwrq)); | ||
87 | } | ||
88 | |||
89 | /*------------------------------------------------------------------*/ | ||
90 | /* | ||
91 | * Wrapper to extract some Wireless Parameter out of the driver | ||
92 | */ | ||
93 | static inline int | ||
94 | iw_get_ext(int skfd, /* Socket to the kernel */ | ||
95 | char * ifname, /* Device name */ | ||
96 | int request,/* WE ID */ | ||
97 | struct iwreq * pwrq) /* Fixed part of the request */ | ||
98 | { | ||
99 | /* Set device name */ | ||
100 | strncpy(pwrq->ifr_name, ifname, IFNAMSIZ); | ||
101 | /* Do the request */ | ||
102 | return(ioctl(skfd, request, pwrq)); | ||
103 | } | ||
104 | |||
105 | |||
106 | |||
107 | #endif /* CARDMODE_HH */ | ||