Skip to content

Phase 3: static IP finder, Reach it, subnet scan and device discovery - #7

Merged
cookingwithsimon merged 2 commits into
mainfrom
phase-3
Oct 16, 2026
Merged

cookingwithsimon merged 2 commits into
mainfrom
phase-3

Conversation

@cookingwithsimon

Copy link
Copy Markdown
Owner

What changes for the user

Before: a device with a static IP on another subnet never showed up. The status said "may have a static IP", and the tech had to guess the address and set the laptop by hand.

After:

  • While the server runs, a new Found on the network list shows every device heard on the cable that didn't take a lease. That includes static devices on other subnets, each marked "Static IP on 192.168.1.x, which this laptop isn't on yet". Step 5 names the device too.
  • Reach it adds a temporary address on the device's subnet, so Open WebUI works without stopping DHCP. If Wi-Fi is on that subnet, the app first offers to turn Wi-Fi off until Stop.
  • Scan for static IPs finds quiet devices. It ARPs every address on the laptop's own subnet, the brand presets' factory subnets and any subnet a device was seen on, using a temporary address on each that's removed straight afterwards.
  • Devices are named from mDNS/DNS-SD, SSDP/UPnP descriptions, PJLink, Art-Net, AES67/SAP, AMX beacons and NetLinx, Q-SYS and Shure discovery. Every query is read-only. Only addresses, ports and formats documented by the standard or the maker are used; the sources are in docs/vendor-discovery.md.
  • With Npcap installed, the app also shows which switch, port and VLAN the laptop is on (from LLDP/CDP) and catches devices as they power up (from their ARP probe). Without Npcap, a hint offers the download and everything else still works.

How

  • Core, Discovery/:
    • Packet readers for IPv4/UDP, Ethernet, ARP, LLDP, CDP, mDNS, SSDP and UPnP XML (DTDs refused), plus the vendor protocols.
    • DiscoveryTable merges sightings by MAC, falling back to IP.
    • SubnetPlanner chooses the subnets to scan and the helper addresses: .249 downwards, skipping documented factory addresses and subnets used by another adapter.
    • SubnetHelper runs Reach and the sweep against fake-able interfaces.
    • StatusChain names a found static device in step 5.
  • Windows:
    • DiscoveryService runs for the session. It uses a raw socket in SIO_RCVALL IP-level mode (not promiscuous, so a busy video stream can't flood it), mDNS/SSDP/vendor sockets joined on the adapter, Windows' ARP table, and SendARP for the sweep.
    • NpcapCapture loads wpcap.dll at run time with a driver-side filter for ARP, LLDP and CDP only.
    • Temporary addresses go through AdapterSessionManager, which gains RemoveTemporaryAddress, so Stop, exit and a crash all remove them.
    • A second firewall rule ("ProDHCPServer (discovery)") covers this exe on wired adapters and is removed on Stop.
    • SSDP descriptions are fetched only from devices this adapter can reach, so the request never goes out over Wi-Fi.
  • App: the found-device list with Reach it, Open WebUI and Copy IP, the scan button and progress, the switch-port line and the Npcap hint.

Testing

  • Core tests pass (211, 49 new). They cover every protocol parser, table merging, subnet planning, Reach retrying after a duplicate address, the sweep removing its address even when cancelled, and the step 5 wording.
  • Windows CI is green. New integration tests cover the ARP table and SendARP against the runner's gateway, the Npcap check, a discovery socket plus raw sniffer receiving a PJLink reply, and the discovery firewall rule.
  • Hardware checklist added: docs/hardware-test-phase3.md.

🤖 Generated with Claude Code

https://claude.ai/code/session_01KZvcgLYKFKnCYgDw2Bxw5e


Generated by Claude Code

Finds devices on the cable that didn't take a DHCP lease, including ones
with a static IP on another subnet, from broadcasts (raw socket at IP
level), Windows' ARP table, mDNS/DNS-SD, SSDP/UPnP and documented vendor
protocols (PJLink, Art-Net, SAP, AMX, Q-SYS, Shure). With Npcap installed
it also watches ARP and shows the switch port from LLDP/CDP.

Reach it and the subnet scan add temporary addresses through the adapter
backup session, so Stop, exit and a crash remove them.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KZvcgLYKFKnCYgDw2Bxw5e
@cookingwithsimon
cookingwithsimon marked this pull request as ready for review October 16, 2026 05:36
@cookingwithsimon
cookingwithsimon merged commit 822c4dc into main Oct 16, 2026
1 check passed
@cookingwithsimon
cookingwithsimon deleted the phase-3 branch October 16, 2026 05:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants