# seemoo-lab/owl architecture

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

- Interactive diagram: https://gitdiagram.com/seemoo-lab/owl
- Repository: https://github.com/seemoo-lab/owl

## Overview

OWL is a user-space Apple Wireless Direct Link implementation that bridges AWDL radio frames to ordinary IPv6 networking. The main workflow is: an operator starts the daemon, the event-driven core configures interfaces and schedules protocol activity, received frames are parsed into peer and synchronization state, and transmitted or decapsulated traffic crosses between the WLAN and host interfaces. The graph reflects README-documented capabilities and source-index references; several implementation links are therefore documented or import-based rather than verified from full source excerpts.

Main entry points: [`daemon/core.c`](https://github.com/seemoo-lab/owl/blob/master/daemon/core.c) (Event core), [`src/rx.c`](https://github.com/seemoo-lab/owl/blob/master/src/rx.c) (Receive processing), [`src/state.c`](https://github.com/seemoo-lab/owl/blob/master/src/state.c) (AWDL state), [`src/peers.c`](https://github.com/seemoo-lab/owl/blob/master/src/peers.c) (Peer table)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Daemon runtime"]
  node_owl_cli["CLI startup<br/>[owl.c]"]
  node_core["Event core<br/>[core.c]"]
end

subgraph group_protocol["AWDL protocol"]
  node_rx["Receive processing<br/>[rx.c]"]
  node_tx["Frame crafting<br/>[tx.c]"]
  node_schedule["Transmission schedule<br/>[schedule.c]"]
  node_frame["AWDL frame types<br/>[frame.h]"]
  node_wire["Buffer and wire parsing<br/>[wire.c]"]
  node_version["Protocol version<br/>[version.c]"]
  node_ieee80211["802.11 definitions<br/>[ieee80211.h]"]
end

subgraph group_peerstate["Peer and timing state"]
  node_state["AWDL state<br/>[state.c]"]
  node_peers["Peer table<br/>[peers.c]"]
  node_hashmap["Peer map storage<br/>[hashmap.c]"]
  node_election["Master election<br/>[election.c]"]
  node_sync["Availability timing<br/>[sync.c]"]
  node_channel["Channel sequence<br/>[channel.c]"]
end

subgraph group_platform["Platform networking"]
  node_io["Frame I/O<br/>[io.c]"]
  node_netutils["System networking<br/>[netutils.c]"]
end

node_operator(("Operator"))
node_host_apps(("IPv6 applications"))
node_wireless_peers(("AWDL peers"))

node_operator -->|"starts"| node_owl_cli
node_owl_cli -->|"configures"| node_core
node_core -->|"uses"| node_io
node_core -->|"configures"| node_netutils
node_core -->|"dispatches frames"| node_rx
node_core -->|"requests frames"| node_tx
node_core -->|"schedules"| node_schedule
node_rx -->|"updates peers"| node_peers
node_rx -->|"parses bytes"| node_wire
node_rx -->|"dispatches TLVs"| node_frame
node_rx -->|"updates protocol state"| node_state
node_rx -->|"handles timing TLVs"| node_sync
node_tx -->|"encodes frames"| node_frame
node_tx -->|"uses timing"| node_sync
node_tx -->|"uses definitions"| node_ieee80211
node_schedule -->|"reads state"| node_state
node_schedule -->|"reads peers"| node_peers
node_state -->|"contains peer state"| node_peers
node_state -->|"contains timing state"| node_sync
node_state -->|"contains channel state"| node_channel
node_state -->|"initializes version"| node_version
node_peers -->|"uses storage"| node_hashmap
node_peers -->|"stores election data"| node_election
node_peers -->|"stores sequences"| node_channel
node_core -->|"bridges IPv6 traffic"| node_host_apps
node_host_apps -->|"sends host traffic"| node_core
node_core -->|"exchanges AWDL frames"| node_wireless_peers
node_wireless_peers -->|"sends radio frames"| node_core
node_core -->|"updates neighbor table"| node_netutils
node_io -->|"uses platform helpers"| node_netutils

click node_owl_cli "https://github.com/seemoo-lab/owl/blob/master/daemon/owl.c"
click node_core "https://github.com/seemoo-lab/owl/blob/master/daemon/core.c"
click node_io "https://github.com/seemoo-lab/owl/blob/master/daemon/io.c"
click node_netutils "https://github.com/seemoo-lab/owl/blob/master/daemon/netutils.c"
click node_rx "https://github.com/seemoo-lab/owl/blob/master/src/rx.c"
click node_tx "https://github.com/seemoo-lab/owl/blob/master/src/tx.c"
click node_schedule "https://github.com/seemoo-lab/owl/blob/master/src/schedule.c"
click node_frame "https://github.com/seemoo-lab/owl/blob/master/src/frame.h"
click node_wire "https://github.com/seemoo-lab/owl/blob/master/src/wire.c"
click node_state "https://github.com/seemoo-lab/owl/blob/master/src/state.c"
click node_peers "https://github.com/seemoo-lab/owl/blob/master/src/peers.c"
click node_hashmap "https://github.com/seemoo-lab/owl/blob/master/src/hashmap.c"
click node_election "https://github.com/seemoo-lab/owl/blob/master/src/election.c"
click node_sync "https://github.com/seemoo-lab/owl/blob/master/src/sync.c"
click node_channel "https://github.com/seemoo-lab/owl/blob/master/src/channel.c"
click node_version "https://github.com/seemoo-lab/owl/blob/master/src/version.c"
click node_ieee80211 "https://github.com/seemoo-lab/owl/blob/master/src/ieee80211.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_owl_cli,node_core toneBlue
class node_rx,node_tx,node_schedule,node_frame,node_wire,node_version,node_ieee80211 toneAmber
class node_state,node_peers,node_hashmap,node_election,node_sync,node_channel toneMint
class node_io,node_netutils toneRose
class node_operator,node_host_apps,node_wireless_peers toneIndigo
```

## Components

### Daemon runtime

- [CLI startup](https://github.com/seemoo-lab/owl/blob/master/daemon/owl.c): `daemon/owl.c`
- [Event core](https://github.com/seemoo-lab/owl/blob/master/daemon/core.c): `daemon/core.c`

### AWDL protocol

- [Receive processing](https://github.com/seemoo-lab/owl/blob/master/src/rx.c): `src/rx.c`
- [Frame crafting](https://github.com/seemoo-lab/owl/blob/master/src/tx.c): `src/tx.c`
- [Transmission schedule](https://github.com/seemoo-lab/owl/blob/master/src/schedule.c): `src/schedule.c`
- [AWDL frame types](https://github.com/seemoo-lab/owl/blob/master/src/frame.h): `src/frame.h`
- [Buffer and wire parsing](https://github.com/seemoo-lab/owl/blob/master/src/wire.c): `src/wire.c`
- [Protocol version](https://github.com/seemoo-lab/owl/blob/master/src/version.c): `src/version.c`
- [802.11 definitions](https://github.com/seemoo-lab/owl/blob/master/src/ieee80211.h): `src/ieee80211.h`

### Peer and timing state

- [AWDL state](https://github.com/seemoo-lab/owl/blob/master/src/state.c): `src/state.c`
- [Peer table](https://github.com/seemoo-lab/owl/blob/master/src/peers.c): `src/peers.c`
- [Peer map storage](https://github.com/seemoo-lab/owl/blob/master/src/hashmap.c): `src/hashmap.c`
- [Master election](https://github.com/seemoo-lab/owl/blob/master/src/election.c): `src/election.c`
- [Availability timing](https://github.com/seemoo-lab/owl/blob/master/src/sync.c): `src/sync.c`
- [Channel sequence](https://github.com/seemoo-lab/owl/blob/master/src/channel.c): `src/channel.c`

### Platform networking

- [Frame I/O](https://github.com/seemoo-lab/owl/blob/master/daemon/io.c): `daemon/io.c`
- [System networking](https://github.com/seemoo-lab/owl/blob/master/daemon/netutils.c): `daemon/netutils.c`

### Other components

- **Operator**
- **IPv6 applications**
- **AWDL peers**

## Connections

- Operator → CLI startup: starts (evidence: `README.md`)
- CLI startup → Event core: configures (evidence: `daemon/owl.c`)
- Event core → Frame I/O: uses (evidence: `daemon/core.c`)
- Event core → System networking: configures (evidence: `daemon/core.c`)
- Event core → Receive processing: dispatches frames (evidence: `daemon/core.c`)
- Event core → Frame crafting: requests frames (evidence: `daemon/core.c`)
- Event core → Transmission schedule: schedules (evidence: `daemon/core.c`)
- Receive processing → Peer table: updates peers (evidence: `src/rx.c`)
- Receive processing → Buffer and wire parsing: parses bytes (evidence: `src/rx.c`)
- Receive processing → AWDL frame types: dispatches TLVs (evidence: `src/rx.c`)
- Receive processing → AWDL state: updates protocol state
- Receive processing → Availability timing: handles timing TLVs (evidence: `src/rx.c`)
- Frame crafting → AWDL frame types: encodes frames
- Frame crafting → Availability timing: uses timing (evidence: `src/tx.c`)
- Frame crafting → 802.11 definitions: uses definitions (evidence: `src/tx.c`)
- Transmission schedule → AWDL state: reads state
- Transmission schedule → Peer table: reads peers
- AWDL state → Peer table: contains peer state
- AWDL state → Availability timing: contains timing state
- AWDL state → Channel sequence: contains channel state
- AWDL state → Protocol version: initializes version (evidence: `src/state.c`)
- Peer table → Peer map storage: uses storage (evidence: `src/peers.c`)
- Peer table → Master election: stores election data
- Peer table → Channel sequence: stores sequences
- Event core → IPv6 applications: bridges IPv6 traffic (evidence: `README.md`)
- IPv6 applications → Event core: sends host traffic (evidence: `daemon/core.c`)
- Event core → AWDL peers: exchanges AWDL frames (evidence: `README.md`)
- AWDL peers → Event core: sends radio frames (evidence: `daemon/core.c`)
- Event core → System networking: updates neighbor table (evidence: `daemon/core.c`)
- Frame I/O → System networking: uses platform helpers (evidence: `daemon/io.c`)
