MCPcopy
hub / github.com/evilsocket/opensnitch / Track

Function Track

daemon/dns/track.go:58–71  ·  view source on GitHub ↗

Track adds a resolved domain to the list.

(resolved string, hostname string)

Source from the content-addressed store, hash-verified

56
57// Track adds a resolved domain to the list.
58func Track(resolved string, hostname string) {
59 lock.Lock()
60 defer lock.Unlock()
61
62 if len(resolved) > 3 && resolved[0:4] == "127." {
63 return
64 }
65 if resolved == "::1" || resolved == hostname {
66 return
67 }
68 responses[resolved] = hostname
69
70 log.Debug("New DNS record: %s -> %s", resolved, hostname)
71}
72
73// Host returns if a resolved domain is in the list.
74func Host(resolved string) (host string, found bool) {

Callers 2

TrackAnswersFunction · 0.85
dnsWorkerFunction · 0.85

Calls 2

LockMethod · 0.80
UnlockMethod · 0.80

Tested by

no test coverage detected