# aryannehe/swiper-network-packet-analyzer architecture

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

- Interactive diagram: https://gitdiagram.com/aryannehe/swiper-network-packet-analyzer
- Repository: https://github.com/aryannehe/swiper-network-packet-analyzer

## Overview

SWIPER is a desktop network packet analyzer. The operator starts or stops capture from its terminal-style UI; a background thread runs Scapy sniffing, the callback classifies IP packets and formats endpoints and optional hex payload, then schedules log output on the UI thread. The same UI provides boot output and console reset. The README documents these capabilities; the sole source file is excerpted, so component boundaries are logical responsibilities within that file, not separate modules.

Main entry points: [`task_5.py`](https://github.com/aryannehe/swiper-network-packet-analyzer/blob/main/task_5.py) (Terminal and controls)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Terminal interface"]
  node_app["SWIPER application<br/>[task_5.py]"]
  node_terminal["Terminal and controls<br/>[task_5.py]"]
  node_console["Console output and reset<br/>[task_5.py]"]
end

subgraph group_capture["Packet capture"]
  node_capture_control["Capture control<br/>[task_5.py]"]
  node_sniffer["Scapy sniffer<br/>[task_5.py]"]
  node_packet_analysis["Packet classification<br/>[task_5.py]"]
end

node_operator(("Operator"))
node_network(("Network traffic"))

node_operator -->|"uses controls"| node_terminal
node_app -->|"builds interface"| node_terminal
node_terminal -->|"starts or stops"| node_capture_control
node_capture_control -->|"starts thread"| node_sniffer
node_sniffer -->|"captures packets"| node_network
node_sniffer -->|"calls callback"| node_packet_analysis
node_packet_analysis -->|"schedules packet log"| node_console
node_capture_control -->|"logs state"| node_console
node_terminal -->|"resets buffer"| node_console

click node_app "https://github.com/aryannehe/swiper-network-packet-analyzer/blob/main/task_5.py"
click node_terminal "https://github.com/aryannehe/swiper-network-packet-analyzer/blob/main/task_5.py"
click node_capture_control "https://github.com/aryannehe/swiper-network-packet-analyzer/blob/main/task_5.py"
click node_sniffer "https://github.com/aryannehe/swiper-network-packet-analyzer/blob/main/task_5.py"
click node_packet_analysis "https://github.com/aryannehe/swiper-network-packet-analyzer/blob/main/task_5.py"
click node_console "https://github.com/aryannehe/swiper-network-packet-analyzer/blob/main/task_5.py"

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_app,node_terminal,node_console toneBlue
class node_capture_control,node_sniffer,node_packet_analysis toneAmber
class node_operator,node_network toneIndigo
```

## Components

### Terminal interface

- [SWIPER application](https://github.com/aryannehe/swiper-network-packet-analyzer/blob/main/task_5.py): `task_5.py`
- [Terminal and controls](https://github.com/aryannehe/swiper-network-packet-analyzer/blob/main/task_5.py): `task_5.py`
- [Console output and reset](https://github.com/aryannehe/swiper-network-packet-analyzer/blob/main/task_5.py): `task_5.py`

### Packet capture

- [Capture control](https://github.com/aryannehe/swiper-network-packet-analyzer/blob/main/task_5.py): `task_5.py`
- [Scapy sniffer](https://github.com/aryannehe/swiper-network-packet-analyzer/blob/main/task_5.py): `task_5.py`
- [Packet classification](https://github.com/aryannehe/swiper-network-packet-analyzer/blob/main/task_5.py): `task_5.py`

### Other components

- **Operator**
- **Network traffic**

## Connections

- Operator → Terminal and controls: uses controls (evidence: `task_5.py`)
- SWIPER application → Terminal and controls: builds interface (evidence: `task_5.py`)
- Terminal and controls → Capture control: starts or stops (evidence: `task_5.py`)
- Capture control → Scapy sniffer: starts thread (evidence: `task_5.py`)
- Scapy sniffer → Network traffic: captures packets (evidence: `task_5.py`)
- Scapy sniffer → Packet classification: calls callback (evidence: `task_5.py`)
- Packet classification → Console output and reset: schedules packet log (evidence: `task_5.py`)
- Capture control → Console output and reset: logs state (evidence: `task_5.py`)
- Terminal and controls → Console output and reset: resets buffer (evidence: `task_5.py`)
