Documentation
¶
Overview ¶
Package netutil answers the two questions the rest of the app keeps asking: "is this address on my own network?" and "who am I?".
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddrFromIP ¶
AddrFromIP converts a net.IP, normalising IPv4-mapped IPv6 to plain IPv4.
Packet capture and the pcap interface list both hand back net.IP, and a 4-in-6 address left mapped would be treated as a different endpoint from the same address seen over IPv4.
func IsInternal ¶
IsInternal reports whether an address is local to this network rather than a destination out on the internet.
func IsRoutable ¶
IsRoutable reports whether an address is a plausible external destination.
func PublicIP ¶
PublicIP discovers this network's own external address, which is the only way to place the map's origin, nothing observable from inside the network says where it is.
The DNS route is tried first and deliberately: a TXT query to a resolver that answers with the querier's address discloses nothing that sending the query did not already disclose. The HTTPS fallback exists for networks that block or intercept external resolvers.
This is the only outbound request LAN Sheriff makes about *you* rather than about a dataset, and it can be switched off entirely (--no-locate), in which case arcs are drawn from a neutral origin.
Types ¶
type Self ¶
Self describes this host.
func (Self) Sighting ¶
Device renders this host as a Device record. Sighting describes this machine in the form the store's identity model takes.
PreferredID carries the ID derived from the local hardware address, because the capture sources tag flows with it before the database is open: the record discovery converges on has to be the same one those flows point at.