2 This file is part of GNUnet.
3 (C) 2009 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/gnunet-transport-wlan-helper.h
23 * @brief common internal definitions for the wlan mediator
24 * @author David Brodski
43 typedef unsigned int u32;
44 typedef unsigned short u16;
45 typedef unsigned char u8;
48 #if __BYTE_ORDER == __LITTLE_ENDIAN
49 #define le16_to_cpu(x) (x)
50 #define le32_to_cpu(x) (x)
52 #define le16_to_cpu(x) ((((x)&0xff)<<8)|(((x)&0xff00)>>8))
53 #define le32_to_cpu(x) \
54 ((((x)&0xff)<<24)|(((x)&0xff00)<<8)|(((x)&0xff0000)>>8)|(((x)&0xff000000)>>24))
56 #define unlikely(x) (x)
59 #endif /* gnunet_wlan_H */
62 /* Radiotap header iteration
63 * implemented in net/wireless/radiotap.c
64 * docs in Documentation/networking/radiotap-headers.txt
67 * struct ieee80211_radiotap_iterator - tracks walk thru present radiotap args
68 * rtheader: pointer to the radiotap header we are walking through
69 * max_length: length of radiotap header in cpu byte ordering
70 * this_arg_index: IEEE80211_RADIOTAP_... index of current arg
71 * this_arg: pointer to current radiotap arg
72 * arg_index: internal next argument index
73 * arg: internal next argument pointer
74 * next_bitmap: internal pointer to next present u32
75 * bitmap_shifter: internal shifter for curr u32 bitmap, b0 set == arg present
78 struct ieee80211_radiotap_iterator {
79 struct ieee80211_radiotap_header *rtheader;
90 extern int ieee80211_radiotap_iterator_init(
91 struct ieee80211_radiotap_iterator *iterator,
92 struct ieee80211_radiotap_header *radiotap_header,
95 extern int ieee80211_radiotap_iterator_next(
96 struct ieee80211_radiotap_iterator *iterator);