2 This file is part of GNUnet
3 (C) 2010, 2011 Christian Grothoff (and other contributing authors)
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version.
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 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
22 * @file transport/plugin_transport_wlan.h
23 * @brief header for transport plugin and the helper for wlan
24 * @author David Brodski
26 #ifndef PLUGIN_TRANSPORT_WLAN
27 #define PLUGIN_TRANSPORT_WLAN
30 #include "gnunet_common.h"
33 * Number fo bytes in a mac address.
35 #define MAC_ADDR_SIZE 6
37 GNUNET_NETWORK_STRUCT_BEGIN
41 struct GNUNET_TRANSPORT_WLAN_MacAddress
43 uint8_t mac[MAC_ADDR_SIZE];
47 * Format of a WLAN Control Message.
49 struct GNUNET_TRANSPORT_WLAN_HelperControlMessage
52 * Message header. Type is
53 * GNUNET_MESSAGE_TYPE_WLAN_HELPER_CONTROL
55 struct GNUNET_MessageHeader hdr;
58 * MAC Address of the local WLAN interface.
60 struct GNUNET_TRANSPORT_WLAN_MacAddress mac;
62 GNUNET_NETWORK_STRUCT_END
67 static const struct GNUNET_TRANSPORT_WLAN_MacAddress mac_bssid_gnunet = {
68 {0x13, 0x22, 0x33, 0x44, 0x55, 0x66}
75 static const struct GNUNET_TRANSPORT_WLAN_MacAddress bc_all_mac = {
76 {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}
79 GNUNET_NETWORK_STRUCT_BEGIN
82 * generic definitions for IEEE 802.11 frames
84 struct GNUNET_TRANSPORT_WLAN_Ieee80211Frame
87 * 802.11 Frame Control field,
89 uint16_t frame_control;
92 * Microseconds to reserve link (duration), 0 by default
97 * Address 1: destination address in ad-hoc mode or AP, BSSID if station,
99 struct GNUNET_TRANSPORT_WLAN_MacAddress addr1;
102 * Address 2: source address if in ad-hoc-mode or station, BSSID if AP
104 struct GNUNET_TRANSPORT_WLAN_MacAddress addr2;
107 * Address 3: BSSID in ad-hoc mode, Destination if station, source if AP
109 struct GNUNET_TRANSPORT_WLAN_MacAddress addr3;
112 * 802.11 sequence control field.
114 uint16_t sequence_control;
117 * Link layer control (LLC). Set to a GNUnet-specific value.
128 * Message from the plugin to the WLAN helper: send the given message with the
129 * given connection parameters.
131 struct GNUNET_TRANSPORT_WLAN_RadiotapSendMessage
135 * Type is 'GNUNET_MESSAGE_TYPE_WLAN_HELPER_DATA'.
137 struct GNUNET_MessageHeader header;
145 * Antenna; the first antenna is 0.
150 * Transmit power expressed as unitless distance from max power set at factory calibration.
151 * 0 is max power. Monotonically nondecreasing with lower power levels.
156 * IEEE Frame to transmit (the sender MAC address will be overwritten by the helper as it does not
157 * trust the plugin to set it correctly).
159 struct GNUNET_TRANSPORT_WLAN_Ieee80211Frame frame;
161 /* actual payload follows */
164 GNUNET_NETWORK_STRUCT_END
168 * struct to represent infos gathered form the radiotap fields, see RadiotapHeader for more Infos
173 * FIXME: not initialized properly so far. (supposed to contain
174 * information about which of the fields below are actually valid).
179 * IEEE80211_RADIOTAP_TSFT
185 * either IEEE80211_RADIOTAP_DBM_ANTSIGNAL
186 * or IEEE80211_RADIOTAP_DB_ANTSIGNAL
191 * either IEEE80211_RADIOTAP_DBM_ANTNOISE
192 * or IEEE80211_RADIOTAP_DB_ANTNOISE
197 * IEEE80211_RADIOTAP_CHANNEL
202 * Frequency we use. FIXME: not properly initialized so far!
207 * IEEE80211_RADIOTAP_RATE * 50000
212 * IEEE80211_RADIOTAP_ANTENNA