# 0xm1sk/port_scanner architecture

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

- Interactive diagram: https://gitdiagram.com/0xm1sk/port_scanner
- Repository: https://github.com/0xm1sk/port_scanner

## Overview

This is a small Rust TCP port scanner. The user supplies a target address; the command-line entry point scans ports 1–9999, calls a probe that resolves each address and attempts a timed TCP connection, then prints open ports and a summary. The repository has one runtime source file, so stages are separated by responsibility rather than by module. The README documents the scan behavior; implementation relationships below are supported by the excerpted source.

Main entry points: [`src/main.rs`](https://github.com/0xm1sk/port_scanner/blob/main/src/main.rs) (CLI scan)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("User"))
node_entry["CLI scan<br/>[main.rs]"]
node_probe["Port probe<br/>[main.rs]"]
node_target(("Target host"))
node_terminal["Terminal output"]

node_user -->|"provides target"| node_entry
node_entry -->|"probes ports"| node_probe
node_probe -->|"connects TCP"| node_target
node_entry -->|"prints results"| node_terminal

click node_entry "https://github.com/0xm1sk/port_scanner/blob/main/src/main.rs"
click node_probe "https://github.com/0xm1sk/port_scanner/blob/main/src/main.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_user toneBlue
class node_entry,node_probe toneTeal
class node_target,node_terminal toneIndigo
```

## Components

### Other components

- **User**
- [CLI scan](https://github.com/0xm1sk/port_scanner/blob/main/src/main.rs): `src/main.rs`
- [Port probe](https://github.com/0xm1sk/port_scanner/blob/main/src/main.rs): `src/main.rs`
- **Target host**
- **Terminal output**

## Connections

- User → CLI scan: provides target (evidence: `README.md`)
- CLI scan → Port probe: probes ports (evidence: `src/main.rs`)
- Port probe → Target host: connects TCP (evidence: `src/main.rs`)
- CLI scan → Terminal output: prints results (evidence: `src/main.rs`)
