dnstap

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2025 License: MIT Imports: 10 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) Close

func (d *Dnstap) Close() error

Close stops the dnstap middleware

func (*Dnstap) Name

func (d *Dnstap) Name() string

Name returns the name of the middleware

func (*Dnstap) ServeDNS

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

ServeDNS logs DNS messages in dnstap format

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