Repository navigation
feat(devices): MAC addresses and makers on the local network, and devices that moved - #104
Merged
Merged
Conversation
…ices that moved A syslog message carries no MAC. The new internal/neighbors reads the system's neighbor table - ARP and NDP - every 30 seconds: GetIpNetTable2 on Windows (checked against Get-NetNeighbor), netlink on Linux, the routing socket on macOS. That table only knows this machine's own networks: an address on none of them is routed, and is given no MAC rather than the router's. This machine and loopback are said so. Nothing is sent on the network, nothing is stored. - Makers come from the IEEE's MA-L registry, embedded reduced and gzipped (40,404 entries, 390 KB; tools/oui rebuilds it from oui.csv). A locally administered MAC (a phone's private address, a VM) is said to be private, with no maker. - Settings > Devices shows each device's MAC and maker under its address, or "routed - no MAC", and a note saying plainly that MACs are only known on the local network. Its filter takes a MAC or a maker. - The inventory remembers the MACs each address had since the start: "MAC changed" for an address whose device changed (replaced, or two claiming it), "also at ..." for a MAC heard at another address (DHCP), and the rule that names a device's old address when none names its new one. - A new rule from the tab suggests the template the maker fits (a camera maker: Camera; Cisco, MikroTik: Sends no hostname), never applied without a click. - The detail panel of a message gives its source's MAC and maker, or why there is none. Anonymous mode replaces MACs (redactMAC). - LookupAddress on Backend; the inventory and the lookups are those of the engine that receives, the service's when the window drives it. Tests: MAC parsing in its usual spellings, makers, what the table keeps, the lookup on and off the local network and for this machine, the netlink parsing (Linux), the table read here, and the inventory's MAC history.
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.
Stacked on #103 because they share generated files. It will be retargeted to
mainonce #103 is merged.A syslog message carries no MAC address. This adds the MAC wherever it helps, and says plainly that it is only known on the local network.
Where the MAC comes from
The new package
internal/neighborsreads the system's neighbor table (ARP for IPv4, NDP for IPv6) every 30 seconds:GetIpNetTable2(iphlpapi), whichx/sys/windowsdoes not wrap. Checked on this machine againstGet-NetNeighbor: same 9 IPv4 neighbors, same MACs.RTM_GETNEIGH, IPv4 and IPv6RTF_LLINFO), viax/net/routetools/ouirebuilds it fromoui.csv. A locally administered MAC (a phone's private address, a VM) is shown as private, with no maker.In the application
redactMAC).LookupAddressonBackend: the inventory and the lookups are those of the engine that receives, so the service's when the window drives it.message-detailscreenshots are regenerated.Tests
internal/neighbors:internal/sources: the inventory's MAC history (a device that moved, an address that changed hands).Checked:
go vet(Windows, Linux; macOS forinternal/neighbors),staticcheck,go test -race ./...,svelte-check --fail-on-warnings,npm test,npm run build, the docs' links.