Documentation ¶
Index ¶
Constants ¶
const ( // LogEmerg is a Syslog-type priority for Emergency messages LogEmerg uint = iota // LogAlert is a Syslog-type priority for Alert messages LogAlert // LogCrit is a Syslog-type priority for Critical messages LogCrit // LogErr is a Syslog-type priority for Error messages LogErr // LogWarn is a Syslog-type priority for Warning messages LogWarn // LogNotice is a Syslog-type priority for Notice messages LogNotice // LogInform is a Syslog-type priority for Informational messages LogInform // LogDebug is a Syslog-type priority for Debug messages LogDebug )
const TelemetryDNSRequestTypeA uint = 0b00000001
TelemetryDNSRequestTypeA is an arbitary type to track DNS A requests
const TelemetryDNSRequestTypeAAAA uint = 0b00011100
TelemetryDNSRequestTypeAAAA is an arbitary type to track DNS AAAA requests
const TelemetryDNSRequestTypeALL uint = 0b11111111
TelemetryDNSRequestTypeALL is an arbitary type to track DNS ALL requests
const TelemetryDNSRequestTypeCNAME uint = 0b00000101
TelemetryDNSRequestTypeCNAME is an arbitary type to track DNS CNAME requests
const TelemetryDNSRequestTypeHINFO uint = 0b00001101
TelemetryDNSRequestTypeHINFO is an arbitary type to track DNS HINFO requests
const TelemetryDNSRequestTypeMINFO uint = 0b00001110
TelemetryDNSRequestTypeMINFO is an arbitary type to track DNS MINFO requests
const TelemetryDNSRequestTypeMX uint = 0b00001111
TelemetryDNSRequestTypeMX is an arbitary type to track DNS MX requests
const TelemetryDNSRequestTypeNS uint = 0b00000010
TelemetryDNSRequestTypeNS is an arbitary type to track DNS NS requests
const TelemetryDNSRequestTypePTR uint = 0b00001100
TelemetryDNSRequestTypePTR is an arbitary type to track DNS PTR requests
const TelemetryDNSRequestTypeSOA uint = 0b00000110
TelemetryDNSRequestTypeSOA is an arbitary type to track DNS SOA requests
const TelemetryDNSRequestTypeSRV uint = 0b00100001
TelemetryDNSRequestTypeSRV is an arbitary type to track DNS SRV requests
const TelemetryDNSRequestTypeTXT uint = 0b00010000
TelemetryDNSRequestTypeTXT is an arbitary type to track DNS TXT requests
const TelemetryDNSRequestTypeWKS uint = 0b00001011
TelemetryDNSRequestTypeWKS is an arbitary type to track DNS WKS requests
const TelemetryHTTPRequestTypeGet uint = 0b0000001000000000
TelemetryHTTPRequestTypeGet is an arbitary type to track HTTP GET requests
const TelemetryHTTPRequestTypePost uint = 0b0000001000000001
TelemetryHTTPRequestTypePost is an arbitary type to track HTTP POST requests
const TelemetryKeepAlive uint = 0b1111111111111111
TelemetryKeepAlive is a generic type to track internal keep-alive
const TelemetryRedisCacheHit uint = 0b0000001000000010
TelemetryRedisCacheHit is an arbitary type to track Redis cache hits
const TelemetryRedisCacheMiss uint = 0b0000001000000100
TelemetryRedisCacheMiss is an arbitary type to track Redis cache misses
Variables ¶
var ActiveDNSResolvers = []DNSResolver{}
ActiveDNSResolvers is our list of known active resolvers
var GlobalDNSResolvers = []DNSResolver{}
GlobalDNSResolvers is our list of globally known resolvers
var LogLevels = map[uint]logrus.Level{ LogEmerg: logrus.PanicLevel, LogAlert: logrus.FatalLevel, LogCrit: logrus.FatalLevel, LogErr: logrus.ErrorLevel, LogWarn: logrus.WarnLevel, LogNotice: logrus.InfoLevel, LogInform: logrus.InfoLevel, LogDebug: logrus.DebugLevel, }
LogLevels is a map of logrus <-> syslog log levels.
var TelemetryValues = map[string]uint{ "POST": TelemetryHTTPRequestTypePost, "GET": TelemetryHTTPRequestTypeGet, "TypeANY": TelemetryDNSRequestTypeALL, "TypeA": TelemetryDNSRequestTypeA, "TypeAAAA": TelemetryDNSRequestTypeAAAA, "TypeHINFO": TelemetryDNSRequestTypeHINFO, "TypeMINFO": TelemetryDNSRequestTypeMINFO, "TypeMX": TelemetryDNSRequestTypeMX, "TypeNS": TelemetryDNSRequestTypeNS, "TypePTR": TelemetryDNSRequestTypePTR, "TypeSOA": TelemetryDNSRequestTypeSOA, "TypeSRV": TelemetryDNSRequestTypeSRV, "TypeTXT": TelemetryDNSRequestTypeTXT, "TypeWKS": TelemetryDNSRequestTypeWKS, "CacheHit": TelemetryRedisCacheHit, "CacheMiss": TelemetryRedisCacheMiss, "KeepAlive": TelemetryKeepAlive, }
TelemetryValues serves as a lookup table to map given keywords to a binary type. The binary type will be reflected over the IPC channel, in order to not fummel around with string literals
TelemetryValues is a public map, so external functions can make use of this.
Functions ¶
func DNSQueryGet ¶
func DNSQueryGet(w http.ResponseWriter, r *http.Request)
DNSQueryGet is the HTTP GET request handler, which performs minimum upfront validation, before passing the request over to the shared backend routine
func DNSQueryPost ¶
func DNSQueryPost(w http.ResponseWriter, r *http.Request)
DNSQueryPost is the HTTP POST request handler, which performs minimum upfront validation, before passing the request over to the shared backend routine
func TelemetryCollector ¶
func TelemetryCollector(chanTelemetry chan uint)
TelemetryCollector receives information from other go routines and forwards them to InfluxDB