Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/honwen/aiodns
/ functions
Functions
80 in github.com/honwen/aiodns
⨍
Functions
80
◇
Types & classes
13
↓ 18 callers
Method
Set
Set implements the [flag.Value] interface for *uint32Value.
internal/cmd/flag.go:19
↓ 6 callers
Method
String
String implements the [flag.Value] interface for *uint32Value.
internal/cmd/flag.go:27
↓ 6 callers
Function
scanDoamins
(dat []byte, filter func(string) bool)
main.go:82
↓ 4 callers
Function
defineFlag
defineFlag defines a flag with specified setFlag function. o must not be nil.
internal/cmd/args.go:489
↓ 4 callers
Function
defineFlagVar
defineFlagVar defines a flag with the specified [flag.Value] value. o must not be nil.
internal/cmd/args.go:502
↓ 4 callers
Function
reply
reply creates a new response message replying to req with the given code.
internal/dnsmsg/constructor.go:108
↓ 3 callers
Function
hdr
hdr creates a new DNS header with the given name and RR type.
internal/handler/constructor.go:86
↓ 3 callers
Function
loadServersList
loadServersList loads a list of DNS servers from the specified list. The thing is that the user may specify either a server address or the path to a
internal/cmd/proxy.go:487
↓ 2 callers
Method
ByName
ByName implements the [hostsfile.Storage] interface for [emptyStorage].
internal/handler/hosts.go:33
↓ 2 callers
Function
RunProxy
RunProxy starts and runs the proxy. l must not be nil. TODO(e.burkov): Move into separate dnssvc package.
internal/cmd/cmd.go:84
↓ 2 callers
Function
cliErrorExit
(c *cli.Context, err error)
main.go:47
↓ 2 callers
Function
fetch
(uri string, resolvers []string)
main.go:53
↓ 2 callers
Function
isEmpty
isEmpty returns false if uc contains at least a single upstream. uc must not be nil. TODO(e.burkov): Think of a better way to validate the config.
internal/cmd/proxy.go:120
↓ 2 callers
Function
parseCmdLineOptions
parseCmdLineOptions parses the command-line options. conf must not be nil.
internal/cmd/args.go:410
↓ 2 callers
Function
usage
usage prints a usage message similar to the one printed by package flag but taking long vs. short versions into account as well as using more informat
internal/cmd/args.go:552
↓ 1 callers
Method
ByAddr
ByAddr implements the [hostsfile.Storage] interface for [emptyStorage].
internal/handler/hosts.go:28
↓ 1 callers
Method
NewCompressedResponse
NewCompressedResponse creates a new compressed response message for req with the given response code.
internal/handler/constructor.go:17
↓ 1 callers
Method
NewCompressedResponse
NewCompressedResponse implements the [messageConstructor] interface for defaultConstructor.
internal/handler/constructor.go:43
↓ 1 callers
Function
NewDefault
NewDefault creates a new [Default] handler.
internal/handler/default.go:37
↓ 1 callers
Method
NewIPResponse
NewIPResponse creates a new A/AAAA response message for req with the given IP addresses. All IP addresses must be of the same family.
internal/handler/constructor.go:26
↓ 1 callers
Method
NewMsgNODATA
NewMsgNODATA creates a new empty response message replying to req with the NOERROR code. See https://www.rfc-editor.org/rfc/rfc2308#section-2.2.
internal/dnsmsg/constructor.go:29
↓ 1 callers
Method
NewPTRAnswer
NewPTRAnswer creates a new resource record for PTR response with the given FQDN and PTR domain. Arguments must be fully qualified domain names.
internal/handler/constructor.go:22
↓ 1 callers
Function
ReadHosts
ReadHosts reads the hosts files from the file system and returns a storage with parsed records. strg is always usable even if an error occurred.
internal/handler/hosts.go:39
↓ 1 callers
Function
addOption
addOption adds the command-line option described by o to flags using fieldPtr as the pointer to the value.
internal/cmd/args.go:524
↓ 1 callers
Function
createProxyConfig
TODO(e.burkov): Use a separate type for the YAML Configuration file. createProxyConfig initializes [proxy.Config]. l must not be nil.
internal/cmd/proxy.go:34
↓ 1 callers
Function
curl
(url string, resolvers []string, retry int)
curl.go:16
↓ 1 callers
Function
defaultHostsPaths
defaultHostsPaths returns default paths to hosts files for UNIX.
internal/netutil/paths_unix.go:8
↓ 1 callers
Function
defineTimeutilDurationFlag
defineTimeutilDurationFlag defines a flag with for the specified [*timeutil.Duration] pointer and command line option. o must not be nil.
internal/cmd/args.go:511
↓ 1 callers
Function
genAnswersWithIPv4s
genAnswersWithIPv4s generates DNS A answers provided IPv4 addresses. If any of the IPs isn't an IPv4 address, genAnswersWithIPv4s logs a warning and
internal/handler/constructor.go:122
↓ 1 callers
Method
haltAAAA
haltAAAA halts the processing of AAAA requests if IPv6 is disabled. req must not be nil.
internal/handler/ipv6halt.go:11
↓ 1 callers
Method
hostsFiles
hostsFiles returns the list of hosts files to resolve from. It's empty if resolving from hosts files is disabled.
internal/cmd/proxy.go:519
↓ 1 callers
Method
initBogusNXDomain
initBogusNXDomain inits BogusNXDomain structure.
internal/cmd/proxy.go:276
↓ 1 callers
Function
initBootstrap
initBootstrap initializes the [upstream.Resolver] for bootstrapping upstream servers. It returns the default resolver if no bootstraps were specified
internal/cmd/proxy.go:216
↓ 1 callers
Method
initDNSCryptConfig
initDNSCryptConfig inits the DNSCrypt config.
internal/cmd/proxy.go:312
↓ 1 callers
Function
initDNSCryptListenAddrs
initDNSCryptListenAddrs sets up proxy Configuration DNSCrypt listen addresses.
internal/cmd/proxy.go:420
↓ 1 callers
Method
initEDNS
initEDNS inits EDNS-related config fields.
internal/cmd/proxy.go:252
↓ 1 callers
Method
initListenAddrs
initListenAddrs sets up proxy Configuration listen IP addresses.
internal/cmd/proxy.go:367
↓ 1 callers
Method
initPrivateSubnets
initSubnets sets the private subnets Configuration into conf.
internal/cmd/proxy.go:464
↓ 1 callers
Method
initSubnets
initSubnets sets the DNS64 Configuration into conf. TODO(d.kolyshev): Join errors.
internal/cmd/proxy.go:443
↓ 1 callers
Method
initTLSConfig
initTLSConfig inits the TLS config.
internal/cmd/proxy.go:297
↓ 1 callers
Function
initTLSListenAddrs
initTLSListenAddrs sets up proxy Configuration TLS listen addresses.
internal/cmd/proxy.go:395
↓ 1 callers
Method
initUpstreams
initUpstreams inits upstream-related config fields. TODO(d.kolyshev): Join errors.
internal/cmd/proxy.go:132
↓ 1 callers
Function
loadX509KeyPair
loadX509KeyPair reads and parses a public/private key pair from a pair of files. The files must contain PEM encoded data. The certificate file may c
internal/cmd/tls.go:53
↓ 1 callers
Function
newAnswerA
newAnswerA creates a DNS A answer for req with the given IP address.
internal/handler/constructor.go:104
↓ 1 callers
Function
newAnswerAAAA
newAnswerAAAA creates a DNS AAAA answer for req with the given IP address.
internal/handler/constructor.go:112
↓ 1 callers
Function
newIntSliceValue
newIntSliceValue returns a pointer to intSliceValue with the given value.
internal/cmd/flag.go:62
↓ 1 callers
Function
newStringSliceValue
newStringSliceValue returns a pointer to stringSliceValue with the given value.
internal/cmd/flag.go:120
↓ 1 callers
Function
newTLSConfig
NewTLSConfig returns the TLS config that includes a certificate. Use it for server TLS Configuration or for a client certificate. If caPath is empty
internal/cmd/tls.go:12
↓ 1 callers
Function
parseConfig
parseConfig returns options parsed from the command args or config file. If no options have been parsed, it returns a suitable exit code and an error
internal/cmd/config.go:207
↓ 1 callers
Function
parseConfigFile
parseConfigFile fills options with the settings from file read by the given path.
internal/cmd/config.go:256
↓ 1 callers
Function
parseListenAddrs
parseListenAddrs returns a slice of listen IP addresses from the given options. In case no addresses are specified by options returns a slice with th
internal/cmd/proxy.go:344
↓ 1 callers
Function
processCmdLineOptions
processCmdLineOptions decides if dnsproxy should exit depending on the results of command-line option parsing.
internal/cmd/args.go:593
↓ 1 callers
Function
readHostsFile
readHostsFile reads the hosts file at path and parses it into strg.
internal/handler/hosts.go:74
↓ 1 callers
Function
reply
reply creates a DNS response for req.
internal/handler/constructor.go:96
↓ 1 callers
Method
resolveFromHosts
resolveFromHosts resolves the DNS query from the hosts file. It fills the response with the A, AAAA, and PTR records from the hosts file.
internal/handler/hosts.go:94
↓ 1 callers
Function
runPprof
runPprof runs pprof server on localhost:6060. TODO(e.burkov): Add debugsvc.
internal/cmd/cmd.go:125
↓ 1 callers
Function
writeUsageLine
writeUsageLine writes the usage line for the provided command-line option.
internal/cmd/args.go:573
Function
DefaultHostsPaths
DefaultHostsPaths returns the slice of default paths to system hosts files. TODO(s.chzhen): Since [fs.FS] is no longer needed, update the [hostsfile
internal/netutil/paths.go:7
Method
HandleRequest
HandleRequest resolves the DNS request within proxyCtx. It only calls [proxy.Proxy.Resolve] if the request isn't handled by any of the internal handl
internal/handler/default.go:56
Function
Main
Main is the entrypoint of dnsproxy CLI. Main may accept arguments, such as embedded assets and command-line arguments.
internal/cmd/cmd.go:23
Method
NewIPResponse
NewIPResponse implements the [messageConstructor] interface for [defaultConstructor]
internal/handler/constructor.go:61
Method
NewMsgNODATA
NewMsgNODATA implements the [MessageConstructor] interface for DefaultMessageConstructor.
internal/dnsmsg/constructor.go:72
Method
NewMsgNOTIMPLEMENTED
NewMsgNOTIMPLEMENTED creates a new response message replying to req with the NOTIMPLEMENTED code.
internal/dnsmsg/constructor.go:23
Method
NewMsgNOTIMPLEMENTED
NewMsgNOTIMPLEMENTED implements the [MessageConstructor] interface for DefaultMessageConstructor.
internal/dnsmsg/constructor.go:53
Method
NewMsgNXDOMAIN
NewMsgNXDOMAIN creates a new response message replying to req with the NXDOMAIN code.
internal/dnsmsg/constructor.go:15
Method
NewMsgNXDOMAIN
NewMsgNXDOMAIN implements the [MessageConstructor] interface for DefaultMessageConstructor.
internal/dnsmsg/constructor.go:41
Method
NewMsgSERVFAIL
NewMsgSERVFAIL creates a new response message replying to req with the SERVFAIL code.
internal/dnsmsg/constructor.go:19
Method
NewMsgSERVFAIL
NewMsgSERVFAIL implements the [MessageConstructor] interface for DefaultMessageConstructor.
internal/dnsmsg/constructor.go:47
Method
NewPTRAnswer
NewPTRAnswer implements the [messageConstructor] interface for [defaultConstructor].
internal/handler/constructor.go:52
Function
ParseSubnet
ParseSubnet parses s either as a CIDR prefix itself, or as an IP address, returning the corresponding single-IP CIDR prefix. TODO(e.burkov): Replace
internal/netutil/netutil.go:17
Method
Set
Set implements the [flag.Value] interface for *float32Value.
internal/cmd/flag.go:38
Method
Set
Set implements the [flag.Value] interface for *intSliceValue.
internal/cmd/flag.go:73
Method
Set
Set implements the [flag.Value] interface for *stringSliceValue.
internal/cmd/flag.go:131
Method
String
String implements the [flag.Value] interface for *float32Value.
internal/cmd/flag.go:46
Method
String
String implements the [flag.Value] interface for *intSliceValue.
internal/cmd/flag.go:90
Method
String
String implements the [flag.Value] interface for *stringSliceValue.
internal/cmd/flag.go:143
Function
defaultHostsPaths
defaultHostsPaths returns default paths to hosts files for Windows.
internal/netutil/paths_windows.go:13
Function
init
()
init.go:24
Function
init
()
main.go:112
Function
main
()
main.go:122