config.pb.go 14 KB

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