Identity and version support for the dnstap plugin (#5555)

* Added identity and version support to dnstap plugin

Signed-off-by: Daniel Jolly <code@danieljolly.com>

* Added missing commas

Signed-off-by: Daniel Jolly <code@danieljolly.com>

* Moved byte slice conversions to setup rather than handler.
Fixed indentation issue.

Signed-off-by: Daniel Jolly <code@danieljolly.com>

* Improved setup config parsing and added tests to detect various configurations

Signed-off-by: Daniel Jolly <code@danieljolly.com>

Signed-off-by: Daniel Jolly <code@danieljolly.com>
Co-authored-by: Daniel Jolly <code@danieljolly.com>
This commit is contained in:
Daniel Jolly 2022-09-07 09:22:38 -04:00 committed by GitHub
parent a740ed7536
commit 0511ca2e4d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 67 additions and 10 deletions

View file

@ -18,12 +18,14 @@ type Dnstap struct {
// IncludeRawMessage will include the raw DNS message into the dnstap messages if true.
IncludeRawMessage bool
Identity []byte
Version []byte
}
// TapMessage sends the message m to the dnstap interface.
func (h Dnstap) TapMessage(m *tap.Message) {
t := tap.Dnstap_MESSAGE
h.io.Dnstap(&tap.Dnstap{Type: &t, Message: m})
h.io.Dnstap(&tap.Dnstap{Type: &t, Message: m, Identity: h.Identity, Version: h.Version})
}
func (h Dnstap) tapQuery(w dns.ResponseWriter, query *dns.Msg, queryTime time.Time) {