msg

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

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