common

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2019 License: MIT Imports: 6 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 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 IsIPMatchList

func IsIPMatchList(ip net.IP, ipNetList []*net.IPNet, isLog bool, name string) 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
}

type Filter

type Filter struct {
	Matcher       string
	DomainFile    string
	IPNetworkFile string
	IPNetworkList []*net.IPNet
	DomainList    matcher.Matcher
}

Jump to

Keyboard shortcuts

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