GNUnet  0.10.x
plugin_transport_wlan.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet
3  Copyright (C) 2010, 2011 GNUnet e.V.
4 
5  GNUnet is free software: you can redistribute it and/or modify it
6  under the terms of the GNU Affero General Public License as published
7  by the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  GNUnet is distributed in the hope that it will be useful, but
11  WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Affero General Public License for more details.
14 
15  You should have received a copy of the GNU Affero General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 
18  SPDX-License-Identifier: AGPL3.0-or-later
19  */
20 
26 #ifndef PLUGIN_TRANSPORT_WLAN
27 #define PLUGIN_TRANSPORT_WLAN
28 
29 #include "gnunet_crypto_lib.h"
30 #include "gnunet_common.h"
31 
35 #ifdef MINGW
36  #define MAC_ADDR_SIZE 8
37  typedef uint8_t u_int8_t;
38 #else
39  #define MAC_ADDR_SIZE 6
40 #endif
41 
46 #define IEEE80211_FC0_TYPE_MGT 0x00
47 
52 #define IEEE80211_FC0_TYPE_CTL 0x04
53 
58 #define IEEE80211_FC0_TYPE_DATA 0x08
59 
60 
62 
67 {
68  uint8_t mac[MAC_ADDR_SIZE];
69 };
70 
75 {
81 
86 };
87 
92 {
93 
98 
103 
107  uint16_t type;
108 
109 };
110 
111 
116 {
126  uint16_t frame_control GNUNET_PACKED;
127 
132 
137 
142 
147 
152  uint16_t sequence_control GNUNET_PACKED;
153 
157  u_int8_t llc[4];
158 
159  /* payload */
160 
161 } GNUNET_PACKED;
162 
163 
164 
170 {
171 
175  struct GNUNET_MessageHeader header;
176 
180  uint8_t rate;
181 
185  uint8_t antenna;
186 
191  uint16_t tx_power GNUNET_PACKED;
192 
198 
199  /* actual payload follows */
200 };
201 
202 
211 {
212 
216  struct GNUNET_MessageHeader header;
217 
222  uint32_t ri_present GNUNET_PACKED;
223 
227  uint64_t ri_mactime GNUNET_PACKED;
228 
234  int32_t ri_power GNUNET_PACKED;
235 
240  int32_t ri_noise GNUNET_PACKED;
241 
245  uint32_t ri_channel GNUNET_PACKED;
246 
250  uint32_t ri_freq GNUNET_PACKED;
251 
255  uint32_t ri_rate GNUNET_PACKED;
256 
260  uint32_t ri_antenna GNUNET_PACKED;
261 
266 
267  /* followed by payload */
268 };
269 
271 
276  {0x13, 0x22, 0x33, 0x44, 0x55, 0x66}
277 };
278 
279 
284  {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}
285 };
286 
287 #endif
#define MAC_ADDR_SIZE
Number fo bytes in a mac address.
uint8_t antenna
Antenna; the first antenna is 0.
generic definitions for IEEE 802.3 frames
#define GNUNET_NETWORK_STRUCT_BEGIN
Define as empty, GNUNET_PACKED should suffice, but this won&#39;t work on W32.
Format of a WLAN Control Message.
Message from the WLAN helper to the plugin: we have received the given message with the given perform...
cryptographic primitives for GNUnet
static GNUNET_NETWORK_STRUCT_END const struct GNUNET_TRANSPORT_WLAN_MacAddress mac_bssid_gnunet
GNUnet bssid.
#define GNUNET_NETWORK_STRUCT_END
Define as empty, GNUNET_PACKED should suffice, but this won&#39;t work on W32;.
#define GNUNET_PACKED
gcc-ism to get packed structs.
generic definitions for IEEE 802.11 frames
static struct GNUNET_TIME_Relative duration
How long do we run the test?
Header for all communications.
commonly used definitions; globals in this file are exempt from the rule that the module name ("commo...
static const struct GNUNET_TRANSPORT_WLAN_MacAddress bc_all_mac
Broadcast MAC.
Message from the plugin to the WLAN helper: send the given message with the given connection paramete...