# radiotap/radiotap-library architecture

> Architecture diagram of the GitHub repository radiotap/radiotap-library, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/radiotap/radiotap-library
- Repository: https://github.com/radiotap/radiotap-library

## Overview

This is a C library for iterating over IEEE 802.11 radiotap headers, accompanied by a command-line example that reads a file and prints recognized fields. The principal workflow is: a user supplies a capture file, the example initializes the iterator, advances through present arguments, and reports them. The library handles header validation, alignment, extended presence bitmaps, and vendor namespaces; public headers define the wire format and iterator interface. The excerpts show the example’s calls and the iterator implementation’s helpers. Other capabilities are limited to what the sampled files establish.

Main entry points: [`parse.c`](https://github.com/radiotap/radiotap-library/blob/master/parse.c) (File parser), [`radiotap.c`](https://github.com/radiotap/radiotap-library/blob/master/radiotap.c) (Radiotap iterator), [`radiotap_iter.h`](https://github.com/radiotap/radiotap-library/blob/master/radiotap_iter.h) (Iterator API), [`platform.h`](https://github.com/radiotap/radiotap-library/blob/master/platform.h) (Platform helpers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_example["Example parser"]
  node_parse["File parser<br/>[parse.c]"]
  node_output["Printed fields"]
end

subgraph group_runtime["Iterator runtime"]
  node_iterator["Radiotap iterator<br/>[radiotap.c]"]
  node_platform["Platform helpers<br/>[platform.h]"]
end

subgraph group_interface["Public interface"]
  node_iter_api["Iterator API<br/>[radiotap_iter.h]"]
  node_format["Radiotap definitions<br/>[radiotap.h]"]
end

node_user(("CLI user"))

node_user -->|"runs on file"| node_parse
node_parse -->|"initializes and advances"| node_iterator
node_parse -->|"prints fields"| node_output
node_iterator -->|"uses endian helpers"| node_platform
node_iterator -->|"implements interface"| node_iter_api
node_iter_api -->|"includes definitions"| node_format

click node_parse "https://github.com/radiotap/radiotap-library/blob/master/parse.c"
click node_iterator "https://github.com/radiotap/radiotap-library/blob/master/radiotap.c"
click node_platform "https://github.com/radiotap/radiotap-library/blob/master/platform.h"
click node_iter_api "https://github.com/radiotap/radiotap-library/blob/master/radiotap_iter.h"
click node_format "https://github.com/radiotap/radiotap-library/blob/master/radiotap.h"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_parse,node_output,node_user toneBlue
class node_iterator,node_platform toneAmber
class node_iter_api,node_format toneMint
```

## Components

### Example parser

- [File parser](https://github.com/radiotap/radiotap-library/blob/master/parse.c): `parse.c`
- **Printed fields**

### Iterator runtime

- [Radiotap iterator](https://github.com/radiotap/radiotap-library/blob/master/radiotap.c): `radiotap.c`
- [Platform helpers](https://github.com/radiotap/radiotap-library/blob/master/platform.h): `platform.h`

### Public interface

- [Iterator API](https://github.com/radiotap/radiotap-library/blob/master/radiotap_iter.h): `radiotap_iter.h`
- [Radiotap definitions](https://github.com/radiotap/radiotap-library/blob/master/radiotap.h): `radiotap.h`

### Other components

- **CLI user**

## Connections

- CLI user → File parser: runs on file (evidence: `parse.c`)
- File parser → Radiotap iterator: initializes and advances (evidence: `parse.c`)
- File parser → Printed fields: prints fields (evidence: `parse.c`)
- Radiotap iterator → Platform helpers: uses endian helpers (evidence: `radiotap.c`)
- Radiotap iterator → Iterator API: implements interface (evidence: `radiotap.c`)
- Iterator API → Radiotap definitions: includes definitions (evidence: `radiotap_iter.h`)
