# y1hng/wikirarp architecture

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

- Interactive diagram: https://gitdiagram.com/y1hng/wikirarp
- Repository: https://github.com/y1hng/wikirarp

## Overview

WikiRarp is a small ARP network-discovery tool offered as both a Python library and a CLI. Its workflow validates root access, enumerates hosts in a CIDR range, probes them concurrently with ARP, and returns discovered IP/MAC pairs; the CLI enriches those results with vendor names and prints a table. The README also documents library-based scanning and vendor lookup. The source confirms the CLI and scanner wiring; the external vendor package’s lookup internals are not sampled.

Main entry points: [`wikirarp/cli.py`](https://github.com/y1hng/wikirarp/blob/main/wikirarp/cli.py) (CLI), [`wikirarp/scanner.py`](https://github.com/y1hng/wikirarp/blob/main/wikirarp/scanner.py) (Network scanner), [`wikirarp/mac_lookup.py`](https://github.com/y1hng/wikirarp/blob/main/wikirarp/mac_lookup.py) (MAC vendor lookup), [`wikirarp/__init__.py`](https://github.com/y1hng/wikirarp/blob/main/wikirarp/__init__.py) (Library exports)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_cli["CLI<br/>[cli.py]"]
  node_library["Library exports<br/>[__init__.py]"]
end

subgraph group_discovery["ARP discovery"]
  node_scanner["Network scanner<br/>[scanner.py]"]
end

subgraph group_enrichment["Vendor enrichment"]
  node_mac_lookup["MAC vendor lookup<br/>[mac_lookup.py]"]
end

node_operator(("Operator"))
node_library_user(("Library caller"))
node_arp_network(("ARP network"))
node_scapy["Scapy ARP"]
node_vendor_resolver["Vendor resolver"]
node_terminal(("Terminal"))

node_operator -->|"runs"| node_cli
node_library_user -->|"imports scan"| node_library
node_library -->|"exports"| node_scanner
node_cli -->|"calls scan"| node_scanner
node_scanner -->|"sends probes"| node_scapy
node_scapy -->|"exchanges ARP"| node_arp_network
node_arp_network -->|"replies"| node_scapy
node_scanner -->|"returns hosts"| node_cli
node_cli -->|"looks up MACs"| node_mac_lookup
node_library_user -.->|"can call"| node_mac_lookup
node_mac_lookup -->|"resolves vendor"| node_vendor_resolver
node_cli -->|"prints results"| node_terminal

click node_cli "https://github.com/y1hng/wikirarp/blob/main/wikirarp/cli.py"
click node_library "https://github.com/y1hng/wikirarp/blob/main/wikirarp/__init__.py"
click node_scanner "https://github.com/y1hng/wikirarp/blob/main/wikirarp/scanner.py"
click node_mac_lookup "https://github.com/y1hng/wikirarp/blob/main/wikirarp/mac_lookup.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_cli,node_library toneBlue
class node_scanner toneAmber
class node_mac_lookup toneMint
class node_operator,node_library_user,node_arp_network,node_scapy,node_vendor_resolver,node_terminal toneIndigo
```

## Components

### User interfaces

- [CLI](https://github.com/y1hng/wikirarp/blob/main/wikirarp/cli.py): `wikirarp/cli.py`
- [Library exports](https://github.com/y1hng/wikirarp/blob/main/wikirarp/__init__.py): `wikirarp/__init__.py`

### ARP discovery

- [Network scanner](https://github.com/y1hng/wikirarp/blob/main/wikirarp/scanner.py): `wikirarp/scanner.py`

### Vendor enrichment

- [MAC vendor lookup](https://github.com/y1hng/wikirarp/blob/main/wikirarp/mac_lookup.py): `wikirarp/mac_lookup.py`

### Other components

- **Operator**
- **Library caller**
- **ARP network**
- **Scapy ARP**
- **Vendor resolver**
- **Terminal**

## Connections

- Operator → CLI: runs
- Library caller → Library exports: imports scan
- Library exports → Network scanner: exports
- CLI → Network scanner: calls scan
- Network scanner → Scapy ARP: sends probes
- Scapy ARP → ARP network: exchanges ARP
- ARP network → Scapy ARP: replies
- Network scanner → CLI: returns hosts
- CLI → MAC vendor lookup: looks up MACs
- Library caller → MAC vendor lookup: can call
- MAC vendor lookup → Vendor resolver: resolves vendor
- CLI → Terminal: prints results
