Xray-core/app/dns/options.go

17 lines
373 B
Go
Raw Normal View History

2021-04-09 15:36:36 +00:00
package dns
import "github.com/xtls/xray-core/features/dns"
2021-04-10 03:36:58 +00:00
func isIPQuery(o *dns.IPOption) bool {
2021-04-09 15:36:36 +00:00
return o.IPv4Enable || o.IPv6Enable
}
2021-04-10 03:36:58 +00:00
func canQueryOnClient(o *dns.IPOption, c *Client) bool {
2021-04-09 15:36:36 +00:00
isIPClient := !(c.Name() == FakeDNSName)
return isIPClient && isIPQuery(o)
}
2021-04-10 03:36:58 +00:00
func isQuery(o *dns.IPOption) bool {
2021-04-09 15:36:36 +00:00
return !(o.IPv4Enable || o.IPv6Enable || o.FakeEnable)
}