common

package
Version: v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package common provides common functions.

Index

Constants

This section is empty.

Variables

View Source
var ReservedIPNetworkList = getReservedIPNetworkList()

Functions

func FindRecordByType

func FindRecordByType(msg *dns.Msg, t uint16) string

func GetEDNSClientSubnetIP

func GetEDNSClientSubnetIP(m *dns.Msg) string

func HasAnswer

func HasAnswer(m *dns.Msg) bool

func HasSubDomain

func HasSubDomain(s string, sub string) bool

func IsDomainMatchRule

func IsDomainMatchRule(pattern string, domain string) bool

func IsEDNSClientSubnet

func IsEDNSClientSubnet(o *dns.OPT) *dns.EDNS0_SUBNET

func IsIPMatchList

func IsIPMatchList(ip net.IP, ipNetList []*net.IPNet, isLog bool, name string) bool

func SetEDNSClientSubnet

func SetEDNSClientSubnet(m *dns.Msg, ip string, isNoCookie bool)

func SetMinimumTTL

func SetMinimumTTL(msg *dns.Msg, minimumTTL uint32)

func SetTTLByMap

func SetTTLByMap(msg *dns.Msg, domainTTLMap map[string]uint32)

Types

type DNSUpstream

type DNSUpstream struct {
	Name             string
	Address          string
	Protocol         string
	SOCKS5Address    string
	Timeout          int
	EDNSClientSubnet *EDNSClientSubnetType
	TCPPoolConfig    struct {
		Enable          bool
		InitialCapacity int
		MaxCapacity     int
		IdleTimeout     int
	}
}

type EDNSClientSubnetType

type EDNSClientSubnetType struct {
	Policy     string
	ExternalIP string
	NoCookie   bool
}

Jump to

Keyboard shortcuts

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