# gyulyvgc/sniffnet architecture

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

- Interactive diagram: https://gitdiagram.com/gyulyvgc/sniffnet
- Repository: https://github.com/gyulyvgc/sniffnet

## Overview

Sniffnet is a cross-platform desktop application for monitoring network traffic. The main user workflow is to choose a capture source and filters, collect and interpret traffic, then inspect live statistics and charts or browse connection details; users can also export PCAP reports. The graph preserves documented reporting, notifications, location lookup, and customization capabilities. Source excerpts are partial, so some subsystem links are documented capabilities rather than verified calls; unshown implementation details are not inferred.

Main entry points: [`src/gui/sniffer.rs`](https://github.com/gyulyvgc/sniffnet/blob/main/src/gui/sniffer.rs) (App coordinator), [`src/gui/pages`](https://github.com/gyulyvgc/sniffnet/tree/main/src/gui/pages) (App pages), [`src/networking/parse_packets.rs`](https://github.com/gyulyvgc/sniffnet/blob/main/src/networking/parse_packets.rs) (Packet processing), [`src/networking/types/data_info.rs`](https://github.com/gyulyvgc/sniffnet/blob/main/src/networking/types/data_info.rs) (Traffic statistics)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application and UI"]
  node_sniffer["App coordinator<br/>[sniffer.rs]"]
  node_pages["App pages"]
  node_preferences["Settings and filters<br/>[conf.rs]"]
end

subgraph group_capture["Capture and analysis"]
  node_capture_source["Capture sources<br/>[capture_context.rs]"]
  node_packet_capture["Packet capture<br/>[capture.rs]"]
  node_packet_parser["Packet parser<br/>[packet.rs]"]
  node_packet_manager["Packet management<br/>[manage_packets.rs]"]
  node_packet_processing["Packet processing<br/>[parse_packets.rs]"]
end

subgraph group_insight["Traffic insights"]
  node_traffic_state["Traffic statistics<br/>[data_info.rs]"]
  node_traffic_model["Traffic model"]
  node_overview["Overview charts<br/>[overview_page.rs]"]
  node_inspect["Connection inspection<br/>[inspect_page.rs]"]
  node_preview["Traffic previews<br/>[traffic_preview.rs]"]
end

subgraph group_support["Supporting features"]
  node_geo_lookup["Host geolocation<br/>[country.rs]"]
  node_asn_lookup["ASN lookup<br/>[asn.rs]"]
end

subgraph group_reporting["Reports and alerts"]
  node_notifications["Notifications<br/>[notify_and_log.rs]"]
  node_report_export["Report and PCAP"]
end

node_user(("User"))

node_user -->|"uses"| node_sniffer
node_sniffer -->|"starts previews"| node_preview
node_sniffer -->|"manages capture"| node_capture_source
node_capture_source -.->|"opens source"| node_packet_capture
node_packet_capture -.->|"delivers packets"| node_packet_manager
node_packet_manager -.->|"processes packets"| node_packet_processing
node_packet_processing -.->|"parses packets"| node_packet_parser
node_packet_processing -.->|"updates statistics"| node_traffic_state
node_sniffer -.->|"renders pages"| node_pages
node_sniffer -.->|"loads settings"| node_preferences
node_pages -->|"shows overview"| node_overview
node_pages -->|"shows connections"| node_inspect
node_traffic_state -.->|"summarized in"| node_overview
node_traffic_state -.->|"queried in"| node_inspect
node_traffic_model -.->|"formats statistics"| node_overview
node_sniffer -->|"uses lookup"| node_geo_lookup
node_sniffer -->|"uses lookup"| node_asn_lookup
node_sniffer -.->|"updates alerts"| node_notifications
node_user -->|"imports or exports"| node_report_export
node_sniffer -.->|"coordinates reports"| node_report_export

click node_sniffer "https://github.com/gyulyvgc/sniffnet/blob/main/src/gui/sniffer.rs"
click node_pages "https://github.com/gyulyvgc/sniffnet/tree/main/src/gui/pages"
click node_preferences "https://github.com/gyulyvgc/sniffnet/blob/main/src/gui/types/conf.rs"
click node_capture_source "https://github.com/gyulyvgc/sniffnet/blob/main/src/networking/types/capture_context.rs"
click node_packet_capture "https://github.com/gyulyvgc/sniffnet/blob/main/src/networking/capture.rs"
click node_packet_parser "https://github.com/gyulyvgc/sniffnet/blob/main/lib/sniffnet-packet-parser/src/packet.rs"
click node_packet_manager "https://github.com/gyulyvgc/sniffnet/blob/main/src/networking/manage_packets.rs"
click node_packet_processing "https://github.com/gyulyvgc/sniffnet/blob/main/src/networking/parse_packets.rs"
click node_traffic_state "https://github.com/gyulyvgc/sniffnet/blob/main/src/networking/types/data_info.rs"
click node_traffic_model "https://github.com/gyulyvgc/sniffnet/blob/main/src/networking/types/data_representation.rs"
click node_overview "https://github.com/gyulyvgc/sniffnet/blob/main/src/gui/pages/overview_page.rs"
click node_inspect "https://github.com/gyulyvgc/sniffnet/blob/main/src/gui/pages/inspect_page.rs"
click node_preview "https://github.com/gyulyvgc/sniffnet/blob/main/src/networking/traffic_preview.rs"
click node_geo_lookup "https://github.com/gyulyvgc/sniffnet/blob/main/src/mmdb/country.rs"
click node_asn_lookup "https://github.com/gyulyvgc/sniffnet/blob/main/src/mmdb/asn.rs"
click node_notifications "https://github.com/gyulyvgc/sniffnet/blob/main/src/notifications/notify_and_log.rs"
click node_report_export "https://github.com/gyulyvgc/sniffnet/blob/main/src/report/get_report_entries.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_sniffer,node_pages,node_preferences,node_user toneBlue
class node_capture_source,node_packet_capture,node_packet_parser,node_packet_manager,node_packet_processing toneAmber
class node_traffic_state,node_traffic_model,node_overview,node_inspect,node_preview toneMint
class node_geo_lookup,node_asn_lookup toneRose
class node_notifications,node_report_export toneIndigo
```

## Components

### Application and UI

- [App coordinator](https://github.com/gyulyvgc/sniffnet/blob/main/src/gui/sniffer.rs): `src/gui/sniffer.rs`
- [App pages](https://github.com/gyulyvgc/sniffnet/tree/main/src/gui/pages): `src/gui/pages`
- [Settings and filters](https://github.com/gyulyvgc/sniffnet/blob/main/src/gui/types/conf.rs): `src/gui/types/conf.rs`

### Capture and analysis

- [Capture sources](https://github.com/gyulyvgc/sniffnet/blob/main/src/networking/types/capture_context.rs): `src/networking/types/capture_context.rs`
- [Packet capture](https://github.com/gyulyvgc/sniffnet/blob/main/src/networking/capture.rs): `src/networking/capture.rs`
- [Packet parser](https://github.com/gyulyvgc/sniffnet/blob/main/lib/sniffnet-packet-parser/src/packet.rs): `lib/sniffnet-packet-parser/src/packet.rs`
- [Packet management](https://github.com/gyulyvgc/sniffnet/blob/main/src/networking/manage_packets.rs): `src/networking/manage_packets.rs`
- [Packet processing](https://github.com/gyulyvgc/sniffnet/blob/main/src/networking/parse_packets.rs): `src/networking/parse_packets.rs`

### Traffic insights

- [Traffic statistics](https://github.com/gyulyvgc/sniffnet/blob/main/src/networking/types/data_info.rs): `src/networking/types/data_info.rs`
- [Traffic model](https://github.com/gyulyvgc/sniffnet/blob/main/src/networking/types/data_representation.rs): `src/networking/types/data_representation.rs`
- [Overview charts](https://github.com/gyulyvgc/sniffnet/blob/main/src/gui/pages/overview_page.rs): `src/gui/pages/overview_page.rs`
- [Connection inspection](https://github.com/gyulyvgc/sniffnet/blob/main/src/gui/pages/inspect_page.rs): `src/gui/pages/inspect_page.rs`
- [Traffic previews](https://github.com/gyulyvgc/sniffnet/blob/main/src/networking/traffic_preview.rs): `src/networking/traffic_preview.rs`

### Supporting features

- [Host geolocation](https://github.com/gyulyvgc/sniffnet/blob/main/src/mmdb/country.rs): `src/mmdb/country.rs`
- [ASN lookup](https://github.com/gyulyvgc/sniffnet/blob/main/src/mmdb/asn.rs): `src/mmdb/asn.rs`

### Reports and alerts

- [Notifications](https://github.com/gyulyvgc/sniffnet/blob/main/src/notifications/notify_and_log.rs): `src/notifications/notify_and_log.rs`
- [Report and PCAP](https://github.com/gyulyvgc/sniffnet/blob/main/src/report/get_report_entries.rs): `src/report/get_report_entries.rs`

### Other components

- **User**

## Connections

- User → App coordinator: uses (evidence: `README.md`)
- App coordinator → Traffic previews: starts previews (evidence: `src/gui/sniffer.rs`)
- App coordinator → Capture sources: manages capture (evidence: `src/gui/sniffer.rs`)
- Capture sources → Packet capture: opens source
- Packet capture → Packet management: delivers packets
- Packet management → Packet processing: processes packets
- Packet processing → Packet parser: parses packets
- Packet processing → Traffic statistics: updates statistics
- App coordinator → App pages: renders pages (evidence: `src/gui/sniffer.rs`)
- App coordinator → Settings and filters: loads settings (evidence: `src/gui/sniffer.rs`)
- App pages → Overview charts: shows overview (evidence: `README.md`)
- App pages → Connection inspection: shows connections (evidence: `README.md`)
- Traffic statistics → Overview charts: summarized in (evidence: `src/gui/pages/overview_page.rs`)
- Traffic statistics → Connection inspection: queried in
- Traffic model → Overview charts: formats statistics (evidence: `src/gui/pages/overview_page.rs`)
- App coordinator → Host geolocation: uses lookup (evidence: `src/gui/sniffer.rs`)
- App coordinator → ASN lookup: uses lookup (evidence: `src/gui/sniffer.rs`)
- App coordinator → Notifications: updates alerts
- User → Report and PCAP: imports or exports (evidence: `README.md`)
- App coordinator → Report and PCAP: coordinates reports
