msg

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2018 License: Apache-2.0 Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder struct {
	Packed      []byte
	SocketProto tap.SocketProtocol
	SocketFam   tap.SocketFamily
	Address     net.IP
	Port        uint32
	TimeSec     uint64
	TimeNsec    uint32
	// contains filtered or unexported fields
}

Builder helps to build a Dnstap message.

func New added in v1.1.0

func New() *Builder

New returns a new Builder

func (*Builder) Addr added in v1.1.0

func (b *Builder) Addr(remote net.Addr) *Builder

Addr adds the remote address to the message.

func (*Builder) HostPort added in v1.1.0

func (b *Builder) HostPort(addr string) *Builder

HostPort adds the remote address as encoded by dnsutil.ParseHostPortOrFile to the message.

func (*Builder) Msg

func (b *Builder) Msg(m *dns.Msg) *Builder

Msg adds the raw DNS message to the dnstap message.

func (*Builder) Time added in v1.1.0

func (b *Builder) Time(ts time.Time) *Builder

Time adds the timestamp to the message.

func (*Builder) ToClientQuery added in v1.1.0

func (b *Builder) ToClientQuery() (*tap.Message, error)

ToClientQuery transforms Data into a client query message.

func (*Builder) ToClientResponse added in v1.1.0

func (b *Builder) ToClientResponse() (*tap.Message, error)

ToClientResponse transforms Data into a client response message.

func (*Builder) ToOutsideQuery added in v1.1.0

func (b *Builder) ToOutsideQuery(t tap.Message_Type) (*tap.Message, error)

ToOutsideQuery transforms the data into a forwarder or resolver query message.

func (*Builder) ToOutsideResponse added in v1.1.0

func (b *Builder) ToOutsideResponse(t tap.Message_Type) (*tap.Message, error)

ToOutsideResponse transforms the data into a forwarder or resolver response message.

Jump to

Keyboard shortcuts

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