Documentation ¶
Overview ¶
Package dns is an implementation of core.DNS feature.
Index ¶
- Variables
- func NewLocalNameServer() *localNameServer
- type ClassicNameServer
- type Config
- func (*Config) Descriptor() ([]byte, []int)
- func (m *Config) GetClientIp() []byte
- func (m *Config) GetHosts() map[string]*net.IPOrDomaindeprecated
- func (m *Config) GetNameServers() []*net.Endpoint
- func (m *Config) GetStaticHosts() []*Config_HostMapping
- func (*Config) ProtoMessage()
- func (m *Config) Reset()
- func (m *Config) String() string
- func (m *Config) XXX_DiscardUnknown()
- func (m *Config) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Config) XXX_Merge(src proto.Message)
- func (m *Config) XXX_Size() int
- func (m *Config) XXX_Unmarshal(b []byte) error
- type Config_HostMapping
- func (*Config_HostMapping) Descriptor() ([]byte, []int)
- func (m *Config_HostMapping) GetDomain() string
- func (m *Config_HostMapping) GetIp() [][]byte
- func (m *Config_HostMapping) GetType() Config_HostMapping_Type
- func (*Config_HostMapping) ProtoMessage()
- func (m *Config_HostMapping) Reset()
- func (m *Config_HostMapping) String() string
- func (m *Config_HostMapping) XXX_DiscardUnknown()
- func (m *Config_HostMapping) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Config_HostMapping) XXX_Merge(src proto.Message)
- func (m *Config_HostMapping) XXX_Size() int
- func (m *Config_HostMapping) XXX_Unmarshal(b []byte) error
- type Config_HostMapping_Type
- type IPRecord
- type NameServer
- type Server
- type StaticHosts
Constants ¶
This section is empty.
Variables ¶
View Source
var Config_HostMapping_Type_name = map[int32]string{
0: "Full",
1: "SubDomain",
}
View Source
var Config_HostMapping_Type_value = map[string]int32{
"Full": 0,
"SubDomain": 1,
}
Functions ¶
func NewLocalNameServer ¶
func NewLocalNameServer() *localNameServer
Types ¶
type ClassicNameServer ¶
func NewClassicNameServer ¶
func NewClassicNameServer(address net.Destination, dispatcher core.Dispatcher, clientIP net.IP) *ClassicNameServer
func (*ClassicNameServer) Cleanup ¶
func (s *ClassicNameServer) Cleanup() error
func (*ClassicNameServer) HandleResponse ¶
func (s *ClassicNameServer) HandleResponse(payload *buf.Buffer)
type Config ¶ added in v1.13.1
type Config struct { // Nameservers used by this DNS. Only traditional UDP servers are support at the moment. // A special value 'localhost' as a domain address can be set to use DNS on local system. NameServers []*net.Endpoint `protobuf:"bytes,1,rep,name=NameServers,proto3" json:"NameServers,omitempty"` // Static hosts. Domain to IP. // Deprecated. Use static_hosts. Hosts map[string]*net.IPOrDomain `` // Deprecated: Do not use. /* 151-byte string literal not displayed */ // Client IP for EDNS client subnet. Must be 4 bytes (IPv4) or 16 bytes (IPv6). ClientIp []byte `protobuf:"bytes,3,opt,name=client_ip,json=clientIp,proto3" json:"client_ip,omitempty"` StaticHosts []*Config_HostMapping `protobuf:"bytes,4,rep,name=static_hosts,json=staticHosts,proto3" json:"static_hosts,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Config) Descriptor ¶
func (*Config) GetClientIp ¶
func (*Config) GetHosts
deprecated
func (m *Config) GetHosts() map[string]*net.IPOrDomain
Deprecated: Do not use.
func (*Config) GetNameServers ¶
func (*Config) GetStaticHosts ¶
func (m *Config) GetStaticHosts() []*Config_HostMapping
func (*Config) ProtoMessage ¶
func (*Config) ProtoMessage()
func (*Config) XXX_DiscardUnknown ¶
func (m *Config) XXX_DiscardUnknown()
func (*Config) XXX_Marshal ¶
func (*Config) XXX_Unmarshal ¶
type Config_HostMapping ¶
type Config_HostMapping struct { Type Config_HostMapping_Type `protobuf:"varint,1,opt,name=type,proto3,enum=v2ray.core.app.dns.Config_HostMapping_Type" json:"type,omitempty"` Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain,omitempty"` Ip [][]byte `protobuf:"bytes,3,rep,name=ip,proto3" json:"ip,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Config_HostMapping) Descriptor ¶
func (*Config_HostMapping) Descriptor() ([]byte, []int)
func (*Config_HostMapping) GetDomain ¶
func (m *Config_HostMapping) GetDomain() string
func (*Config_HostMapping) GetIp ¶
func (m *Config_HostMapping) GetIp() [][]byte
func (*Config_HostMapping) GetType ¶
func (m *Config_HostMapping) GetType() Config_HostMapping_Type
func (*Config_HostMapping) ProtoMessage ¶
func (*Config_HostMapping) ProtoMessage()
func (*Config_HostMapping) Reset ¶
func (m *Config_HostMapping) Reset()
func (*Config_HostMapping) String ¶
func (m *Config_HostMapping) String() string
func (*Config_HostMapping) XXX_DiscardUnknown ¶
func (m *Config_HostMapping) XXX_DiscardUnknown()
func (*Config_HostMapping) XXX_Marshal ¶
func (m *Config_HostMapping) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*Config_HostMapping) XXX_Merge ¶
func (dst *Config_HostMapping) XXX_Merge(src proto.Message)
func (*Config_HostMapping) XXX_Size ¶
func (m *Config_HostMapping) XXX_Size() int
func (*Config_HostMapping) XXX_Unmarshal ¶
func (m *Config_HostMapping) XXX_Unmarshal(b []byte) error
type Config_HostMapping_Type ¶
type Config_HostMapping_Type int32
const ( Config_HostMapping_Full Config_HostMapping_Type = 0 Config_HostMapping_SubDomain Config_HostMapping_Type = 1 )
func (Config_HostMapping_Type) EnumDescriptor ¶
func (Config_HostMapping_Type) EnumDescriptor() ([]byte, []int)
func (Config_HostMapping_Type) String ¶
func (x Config_HostMapping_Type) String() string
type NameServer ¶ added in v1.13.1
type StaticHosts ¶
type StaticHosts struct {
// contains filtered or unexported fields
}
func NewStaticHosts ¶
func NewStaticHosts(hosts []*Config_HostMapping, legacy map[string]*net.IPOrDomain) (*StaticHosts, error)
Click to show internal directories.
Click to hide internal directories.