Skip to content

feat: ask devices what they are over mDNS instead of guessing from vendor - #2

Merged
gclluch merged 1 commit into
mainfrom
feat/mdns-services
Aug 1, 2026
Merged

feat: ask devices what they are over mDNS instead of guessing from vendor#2
gclluch merged 1 commit into
mainfrom
feat/mdns-services

Conversation

@gclluch

@gclluch gclluch commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Closes the last real capability gap versus the tool netdiff replaced. A MAC vendor says who made a thing - "Espressif" covers a smart plug, a doorbell and a weekend project equally - so the device column was mostly empty or useless. Devices announce what they are over multicast DNS unprompted; this reads that answer instead of inferring a type from open ports.

  • scan, audit, inventory and the change lines now label devices with what they announce - e.g. randomised (Mac15,7, AirPlay, AirPlay speaker). A device that announces nothing is left blank rather than guessed at.
  • New services column, with the first migration mechanism this project has had: an idempotent column list applied on every connect(). CREATE TABLE IF NOT EXISTS does nothing to an existing table, so without it every read fails on exactly the databases worth keeping. Verified against a database written by the released store.py.
  • Fixes a parsing bug reachable by anything that can send a UDP datagram: parse_records trusted a record's own rdlen against a buffer that might not hold it, so a 4-byte address truncated to one byte parsed as the address 192.
  • --no-mdns on scan and audit, matching the existing --no-ports / --no-resolve / --no-upnp opt-outs.
  • 88 tests -> 117. test_mdns.py builds its packets with its own helpers rather than the encoder under test, and roughly half of it is malformed input - a name pointing at itself, a record longer than the packet carrying it.

diff.py compares nothing new. services reaches Change.__str__ only, so a device whose reply is missed once cannot report a spurious change every other scan.

@gclluch
gclluch merged commit 1e4529a into main Aug 1, 2026
8 checks passed
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.

1 participant