diff options
Diffstat (limited to 'src/transport/gnunet-transport-wlan-helper.h')
-rw-r--r-- | src/transport/gnunet-transport-wlan-helper.h | 55 |
1 files changed, 17 insertions, 38 deletions
diff --git a/src/transport/gnunet-transport-wlan-helper.h b/src/transport/gnunet-transport-wlan-helper.h index e4d13275c..d4845af5a 100644 --- a/src/transport/gnunet-transport-wlan-helper.h +++ b/src/transport/gnunet-transport-wlan-helper.h | |||
@@ -27,6 +27,7 @@ | |||
27 | #ifndef gnunet_wlan_H | 27 | #ifndef gnunet_wlan_H |
28 | #define gnunet_wlan_H | 28 | #define gnunet_wlan_H |
29 | 29 | ||
30 | /* | ||
30 | #include <stdio.h> | 31 | #include <stdio.h> |
31 | #include <stdlib.h> | 32 | #include <stdlib.h> |
32 | #include <errno.h> | 33 | #include <errno.h> |
@@ -35,16 +36,16 @@ | |||
35 | #include <utime.h> | 36 | #include <utime.h> |
36 | #include <unistd.h> | 37 | #include <unistd.h> |
37 | #include <getopt.h> | 38 | #include <getopt.h> |
38 | #include <pcap.h> | 39 | #include <pcap.h>*/ |
39 | //#include <endian.h> | 40 | //#include <endian.h> |
40 | #include <pcap.h> | ||
41 | |||
42 | 41 | ||
42 | /* | ||
43 | typedef unsigned int u32; | 43 | typedef unsigned int u32; |
44 | typedef unsigned short u16; | 44 | typedef unsigned short u16; |
45 | typedef unsigned char u8; | 45 | typedef unsigned char u8; |
46 | typedef u32 __le32; | 46 | typedef u32 __le32; |
47 | 47 | */ | |
48 | /* | ||
48 | #if __BYTE_ORDER == __LITTLE_ENDIAN | 49 | #if __BYTE_ORDER == __LITTLE_ENDIAN |
49 | #define le16_to_cpu(x) (x) | 50 | #define le16_to_cpu(x) (x) |
50 | #define le32_to_cpu(x) (x) | 51 | #define le32_to_cpu(x) (x) |
@@ -53,44 +54,22 @@ typedef u32 __le32; | |||
53 | #define le32_to_cpu(x) \ | 54 | #define le32_to_cpu(x) \ |
54 | ((((x)&0xff)<<24)|(((x)&0xff00)<<8)|(((x)&0xff0000)>>8)|(((x)&0xff000000)>>24)) | 55 | ((((x)&0xff)<<24)|(((x)&0xff00)<<8)|(((x)&0xff0000)>>8)|(((x)&0xff000000)>>24)) |
55 | #endif | 56 | #endif |
57 | */ | ||
56 | #define unlikely(x) (x) | 58 | #define unlikely(x) (x) |
57 | 59 | ||
60 | #define FIFO_FILE1 "/tmp/MYFIFOin" | ||
61 | #define FIFO_FILE2 "/tmp/MYFIFOout" | ||
62 | #define MAXLINE 4096 | ||
58 | 63 | ||
59 | #endif /* gnunet_wlan_H */ | 64 | extern int closeprog; |
60 | |||
61 | |||
62 | /* Radiotap header iteration | ||
63 | * implemented in net/wireless/radiotap.c | ||
64 | * docs in Documentation/networking/radiotap-headers.txt | ||
65 | */ | ||
66 | /** | ||
67 | * struct ieee80211_radiotap_iterator - tracks walk thru present radiotap args | ||
68 | * rtheader: pointer to the radiotap header we are walking through | ||
69 | * max_length: length of radiotap header in cpu byte ordering | ||
70 | * this_arg_index: IEEE80211_RADIOTAP_... index of current arg | ||
71 | * this_arg: pointer to current radiotap arg | ||
72 | * arg_index: internal next argument index | ||
73 | * arg: internal next argument pointer | ||
74 | * next_bitmap: internal pointer to next present u32 | ||
75 | * bitmap_shifter: internal shifter for curr u32 bitmap, b0 set == arg present | ||
76 | */ | ||
77 | |||
78 | struct ieee80211_radiotap_iterator { | ||
79 | struct ieee80211_radiotap_header *rtheader; | ||
80 | int max_length; | ||
81 | int this_arg_index; | ||
82 | u8 *this_arg; | ||
83 | 65 | ||
84 | int arg_index; | 66 | struct sendbuf |
85 | u8 *arg; | 67 | { |
86 | __le32 *next_bitmap; | 68 | unsigned int pos; |
87 | u32 bitmap_shifter; | 69 | unsigned int size; |
70 | unsigned char buf[MAXLINE * 2]; | ||
88 | }; | 71 | }; |
89 | 72 | ||
90 | extern int ieee80211_radiotap_iterator_init( | ||
91 | struct ieee80211_radiotap_iterator *iterator, | ||
92 | struct ieee80211_radiotap_header *radiotap_header, | ||
93 | int max_length); | ||
94 | 73 | ||
95 | extern int ieee80211_radiotap_iterator_next( | 74 | #endif /* gnunet_wlan_H */ |
96 | struct ieee80211_radiotap_iterator *iterator); | 75 | |