qlog

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2019 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CacheMulticastMessages added in v0.3.17

func CacheMulticastMessages(cache *gocache.Cache, msgChan chan *dns.Msg)

func MulticastMdnsListen added in v0.3.17

func MulticastMdnsListen(msgChan chan *dns.Msg)

func MulticastMdnsQuery added in v0.3.17

func MulticastMdnsQuery()

func ParseMulticastMessage added in v0.3.17

func ParseMulticastMessage(msg *dns.Msg) map[string]string

func ReadCachedHostname added in v0.3.17

func ReadCachedHostname(cache *gocache.Cache, address string) string

Types

type LogInfo added in v0.3.0

type LogInfo struct {
	// client address
	Address string

	// hold the information but aren't serialized
	Request        *dns.Msg                   `json:"-"`
	Response       *dns.Msg                   `json:"-"`
	Result         *resolver.ResolutionResult `json:"-"`
	RequestContext *resolver.RequestContext   `json:"-"`

	// generated/calculated values
	Consumer       string
	ClientName     string
	ConnectionType string
	RequestDomain  string
	RequestType    string
	ResponseText   string
	// hard consumer blocked
	Blocked bool
	// matching
	Match     rule.Match
	MatchList string
	MatchRule string
	// cached in resolver cache store
	Cached bool
	// when this log record was created
	// todo: add when it was received and when it was completed
	//       through the context so we can compute a delta
	Created time.Time
}

info passed over channel and stored in database and that is recovered via the Query method

type QLog added in v0.3.0

type QLog interface {
	Query(query *QueryLogQuery) ([]*LogInfo, uint64)
	Log(address *net.IP, request *dns.Msg, response *dns.Msg, rCon *resolver.RequestContext, result *resolver.ResolutionResult)
	Stop()
}

public interface

func New added in v0.3.0

func New(conf *config.GudgeonConfig) (QLog, error)

create a new query log according to configuration

func NewWithReverseLookup added in v0.3.17

func NewWithReverseLookup(conf *config.GudgeonConfig, rlookup ReverseLookupFunction) (QLog, error)

type QueryLogQuery added in v0.3.0

type QueryLogQuery struct {
	// query on fields
	Address        string
	ClientName     string
	ConnectionType string
	RequestDomain  string
	RequestType    string
	ResponseText   string
	Blocked        *bool
	Cached         *bool
	Match          *rule.Match
	// query on created time
	After  *time.Time
	Before *time.Time
	// query limits for paging
	Skip  int
	Limit int
	// query sort
	SortBy    string
	Direction string
}

the type that is used to make queries against the query log (should be used by the web interface to find queries)

type ReverseLookupFunction added in v0.3.17

type ReverseLookupFunction = func(addres string) string

allows a dependency injection-way of defining a reverse lookup function, takes a string address (should be an IP) and returns a string that contains the domain name result

Jump to

Keyboard shortcuts

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