Documentation ¶
Overview ¶
Package hostinfo can be used to correlate IPs, MACs and hostnames using caches DNS lookups and ARP information.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
Cache caches information such as IPv4 addresses, MAC vendors and hostnames.
func NewCache ¶
func NewCache() *Cache
NewCache returns a new HostInfoCache and parses the embedded MAC vendors file.
func (*Cache) AddHostnamesForIP ¶
AddHostnamesForIP registers a set of hostnames for a given IP that were obtained externally. Hostnames are only added if they are not already present.
func (*Cache) HostInfos ¶
HostInfos returns the string representations of all available infos for the host.
func (*Cache) SaveMACFromIP ¶
func (c *Cache) SaveMACFromIP(ip net.IP, fallback net.HardwareAddr)
SaveMACFromIP saves the MAC address extracted from the IP together with the IP in the cache. If the IP did not contain an EUI-64 encoded MAC address a MAC address with the first three bytes of the provided fallback address is saved in order to be able to identify the vendor.