removing ats functions from plugins, instead provide callback function
[oweals/gnunet.git] / src / transport / plugin_transport_wlan.h
1 /*
2  This file is part of GNUnet
3  (C) 2010, 2011 Christian Grothoff (and other contributing authors)
4
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.
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  General Public License for more details.
14
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.
19  */
20
21 /**
22  * @file transport/plugin_transport_wlan.h
23  * @brief header for transport plugin and the helper for wlan
24  * @author David Brodski
25  */
26 #ifndef PLUGIN_TRANSPORT_WLAN
27 #define PLUGIN_TRANSPORT_WLAN
28
29 #include <stdint.h>
30 #include "gnunet_common.h"
31
32 /**
33  * Number fo bytes in a mac address.
34  */
35 #define MAC_ADDR_SIZE 6
36
37 /**
38  * A MAC Address.
39  */
40 struct MacAddress
41 {
42   uint8_t mac[MAC_ADDR_SIZE];
43 };
44
45
46 /**
47  * Format of a WLAN Control Message.
48  */
49 struct GNUNET_TRANSPORT_WLAN_HelperControlMessage
50 {
51   /**
52    * Message header. FIXME: type?
53    */
54   struct GNUNET_MessageHeader hdr;
55
56   /**
57    * MAC Address. FIXME: of what?
58    */
59   struct MacAddress mac;
60 };
61
62
63 /**
64  * GNUnet bssid
65  */
66 static const struct MacAddress mac_bssid_gnunet = {
67   {0x13, 0x22, 0x33, 0x44, 0x55, 0x66}
68 };
69
70
71 /**
72  * Broadcast MAC
73  */
74 static const struct MacAddress bc_all_mac = {
75   {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}
76 };
77
78
79 struct Radiotap_Send
80 {
81   /**
82    * wlan send rate
83    */
84   uint8_t rate;
85
86   /**
87    * Antenna; the first antenna is 0.
88    */
89   uint8_t antenna;
90
91   /**
92    * Transmit power expressed as unitless distance from max power set at factory calibration.
93    * 0 is max power. Monotonically nondecreasing with lower power levels.
94    */
95   uint16_t tx_power;
96 };
97
98
99 /**
100  * struct to represent infos gathered form the radiotap fields, see RadiotapHeader for more Infos
101  */
102 struct Radiotap_rx
103 {
104   /**
105    * FIXME: not initialized properly so far. (supposed to contain
106    * information about which of the fields below are actually valid).
107    */
108   uint32_t ri_present;
109
110   /**
111    * IEEE80211_RADIOTAP_TSFT
112    */
113   uint64_t ri_mactime;
114
115   /**
116    * from radiotap
117    * either IEEE80211_RADIOTAP_DBM_ANTSIGNAL
118    * or IEEE80211_RADIOTAP_DB_ANTSIGNAL
119    */
120   int32_t ri_power;
121
122   /**
123    * either IEEE80211_RADIOTAP_DBM_ANTNOISE
124    * or IEEE80211_RADIOTAP_DB_ANTNOISE
125    */
126   int32_t ri_noise;
127
128   /**
129    * IEEE80211_RADIOTAP_CHANNEL
130    */
131   uint32_t ri_channel;
132
133   /**
134    * Frequency we use.  FIXME: not properly initialized so far!
135    */
136   uint32_t ri_freq;
137
138   /**
139    * IEEE80211_RADIOTAP_RATE * 50000
140    */
141   uint32_t ri_rate;
142
143   /**
144    * IEEE80211_RADIOTAP_ANTENNA
145    */
146   uint32_t ri_antenna;
147 };
148
149
150
151 #endif