Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DB ¶
func LoadDefault ¶
func LoadDefault() DB
LoadDefault returns the OUI database, preferring (in order): a user override at ~/.ndscan/oui.txt, nmap's bundled prefix file, then a tiny built-in sample. The parser handles both "AABBCC Vendor" and "AA:BB:CC\tVendor" forms.
type MACKind ¶ added in v0.1.4
type MACKind string
MACKind classifies a hardware address, so callers can explain *why* a vendor lookup came back empty instead of leaving a blank field.
const ( // KindGlobal is a real, IEEE-assigned address: the OUI identifies a vendor. KindGlobal MACKind = "global" // KindRandomized is a locally-administered address. Modern phones and // laptops randomize their MAC per network for privacy, so no vendor exists // to look up — an empty vendor here is correct, not a failed lookup. KindRandomized MACKind = "randomized" // KindMulticast is a group address, not a host. KindMulticast MACKind = "multicast" // KindUnknown means the value didn't parse as a MAC. KindUnknown MACKind = "" )
func Classify ¶ added in v0.1.4
Classify inspects the two flag bits in the first octet of a MAC address.
Bit 0 marks a multicast/group address; bit 1 marks a locally-administered one. Randomized privacy addresses set bit 1, which is why they never match an OUI: the IEEE never assigned them to anybody.
Click to show internal directories.
Click to hide internal directories.