Documentation ¶
Overview ¶
Package msg helps to build a dnstap Message.
Index ¶
- func Epoch() uint64
- func Marshal(m *lib.Message) (data []byte, err error)
- type Builder
- type Data
- func (d *Data) Epoch()
- func (d *Data) HostPort(addr string) error
- func (d *Data) Pack(m *dns.Msg) error
- func (d *Data) RemoteAddr(remote net.Addr) error
- func (d *Data) ToClientQuery() *tap.Message
- func (d *Data) ToClientResponse() *tap.Message
- func (d *Data) ToOutsideQuery(t tap.Message_Type) *tap.Message
- func (d *Data) ToOutsideResponse(t tap.Message_Type) *tap.Message
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Builder ¶
Builder helps to build Data by being aware of the dnstap middleware configuration.
type Data ¶
type Data struct { Packed []byte SocketProto tap.SocketProtocol SocketFam tap.SocketFamily Address []byte Port uint32 TimeSec uint64 }
Data helps to build a dnstap Message. It can be transformed into the actual Message using this package.
func (*Data) HostPort ¶
HostPort decodes into Data any string returned by dnsutil.ParseHostPortOrFile.
func (*Data) RemoteAddr ¶
RemoteAddr parses the information about the remote address into Data.
func (*Data) ToClientQuery ¶
ToClientQuery transforms Data into a client query message.
func (*Data) ToClientResponse ¶
ToClientResponse transforms Data into a client response message.
func (*Data) ToOutsideQuery ¶
func (d *Data) ToOutsideQuery(t tap.Message_Type) *tap.Message
ToOutsideQuery transforms the data into a forwarder or resolver query message.
func (*Data) ToOutsideResponse ¶
func (d *Data) ToOutsideResponse(t tap.Message_Type) *tap.Message
ToOutsideResponse transforms the data into a forwarder or resolver response message.