# alphagolf-sec/nettool architecture

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

- Interactive diagram: https://gitdiagram.com/alphagolf-sec/nettool
- Repository: https://github.com/alphagolf-sec/nettool

## Overview

NetTool is a Windows console application for managing Wi-Fi and the PC hotspot through native Windows APIs, with optional packet shaping, bandwidth limiting, captive-portal login, and system-level hotspot controls. The principal workflow is the user launching the console tool, choosing a network or hotspot operation, and receiving status or an action result. The runtime is concentrated in net_tool.py; README-described capabilities are included, but unsampled implementation details and their internal call paths are not inferred.

Main entry points: [`net_tool.py`](https://github.com/alphagolf-sec/nettool/blob/main/net_tool.py) (Console workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_wifi["Wi-Fi"]
  node_wlan_ops["Wi-Fi operations<br/>[net_tool.py]"]
  node_network_scan["Network scan<br/>[net_tool.py]"]
  node_connection_status["Connection status<br/>[net_tool.py]"]
  node_bssid_lock["BSSID lock watchdog<br/>[net_tool.py]"]
  node_traffic_shaping["Traffic shaping test<br/>[net_tool.py]"]
  node_bandwidth_limit["Bandwidth limiter<br/>[net_tool.py]"]
  node_wlan_api["Windows WLAN API"]
end

subgraph group_hotspot["Hotspot"]
  node_hotspot_control["Hotspot control<br/>[net_tool.py]"]
  node_hotspot_watchdog["Hotspot persistence watchdog<br/>[net_tool.py]"]
  node_tethering_api["WinRT tethering API"]
end

subgraph group_portal_system["Portal and system"]
  node_portal_detection["Portal detection<br/>[net_tool.py]"]
  node_portal_login["Portal login<br/>[net_tool.py]"]
  node_internet["Portal and Internet services"]
  node_anti_timeout["Hotspot anti-timeout<br/>[net_tool.py]"]
  node_windows_registry[("Windows registry")]
  node_event_log["Event logging<br/>[net_tool.py]"]
end

node_user(("Console user"))
node_console["Console workflow<br/>[net_tool.py]"]

node_user -->|"launches"| node_console
node_console -->|"offers"| node_wlan_ops
node_console -->|"offers"| node_hotspot_control
node_console -->|"offers"| node_traffic_shaping
node_console -->|"offers"| node_bandwidth_limit
node_console -->|"offers"| node_portal_detection
node_console -->|"offers"| node_portal_login
node_wlan_ops -->|"calls"| node_wlan_api
node_wlan_ops -->|"scans"| node_network_scan
node_wlan_ops -->|"reads status"| node_connection_status
node_bssid_lock -->|"reconnects via"| node_wlan_ops
node_traffic_shaping -->|"downloads from"| node_internet
node_bandwidth_limit -->|"intercepts packets"| node_internet
node_hotspot_control -->|"controls"| node_tethering_api
node_hotspot_watchdog -->|"restarts"| node_hotspot_control
node_portal_detection -->|"checks access"| node_internet
node_portal_login -->|"submits login"| node_internet
node_hotspot_control -->|"logs events"| node_event_log
node_portal_login -->|"logs events"| node_event_log
node_anti_timeout -->|"changes timeout"| node_windows_registry

click node_console "https://github.com/alphagolf-sec/nettool/blob/main/net_tool.py"
click node_wlan_ops "https://github.com/alphagolf-sec/nettool/blob/main/net_tool.py"
click node_network_scan "https://github.com/alphagolf-sec/nettool/blob/main/net_tool.py"
click node_connection_status "https://github.com/alphagolf-sec/nettool/blob/main/net_tool.py"
click node_bssid_lock "https://github.com/alphagolf-sec/nettool/blob/main/net_tool.py"
click node_traffic_shaping "https://github.com/alphagolf-sec/nettool/blob/main/net_tool.py"
click node_bandwidth_limit "https://github.com/alphagolf-sec/nettool/blob/main/net_tool.py"
click node_hotspot_control "https://github.com/alphagolf-sec/nettool/blob/main/net_tool.py"
click node_hotspot_watchdog "https://github.com/alphagolf-sec/nettool/blob/main/net_tool.py"
click node_portal_detection "https://github.com/alphagolf-sec/nettool/blob/main/net_tool.py"
click node_portal_login "https://github.com/alphagolf-sec/nettool/blob/main/net_tool.py"
click node_anti_timeout "https://github.com/alphagolf-sec/nettool/blob/main/net_tool.py"
click node_event_log "https://github.com/alphagolf-sec/nettool/blob/main/net_tool.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_wlan_ops,node_network_scan,node_connection_status,node_bssid_lock,node_traffic_shaping,node_bandwidth_limit,node_wlan_api,node_user toneBlue
class node_hotspot_control,node_hotspot_watchdog,node_tethering_api toneAmber
class node_portal_detection,node_portal_login,node_internet,node_anti_timeout,node_windows_registry,node_event_log toneMint
class node_console toneTeal
```

## Components

### Wi-Fi

- [Wi-Fi operations](https://github.com/alphagolf-sec/nettool/blob/main/net_tool.py): `net_tool.py`
- [Network scan](https://github.com/alphagolf-sec/nettool/blob/main/net_tool.py): `net_tool.py`
- [Connection status](https://github.com/alphagolf-sec/nettool/blob/main/net_tool.py): `net_tool.py`
- [BSSID lock watchdog](https://github.com/alphagolf-sec/nettool/blob/main/net_tool.py): `net_tool.py`
- [Traffic shaping test](https://github.com/alphagolf-sec/nettool/blob/main/net_tool.py): `net_tool.py`
- [Bandwidth limiter](https://github.com/alphagolf-sec/nettool/blob/main/net_tool.py): `net_tool.py`
- **Windows WLAN API**

### Hotspot

- [Hotspot control](https://github.com/alphagolf-sec/nettool/blob/main/net_tool.py): `net_tool.py`
- [Hotspot persistence watchdog](https://github.com/alphagolf-sec/nettool/blob/main/net_tool.py): `net_tool.py`
- **WinRT tethering API**

### Portal and system

- [Portal detection](https://github.com/alphagolf-sec/nettool/blob/main/net_tool.py): `net_tool.py`
- [Portal login](https://github.com/alphagolf-sec/nettool/blob/main/net_tool.py): `net_tool.py`
- **Portal and Internet services**
- [Hotspot anti-timeout](https://github.com/alphagolf-sec/nettool/blob/main/net_tool.py): `net_tool.py`
- **Windows registry**
- [Event logging](https://github.com/alphagolf-sec/nettool/blob/main/net_tool.py): `net_tool.py`

### Other components

- **Console user**
- [Console workflow](https://github.com/alphagolf-sec/nettool/blob/main/net_tool.py): `net_tool.py`

## Connections

- Console user → Console workflow: launches (evidence: `README.md`)
- Console workflow → Wi-Fi operations: offers (evidence: `README.md`)
- Console workflow → Hotspot control: offers (evidence: `README.md`)
- Console workflow → Traffic shaping test: offers (evidence: `README.md`)
- Console workflow → Bandwidth limiter: offers (evidence: `README.md`)
- Console workflow → Portal detection: offers (evidence: `README.md`)
- Console workflow → Portal login: offers (evidence: `README.md`)
- Wi-Fi operations → Windows WLAN API: calls (evidence: `net_tool.py`)
- Wi-Fi operations → Network scan: scans (evidence: `net_tool.py`)
- Wi-Fi operations → Connection status: reads status (evidence: `net_tool.py`)
- BSSID lock watchdog → Wi-Fi operations: reconnects via (evidence: `README.md`)
- Traffic shaping test → Portal and Internet services: downloads from (evidence: `README.md`)
- Bandwidth limiter → Portal and Internet services: intercepts packets (evidence: `README.md`)
- Hotspot control → WinRT tethering API: controls (evidence: `README.md`)
- Hotspot persistence watchdog → Hotspot control: restarts (evidence: `README.md`)
- Portal detection → Portal and Internet services: checks access (evidence: `README.md`)
- Portal login → Portal and Internet services: submits login (evidence: `net_tool.py`)
- Hotspot control → Event logging: logs events (evidence: `README.md`)
- Portal login → Event logging: logs events (evidence: `README.md`)
- Hotspot anti-timeout → Windows registry: changes timeout (evidence: `README.md`)
