responder

package
v0.0.0-...-fb72fe2 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2019 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatsQueryTotal = "resolver:queries:total"
	StatsQueryUDP   = "resolver:queries:udp"
	StatsQueryTCP   = "resolver:queries:tcp"
	StatsQueryTLS   = "resolver:queries:tls"
	/// will fine tune the definition of failure
	StatsQueryFailure    = "resolver:queries:failed"
	StatsQueryLimitedIps = "resolver:queries:limited_ips"
	StatsQueryUniqueIps  = "resolver:queries:remote_ips"
)
View Source
const (
	LOGGING_NONE = iota
	LOGGING_LOGRUS
	LOGGING_PRINTF
	LOGGING_FILE
	LOGGING_EVENTUALLY
)
View Source
const (
	THREADING_NONE = iota
	THREADING_NETWORK_ONLY
	THREADING_MAX
)
View Source
const (
	/// by default allowed, and encouraged
	EDNS_ALLOWED = iota
	EDNS_SKIP
)
View Source
const (
	RECURSIVE_DNS_UDP_SIZE                      = 4096
	RECURSIVE_DNS_NETWORK_ERROR                 = -1
	RECURSIVE_DNS_WAIT_ON_RATELIMIT             = 1000 /// millisec
	RECURSIVE_DNS_NUM_BLOCKED_BEFORE_FAILURE    = 3
	RECURSIVE_DNS_NUM_RECURSIONS_BEFORE_FAILURE = 30
	RECURSIVE_DNS_ALLOW_ISLANDS_OF_SECURITY     = true
	RECURSIVE_DNS_FILE_LOGGING_LOCATION         = "" /// folder in which to dump resolver debug files, when LOGGING_FILE is active
	RECURSIVE_DNS_MAX_GOROUTINES                = 20000
	RECURSIVE_DNS_SLOW_QUERY_THRESHOLD          = 1000 /// expressed in milliseconds
)
View Source
const (
	PROVIDER_TENTA   = "iana"
	PROVIDER_OPENNIC = "opennic"
)
View Source
const (
	NETWORK_UDP   = "udp"
	NETWORK_TCP   = "tcp"
	NETWORK_TLS   = "tcp-tls"
	NETWORK_HTTPS = "https"
)
View Source
const (
	RR_NAVIGATOR_NEXT = iota
	RR_NAVIGATOR_BREAK
	RR_NAVIGATOR_BREAK_AND_PROPAGATE
)
View Source
const (
	RESPONSE_UNKNOWN = iota
	RESPONSE_ANSWER
	RESPONSE_ANSWER_REDIRECT
	RESPONSE_ANSWER_HIDDEN
	RESPONSE_ANSWER_ALTERNATIVE
	RESPONSE_ANSWER_BEFORE_ASKED
	RESPONSE_DELEGATION
	RESPONSE_DELEGATION_GLUE
	RESPONSE_DELEGATION_AUTHORITATIVE
	RESPONSE_NXDOMAIN
	///RESPONSE_EMPTY_NON_TERMINAL
	RESPONSE_NODATA
	RESPONSE_REDIRECT
	RESPONSE_REDIRECT_GLUE
	RESPONSE_THROTTLE_SUSPECT
	RESPONSE_EDNS_ALLERGY
)

Variables

View Source
var (
	THREADING = THREADING_NONE
	LOGGING   = LOGGING_EVENTUALLY
)
View Source
var (
	RESPONSE_EMPTY = [][]dns.RR{nil, nil, nil}
	EXTRA_EMPTY    = &runtime.ItemCacheExtra{false, false, false, nil}
)
View Source
var (
	NetworkToPort = map[string]string{"udp": "53", "tcp": "53", "tcp-tls": "853"}
)

Functions

func AuthoritativeDNSServer

func AuthoritativeDNSServer(cfg runtime.AuthorityConfig, rt *runtime.Runtime, v4 bool, net string, d *runtime.ServerDomain)

func EnsureLogDir

func EnsureLogDir()

func GetLogDir

func GetLogDir() string

func LogError

func LogError(rrt *ResolverRuntime, format string, args ...interface{})

func LogInfo

func LogInfo(rrt *ResolverRuntime, format string, args ...interface{})

func Resolve

func Resolve(rrt *ResolverRuntime) (outgoing *dns.Msg, e error)

Resolve -- takes a DNS question, and turns it into a DNS answer, be that a set of RRs or a failure. *outgoing* is only partially filled, RCODE and RRs are set, the rest is up to the caller. Expects a fully setup *ResolverRuntime as input (see NewResolverRuntime())

func ServeDNS

func ServeDNS(cfg runtime.RecursorConfig, rt *runtime.Runtime, v4 bool, net string, d *runtime.ServerDomain, opennicMode bool, dnssecMode bool)

func SnitchDNSServer

func SnitchDNSServer(cfg runtime.NSnitchConfig, rt *runtime.Runtime, v4 bool, net string, d *runtime.ServerDomain)

func SnitchHTTPServer

func SnitchHTTPServer(cfg runtime.NSnitchConfig, rt *runtime.Runtime, v4 bool, net string, d *runtime.ServerDomain)

func ToA

func ToA(cr interface{}) (ret []*dns.A)

func ToNS

func ToNS(cr interface{}) (ret []*dns.NS)

Types

type DomainCache

type DomainCache struct {
	CoT bool
	TTL uint32
}

/ Cache primitives / Solves problems: / - cache multiplication (ttl should not be part of the search key!) / - save PTR IP in reverse order (correctly)

type ExchangeHistory

type ExchangeHistory []*ExchangeHistoryItem

func (*ExchangeHistory) Add

func (ExchangeHistory) String

func (h ExchangeHistory) String() (s string)

type ExchangeHistoryItem

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

type JSONQuestion

type JSONQuestion struct {
	Name   string
	RRtype uint16 `json:"Type"`
}

type JSONRR

type JSONRR struct {
	*JSONQuestion
	TTL  uint32
	Data string
}

type JSONResponse

type JSONResponse struct {
	Status                        int
	TC, RD, RA, AD, CD            bool
	Question                      []*JSONQuestion
	Answer, Authority, Additional []*JSONRR `json:",omitempty"`
}

func JSONFromMsg

func JSONFromMsg(in *dns.Msg) *JSONResponse

type JSONTLSMAP

type JSONTLSMAP struct {
	Servers []*runtime.TLSSupport
}

type ResolverRuntime

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

ResolverRuntime -- central piece of a resolve; holds all the necessary data, incoming query, ancillary modules etc

func NewResolverRuntime

func NewResolverRuntime(rt *runtime.Runtime, lg *logrus.Entry, provider string, incoming *dns.Msg, recursionStats, recursionStats2 int32, fileLogger *os.File, eventualLogger *log.EventualLogger) (rrt *ResolverRuntime)

type StackAddedPanic

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

func (*StackAddedPanic) String

func (s *StackAddedPanic) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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