outbound

package
v0.0.0-...-874f226 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package outbound implements multiple dns client and dispatcher for outbound connection.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	ResponseMessage *dns.Msg
	QuestionMessage *dns.Msg

	DNSUpstream        *common.DNSUpstream
	EDNSClientSubnetIP string
	InboundIP          string

	Hosts *hosts.Hosts
	Cache *cache.Cache
}

func NewClient

func NewClient(q *dns.Msg, u *common.DNSUpstream, ip string, h *hosts.Hosts, cache *cache.Cache) *Client

func (*Client) CacheResult

func (c *Client) CacheResult()

func (*Client) ExchangeFromCache

func (c *Client) ExchangeFromCache() bool

func (*Client) ExchangeFromHosts

func (c *Client) ExchangeFromHosts(raw_name string) bool

func (*Client) ExchangeFromIP

func (c *Client) ExchangeFromIP(raw_name string) bool

func (*Client) ExchangeFromLocal

func (c *Client) ExchangeFromLocal() bool

func (*Client) ExchangeFromRemote

func (c *Client) ExchangeFromRemote(isCache bool, isLog bool)

type ClientBundle

type ClientBundle struct {
	ResponseMessage *dns.Msg
	QuestionMessage *dns.Msg

	ClientList []*Client

	DNSUpstreamList []*common.DNSUpstream
	InboundIP       string
	MinimumTTL      int

	Hosts *hosts.Hosts
	Cache *cache.Cache
}

func NewClientBundle

func NewClientBundle(q *dns.Msg, ul []*common.DNSUpstream, ip string, ttl int, h *hosts.Hosts, cache *cache.Cache) *ClientBundle

func (*ClientBundle) CacheResult

func (cb *ClientBundle) CacheResult()

func (*ClientBundle) ExchangeFromLocal

func (cb *ClientBundle) ExchangeFromLocal() bool

func (*ClientBundle) ExchangeFromRemote

func (cb *ClientBundle) ExchangeFromRemote(isCache bool, isLog bool)

type Dispatcher

type Dispatcher struct {
	QuestionMessage *dns.Msg

	PrimaryDNS     []*common.DNSUpstream
	AlternativeDNS []*common.DNSUpstream
	OnlyPrimaryDNS bool

	PrimaryClientBundle     *ClientBundle
	AlternativeClientBundle *ClientBundle
	ActiveClientBundle      *ClientBundle

	IPNetworkPrimaryList     []*net.IPNet
	IPNetworkAlternativeList []*net.IPNet
	DomainPrimaryList        []string
	DomainAlternativeList    []string
	RedirectIPv6Record       bool

	InboundIP  string
	MinimumTTL int

	Hosts *hosts.Hosts
	Cache *cache.Cache
}

func (*Dispatcher) ChooseActiveClientBundle

func (d *Dispatcher) ChooseActiveClientBundle()

func (*Dispatcher) Exchange

func (d *Dispatcher) Exchange()

func (*Dispatcher) ExchangeForAlternativeDomain

func (d *Dispatcher) ExchangeForAlternativeDomain() bool

func (*Dispatcher) ExchangeForIPv6

func (d *Dispatcher) ExchangeForIPv6() bool

func (*Dispatcher) ExchangeForPrimaryDomain

func (d *Dispatcher) ExchangeForPrimaryDomain() bool

Jump to

Keyboard shortcuts

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