# dem0nk/yeyo architecture

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

- Interactive diagram: https://gitdiagram.com/dem0nk/yeyo
- Repository: https://github.com/dem0nk/yeyo

## Overview

yeyo is an in-development Rust packet-capture and inspection tool. Its apparent workflow is selecting a network interface or capture file, receiving frames, parsing link/IP/transport headers, then displaying packet summaries and payload text in line or terminal views. Capture configuration, filtering, saving, and statistics are additional capture capabilities. The README provides no product detail, and the CLI source was not excerpted; edges below are limited to relationships visible in sampled source or the SOURCE INDEX.

Main entry points: [`src/packet/mod.rs`](https://github.com/dem0nk/yeyo/blob/master/src/packet/mod.rs) (Packet parser), [`src/capture/mod.rs`](https://github.com/dem0nk/yeyo/blob/master/src/capture/mod.rs) (Capture control), [`src/render/tui.rs`](https://github.com/dem0nk/yeyo/blob/master/src/render/tui.rs) (Terminal UI), [`src/render/lines.rs`](https://github.com/dem0nk/yeyo/blob/master/src/render/lines.rs) (Line output)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Capture"]
  node_capture_api["Capture control<br/>[mod.rs]"]
  node_devices["Interface discovery<br/>[device.rs]"]
  node_feed["Frame feed<br/>[feed.rs]"]
  node_frame["Captured frame<br/>[frame.rs]"]
  node_options["Capture options<br/>[options.rs]"]
  node_stats["Capture statistics<br/>[stats.rs]"]
end

subgraph group_decode["Packet decoding"]
  node_packet["Packet parser<br/>[mod.rs]"]
  node_linktype["Link types<br/>[link.rs]"]
  node_ethernet["Ethernet headers<br/>[ethernet.rs]"]
  node_ipv4["IPv4 headers<br/>[ipv4.rs]"]
  node_ipv6["IPv6 headers<br/>[ipv6.rs]"]
  node_tcp["TCP headers<br/>[tcp.rs]"]
  node_udp["UDP headers<br/>[udp.rs]"]
end

subgraph group_views["Output views"]
  node_lines["Line output<br/>[lines.rs]"]
  node_summary["Packet summaries<br/>[summary.rs]"]
  node_tui["Terminal UI<br/>[tui.rs]"]
  node_text["Payload text<br/>[text.rs]"]
end

subgraph group_shared["Shared support"]
  node_errors["Error reporting<br/>[error.rs]"]
end

node_operator(("User"))
node_cli["CLI entry<br/>[main.rs]"]
node_pcap["libpcap"]

node_packet -->|"parses headers"| node_ethernet
node_packet -->|"parses headers"| node_ipv4
node_packet -->|"parses headers"| node_ipv6
node_packet -->|"parses headers"| node_tcp
node_packet -->|"parses headers"| node_udp
node_packet -->|"dispatches by"| node_linktype
node_packet -->|"returns parse errors"| node_errors
node_capture_api -->|"exposes discovery"| node_devices
node_capture_api -->|"exposes feed"| node_feed
node_capture_api -->|"creates frames"| node_frame
node_capture_api -->|"configures capture"| node_options
node_capture_api -->|"provides statistics"| node_stats
node_capture_api -->|"captures and saves"| node_pcap
node_capture_api -->|"returns capture errors"| node_errors
node_lines -->|"receives frames"| node_feed
node_lines -->|"parses frames"| node_packet
node_lines -->|"formats packets"| node_summary
node_tui -->|"receives frames"| node_feed
node_tui -->|"parses frames"| node_packet
node_tui -->|"formats packets"| node_summary
node_tui -->|"formats payload"| node_text
node_tui -->|"reports errors"| node_errors
node_lines -->|"reports output errors"| node_errors
node_operator -.->|"invokes"| node_cli

click node_cli "https://github.com/dem0nk/yeyo/blob/master/src/main.rs"
click node_capture_api "https://github.com/dem0nk/yeyo/blob/master/src/capture/mod.rs"
click node_devices "https://github.com/dem0nk/yeyo/blob/master/src/capture/device.rs"
click node_feed "https://github.com/dem0nk/yeyo/blob/master/src/capture/feed.rs"
click node_frame "https://github.com/dem0nk/yeyo/blob/master/src/capture/frame.rs"
click node_options "https://github.com/dem0nk/yeyo/blob/master/src/capture/options.rs"
click node_stats "https://github.com/dem0nk/yeyo/blob/master/src/capture/stats.rs"
click node_packet "https://github.com/dem0nk/yeyo/blob/master/src/packet/mod.rs"
click node_linktype "https://github.com/dem0nk/yeyo/blob/master/src/packet/link.rs"
click node_ethernet "https://github.com/dem0nk/yeyo/blob/master/src/packet/ethernet.rs"
click node_ipv4 "https://github.com/dem0nk/yeyo/blob/master/src/packet/ipv4.rs"
click node_ipv6 "https://github.com/dem0nk/yeyo/blob/master/src/packet/ipv6.rs"
click node_tcp "https://github.com/dem0nk/yeyo/blob/master/src/packet/tcp.rs"
click node_udp "https://github.com/dem0nk/yeyo/blob/master/src/packet/udp.rs"
click node_lines "https://github.com/dem0nk/yeyo/blob/master/src/render/lines.rs"
click node_summary "https://github.com/dem0nk/yeyo/blob/master/src/render/summary.rs"
click node_tui "https://github.com/dem0nk/yeyo/blob/master/src/render/tui.rs"
click node_text "https://github.com/dem0nk/yeyo/blob/master/src/render/text.rs"
click node_errors "https://github.com/dem0nk/yeyo/blob/master/src/error.rs"

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_capture_api,node_devices,node_feed,node_frame,node_options,node_stats,node_operator toneBlue
class node_packet,node_linktype,node_ethernet,node_ipv4,node_ipv6,node_tcp,node_udp toneAmber
class node_lines,node_summary,node_tui,node_text toneMint
class node_errors toneRose
class node_cli toneTeal
class node_pcap toneIndigo
```

## Components

### Capture

- [Capture control](https://github.com/dem0nk/yeyo/blob/master/src/capture/mod.rs): `src/capture/mod.rs`
- [Interface discovery](https://github.com/dem0nk/yeyo/blob/master/src/capture/device.rs): `src/capture/device.rs`
- [Frame feed](https://github.com/dem0nk/yeyo/blob/master/src/capture/feed.rs): `src/capture/feed.rs`
- [Captured frame](https://github.com/dem0nk/yeyo/blob/master/src/capture/frame.rs): `src/capture/frame.rs`
- [Capture options](https://github.com/dem0nk/yeyo/blob/master/src/capture/options.rs): `src/capture/options.rs`
- [Capture statistics](https://github.com/dem0nk/yeyo/blob/master/src/capture/stats.rs): `src/capture/stats.rs`

### Packet decoding

- [Packet parser](https://github.com/dem0nk/yeyo/blob/master/src/packet/mod.rs): `src/packet/mod.rs`
- [Link types](https://github.com/dem0nk/yeyo/blob/master/src/packet/link.rs): `src/packet/link.rs`
- [Ethernet headers](https://github.com/dem0nk/yeyo/blob/master/src/packet/ethernet.rs): `src/packet/ethernet.rs`
- [IPv4 headers](https://github.com/dem0nk/yeyo/blob/master/src/packet/ipv4.rs): `src/packet/ipv4.rs`
- [IPv6 headers](https://github.com/dem0nk/yeyo/blob/master/src/packet/ipv6.rs): `src/packet/ipv6.rs`
- [TCP headers](https://github.com/dem0nk/yeyo/blob/master/src/packet/tcp.rs): `src/packet/tcp.rs`
- [UDP headers](https://github.com/dem0nk/yeyo/blob/master/src/packet/udp.rs): `src/packet/udp.rs`

### Output views

- [Line output](https://github.com/dem0nk/yeyo/blob/master/src/render/lines.rs): `src/render/lines.rs`
- [Packet summaries](https://github.com/dem0nk/yeyo/blob/master/src/render/summary.rs): `src/render/summary.rs`
- [Terminal UI](https://github.com/dem0nk/yeyo/blob/master/src/render/tui.rs): `src/render/tui.rs`
- [Payload text](https://github.com/dem0nk/yeyo/blob/master/src/render/text.rs): `src/render/text.rs`

### Shared support

- [Error reporting](https://github.com/dem0nk/yeyo/blob/master/src/error.rs): `src/error.rs`

### Other components

- **User**
- [CLI entry](https://github.com/dem0nk/yeyo/blob/master/src/main.rs): `src/main.rs`
- **libpcap**

## Connections

- Packet parser → Ethernet headers: parses headers (evidence: `src/packet/mod.rs`)
- Packet parser → IPv4 headers: parses headers (evidence: `src/packet/mod.rs`)
- Packet parser → IPv6 headers: parses headers (evidence: `src/packet/mod.rs`)
- Packet parser → TCP headers: parses headers (evidence: `src/packet/mod.rs`)
- Packet parser → UDP headers: parses headers (evidence: `src/packet/mod.rs`)
- Packet parser → Link types: dispatches by (evidence: `src/packet/mod.rs`)
- Packet parser → Error reporting: returns parse errors (evidence: `src/packet/mod.rs`)
- Capture control → Interface discovery: exposes discovery (evidence: `src/capture/mod.rs`)
- Capture control → Frame feed: exposes feed (evidence: `src/capture/mod.rs`)
- Capture control → Captured frame: creates frames (evidence: `src/capture/mod.rs`)
- Capture control → Capture options: configures capture (evidence: `src/capture/mod.rs`)
- Capture control → Capture statistics: provides statistics (evidence: `src/capture/mod.rs`)
- Capture control → libpcap: captures and saves (evidence: `src/capture/mod.rs`)
- Capture control → Error reporting: returns capture errors (evidence: `src/capture/mod.rs`)
- Line output → Frame feed: receives frames (evidence: `src/render/lines.rs`)
- Line output → Packet parser: parses frames (evidence: `src/render/lines.rs`)
- Line output → Packet summaries: formats packets (evidence: `src/render/lines.rs`)
- Terminal UI → Frame feed: receives frames (evidence: `src/render/tui.rs`)
- Terminal UI → Packet parser: parses frames (evidence: `src/render/tui.rs`)
- Terminal UI → Packet summaries: formats packets (evidence: `src/render/tui.rs`)
- Terminal UI → Payload text: formats payload (evidence: `src/render/tui.rs`)
- Terminal UI → Error reporting: reports errors (evidence: `src/render/tui.rs`)
- Line output → Error reporting: reports output errors (evidence: `src/render/lines.rs`)
- User → CLI entry: invokes
