dns

package
v2.3.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2016 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package dns is a generated protocol buffer package.

It is generated from these files:

v2ray.com/core/app/dns/config.proto

It has these top-level messages:

Config

Index

Constants

View Source
const (
	DefaultTTL       = uint32(3600)
	CleanupInterval  = time.Second * 120
	CleanupThreshold = 512
)
View Source
const (
	APP_ID = app.ID(2)
)
View Source
const (
	QueryTimeout = time.Second * 8
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ARecord added in v1.13.1

type ARecord struct {
	IPs    []net.IP
	Expire time.Time
}

type CacheServer added in v1.13.1

type CacheServer struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewCacheServer added in v1.13.1

func NewCacheServer(space app.Space, config *Config) *CacheServer

func (*CacheServer) Get added in v1.13.1

func (this *CacheServer) Get(domain string) []net.IP

func (*CacheServer) GetCached added in v1.13.1

func (this *CacheServer) GetCached(domain string) []net.IP

Private: Visible for testing.

func (*CacheServer) Release added in v1.13.1

func (this *CacheServer) Release()

type CacheServerFactory

type CacheServerFactory struct{}

func (CacheServerFactory) AppId

func (this CacheServerFactory) AppId() app.ID

func (CacheServerFactory) Create

func (this CacheServerFactory) Create(space app.Space, config interface{}) (app.Application, error)

type Config added in v1.13.1

type Config struct {
	NameServers []*v2ray_core_common_net2.Endpoint           `protobuf:"bytes,1,rep,name=NameServers" json:"NameServers,omitempty"`
	Hosts       map[string]*v2ray_core_common_net.IPOrDomain `` /* 130-byte string literal not displayed */
}

func (*Config) Descriptor

func (*Config) Descriptor() ([]byte, []int)

func (*Config) GetHosts

func (m *Config) GetHosts() map[string]*v2ray_core_common_net.IPOrDomain

func (*Config) GetInternalHosts

func (this *Config) GetInternalHosts() map[string]net.IP

func (*Config) GetNameServers

func (m *Config) GetNameServers() []*v2ray_core_common_net2.Endpoint

func (*Config) ProtoMessage

func (*Config) ProtoMessage()

func (*Config) Reset

func (m *Config) Reset()

func (*Config) String

func (m *Config) String() string

type DomainRecord added in v1.13.1

type DomainRecord struct {
	A *ARecord
}

type LocalNameServer added in v1.13.1

type LocalNameServer struct {
}

func (*LocalNameServer) QueryA added in v1.13.1

func (this *LocalNameServer) QueryA(domain string) <-chan *ARecord

type NameServer added in v1.13.1

type NameServer interface {
	QueryA(domain string) <-chan *ARecord
}

type PendingRequest added in v1.13.1

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

type Server added in v1.13.1

type Server interface {
	Get(domain string) []net.IP
}

A DnsCache is an internal cache of DNS resolutions.

type UDPNameServer added in v1.13.1

type UDPNameServer struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewUDPNameServer added in v1.13.1

func NewUDPNameServer(address v2net.Destination, dispatcher dispatcher.PacketDispatcher) *UDPNameServer

func (*UDPNameServer) AssignUnusedID added in v1.13.1

func (this *UDPNameServer) AssignUnusedID(response chan<- *ARecord) uint16

Private: Visible for testing.

func (*UDPNameServer) BuildQueryA added in v1.17.1

func (this *UDPNameServer) BuildQueryA(domain string, id uint16) *alloc.Buffer

func (*UDPNameServer) Cleanup added in v1.13.1

func (this *UDPNameServer) Cleanup()

Private: Visible for testing.

func (*UDPNameServer) DispatchQuery added in v1.17.1

func (this *UDPNameServer) DispatchQuery(payload *alloc.Buffer)

func (*UDPNameServer) HandleResponse added in v1.13.1

func (this *UDPNameServer) HandleResponse(dest v2net.Destination, payload *alloc.Buffer)

Private: Visible for testing.

func (*UDPNameServer) QueryA added in v1.13.1

func (this *UDPNameServer) QueryA(domain string) <-chan *ARecord

Jump to

Keyboard shortcuts

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