config.pb.go 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360
  1. package dns
  2. import (
  3. fmt "fmt"
  4. proto "github.com/golang/protobuf/proto"
  5. math "math"
  6. router "v2ray.com/core/app/router"
  7. net "v2ray.com/core/common/net"
  8. )
  9. // Reference imports to suppress errors if they are not otherwise used.
  10. var _ = proto.Marshal
  11. var _ = fmt.Errorf
  12. var _ = math.Inf
  13. // This is a compile-time assertion to ensure that this generated file
  14. // is compatible with the proto package it is being compiled against.
  15. // A compilation error at this line likely means your copy of the
  16. // proto package needs to be updated.
  17. const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
  18. type DomainMatchingType int32
  19. const (
  20. DomainMatchingType_Full DomainMatchingType = 0
  21. DomainMatchingType_Subdomain DomainMatchingType = 1
  22. DomainMatchingType_Keyword DomainMatchingType = 2
  23. DomainMatchingType_Regex DomainMatchingType = 3
  24. )
  25. var DomainMatchingType_name = map[int32]string{
  26. 0: "Full",
  27. 1: "Subdomain",
  28. 2: "Keyword",
  29. 3: "Regex",
  30. }
  31. var DomainMatchingType_value = map[string]int32{
  32. "Full": 0,
  33. "Subdomain": 1,
  34. "Keyword": 2,
  35. "Regex": 3,
  36. }
  37. func (x DomainMatchingType) String() string {
  38. return proto.EnumName(DomainMatchingType_name, int32(x))
  39. }
  40. func (DomainMatchingType) EnumDescriptor() ([]byte, []int) {
  41. return fileDescriptor_ed5695198e3def8f, []int{0}
  42. }
  43. type NameServer struct {
  44. Address *net.Endpoint `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
  45. PrioritizedDomain []*NameServer_PriorityDomain `protobuf:"bytes,2,rep,name=prioritized_domain,json=prioritizedDomain,proto3" json:"prioritized_domain,omitempty"`
  46. Geoip []*router.GeoIP `protobuf:"bytes,3,rep,name=geoip,proto3" json:"geoip,omitempty"`
  47. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  48. XXX_unrecognized []byte `json:"-"`
  49. XXX_sizecache int32 `json:"-"`
  50. }
  51. func (m *NameServer) Reset() { *m = NameServer{} }
  52. func (m *NameServer) String() string { return proto.CompactTextString(m) }
  53. func (*NameServer) ProtoMessage() {}
  54. func (*NameServer) Descriptor() ([]byte, []int) {
  55. return fileDescriptor_ed5695198e3def8f, []int{0}
  56. }
  57. func (m *NameServer) XXX_Unmarshal(b []byte) error {
  58. return xxx_messageInfo_NameServer.Unmarshal(m, b)
  59. }
  60. func (m *NameServer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  61. return xxx_messageInfo_NameServer.Marshal(b, m, deterministic)
  62. }
  63. func (m *NameServer) XXX_Merge(src proto.Message) {
  64. xxx_messageInfo_NameServer.Merge(m, src)
  65. }
  66. func (m *NameServer) XXX_Size() int {
  67. return xxx_messageInfo_NameServer.Size(m)
  68. }
  69. func (m *NameServer) XXX_DiscardUnknown() {
  70. xxx_messageInfo_NameServer.DiscardUnknown(m)
  71. }
  72. var xxx_messageInfo_NameServer proto.InternalMessageInfo
  73. func (m *NameServer) GetAddress() *net.Endpoint {
  74. if m != nil {
  75. return m.Address
  76. }
  77. return nil
  78. }
  79. func (m *NameServer) GetPrioritizedDomain() []*NameServer_PriorityDomain {
  80. if m != nil {
  81. return m.PrioritizedDomain
  82. }
  83. return nil
  84. }
  85. func (m *NameServer) GetGeoip() []*router.GeoIP {
  86. if m != nil {
  87. return m.Geoip
  88. }
  89. return nil
  90. }
  91. type NameServer_PriorityDomain struct {
  92. Type DomainMatchingType `protobuf:"varint,1,opt,name=type,proto3,enum=v2ray.core.app.dns.DomainMatchingType" json:"type,omitempty"`
  93. Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain,omitempty"`
  94. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  95. XXX_unrecognized []byte `json:"-"`
  96. XXX_sizecache int32 `json:"-"`
  97. }
  98. func (m *NameServer_PriorityDomain) Reset() { *m = NameServer_PriorityDomain{} }
  99. func (m *NameServer_PriorityDomain) String() string { return proto.CompactTextString(m) }
  100. func (*NameServer_PriorityDomain) ProtoMessage() {}
  101. func (*NameServer_PriorityDomain) Descriptor() ([]byte, []int) {
  102. return fileDescriptor_ed5695198e3def8f, []int{0, 0}
  103. }
  104. func (m *NameServer_PriorityDomain) XXX_Unmarshal(b []byte) error {
  105. return xxx_messageInfo_NameServer_PriorityDomain.Unmarshal(m, b)
  106. }
  107. func (m *NameServer_PriorityDomain) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  108. return xxx_messageInfo_NameServer_PriorityDomain.Marshal(b, m, deterministic)
  109. }
  110. func (m *NameServer_PriorityDomain) XXX_Merge(src proto.Message) {
  111. xxx_messageInfo_NameServer_PriorityDomain.Merge(m, src)
  112. }
  113. func (m *NameServer_PriorityDomain) XXX_Size() int {
  114. return xxx_messageInfo_NameServer_PriorityDomain.Size(m)
  115. }
  116. func (m *NameServer_PriorityDomain) XXX_DiscardUnknown() {
  117. xxx_messageInfo_NameServer_PriorityDomain.DiscardUnknown(m)
  118. }
  119. var xxx_messageInfo_NameServer_PriorityDomain proto.InternalMessageInfo
  120. func (m *NameServer_PriorityDomain) GetType() DomainMatchingType {
  121. if m != nil {
  122. return m.Type
  123. }
  124. return DomainMatchingType_Full
  125. }
  126. func (m *NameServer_PriorityDomain) GetDomain() string {
  127. if m != nil {
  128. return m.Domain
  129. }
  130. return ""
  131. }
  132. type Config struct {
  133. // Nameservers used by this DNS. Only traditional UDP servers are support at the moment.
  134. // A special value 'localhost' as a domain address can be set to use DNS on local system.
  135. NameServers []*net.Endpoint `protobuf:"bytes,1,rep,name=NameServers,proto3" json:"NameServers,omitempty"` // Deprecated: Do not use.
  136. // NameServer list used by this DNS client.
  137. NameServer []*NameServer `protobuf:"bytes,5,rep,name=name_server,json=nameServer,proto3" json:"name_server,omitempty"`
  138. // Static hosts. Domain to IP.
  139. // Deprecated. Use static_hosts.
  140. Hosts map[string]*net.IPOrDomain `protobuf:"bytes,2,rep,name=Hosts,proto3" json:"Hosts,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // Deprecated: Do not use.
  141. // Client IP for EDNS client subnet. Must be 4 bytes (IPv4) or 16 bytes (IPv6).
  142. ClientIp []byte `protobuf:"bytes,3,opt,name=client_ip,json=clientIp,proto3" json:"client_ip,omitempty"`
  143. StaticHosts []*Config_HostMapping `protobuf:"bytes,4,rep,name=static_hosts,json=staticHosts,proto3" json:"static_hosts,omitempty"`
  144. // Tag is the inbound tag of DNS client.
  145. Tag string `protobuf:"bytes,6,opt,name=tag,proto3" json:"tag,omitempty"`
  146. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  147. XXX_unrecognized []byte `json:"-"`
  148. XXX_sizecache int32 `json:"-"`
  149. }
  150. func (m *Config) Reset() { *m = Config{} }
  151. func (m *Config) String() string { return proto.CompactTextString(m) }
  152. func (*Config) ProtoMessage() {}
  153. func (*Config) Descriptor() ([]byte, []int) {
  154. return fileDescriptor_ed5695198e3def8f, []int{1}
  155. }
  156. func (m *Config) XXX_Unmarshal(b []byte) error {
  157. return xxx_messageInfo_Config.Unmarshal(m, b)
  158. }
  159. func (m *Config) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  160. return xxx_messageInfo_Config.Marshal(b, m, deterministic)
  161. }
  162. func (m *Config) XXX_Merge(src proto.Message) {
  163. xxx_messageInfo_Config.Merge(m, src)
  164. }
  165. func (m *Config) XXX_Size() int {
  166. return xxx_messageInfo_Config.Size(m)
  167. }
  168. func (m *Config) XXX_DiscardUnknown() {
  169. xxx_messageInfo_Config.DiscardUnknown(m)
  170. }
  171. var xxx_messageInfo_Config proto.InternalMessageInfo
  172. // Deprecated: Do not use.
  173. func (m *Config) GetNameServers() []*net.Endpoint {
  174. if m != nil {
  175. return m.NameServers
  176. }
  177. return nil
  178. }
  179. func (m *Config) GetNameServer() []*NameServer {
  180. if m != nil {
  181. return m.NameServer
  182. }
  183. return nil
  184. }
  185. // Deprecated: Do not use.
  186. func (m *Config) GetHosts() map[string]*net.IPOrDomain {
  187. if m != nil {
  188. return m.Hosts
  189. }
  190. return nil
  191. }
  192. func (m *Config) GetClientIp() []byte {
  193. if m != nil {
  194. return m.ClientIp
  195. }
  196. return nil
  197. }
  198. func (m *Config) GetStaticHosts() []*Config_HostMapping {
  199. if m != nil {
  200. return m.StaticHosts
  201. }
  202. return nil
  203. }
  204. func (m *Config) GetTag() string {
  205. if m != nil {
  206. return m.Tag
  207. }
  208. return ""
  209. }
  210. type Config_HostMapping struct {
  211. Type DomainMatchingType `protobuf:"varint,1,opt,name=type,proto3,enum=v2ray.core.app.dns.DomainMatchingType" json:"type,omitempty"`
  212. Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain,omitempty"`
  213. Ip [][]byte `protobuf:"bytes,3,rep,name=ip,proto3" json:"ip,omitempty"`
  214. // ProxiedDomain indicates the mapped domain has the same IP address on this domain. V2Ray will use this domain for IP queries.
  215. // This field is only effective if ip is empty.
  216. ProxiedDomain string `protobuf:"bytes,4,opt,name=proxied_domain,json=proxiedDomain,proto3" json:"proxied_domain,omitempty"`
  217. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  218. XXX_unrecognized []byte `json:"-"`
  219. XXX_sizecache int32 `json:"-"`
  220. }
  221. func (m *Config_HostMapping) Reset() { *m = Config_HostMapping{} }
  222. func (m *Config_HostMapping) String() string { return proto.CompactTextString(m) }
  223. func (*Config_HostMapping) ProtoMessage() {}
  224. func (*Config_HostMapping) Descriptor() ([]byte, []int) {
  225. return fileDescriptor_ed5695198e3def8f, []int{1, 1}
  226. }
  227. func (m *Config_HostMapping) XXX_Unmarshal(b []byte) error {
  228. return xxx_messageInfo_Config_HostMapping.Unmarshal(m, b)
  229. }
  230. func (m *Config_HostMapping) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  231. return xxx_messageInfo_Config_HostMapping.Marshal(b, m, deterministic)
  232. }
  233. func (m *Config_HostMapping) XXX_Merge(src proto.Message) {
  234. xxx_messageInfo_Config_HostMapping.Merge(m, src)
  235. }
  236. func (m *Config_HostMapping) XXX_Size() int {
  237. return xxx_messageInfo_Config_HostMapping.Size(m)
  238. }
  239. func (m *Config_HostMapping) XXX_DiscardUnknown() {
  240. xxx_messageInfo_Config_HostMapping.DiscardUnknown(m)
  241. }
  242. var xxx_messageInfo_Config_HostMapping proto.InternalMessageInfo
  243. func (m *Config_HostMapping) GetType() DomainMatchingType {
  244. if m != nil {
  245. return m.Type
  246. }
  247. return DomainMatchingType_Full
  248. }
  249. func (m *Config_HostMapping) GetDomain() string {
  250. if m != nil {
  251. return m.Domain
  252. }
  253. return ""
  254. }
  255. func (m *Config_HostMapping) GetIp() [][]byte {
  256. if m != nil {
  257. return m.Ip
  258. }
  259. return nil
  260. }
  261. func (m *Config_HostMapping) GetProxiedDomain() string {
  262. if m != nil {
  263. return m.ProxiedDomain
  264. }
  265. return ""
  266. }
  267. func init() {
  268. proto.RegisterEnum("v2ray.core.app.dns.DomainMatchingType", DomainMatchingType_name, DomainMatchingType_value)
  269. proto.RegisterType((*NameServer)(nil), "v2ray.core.app.dns.NameServer")
  270. proto.RegisterType((*NameServer_PriorityDomain)(nil), "v2ray.core.app.dns.NameServer.PriorityDomain")
  271. proto.RegisterType((*Config)(nil), "v2ray.core.app.dns.Config")
  272. proto.RegisterMapType((map[string]*net.IPOrDomain)(nil), "v2ray.core.app.dns.Config.HostsEntry")
  273. proto.RegisterType((*Config_HostMapping)(nil), "v2ray.core.app.dns.Config.HostMapping")
  274. }
  275. func init() {
  276. proto.RegisterFile("v2ray.com/core/app/dns/config.proto", fileDescriptor_ed5695198e3def8f)
  277. }
  278. var fileDescriptor_ed5695198e3def8f = []byte{
  279. // 583 bytes of a gzipped FileDescriptorProto
  280. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x54, 0xdf, 0x6e, 0xd3, 0x3e,
  281. 0x18, 0xfd, 0x25, 0xfd, 0xb3, 0xf5, 0xcb, 0x56, 0xf5, 0xe7, 0x8b, 0x29, 0x2a, 0x08, 0xc6, 0xd0,
  282. 0x46, 0x05, 0xc2, 0x91, 0x02, 0x12, 0xb0, 0x9b, 0x89, 0x6d, 0x05, 0x2a, 0x34, 0xa8, 0x3c, 0xc4,
  283. 0x05, 0x20, 0x55, 0x5e, 0x62, 0x32, 0x8b, 0xc6, 0xb6, 0x1c, 0x77, 0x2c, 0x3c, 0x09, 0xcf, 0xc0,
  284. 0x4b, 0x70, 0xc1, 0x8b, 0xa1, 0xda, 0x19, 0xed, 0xb6, 0x0e, 0xb8, 0xe1, 0xce, 0x7f, 0xce, 0xf9,
  285. 0xce, 0xf9, 0x8e, 0xbf, 0x04, 0x6e, 0x9f, 0xc4, 0x9a, 0x96, 0x38, 0x91, 0x79, 0x94, 0x48, 0xcd,
  286. 0x22, 0xaa, 0x54, 0x94, 0x8a, 0x22, 0x4a, 0xa4, 0xf8, 0xc8, 0x33, 0xac, 0xb4, 0x34, 0x12, 0xa1,
  287. 0x33, 0x90, 0x66, 0x98, 0x2a, 0x85, 0x53, 0x51, 0x74, 0xef, 0x5c, 0x20, 0x26, 0x32, 0xcf, 0xa5,
  288. 0x88, 0x04, 0x33, 0x11, 0x4d, 0x53, 0xcd, 0x8a, 0xc2, 0x91, 0xbb, 0xf7, 0xae, 0x06, 0xa6, 0xac,
  289. 0x30, 0x5c, 0x50, 0xc3, 0xa5, 0xa8, 0xc0, 0x5b, 0x0b, 0xec, 0x68, 0x39, 0x31, 0x4c, 0x9f, 0x73,
  290. 0xb4, 0xf1, 0xdd, 0x07, 0x78, 0x45, 0x73, 0x76, 0xc8, 0xf4, 0x09, 0xd3, 0xe8, 0x09, 0x2c, 0x55,
  291. 0xa2, 0xa1, 0xb7, 0xee, 0xf5, 0x82, 0xf8, 0x26, 0x9e, 0xb3, 0xec, 0x14, 0xb1, 0x60, 0x06, 0xf7,
  292. 0x45, 0xaa, 0x24, 0x17, 0x86, 0x9c, 0xe1, 0xd1, 0x07, 0x40, 0x4a, 0x73, 0xa9, 0xb9, 0xe1, 0x5f,
  293. 0x58, 0x3a, 0x4a, 0x65, 0x4e, 0xb9, 0x08, 0xfd, 0xf5, 0x5a, 0x2f, 0x88, 0xef, 0xe3, 0xcb, 0x8d,
  294. 0xe3, 0x99, 0x2c, 0x1e, 0x3a, 0x62, 0xb9, 0x6f, 0x49, 0xe4, 0xff, 0xb9, 0x42, 0xee, 0x08, 0xc5,
  295. 0xd0, 0xc8, 0x98, 0xe4, 0x2a, 0xac, 0xd9, 0x82, 0xd7, 0x2f, 0x16, 0x74, 0xbd, 0xe1, 0xe7, 0x4c,
  296. 0x0e, 0x86, 0xc4, 0x41, 0xbb, 0x29, 0xb4, 0xcf, 0x17, 0x46, 0xdb, 0x50, 0x37, 0xa5, 0x62, 0xb6,
  297. 0xb7, 0x76, 0xbc, 0xb5, 0xc8, 0x95, 0x43, 0x1e, 0x50, 0x93, 0x1c, 0x73, 0x91, 0xbd, 0x29, 0x15,
  298. 0x23, 0x96, 0x83, 0xd6, 0xa0, 0xf9, 0xab, 0x27, 0xaf, 0xd7, 0x22, 0xd5, 0x6e, 0xe3, 0x47, 0x1d,
  299. 0x9a, 0x7b, 0x36, 0x52, 0xd4, 0x87, 0x60, 0xd6, 0xd4, 0x34, 0xc1, 0xda, 0x5f, 0x24, 0xb8, 0xeb,
  300. 0x87, 0x1e, 0x99, 0xe7, 0xa1, 0x1d, 0x08, 0x04, 0xcd, 0xd9, 0xa8, 0xb0, 0xfb, 0xb0, 0x61, 0xcb,
  301. 0xdc, 0xf8, 0x7d, 0x84, 0x04, 0xc4, 0xec, 0x15, 0x77, 0xa0, 0xf1, 0x42, 0x16, 0xa6, 0xa8, 0xd2,
  302. 0xdf, 0x5c, 0x44, 0x75, 0x96, 0xb1, 0xc5, 0xf5, 0x85, 0xd1, 0xa5, 0xf5, 0xe1, 0x78, 0xe8, 0x1a,
  303. 0xb4, 0x92, 0x31, 0x67, 0xc2, 0x8c, 0x6c, 0xe2, 0x5e, 0x6f, 0x85, 0x2c, 0xbb, 0x83, 0x81, 0x42,
  304. 0x03, 0x58, 0x29, 0x0c, 0x35, 0x3c, 0x19, 0x1d, 0x5b, 0x91, 0xba, 0x15, 0xd9, 0xfa, 0x83, 0xc8,
  305. 0x01, 0x55, 0x8a, 0x8b, 0x8c, 0x04, 0x8e, 0xeb, 0x74, 0x3a, 0x50, 0x33, 0x34, 0x0b, 0x9b, 0x36,
  306. 0xd0, 0xe9, 0xb2, 0xfb, 0x1e, 0x60, 0x66, 0x69, 0x7a, 0xff, 0x89, 0x95, 0xf6, 0xb9, 0x5a, 0x64,
  307. 0xba, 0x44, 0x8f, 0xa0, 0x71, 0x42, 0xc7, 0x13, 0x66, 0x1f, 0x21, 0x88, 0x6f, 0x5d, 0x11, 0xee,
  308. 0x60, 0xf8, 0x5a, 0x57, 0xc3, 0xe4, 0xf0, 0xdb, 0xfe, 0x63, 0xaf, 0xfb, 0xd5, 0x83, 0x60, 0xce,
  309. 0xcb, 0xbf, 0x18, 0x07, 0xd4, 0x06, 0xbf, 0x9a, 0xd2, 0x15, 0xe2, 0x73, 0x85, 0x36, 0xa1, 0xad,
  310. 0xb4, 0x3c, 0xe5, 0xb3, 0x4f, 0xa2, 0x6e, 0xf1, 0xab, 0xd5, 0xa9, 0x13, 0xb8, 0xdb, 0x07, 0x74,
  311. 0x59, 0x0a, 0x2d, 0x43, 0xfd, 0xd9, 0x64, 0x3c, 0xee, 0xfc, 0x87, 0x56, 0xa1, 0x75, 0x38, 0x39,
  312. 0x72, 0x15, 0x3a, 0x1e, 0x0a, 0x60, 0xe9, 0x25, 0x2b, 0x3f, 0x4b, 0x9d, 0x76, 0x7c, 0xd4, 0x82,
  313. 0x06, 0x61, 0x19, 0x3b, 0xed, 0xd4, 0x76, 0x1f, 0xc2, 0x5a, 0x22, 0xf3, 0x05, 0x8d, 0x0c, 0xbd,
  314. 0x77, 0xb5, 0x54, 0x14, 0xdf, 0x7c, 0xf4, 0x36, 0x26, 0xb4, 0xc4, 0x7b, 0xd3, 0xbb, 0xa7, 0x4a,
  315. 0xe1, 0x7d, 0x51, 0x1c, 0x35, 0xed, 0xbf, 0xe0, 0xc1, 0xcf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x4c,
  316. 0x2a, 0x66, 0x8a, 0xc4, 0x04, 0x00, 0x00,
  317. }