dnstap

package
v1.8.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cfg *config.Config) middleware.Handler

New creates a new dnstap middleware.

Types

type Dnstap

type Dnstap struct {
	// contains filtered or unexported fields
}

Dnstap middleware for binary DNS logging.

func (*Dnstap) ClientOnly added in v1.6.4

func (d *Dnstap) ClientOnly() bool

(*Dnstap).ClientOnly marks dnstap as a client-traffic observer; middleware.Setup excludes it from internal sub-pipelines so dnstap streams reflect real client queries only.

func (*Dnstap) Close

func (d *Dnstap) Close() error

(*Dnstap).Close close stops the dnstap middleware.

func (*Dnstap) Name

func (d *Dnstap) Name() string

(*Dnstap).Name name returns the name of the middleware.

func (*Dnstap) ServeDNS

func (d *Dnstap) ServeDNS(ctx context.Context, ch *middleware.Chain)

(*Dnstap).ServeDNS serveDNS logs DNS messages in dnstap format. Disconnected dnstap is a read-lock check and a wire-born request passes undecoded. A connected tap stays on the byte path too: a dnstap frame carries wire bytes, and a wire-born request already is wire bytes — an owned copy taps it without decoding, so the cache's wire ladder (and the inline fast path behind it) keeps working with the tap on. Only a request that arrived decoded (DoH, internal entries) packs.

type DnstapMessage

type DnstapMessage struct {
	Type         MessageType
	Identity     []byte
	Version      []byte
	QueryAddress net.IP
	QueryPort    uint16
	Protocol     string
	QueryTime    time.Time
	QueryMessage []byte
	ResponseTime time.Time
	ResponseMsg  []byte
}

DnstapMessage represents a simplified dnstap message.

type MessageType

type MessageType uint32

MessageType represents dnstap message types.

const (
	MessageTypeQuery    MessageType = 1
	MessageTypeResponse MessageType = 2
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL