diff options
Diffstat (limited to 'src/transport/plugin_transport_wlan.h')
-rw-r--r-- | src/transport/plugin_transport_wlan.h | 78 |
1 files changed, 46 insertions, 32 deletions
diff --git a/src/transport/plugin_transport_wlan.h b/src/transport/plugin_transport_wlan.h index c220c829d..3f8e82404 100644 --- a/src/transport/plugin_transport_wlan.h +++ b/src/transport/plugin_transport_wlan.h | |||
@@ -35,6 +35,7 @@ | |||
35 | #define MAC_ADDR_SIZE 6 | 35 | #define MAC_ADDR_SIZE 6 |
36 | 36 | ||
37 | GNUNET_NETWORK_STRUCT_BEGIN | 37 | GNUNET_NETWORK_STRUCT_BEGIN |
38 | |||
38 | /** | 39 | /** |
39 | * A MAC Address. | 40 | * A MAC Address. |
40 | */ | 41 | */ |
@@ -59,24 +60,7 @@ struct GNUNET_TRANSPORT_WLAN_HelperControlMessage | |||
59 | */ | 60 | */ |
60 | struct GNUNET_TRANSPORT_WLAN_MacAddress mac; | 61 | struct GNUNET_TRANSPORT_WLAN_MacAddress mac; |
61 | }; | 62 | }; |
62 | GNUNET_NETWORK_STRUCT_END | ||
63 | |||
64 | /** | ||
65 | * GNUnet bssid | ||
66 | */ | ||
67 | static const struct GNUNET_TRANSPORT_WLAN_MacAddress mac_bssid_gnunet = { | ||
68 | {0x13, 0x22, 0x33, 0x44, 0x55, 0x66} | ||
69 | }; | ||
70 | |||
71 | |||
72 | /** | ||
73 | * Broadcast MAC | ||
74 | */ | ||
75 | static const struct GNUNET_TRANSPORT_WLAN_MacAddress bc_all_mac = { | ||
76 | {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF} | ||
77 | }; | ||
78 | 63 | ||
79 | GNUNET_NETWORK_STRUCT_BEGIN | ||
80 | 64 | ||
81 | /** | 65 | /** |
82 | * generic definitions for IEEE 802.11 frames | 66 | * generic definitions for IEEE 802.11 frames |
@@ -86,12 +70,12 @@ struct GNUNET_TRANSPORT_WLAN_Ieee80211Frame | |||
86 | /** | 70 | /** |
87 | * 802.11 Frame Control field, | 71 | * 802.11 Frame Control field, |
88 | */ | 72 | */ |
89 | uint16_t frame_control; | 73 | uint16_t frame_control GNUNET_PACKED; |
90 | 74 | ||
91 | /** | 75 | /** |
92 | * Microseconds to reserve link (duration), 0 by default | 76 | * Microseconds to reserve link (duration), 0 by default |
93 | */ | 77 | */ |
94 | uint16_t duration; | 78 | uint16_t duration GNUNET_PACKED; |
95 | 79 | ||
96 | /** | 80 | /** |
97 | * Address 1: destination address in ad-hoc mode or AP, BSSID if station, | 81 | * Address 1: destination address in ad-hoc mode or AP, BSSID if station, |
@@ -111,7 +95,7 @@ struct GNUNET_TRANSPORT_WLAN_Ieee80211Frame | |||
111 | /** | 95 | /** |
112 | * 802.11 sequence control field. | 96 | * 802.11 sequence control field. |
113 | */ | 97 | */ |
114 | uint16_t sequence_control; | 98 | uint16_t sequence_control GNUNET_PACKED; |
115 | 99 | ||
116 | /** | 100 | /** |
117 | * Link layer control (LLC). Set to a GNUnet-specific value. | 101 | * Link layer control (LLC). Set to a GNUnet-specific value. |
@@ -150,7 +134,7 @@ struct GNUNET_TRANSPORT_WLAN_RadiotapSendMessage | |||
150 | * Transmit power expressed as unitless distance from max power set at factory calibration. | 134 | * Transmit power expressed as unitless distance from max power set at factory calibration. |
151 | * 0 is max power. Monotonically nondecreasing with lower power levels. | 135 | * 0 is max power. Monotonically nondecreasing with lower power levels. |
152 | */ | 136 | */ |
153 | uint16_t tx_power; | 137 | uint16_t tx_power GNUNET_PACKED; |
154 | 138 | ||
155 | /** | 139 | /** |
156 | * IEEE Frame to transmit (the sender MAC address will be overwritten by the helper as it does not | 140 | * IEEE Frame to transmit (the sender MAC address will be overwritten by the helper as it does not |
@@ -161,59 +145,89 @@ struct GNUNET_TRANSPORT_WLAN_RadiotapSendMessage | |||
161 | /* actual payload follows */ | 145 | /* actual payload follows */ |
162 | }; | 146 | }; |
163 | 147 | ||
164 | GNUNET_NETWORK_STRUCT_END | ||
165 | |||
166 | 148 | ||
167 | /** | 149 | /** |
150 | * Message from the WLAN helper to the plugin: we have received the given message with the | ||
151 | * given performance characteristics. | ||
152 | */ | ||
153 | /** | ||
168 | * struct to represent infos gathered form the radiotap fields, see RadiotapHeader for more Infos | 154 | * struct to represent infos gathered form the radiotap fields, see RadiotapHeader for more Infos |
169 | */ | 155 | */ |
170 | struct Radiotap_rx | 156 | struct GNUNET_TRANSPORT_WLAN_RadiotapReceiveMessage |
171 | { | 157 | { |
158 | |||
159 | /** | ||
160 | * Type is 'GNUNET_MESSAGE_TYPE_WLAN_HELPER_DATA'. | ||
161 | */ | ||
162 | struct GNUNET_MessageHeader header; | ||
163 | |||
172 | /** | 164 | /** |
173 | * FIXME: not initialized properly so far. (supposed to contain | 165 | * FIXME: not initialized properly so far. (supposed to contain |
174 | * information about which of the fields below are actually valid). | 166 | * information about which of the fields below are actually valid). |
175 | */ | 167 | */ |
176 | uint32_t ri_present; | 168 | uint32_t ri_present GNUNET_PACKED; |
177 | 169 | ||
178 | /** | 170 | /** |
179 | * IEEE80211_RADIOTAP_TSFT | 171 | * IEEE80211_RADIOTAP_TSFT |
180 | */ | 172 | */ |
181 | uint64_t ri_mactime; | 173 | uint64_t ri_mactime GNUNET_PACKED; |
182 | 174 | ||
183 | /** | 175 | /** |
184 | * from radiotap | 176 | * from radiotap |
185 | * either IEEE80211_RADIOTAP_DBM_ANTSIGNAL | 177 | * either IEEE80211_RADIOTAP_DBM_ANTSIGNAL |
186 | * or IEEE80211_RADIOTAP_DB_ANTSIGNAL | 178 | * or IEEE80211_RADIOTAP_DB_ANTSIGNAL |
187 | */ | 179 | */ |
188 | int32_t ri_power; | 180 | int32_t ri_power GNUNET_PACKED; |
189 | 181 | ||
190 | /** | 182 | /** |
191 | * either IEEE80211_RADIOTAP_DBM_ANTNOISE | 183 | * either IEEE80211_RADIOTAP_DBM_ANTNOISE |
192 | * or IEEE80211_RADIOTAP_DB_ANTNOISE | 184 | * or IEEE80211_RADIOTAP_DB_ANTNOISE |
193 | */ | 185 | */ |
194 | int32_t ri_noise; | 186 | int32_t ri_noise GNUNET_PACKED; |
195 | 187 | ||
196 | /** | 188 | /** |
197 | * IEEE80211_RADIOTAP_CHANNEL | 189 | * IEEE80211_RADIOTAP_CHANNEL |
198 | */ | 190 | */ |
199 | uint32_t ri_channel; | 191 | uint32_t ri_channel GNUNET_PACKED; |
200 | 192 | ||
201 | /** | 193 | /** |
202 | * Frequency we use. FIXME: not properly initialized so far! | 194 | * Frequency we use. FIXME: not properly initialized so far! |
203 | */ | 195 | */ |
204 | uint32_t ri_freq; | 196 | uint32_t ri_freq GNUNET_PACKED; |
205 | 197 | ||
206 | /** | 198 | /** |
207 | * IEEE80211_RADIOTAP_RATE * 50000 | 199 | * IEEE80211_RADIOTAP_RATE * 50000 |
208 | */ | 200 | */ |
209 | uint32_t ri_rate; | 201 | uint32_t ri_rate GNUNET_PACKED; |
210 | 202 | ||
211 | /** | 203 | /** |
212 | * IEEE80211_RADIOTAP_ANTENNA | 204 | * IEEE80211_RADIOTAP_ANTENNA |
213 | */ | 205 | */ |
214 | uint32_t ri_antenna; | 206 | uint32_t ri_antenna GNUNET_PACKED; |
207 | |||
208 | /** | ||
209 | * IEEE Frame. | ||
210 | */ | ||
211 | struct GNUNET_TRANSPORT_WLAN_Ieee80211Frame frame; | ||
212 | |||
213 | /* followed by payload */ | ||
214 | }; | ||
215 | |||
216 | GNUNET_NETWORK_STRUCT_END | ||
217 | |||
218 | /** | ||
219 | * GNUnet bssid | ||
220 | */ | ||
221 | static const struct GNUNET_TRANSPORT_WLAN_MacAddress mac_bssid_gnunet = { | ||
222 | {0x13, 0x22, 0x33, 0x44, 0x55, 0x66} | ||
215 | }; | 223 | }; |
216 | 224 | ||
217 | 225 | ||
226 | /** | ||
227 | * Broadcast MAC | ||
228 | */ | ||
229 | static const struct GNUNET_TRANSPORT_WLAN_MacAddress bc_all_mac = { | ||
230 | {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF} | ||
231 | }; | ||
218 | 232 | ||
219 | #endif | 233 | #endif |