feat: ask devices what they are over mDNS instead of guessing from vendor - #2
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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,inventoryand 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.servicescolumn, with the first migration mechanism this project has had: an idempotent column list applied on everyconnect().CREATE TABLE IF NOT EXISTSdoes nothing to an existing table, so without it every read fails on exactly the databases worth keeping. Verified against a database written by the releasedstore.py.parse_recordstrusted a record's ownrdlenagainst a buffer that might not hold it, so a 4-byte address truncated to one byte parsed as the address192.--no-mdnsonscanandaudit, matching the existing--no-ports/--no-resolve/--no-upnpopt-outs.test_mdns.pybuilds 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.pycompares nothing new.servicesreachesChange.__str__only, so a device whose reply is missed once cannot report a spurious change every other scan.