|
| 1 | +Radiotap - IEEE 802.11 Radiotap Header |
| 2 | +======================================== |
| 3 | + |
| 4 | +.. module:: pcapkit.protocols.link.radiotap |
| 5 | + |
| 6 | +:mod:`pcapkit.protocols.link.radiotap` contains |
| 7 | +:class:`~pcapkit.protocols.link.radiotap.Radiotap` |
| 8 | +only, which implements the extractor for the radiotap header [*]_ capture |
| 9 | +tools prepend to an 802.11 frame, as seen on a |
| 10 | +``LINKTYPE_LINUX_SLL``/``LINKTYPE_LINUX_SLL2`` capture whose ``arphrd_type`` |
| 11 | +is ``ARPHRD_IEEE80211_RADIOTAP``. Radiotap is not part of the 802.11 |
| 12 | +standard itself -- it is a prefix written by the capturing tool, in front of |
| 13 | +the raw 802.11 MAC frame. Its fixed start, all little-endian, is described |
| 14 | +as below: |
| 15 | + |
| 16 | +.. table:: |
| 17 | + |
| 18 | + ====== ==== ======================== ================================ |
| 19 | + Octets Bits Name Description |
| 20 | + ====== ==== ======================== ================================ |
| 21 | + 0 0 ``radiotap.it_version`` Header Revision (always ``0``) |
| 22 | + 1 8 ``radiotap.it_pad`` Padding |
| 23 | + 2 16 ``radiotap.it_len`` Header Length (header included) |
| 24 | + 4 32 ``radiotap.it_present`` First Present-Flags Word |
| 25 | + ====== ==== ======================== ================================ |
| 26 | + |
| 27 | +followed by a chain of further present-flags words -- bit 31 of a word |
| 28 | +signals that another follows -- and then the optional-field region those |
| 29 | +bitmasks select, each field aligned and sized per its own type. ``it_len`` |
| 30 | +bounds the whole of it; the 802.11 MAC frame starts at that offset. |
| 31 | + |
| 32 | +Scope |
| 33 | +----- |
| 34 | + |
| 35 | +Decoding every optional field radiotap.org defines, and the 802.11 MAC |
| 36 | +frame behind them, is future work tracked on :issue:`2460` and |
| 37 | +:issue:`2502` -- this is already the widest of that issue's five |
| 38 | +follow-ups, and the 802.11 MAC frame is a protocol family of its own. This |
| 39 | +first cut instead: |
| 40 | + |
| 41 | +* **Decodes** the fixed 8-octet start -- ``it_version``, ``it_pad``, |
| 42 | + ``it_len`` -- and walks the present-flags chain far enough to know how |
| 43 | + many words it has |
| 44 | + (:attr:`~pcapkit.protocols.data.link.radiotap.Radiotap.present`), without |
| 45 | + decoding what any bit selects. |
| 46 | +* **Skips, rather than decodes,** the optional-field region those bits |
| 47 | + select -- the octets between the present-flags chain and ``it_len`` are |
| 48 | + kept whole and undissected, as |
| 49 | + :attr:`~pcapkit.protocols.data.link.radiotap.Radiotap.fields`. |
| 50 | +* **Leaves opaque** everything from ``it_len`` on: the 802.11 MAC frame |
| 51 | + itself, which has no dissector anywhere in this package yet. It is kept |
| 52 | + as :class:`~pcapkit.protocols.misc.raw.Raw` (or |
| 53 | + :class:`~pcapkit.protocols.misc.null.NoPayload` when nothing follows), |
| 54 | + unconditionally. |
| 55 | + |
| 56 | +.. autoclass:: pcapkit.protocols.link.radiotap.Radiotap |
| 57 | + :no-members: |
| 58 | + :show-inheritance: |
| 59 | + |
| 60 | + .. autoproperty:: name |
| 61 | + .. autoproperty:: alias |
| 62 | + .. autoproperty:: length |
| 63 | + |
| 64 | + .. automethod:: id |
| 65 | + |
| 66 | + .. automethod:: read |
| 67 | + .. automethod:: make |
| 68 | + |
| 69 | + .. automethod:: __length_hint__ |
| 70 | + .. automethod:: __index__ |
| 71 | + |
| 72 | + .. automethod:: _make_data |
| 73 | + .. automethod:: _import_next_layer |
| 74 | + |
| 75 | + .. autoattribute:: __proto__ |
| 76 | + :no-value: |
| 77 | + |
| 78 | +Header Schemas |
| 79 | +-------------- |
| 80 | + |
| 81 | +.. module:: pcapkit.protocols.schema.link.radiotap |
| 82 | + |
| 83 | +.. autoclass:: pcapkit.protocols.schema.link.radiotap.Radiotap |
| 84 | + :members: |
| 85 | + :show-inheritance: |
| 86 | + |
| 87 | +Data Models |
| 88 | +----------- |
| 89 | + |
| 90 | +.. module:: pcapkit.protocols.data.link.radiotap |
| 91 | + |
| 92 | +.. autoclass:: pcapkit.protocols.data.link.radiotap.Radiotap |
| 93 | + :members: |
| 94 | + :show-inheritance: |
| 95 | + |
| 96 | +.. rubric:: Footnotes |
| 97 | + |
| 98 | +.. [*] <https://www.radiotap.org/>; the Linux kernel's |
| 99 | + ``include/net/ieee80211_radiotap.h`` and ``net/wireless/radiotap.c``; and |
| 100 | + Wireshark's ``packet-ieee80211-radiotap.c``. |
0 commit comments