Categorygithub.com/sftfjugg/golang-dnstap
modulepackage
0.5.0
Repository: https://github.com/sftfjugg/golang-dnstap.git
Documentation: pkg.go.dev

# README

dnstap: flexible, structured event replication format for DNS servers

dnstap implements an encoding format for DNS server events. It uses a lightweight framing on top of event payloads encoded using Protocol Buffers and is transport neutral.

dnstap can represent internal state inside a DNS server that is difficult to obtain using techniques based on traditional packet capture or unstructured textual format logging.

This repository contains a command-line tool named "dnstap" developed in the Go programming language. It can be installed with the following command:

go get -u github.com/sftfjugg/golang-dnstap/dnstap

# Packages

No description provided by the author

# Functions

JSONFormat renders a Dnstap message in JSON format.
NewDecoder creates a Decoder using the given dnstap Reader, accepting dnstap data frames up to maxSize in size.
NewEncoder creates an Encoder using the given dnstap Writer.
NewFrameStreamInput creates a FrameStreamInput reading data from the given io.ReadWriter.
NewFrameStreamInputFromFilename creates a FrameStreamInput reading from the named file.
NewFrameStreamInputTimeout creates a FramestreamInput reading data from the given io.ReadWriter with a timeout applied to reading and (for bidirectional inputs) writing control messages.
NewFrameStreamOutput creates a FrameStreamOutput writing dnstap data to the given io.Writer.
NewFrameStreamOutputFromFilename creates a file with the name fname, truncates it if it exists, and returns a FrameStreamOutput writing to the newly created or truncated file.
NewFrameStreamSockInput creates a FrameStreamSockInput collecting dnstap data from clients which connect to the given listener.
NewFrameStreamSockInputFromPath creates a unix domain socket at the given socketPath and returns a FrameStreamSockInput collecting dnstap data from clients connecting to this socket.
NewFrameStreamSockOutput creates a FrameStreamSockOutput manaaging a connection to the given address.
NewReader creates a Reader using the given io.Reader and options.
NewSocketWriter creates a SocketWriter which writes data to a connection to the given addr.
NewTextOutput creates a TextOutput writing dnstap data to the given io.Writer in the text format given by the TextFormatFunc format.
NewTextOutputFromFilename creates a TextOutput writing dnstap data to a file with the given filename in the format given by format.
NewWriter creates a Writer using the given io.Writer and options.
TextFormat renders a dnstap message in a compact human-readable text form.
YamlFormat renders a dnstap message in YAML format.

# Constants

No description provided by the author
AUTH_QUERY is a DNS query message received from a resolver by an authoritative name server, from the perspective of the authoritative name server.
AUTH_RESPONSE is a DNS response message sent from an authoritative name server to a resolver, from the perspective of the authoritative name server.
CLIENT_QUERY is a DNS query message sent from a client to a DNS server which is expected to perform further recursion, from the perspective of the DNS server.
CLIENT_RESPONSE is a DNS response message sent from a DNS server to a client, from the perspective of the DNS server.
FORWARDER_QUERY is a DNS query message sent from a downstream DNS server to an upstream DNS server which is expected to perform further recursion, from the perspective of the downstream DNS server.
FORWARDER_RESPONSE is a DNS response message sent from an upstream DNS server performing recursion to a downstream DNS server, from the perspective of the downstream DNS server.
RESOLVER_QUERY is a DNS query message sent from a resolver to an authoritative name server, from the perspective of the resolver.
RESOLVER_RESPONSE is a DNS response message received from an authoritative name server by a resolver, from the perspective of the resolver.
STUB_QUERY is a DNS query message sent from a stub resolver to a DNS server, from the perspective of the stub resolver.
STUB_RESPONSE is a DNS response message sent from a DNS server to a stub resolver, from the perspective of the stub resolver.
TOOL_QUERY is a DNS query message sent from a DNS software tool to a DNS server, from the perspective of the tool.
TOOL_RESPONSE is a DNS response message received by a DNS software tool from a DNS server, from the perspective of the tool.
UPDATE_QUERY is a DNS update query message received from a resolver by an authoritative name server, from the perspective of the authoritative name server.
UPDATE_RESPONSE is a DNS update response message sent from an authoritative name server to a resolver, from the perspective of the authoritative name server.
IPv4 (RFC 791).
IPv6 (RFC 2460).
DNS over HTTPS (RFC 8484).
DNS over TLS (RFC 7858).
DNS over TCP transport (RFC 1035 section 4.2.2).
DNS over UDP transport (RFC 1035 section 4.2.1).

# Variables

Enum value maps for Dnstap_Type.
Enum value maps for Dnstap_Type.
No description provided by the author
FSContentType is the FrameStream content type for dnstap protobuf data.
MaxPayloadSize sets the upper limit on input Dnstap payload sizes.
Enum value maps for Message_Type.
Enum value maps for Message_Type.
Enum value maps for SocketFamily.
Enum value maps for SocketFamily.
Enum value maps for SocketProtocol.
Enum value maps for SocketProtocol.

# Structs

A Decoder reads and parses Dnstap messages from an io.Reader.
"Dnstap": this is the top-level dnstap type, which is a "union" type that contains other kinds of dnstap payloads, although currently only one type of dnstap payload is defined.
An Encoder serializes and writes Dnstap messages to an underlying dnstap Writer.
A FrameStreamInput reads dnstap data from an io.ReadWriter.
FrameStreamOutput implements a dnstap Output to an io.Writer.
A FrameStreamSockInput collects dnstap data from one or more clients of a listening socket.
A FrameStreamSockOutput manages a socket connection and sends dnstap data over a framestream connection on that socket.
Message: a wire-format (RFC 1035 section 4) DNS message and associated metadata.
ReaderOptions specifies configuration for the Reader.
SocketWriterOptions provides configuration options for a SocketWriter.
TextOutput implements a dnstap Output rendering dnstap data as text.
WriterOptions specifies configuration for the Writer.

# Interfaces

An Input is a source of dnstap data.
A Logger prints a formatted log message to the destination of the implementation's choice.
An Output is a destination for dnstap data.
A Reader is a source of dnstap frames.
A Writer writes dnstap frames to its destination.

# Type aliases

Identifies which field below is filled in.
No description provided by the author
SocketFamily: the network protocol family of a socket.
SocketProtocol: the protocol used to transport a DNS message.
A TextFormatFunc renders a dnstap message into a human readable format.