2 * Copyright (c) 2007, 2008, Andy Green <andy@warmcat.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 2.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #include "byteorder.h"
29 #define unlikely(x) (x)
32 #include "ieee80211_radiotap.h"
36 * Radiotap header iteration
37 * implemented in src/radiotap-parser.c
39 * call __ieee80211_radiotap_iterator_init() to init a semi-opaque iterator
40 * struct ieee80211_radiotap_iterator (no need to init the struct beforehand)
41 * then loop calling __ieee80211_radiotap_iterator_next()... it returns -1
42 * if there are no more args in the header, or the next argument type index
43 * that is present. The iterator's this_arg member points to the start of the
44 * argument associated with the current argument index that is present,
45 * which can be found in the iterator's this_arg_index member. This arg
46 * index corresponds to the IEEE80211_RADIOTAP_... defines.
49 * struct ieee80211_radiotap_iterator - tracks walk thru present radiotap args
50 * @rtheader: pointer to the radiotap header we are walking through
51 * @max_length: length of radiotap header in cpu byte ordering
52 * @this_arg_index: IEEE80211_RADIOTAP_... index of current arg
53 * @this_arg: pointer to current radiotap arg
54 * @arg_index: internal next argument index
55 * @arg: internal next argument pointer
56 * @next_bitmap: internal pointer to next present u32
57 * @bitmap_shifter: internal shifter for curr u32 bitmap, b0 set == arg present
60 struct ieee80211_radiotap_iterator
62 struct ieee80211_radiotap_header *rtheader;
73 int ieee80211_radiotap_iterator_init (struct ieee80211_radiotap_iterator
75 struct ieee80211_radiotap_header
76 *radiotap_header, int max_length);
78 int ieee80211_radiotap_iterator_next (struct ieee80211_radiotap_iterator