libresolve

package
v0.0.0-...-682d07f Latest Latest
Warning

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

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

Documentation

Overview

Package libresolve implements a recursive and stub resolver for RAINS.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ResolutionMode

type ResolutionMode int
const (
	Recursive ResolutionMode = iota
	Forward
)

type Resolver

type Resolver struct {
	RootNameServers []connection.Info
	Forwarders      []connection.Info
	Mode            ResolutionMode
	InsecureTLS     bool
	DialTimeout     time.Duration
	FailFast        bool
	Delegations     *safeHashMap.Map
	Connections     map[connection.Info]net.Conn //FIXME make this map concurency safe, use the connection cache from rainsd
}

Resolver provides methods to resolve names in RAINS.

func New

func New(rootNS, forwarders []connection.Info, mode ResolutionMode, addr connection.Info) *Resolver

New creates a resolver with the given parameters and default settings

func (*Resolver) ClientLookup

func (r *Resolver) ClientLookup(query *query.Name) (*message.Message, error)

ClientLookup forwards the query to the specified forwarders or performs a recursive lookup starting at the specified root servers. It returns the received information.

func (*Resolver) ServerLookup

func (r *Resolver) ServerLookup(query *query.Name, connInfo connection.Info, token token.Token)

ServerLookup forwards the query to the specified forwarders or performs a recursive lookup starting at the specified root servers. It sends the received information to conInfo.

Jump to

Keyboard shortcuts

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