ieee80211_ra...terator_init(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ieee80211_radiotap_iterator_init β€” radiotap parser iterator initialization

okay so bestie, this one's from the Kernel API Manual, page ieee80211_ra...terator_init(9), and it's literally the glow-up ritual for your radiotap parser iterator. let's get into it πŸ’–


✨ NAME ✨

ieee80211_radiotap_iterator_init β€” radiotap parser iterator initialization

like. the setup. the origin story. the "get your iterator ready before the real work starts" moment πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

int ieee80211_radiotap_iterator_init (struct ieee80211_radiotap_iterator
*iterator , struct ieee80211_radiotap_header *radiotap_header , int
max_length , const struct ieee80211_radiotap_vendor_namespaces *vns );

no cap, that's the whole signature. four args, one int coming back at you πŸ’«


🌸 ARGUMENTS 🌸

  • iterator β€” the radiotap_iterator you're initializing. this is the main character of the whole operation, honestly πŸ‘‘
  • radiotap_header β€” the radiotap header you're going to parse. the thing being read. iconic.
  • max_length β€” total length we can parse into (eg, whole packet length). like, how far you're allowed to go 🫢
  • vns β€” vendor namespaces to parse. the little namespace situation πŸ’œ

πŸ”₯ RETURN πŸ”₯

0 or a negative error code if there is a problem.

that's it. 0 = slay, negative = uh oh 😭


⭐ DESCRIPTION ⭐

So this function initializes an opaque iterator struct which can then be passed to ieee80211_radiotap_iterator_next to visit every radiotap argument which is present in the header. It knows about extended present headers and handles them. fr fr, it's got you on the extended-present-header front β€” no manual fiddling required ✨

🧚 how to use it, bestie

  1. call __ieee80211_radiotap_iterator_init to init a semi-opaque iterator struct ieee80211_radiotap_iterator (no need to init the struct beforehand) checking for a good 0 return code.
  2. then loop calling __ieee80211_radiotap_iterator_next... it returns either 0, -ENOENT if there are no more args to parse, or -EINVAL if there is a problem.

the iterator's this_arg member points to the start of the argument associated with the current argument index that is present, which can be found in the iterator's this_arg_index member. This arg index corresponds to the IEEE80211_RADIOTAP_... defines. iykyk πŸ’…

πŸŽ€ radiotap header length

You can find the CPU-endian total radiotap header length in iterator->max_length after executing ieee80211_radiotap_iterator_init successfully. so like, once it actually works, the length's right there waiting for you πŸ’–

⚠️ Alignment Gotcha

You must take care when dereferencing iterator.this_arg for multibyte types... the pointer is not aligned. Use get_unaligned((type *)iterator.this_arg) to dereference iterator.this_arg for type "type" safely on all arches.

not me warning you twice: the pointer is not aligned, bestie. do not just cast and deref like it's nothing. get_unaligned is the safe route on all arches, periodt πŸ™ˆ

πŸ“ example code

See Documentation/networking/radiotap-headers.rst β€” go look, it's giving tutorial energy 🌈


🌟 SEE ALSO 🌟


okay that's the whole page 🫢 this gem lives in ./net/wireless, dated October 2026, and it's from the Kernel API Manual β€” version vibes: ieee80211_ra...terator_init(9). go init that iterator, bestie, you're gonna eat πŸ’œπŸ’«

πŸ“¦ where this page comes from