xref: /openwifi/user_space/inject_80211/radiotap.h (revision 51e498afbfbd6b85e15796b9929c691dd7654a6a)
17273ec43Smmehari #include "ieee80211_radiotap.h"
27273ec43Smmehari 
3*51e498afSXianjun Jiao // -----ieee80211_radiotap_iterator from cfg80211.h ----- //
47273ec43Smmehari /**
57273ec43Smmehari  * struct ieee80211_radiotap_iterator - tracks walk thru present radiotap args
6*51e498afSXianjun Jiao  * @this_arg_index: index of current arg, valid after each successful call
7*51e498afSXianjun Jiao  *	to ieee80211_radiotap_iterator_next()
8*51e498afSXianjun Jiao  * @this_arg: pointer to current radiotap arg; it is valid after each
9*51e498afSXianjun Jiao  *	call to ieee80211_radiotap_iterator_next() but also after
10*51e498afSXianjun Jiao  *	ieee80211_radiotap_iterator_init() where it will point to
11*51e498afSXianjun Jiao  *	the beginning of the actual data portion
12*51e498afSXianjun Jiao  * @this_arg_size: length of the current arg, for convenience
13*51e498afSXianjun Jiao  * @current_namespace: pointer to the current namespace definition
14*51e498afSXianjun Jiao  *	(or internally %NULL if the current namespace is unknown)
15*51e498afSXianjun Jiao  * @is_radiotap_ns: indicates whether the current namespace is the default
16*51e498afSXianjun Jiao  *	radiotap namespace or not
17*51e498afSXianjun Jiao  *
18*51e498afSXianjun Jiao  * @_rtheader: pointer to the radiotap header we are walking through
19*51e498afSXianjun Jiao  * @_max_length: length of radiotap header in cpu byte ordering
20*51e498afSXianjun Jiao  * @_arg_index: next argument index
21*51e498afSXianjun Jiao  * @_arg: next argument pointer
22*51e498afSXianjun Jiao  * @_next_bitmap: internal pointer to next present u32
23*51e498afSXianjun Jiao  * @_bitmap_shifter: internal shifter for curr u32 bitmap, b0 set == arg present
24*51e498afSXianjun Jiao  * @_vns: vendor namespace definitions
25*51e498afSXianjun Jiao  * @_next_ns_data: beginning of the next namespace's data
26*51e498afSXianjun Jiao  * @_reset_on_ext: internal; reset the arg index to 0 when going to the
27*51e498afSXianjun Jiao  *	next bitmap word
28*51e498afSXianjun Jiao  *
29*51e498afSXianjun Jiao  * Describes the radiotap parser state. Fields prefixed with an underscore
30*51e498afSXianjun Jiao  * must not be used by users of the parser, only by the parser internally.
317273ec43Smmehari  */
327273ec43Smmehari 
337273ec43Smmehari struct ieee80211_radiotap_iterator {
34*51e498afSXianjun Jiao 	struct ieee80211_radiotap_header *_rtheader;
35*51e498afSXianjun Jiao 	const struct ieee80211_radiotap_vendor_namespaces *_vns;
36*51e498afSXianjun Jiao 	const struct ieee80211_radiotap_namespace *current_namespace;
377273ec43Smmehari 
38*51e498afSXianjun Jiao 	unsigned char *_arg, *_next_ns_data;
39*51e498afSXianjun Jiao 	__le32 *_next_bitmap;
40*51e498afSXianjun Jiao 
41*51e498afSXianjun Jiao 	unsigned char *this_arg;
42*51e498afSXianjun Jiao 	int this_arg_index;
43*51e498afSXianjun Jiao 	int this_arg_size;
44*51e498afSXianjun Jiao 
45*51e498afSXianjun Jiao 	int is_radiotap_ns;
46*51e498afSXianjun Jiao 
47*51e498afSXianjun Jiao 	int _max_length;
48*51e498afSXianjun Jiao 	int _arg_index;
49*51e498afSXianjun Jiao 	uint32_t _bitmap_shifter;
50*51e498afSXianjun Jiao 	int _reset_on_ext;
517273ec43Smmehari };
527273ec43Smmehari 
537273ec43Smmehari extern int ieee80211_radiotap_iterator_init(
547273ec43Smmehari 	struct ieee80211_radiotap_iterator *iterator,
557273ec43Smmehari 	struct ieee80211_radiotap_header *radiotap_header,
56*51e498afSXianjun Jiao 	int max_length, const struct ieee80211_radiotap_vendor_namespaces *vns);
577273ec43Smmehari 
587273ec43Smmehari extern int ieee80211_radiotap_iterator_next(
597273ec43Smmehari 	struct ieee80211_radiotap_iterator *iterator);
607273ec43Smmehari 
61