GNUnet  0.11.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 #define MAC_ADDR_SIZE 6
36 
41 #define IEEE80211_FC0_TYPE_MGT 0x00
42 
47 #define IEEE80211_FC0_TYPE_CTL 0x04
48 
53 #define IEEE80211_FC0_TYPE_DATA 0x08
54 
55 
57 
62 {
63  uint8_t mac[MAC_ADDR_SIZE];
64 };
65 
70 {
76 
81 };
82 
87 {
92 
97 
101  uint16_t type;
102 };
103 
104 
109 {
120 
125 
130 
135 
140 
146 
150  u_int8_t llc[4];
151 
152  /* payload */
153 } GNUNET_PACKED;
154 
155 
161 {
166 
170  uint8_t rate;
171 
175  uint8_t antenna;
176 
182 
188 
189  /* actual payload follows */
190 };
191 
192 
201 {
206 
212 
217 
224 
230 
235 
240 
245 
250 
255 
256  /* followed by payload */
257 };
258 
260 
265  { 0x13, 0x22, 0x33, 0x44, 0x55, 0x66 }
266 };
267 
268 
272 static const struct GNUNET_TRANSPORT_WLAN_MacAddress bc_all_mac = {
273  { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }
274 };
275 
276 #endif
commonly used definitions; globals in this file are exempt from the rule that the module name ("commo...
#define GNUNET_NETWORK_STRUCT_BEGIN
Define as empty, GNUNET_PACKED should suffice, but this won't work on W32.
#define GNUNET_NETWORK_STRUCT_END
Define as empty, GNUNET_PACKED should suffice, but this won't work on W32;.
#define GNUNET_PACKED
gcc-ism to get packed structs.
cryptographic primitives for GNUnet
static GNUNET_NETWORK_STRUCT_END const struct GNUNET_TRANSPORT_WLAN_MacAddress mac_bssid_gnunet
GNUnet bssid.
static const struct GNUNET_TRANSPORT_WLAN_MacAddress bc_all_mac
Broadcast MAC.
#define MAC_ADDR_SIZE
Number fo bytes in a mac address.
Header for all communications.
struct GNUNET_MessageHeader hdr
Message header.
struct GNUNET_TRANSPORT_WLAN_MacAddress mac
MAC Address of the local WLAN interface.
generic definitions for IEEE 802.11 frames
uint16_t frame_control
802.11 Frame Control field.
struct GNUNET_TRANSPORT_WLAN_MacAddress addr1
Address 1: destination address in ad-hoc mode or AP, BSSID if station,.
uint16_t duration
Microseconds to reserve link (duration), 0 by default.
u_int8_t llc[4]
Link layer control (LLC).
struct GNUNET_TRANSPORT_WLAN_MacAddress addr3
Address 3: BSSID in ad-hoc mode, Destination if station, source if AP.
struct GNUNET_TRANSPORT_WLAN_MacAddress addr2
Address 2: source address if in ad-hoc-mode or station, BSSID if AP.
uint16_t sequence_control
802.11 sequence control field; contains fragment number an sequence number (we set this to all zeros)...
generic definitions for IEEE 802.3 frames
struct GNUNET_TRANSPORT_WLAN_MacAddress src
Address 2: source address if in ad-hoc-mode or station, BSSID if AP.
struct GNUNET_TRANSPORT_WLAN_MacAddress dst
Address 1: destination address in ad-hoc mode or AP, BSSID if station,.
Message from the WLAN helper to the plugin: we have received the given message with the given perform...
uint32_t ri_channel
IEEE80211_RADIOTAP_CHANNEL, 0 if unknown.
struct GNUNET_TRANSPORT_WLAN_Ieee80211Frame frame
IEEE Frame.
uint64_t ri_mactime
IEEE80211_RADIOTAP_TSFT, 0 if unknown.
uint32_t ri_antenna
IEEE80211_RADIOTAP_ANTENNA, 0 if unknown.
int32_t ri_noise
either IEEE80211_RADIOTAP_DBM_ANTNOISE or IEEE80211_RADIOTAP_DB_ANTNOISE, 0 if unknown.
uint32_t ri_rate
IEEE80211_RADIOTAP_RATE * 50000, 0 if unknown.
struct GNUNET_MessageHeader header
Type is 'GNUNET_MESSAGE_TYPE_WLAN_DATA_FROM_HELPER'.
int32_t ri_power
from radiotap either IEEE80211_RADIOTAP_DBM_ANTSIGNAL or IEEE80211_RADIOTAP_DB_ANTSIGNAL,...
uint32_t ri_present
Information about which of the fields below are actually valid.
Message from the plugin to the WLAN helper: send the given message with the given connection paramete...
uint16_t tx_power
Transmit power expressed as unitless distance from max power set at factory calibration.
struct GNUNET_MessageHeader header
Type is 'GNUNET_MESSAGE_TYPE_WLAN_DATA_TO_HELPER'.
struct GNUNET_TRANSPORT_WLAN_Ieee80211Frame frame
IEEE Frame to transmit (the sender MAC address will be overwritten by the helper as it does not trust...
uint8_t antenna
Antenna; the first antenna is 0.