collectors

package
v0.29.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2023 License: MIT Imports: 40 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PROTOBUF_PDNS_TO_DNSTAP = map[string]string{
		"DNSQueryType":            "CLIENT_QUERY",
		"DNSResponseType":         "CLIENT_RESPONSE",
		"DNSOutgoingQueryType":    "RESOLVER_QUERY",
		"DNSIncomingResponseType": "RESOLVER_RESPONSE",
	}
)

Functions

func ApplyBpfFilter

func ApplyBpfFilter(filter []bpf.Instruction, fd int) (err error)

func Close added in v0.29.0

func Close(conn io.Closer) error

thanks to https://stackoverflow.com/questions/28967701/golang-tcp-socket-cant-close-after-get-file, call conn.CloseRead() before calling conn.Close()

func ConvertIp4 added in v0.27.0

func ConvertIp4(ip uint32) net.IP

func ConvertIp6 added in v0.27.0

func ConvertIp6(ip [4]uint32) net.IP

func GetBpfFilter

func GetBpfFilter(port int) []bpf.Instruction

func GetBpfFilter_Ingress added in v0.27.0

func GetBpfFilter_Ingress(port int) []bpf.Instruction

func GetFakeDns added in v0.21.0

func GetFakeDns() ([]byte, error)

func GetFakeDnstap added in v0.21.0

func GetFakeDnstap(dnsquery []byte) *dnstap.Dnstap

func GetIpAddress added in v0.27.0

func GetIpAddress[T uint32 | [4]uint32](ip T, mapper func(T) net.IP) net.IP

func Htons

func Htons(v uint16) int

Convert a uint16 to host byte order (big endian)

func IsValidMode added in v0.26.0

func IsValidMode(mode string) bool

func RemoveBpfFilter

func RemoveBpfFilter(fd int) (err error)

func SetSock_RCVBUF added in v0.29.0

func SetSock_RCVBUF(conn net.Conn, desired int, is_tls bool) (int, int, error)

Configure SO_RCVBUF, thanks to https://github.com/dmachard/go-dns-collector/issues/61#issuecomment-1201199895

Types

type AfpacketSniffer added in v0.27.0

type AfpacketSniffer struct {
	// contains filtered or unexported fields
}

func NewAfpacketSniffer added in v0.27.0

func NewAfpacketSniffer(loggers []dnsutils.Worker, config *dnsutils.Config, logger *logger.Logger, name string) *AfpacketSniffer

func (*AfpacketSniffer) Channel added in v0.27.0

func (c *AfpacketSniffer) Channel() chan dnsutils.DnsMessage

func (*AfpacketSniffer) GetName added in v0.27.0

func (c *AfpacketSniffer) GetName() string

func (*AfpacketSniffer) Listen added in v0.27.0

func (c *AfpacketSniffer) Listen() error

func (*AfpacketSniffer) LogError added in v0.27.0

func (c *AfpacketSniffer) LogError(msg string, v ...interface{})

func (*AfpacketSniffer) LogInfo added in v0.27.0

func (c *AfpacketSniffer) LogInfo(msg string, v ...interface{})

func (*AfpacketSniffer) Loggers added in v0.27.0

func (c *AfpacketSniffer) Loggers() []chan dnsutils.DnsMessage

func (*AfpacketSniffer) ReadConfig added in v0.27.0

func (c *AfpacketSniffer) ReadConfig()

func (*AfpacketSniffer) Run added in v0.27.0

func (c *AfpacketSniffer) Run()

func (*AfpacketSniffer) SetLoggers added in v0.27.0

func (c *AfpacketSniffer) SetLoggers(loggers []dnsutils.Worker)

func (*AfpacketSniffer) Stop added in v0.27.0

func (c *AfpacketSniffer) Stop()

type DnsProcessor added in v0.21.0

type DnsProcessor struct {
	// contains filtered or unexported fields
}

func NewDnsProcessor added in v0.21.0

func NewDnsProcessor(config *dnsutils.Config, logger *logger.Logger, name string) DnsProcessor

func (*DnsProcessor) GetChannel added in v0.21.0

func (d *DnsProcessor) GetChannel() chan dnsutils.DnsMessage

func (*DnsProcessor) GetChannelList added in v0.21.0

func (d *DnsProcessor) GetChannelList() []chan dnsutils.DnsMessage

func (*DnsProcessor) LogError added in v0.21.0

func (c *DnsProcessor) LogError(msg string, v ...interface{})

func (*DnsProcessor) LogInfo added in v0.21.0

func (c *DnsProcessor) LogInfo(msg string, v ...interface{})

func (*DnsProcessor) ReadConfig added in v0.21.0

func (d *DnsProcessor) ReadConfig()

func (*DnsProcessor) Run added in v0.21.0

func (d *DnsProcessor) Run(sendTo []chan dnsutils.DnsMessage)

func (*DnsProcessor) Stop added in v0.21.0

func (d *DnsProcessor) Stop()

type Dnstap added in v0.3.0

type Dnstap struct {
	// contains filtered or unexported fields
}

func NewDnstap added in v0.3.0

func NewDnstap(loggers []dnsutils.Worker, config *dnsutils.Config, logger *logger.Logger, name string) *Dnstap

func (*Dnstap) Channel added in v0.3.0

func (c *Dnstap) Channel() chan dnsutils.DnsMessage

func (*Dnstap) GetName added in v0.22.0

func (c *Dnstap) GetName() string

func (*Dnstap) HandleConn added in v0.3.0

func (c *Dnstap) HandleConn(conn net.Conn)

func (*Dnstap) Listen added in v0.3.0

func (c *Dnstap) Listen() error

func (*Dnstap) LogError added in v0.3.0

func (c *Dnstap) LogError(msg string, v ...interface{})

func (*Dnstap) LogInfo added in v0.3.0

func (c *Dnstap) LogInfo(msg string, v ...interface{})

func (*Dnstap) Loggers added in v0.3.0

func (c *Dnstap) Loggers() []chan dnsutils.DnsMessage

func (*Dnstap) ReadConfig added in v0.3.0

func (c *Dnstap) ReadConfig()

func (*Dnstap) Run added in v0.3.0

func (c *Dnstap) Run()

func (*Dnstap) SetLoggers added in v0.22.0

func (c *Dnstap) SetLoggers(loggers []dnsutils.Worker)

func (*Dnstap) Stop added in v0.3.0

func (c *Dnstap) Stop()

type DnstapProcessor added in v0.21.0

type DnstapProcessor struct {
	// contains filtered or unexported fields
}

func NewDnstapProcessor added in v0.21.0

func NewDnstapProcessor(config *dnsutils.Config, logger *logger.Logger, name string) DnstapProcessor

func (*DnstapProcessor) GetChannel added in v0.21.0

func (d *DnstapProcessor) GetChannel() chan []byte

func (*DnstapProcessor) LogError added in v0.21.0

func (c *DnstapProcessor) LogError(msg string, v ...interface{})

func (*DnstapProcessor) LogInfo added in v0.21.0

func (c *DnstapProcessor) LogInfo(msg string, v ...interface{})

func (*DnstapProcessor) ReadConfig added in v0.21.0

func (d *DnstapProcessor) ReadConfig()

func (*DnstapProcessor) Run added in v0.21.0

func (d *DnstapProcessor) Run(sendTo []chan dnsutils.DnsMessage)

func (*DnstapProcessor) Stop added in v0.21.0

func (d *DnstapProcessor) Stop()

type DnstapProxifier added in v0.26.0

type DnstapProxifier struct {
	// contains filtered or unexported fields
}

func NewDnstapProxifier added in v0.26.0

func NewDnstapProxifier(loggers []dnsutils.Worker, config *dnsutils.Config, logger *logger.Logger, name string) *DnstapProxifier

func (*DnstapProxifier) Channel added in v0.26.0

func (c *DnstapProxifier) Channel() chan dnsutils.DnsMessage

func (*DnstapProxifier) GetName added in v0.26.0

func (c *DnstapProxifier) GetName() string

func (*DnstapProxifier) HandleConn added in v0.26.0

func (c *DnstapProxifier) HandleConn(conn net.Conn)

func (*DnstapProxifier) HandleFrame added in v0.26.0

func (c *DnstapProxifier) HandleFrame(recvFrom chan []byte, sendTo []chan dnsutils.DnsMessage)

func (*DnstapProxifier) Listen added in v0.26.0

func (c *DnstapProxifier) Listen() error

func (*DnstapProxifier) LogError added in v0.26.0

func (c *DnstapProxifier) LogError(msg string, v ...interface{})

func (*DnstapProxifier) LogInfo added in v0.26.0

func (c *DnstapProxifier) LogInfo(msg string, v ...interface{})

func (*DnstapProxifier) Loggers added in v0.26.0

func (c *DnstapProxifier) Loggers() []chan dnsutils.DnsMessage

func (*DnstapProxifier) ReadConfig added in v0.26.0

func (c *DnstapProxifier) ReadConfig()

func (*DnstapProxifier) Run added in v0.26.0

func (c *DnstapProxifier) Run()

func (*DnstapProxifier) SetLoggers added in v0.26.0

func (c *DnstapProxifier) SetLoggers(loggers []dnsutils.Worker)

func (*DnstapProxifier) Stop added in v0.26.0

func (c *DnstapProxifier) Stop()

type FileIngestor added in v0.26.0

type FileIngestor struct {
	// contains filtered or unexported fields
}

func NewFileIngestor added in v0.26.0

func NewFileIngestor(loggers []dnsutils.Worker, config *dnsutils.Config, logger *logger.Logger, name string) *FileIngestor

func (*FileIngestor) Channel added in v0.26.0

func (c *FileIngestor) Channel() chan dnsutils.DnsMessage

func (*FileIngestor) GetName added in v0.26.0

func (c *FileIngestor) GetName() string

func (*FileIngestor) LogError added in v0.26.0

func (c *FileIngestor) LogError(msg string, v ...interface{})

func (*FileIngestor) LogInfo added in v0.26.0

func (c *FileIngestor) LogInfo(msg string, v ...interface{})

func (*FileIngestor) Loggers added in v0.26.0

func (c *FileIngestor) Loggers() []chan dnsutils.DnsMessage

func (*FileIngestor) ProcessDnstap added in v0.26.0

func (c *FileIngestor) ProcessDnstap(filePath string) error

func (*FileIngestor) ProcessFile added in v0.26.0

func (c *FileIngestor) ProcessFile(filePath string)

func (*FileIngestor) ProcessPcap added in v0.26.0

func (c *FileIngestor) ProcessPcap(filePath string) error

func (*FileIngestor) ReadConfig added in v0.26.0

func (c *FileIngestor) ReadConfig()

func (*FileIngestor) RegisterEvent added in v0.26.0

func (c *FileIngestor) RegisterEvent(filePath string)

func (*FileIngestor) RemoveEvent added in v0.26.0

func (c *FileIngestor) RemoveEvent(filePath string)

func (*FileIngestor) Run added in v0.26.0

func (c *FileIngestor) Run()

func (*FileIngestor) SetLoggers added in v0.26.0

func (c *FileIngestor) SetLoggers(loggers []dnsutils.Worker)

func (*FileIngestor) Stop added in v0.26.0

func (c *FileIngestor) Stop()

type PdnsProcessor added in v0.21.0

type PdnsProcessor struct {
	// contains filtered or unexported fields
}

func NewPdnsProcessor added in v0.21.0

func NewPdnsProcessor(config *dnsutils.Config, logger *logger.Logger, name string) PdnsProcessor

func (*PdnsProcessor) GetChannel added in v0.21.0

func (d *PdnsProcessor) GetChannel() chan []byte

func (*PdnsProcessor) LogError added in v0.21.0

func (c *PdnsProcessor) LogError(msg string, v ...interface{})

func (*PdnsProcessor) LogInfo added in v0.21.0

func (c *PdnsProcessor) LogInfo(msg string, v ...interface{})

func (*PdnsProcessor) ReadConfig added in v0.21.0

func (c *PdnsProcessor) ReadConfig()

func (*PdnsProcessor) Run added in v0.21.0

func (d *PdnsProcessor) Run(sendTo []chan dnsutils.DnsMessage)

func (*PdnsProcessor) Stop added in v0.21.0

func (d *PdnsProcessor) Stop()

type ProtobufPowerDNS added in v0.17.0

type ProtobufPowerDNS struct {
	// contains filtered or unexported fields
}

func NewProtobufPowerDNS added in v0.17.0

func NewProtobufPowerDNS(loggers []dnsutils.Worker, config *dnsutils.Config, logger *logger.Logger, name string) *ProtobufPowerDNS

func (*ProtobufPowerDNS) Channel added in v0.17.0

func (c *ProtobufPowerDNS) Channel() chan dnsutils.DnsMessage

func (*ProtobufPowerDNS) GetName added in v0.22.0

func (c *ProtobufPowerDNS) GetName() string

func (*ProtobufPowerDNS) HandleConn added in v0.17.0

func (c *ProtobufPowerDNS) HandleConn(conn net.Conn)

func (*ProtobufPowerDNS) Listen added in v0.17.0

func (c *ProtobufPowerDNS) Listen() error

func (*ProtobufPowerDNS) LogError added in v0.17.0

func (c *ProtobufPowerDNS) LogError(msg string, v ...interface{})

func (*ProtobufPowerDNS) LogInfo added in v0.17.0

func (c *ProtobufPowerDNS) LogInfo(msg string, v ...interface{})

func (*ProtobufPowerDNS) Loggers added in v0.17.0

func (c *ProtobufPowerDNS) Loggers() []chan dnsutils.DnsMessage

func (*ProtobufPowerDNS) ReadConfig added in v0.17.0

func (c *ProtobufPowerDNS) ReadConfig()

func (*ProtobufPowerDNS) Run added in v0.17.0

func (c *ProtobufPowerDNS) Run()

func (*ProtobufPowerDNS) SetLoggers added in v0.22.0

func (c *ProtobufPowerDNS) SetLoggers(loggers []dnsutils.Worker)

func (*ProtobufPowerDNS) Stop added in v0.17.0

func (c *ProtobufPowerDNS) Stop()

type Tail added in v0.5.0

type Tail struct {
	// contains filtered or unexported fields
}

func NewTail added in v0.5.0

func NewTail(loggers []dnsutils.Worker, config *dnsutils.Config, logger *logger.Logger, name string) *Tail

func (*Tail) Channel added in v0.5.0

func (c *Tail) Channel() chan dnsutils.DnsMessage

func (*Tail) Follow added in v0.5.0

func (c *Tail) Follow() error

func (*Tail) GetName added in v0.22.0

func (c *Tail) GetName() string

func (*Tail) LogError added in v0.5.0

func (c *Tail) LogError(msg string, v ...interface{})

func (*Tail) LogInfo added in v0.5.0

func (c *Tail) LogInfo(msg string, v ...interface{})

func (*Tail) Loggers added in v0.5.0

func (c *Tail) Loggers() []chan dnsutils.DnsMessage

func (*Tail) ReadConfig added in v0.5.0

func (c *Tail) ReadConfig()

func (*Tail) Run added in v0.5.0

func (c *Tail) Run()

func (*Tail) SetLoggers added in v0.22.0

func (c *Tail) SetLoggers(loggers []dnsutils.Worker)

func (*Tail) Stop added in v0.5.0

func (c *Tail) Stop()

type TzspSniffer added in v0.29.0

type TzspSniffer struct {
	// contains filtered or unexported fields
}

func NewTzsp added in v0.29.0

func NewTzsp(loggers []dnsutils.Worker, config *dnsutils.Config, logger *logger.Logger, name string) *TzspSniffer

func (*TzspSniffer) Channel added in v0.29.0

func (c *TzspSniffer) Channel() chan dnsutils.DnsMessage

func (*TzspSniffer) GetName added in v0.29.0

func (c *TzspSniffer) GetName() string

func (*TzspSniffer) Listen added in v0.29.0

func (c *TzspSniffer) Listen() error

func (*TzspSniffer) LogError added in v0.29.0

func (c *TzspSniffer) LogError(msg string, v ...interface{})

func (*TzspSniffer) LogInfo added in v0.29.0

func (c *TzspSniffer) LogInfo(msg string, v ...interface{})

func (*TzspSniffer) Loggers added in v0.29.0

func (c *TzspSniffer) Loggers() []chan dnsutils.DnsMessage

func (*TzspSniffer) ReadConfig added in v0.29.0

func (c *TzspSniffer) ReadConfig()

func (*TzspSniffer) Run added in v0.29.0

func (c *TzspSniffer) Run()

func (*TzspSniffer) SetLoggers added in v0.29.0

func (c *TzspSniffer) SetLoggers(loggers []dnsutils.Worker)

func (*TzspSniffer) Stop added in v0.29.0

func (c *TzspSniffer) Stop()

type XdpSniffer added in v0.27.0

type XdpSniffer struct {
	// contains filtered or unexported fields
}

func NewXdpSniffer added in v0.27.0

func NewXdpSniffer(loggers []dnsutils.Worker, config *dnsutils.Config, logger *logger.Logger, name string) *XdpSniffer

func (*XdpSniffer) Channel added in v0.27.0

func (c *XdpSniffer) Channel() chan dnsutils.DnsMessage

func (*XdpSniffer) GetName added in v0.27.0

func (c *XdpSniffer) GetName() string

func (*XdpSniffer) LogError added in v0.27.0

func (c *XdpSniffer) LogError(msg string, v ...interface{})

func (*XdpSniffer) LogInfo added in v0.27.0

func (c *XdpSniffer) LogInfo(msg string, v ...interface{})

func (*XdpSniffer) Loggers added in v0.27.0

func (c *XdpSniffer) Loggers() []chan dnsutils.DnsMessage

func (*XdpSniffer) ReadConfig added in v0.27.0

func (c *XdpSniffer) ReadConfig()

func (*XdpSniffer) Run added in v0.27.0

func (c *XdpSniffer) Run()

func (*XdpSniffer) SetLoggers added in v0.27.0

func (c *XdpSniffer) SetLoggers(loggers []dnsutils.Worker)

func (*XdpSniffer) Stop added in v0.27.0

func (c *XdpSniffer) Stop()

Jump to

Keyboard shortcuts

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