1 #ifndef __RADIOTAP_ITER_H
2 #define __RADIOTAP_ITER_H
7 /* Radiotap header iteration
8 * implemented in radiotap.c
11 struct radiotap_override {
13 uint8_t align:4, size:4;
16 struct radiotap_align_size {
17 uint8_t align:4, size:4;
20 struct ieee80211_radiotap_namespace {
21 const struct radiotap_align_size *align_size;
27 struct ieee80211_radiotap_vendor_namespaces {
28 const struct ieee80211_radiotap_namespace *ns;
33 * struct ieee80211_radiotap_iterator - tracks walk thru present radiotap args
34 * @this_arg_index: index of current arg, valid after each successful call
35 * to ieee80211_radiotap_iterator_next()
36 * @this_arg: pointer to current radiotap arg; it is valid after each
37 * call to ieee80211_radiotap_iterator_next() but also after
38 * ieee80211_radiotap_iterator_init() where it will point to
39 * the beginning of the actual data portion
40 * @this_arg_size: length of the current arg, for convenience
41 * @current_namespace: pointer to the current namespace definition
42 * (or internally %NULL if the current namespace is unknown)
43 * @is_radiotap_ns: indicates whether the current namespace is the default
44 * radiotap namespace or not
46 * @overrides: override standard radiotap fields
47 * @n_overrides: number of overrides
49 * @_rtheader: pointer to the radiotap header we are walking through
50 * @_max_length: length of radiotap header in cpu byte ordering
51 * @_arg_index: next argument index
52 * @_arg: next argument pointer
53 * @_next_bitmap: internal pointer to next present u32
54 * @_bitmap_shifter: internal shifter for curr u32 bitmap, b0 set == arg present
55 * @_vns: vendor namespace definitions
56 * @_next_ns_data: beginning of the next namespace's data
57 * @_reset_on_ext: internal; reset the arg index to 0 when going to the
60 * Describes the radiotap parser state. Fields prefixed with an underscore
61 * must not be used by users of the parser, only by the parser internally.
64 struct ieee80211_radiotap_iterator {
65 struct ieee80211_radiotap_header *_rtheader;
66 const struct ieee80211_radiotap_vendor_namespaces *_vns;
67 const struct ieee80211_radiotap_namespace *current_namespace;
69 unsigned char *_arg, *_next_ns_data;
70 uint32_t *_next_bitmap;
72 unsigned char *this_arg;
73 #ifdef RADIOTAP_SUPPORT_OVERRIDES
74 const struct radiotap_override *overrides;
84 uint32_t _bitmap_shifter;
88 extern int ieee80211_radiotap_iterator_init(
89 struct ieee80211_radiotap_iterator *iterator,
90 struct ieee80211_radiotap_header *radiotap_header,
91 int max_length, const struct ieee80211_radiotap_vendor_namespaces *vns);
93 extern int ieee80211_radiotap_iterator_next(
94 struct ieee80211_radiotap_iterator *iterator);
96 #endif /* __RADIOTAP_ITER_H */