config.pb.go 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775
  1. package router
  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.ProtoPackageIsVersion2 // please upgrade the proto package
  17. // Type of domain value.
  18. type Domain_Type int32
  19. const (
  20. // The value is used as is.
  21. Domain_Plain Domain_Type = 0
  22. // The value is used as a regular expression.
  23. Domain_Regex Domain_Type = 1
  24. // The value is a root domain.
  25. Domain_Domain Domain_Type = 2
  26. // The value is a domain.
  27. Domain_Full Domain_Type = 3
  28. )
  29. var Domain_Type_name = map[int32]string{
  30. 0: "Plain",
  31. 1: "Regex",
  32. 2: "Domain",
  33. 3: "Full",
  34. }
  35. var Domain_Type_value = map[string]int32{
  36. "Plain": 0,
  37. "Regex": 1,
  38. "Domain": 2,
  39. "Full": 3,
  40. }
  41. func (x Domain_Type) String() string {
  42. return proto.EnumName(Domain_Type_name, int32(x))
  43. }
  44. func (Domain_Type) EnumDescriptor() ([]byte, []int) {
  45. return fileDescriptor_6b1608360690c5fc, []int{0, 0}
  46. }
  47. type Config_DomainStrategy int32
  48. const (
  49. // Use domain as is.
  50. Config_AsIs Config_DomainStrategy = 0
  51. // Always resolve IP for domains.
  52. Config_UseIp Config_DomainStrategy = 1
  53. // Resolve to IP if the domain doesn't match any rules.
  54. Config_IpIfNonMatch Config_DomainStrategy = 2
  55. // Resolve to IP if any rule requires IP matching.
  56. Config_IpOnDemand Config_DomainStrategy = 3
  57. )
  58. var Config_DomainStrategy_name = map[int32]string{
  59. 0: "AsIs",
  60. 1: "UseIp",
  61. 2: "IpIfNonMatch",
  62. 3: "IpOnDemand",
  63. }
  64. var Config_DomainStrategy_value = map[string]int32{
  65. "AsIs": 0,
  66. "UseIp": 1,
  67. "IpIfNonMatch": 2,
  68. "IpOnDemand": 3,
  69. }
  70. func (x Config_DomainStrategy) String() string {
  71. return proto.EnumName(Config_DomainStrategy_name, int32(x))
  72. }
  73. func (Config_DomainStrategy) EnumDescriptor() ([]byte, []int) {
  74. return fileDescriptor_6b1608360690c5fc, []int{8, 0}
  75. }
  76. // Domain for routing decision.
  77. type Domain struct {
  78. // Domain matching type.
  79. Type Domain_Type `protobuf:"varint,1,opt,name=type,proto3,enum=v2ray.core.app.router.Domain_Type" json:"type,omitempty"`
  80. // Domain value.
  81. Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
  82. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  83. XXX_unrecognized []byte `json:"-"`
  84. XXX_sizecache int32 `json:"-"`
  85. }
  86. func (m *Domain) Reset() { *m = Domain{} }
  87. func (m *Domain) String() string { return proto.CompactTextString(m) }
  88. func (*Domain) ProtoMessage() {}
  89. func (*Domain) Descriptor() ([]byte, []int) {
  90. return fileDescriptor_6b1608360690c5fc, []int{0}
  91. }
  92. func (m *Domain) XXX_Unmarshal(b []byte) error {
  93. return xxx_messageInfo_Domain.Unmarshal(m, b)
  94. }
  95. func (m *Domain) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  96. return xxx_messageInfo_Domain.Marshal(b, m, deterministic)
  97. }
  98. func (m *Domain) XXX_Merge(src proto.Message) {
  99. xxx_messageInfo_Domain.Merge(m, src)
  100. }
  101. func (m *Domain) XXX_Size() int {
  102. return xxx_messageInfo_Domain.Size(m)
  103. }
  104. func (m *Domain) XXX_DiscardUnknown() {
  105. xxx_messageInfo_Domain.DiscardUnknown(m)
  106. }
  107. var xxx_messageInfo_Domain proto.InternalMessageInfo
  108. func (m *Domain) GetType() Domain_Type {
  109. if m != nil {
  110. return m.Type
  111. }
  112. return Domain_Plain
  113. }
  114. func (m *Domain) GetValue() string {
  115. if m != nil {
  116. return m.Value
  117. }
  118. return ""
  119. }
  120. // IP for routing decision, in CIDR form.
  121. type CIDR struct {
  122. // IP address, should be either 4 or 16 bytes.
  123. Ip []byte `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"`
  124. // Number of leading ones in the network mask.
  125. Prefix uint32 `protobuf:"varint,2,opt,name=prefix,proto3" json:"prefix,omitempty"`
  126. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  127. XXX_unrecognized []byte `json:"-"`
  128. XXX_sizecache int32 `json:"-"`
  129. }
  130. func (m *CIDR) Reset() { *m = CIDR{} }
  131. func (m *CIDR) String() string { return proto.CompactTextString(m) }
  132. func (*CIDR) ProtoMessage() {}
  133. func (*CIDR) Descriptor() ([]byte, []int) {
  134. return fileDescriptor_6b1608360690c5fc, []int{1}
  135. }
  136. func (m *CIDR) XXX_Unmarshal(b []byte) error {
  137. return xxx_messageInfo_CIDR.Unmarshal(m, b)
  138. }
  139. func (m *CIDR) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  140. return xxx_messageInfo_CIDR.Marshal(b, m, deterministic)
  141. }
  142. func (m *CIDR) XXX_Merge(src proto.Message) {
  143. xxx_messageInfo_CIDR.Merge(m, src)
  144. }
  145. func (m *CIDR) XXX_Size() int {
  146. return xxx_messageInfo_CIDR.Size(m)
  147. }
  148. func (m *CIDR) XXX_DiscardUnknown() {
  149. xxx_messageInfo_CIDR.DiscardUnknown(m)
  150. }
  151. var xxx_messageInfo_CIDR proto.InternalMessageInfo
  152. func (m *CIDR) GetIp() []byte {
  153. if m != nil {
  154. return m.Ip
  155. }
  156. return nil
  157. }
  158. func (m *CIDR) GetPrefix() uint32 {
  159. if m != nil {
  160. return m.Prefix
  161. }
  162. return 0
  163. }
  164. type GeoIP struct {
  165. CountryCode string `protobuf:"bytes,1,opt,name=country_code,json=countryCode,proto3" json:"country_code,omitempty"`
  166. Cidr []*CIDR `protobuf:"bytes,2,rep,name=cidr,proto3" json:"cidr,omitempty"`
  167. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  168. XXX_unrecognized []byte `json:"-"`
  169. XXX_sizecache int32 `json:"-"`
  170. }
  171. func (m *GeoIP) Reset() { *m = GeoIP{} }
  172. func (m *GeoIP) String() string { return proto.CompactTextString(m) }
  173. func (*GeoIP) ProtoMessage() {}
  174. func (*GeoIP) Descriptor() ([]byte, []int) {
  175. return fileDescriptor_6b1608360690c5fc, []int{2}
  176. }
  177. func (m *GeoIP) XXX_Unmarshal(b []byte) error {
  178. return xxx_messageInfo_GeoIP.Unmarshal(m, b)
  179. }
  180. func (m *GeoIP) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  181. return xxx_messageInfo_GeoIP.Marshal(b, m, deterministic)
  182. }
  183. func (m *GeoIP) XXX_Merge(src proto.Message) {
  184. xxx_messageInfo_GeoIP.Merge(m, src)
  185. }
  186. func (m *GeoIP) XXX_Size() int {
  187. return xxx_messageInfo_GeoIP.Size(m)
  188. }
  189. func (m *GeoIP) XXX_DiscardUnknown() {
  190. xxx_messageInfo_GeoIP.DiscardUnknown(m)
  191. }
  192. var xxx_messageInfo_GeoIP proto.InternalMessageInfo
  193. func (m *GeoIP) GetCountryCode() string {
  194. if m != nil {
  195. return m.CountryCode
  196. }
  197. return ""
  198. }
  199. func (m *GeoIP) GetCidr() []*CIDR {
  200. if m != nil {
  201. return m.Cidr
  202. }
  203. return nil
  204. }
  205. type GeoIPList struct {
  206. Entry []*GeoIP `protobuf:"bytes,1,rep,name=entry,proto3" json:"entry,omitempty"`
  207. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  208. XXX_unrecognized []byte `json:"-"`
  209. XXX_sizecache int32 `json:"-"`
  210. }
  211. func (m *GeoIPList) Reset() { *m = GeoIPList{} }
  212. func (m *GeoIPList) String() string { return proto.CompactTextString(m) }
  213. func (*GeoIPList) ProtoMessage() {}
  214. func (*GeoIPList) Descriptor() ([]byte, []int) {
  215. return fileDescriptor_6b1608360690c5fc, []int{3}
  216. }
  217. func (m *GeoIPList) XXX_Unmarshal(b []byte) error {
  218. return xxx_messageInfo_GeoIPList.Unmarshal(m, b)
  219. }
  220. func (m *GeoIPList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  221. return xxx_messageInfo_GeoIPList.Marshal(b, m, deterministic)
  222. }
  223. func (m *GeoIPList) XXX_Merge(src proto.Message) {
  224. xxx_messageInfo_GeoIPList.Merge(m, src)
  225. }
  226. func (m *GeoIPList) XXX_Size() int {
  227. return xxx_messageInfo_GeoIPList.Size(m)
  228. }
  229. func (m *GeoIPList) XXX_DiscardUnknown() {
  230. xxx_messageInfo_GeoIPList.DiscardUnknown(m)
  231. }
  232. var xxx_messageInfo_GeoIPList proto.InternalMessageInfo
  233. func (m *GeoIPList) GetEntry() []*GeoIP {
  234. if m != nil {
  235. return m.Entry
  236. }
  237. return nil
  238. }
  239. type GeoSite struct {
  240. CountryCode string `protobuf:"bytes,1,opt,name=country_code,json=countryCode,proto3" json:"country_code,omitempty"`
  241. Domain []*Domain `protobuf:"bytes,2,rep,name=domain,proto3" json:"domain,omitempty"`
  242. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  243. XXX_unrecognized []byte `json:"-"`
  244. XXX_sizecache int32 `json:"-"`
  245. }
  246. func (m *GeoSite) Reset() { *m = GeoSite{} }
  247. func (m *GeoSite) String() string { return proto.CompactTextString(m) }
  248. func (*GeoSite) ProtoMessage() {}
  249. func (*GeoSite) Descriptor() ([]byte, []int) {
  250. return fileDescriptor_6b1608360690c5fc, []int{4}
  251. }
  252. func (m *GeoSite) XXX_Unmarshal(b []byte) error {
  253. return xxx_messageInfo_GeoSite.Unmarshal(m, b)
  254. }
  255. func (m *GeoSite) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  256. return xxx_messageInfo_GeoSite.Marshal(b, m, deterministic)
  257. }
  258. func (m *GeoSite) XXX_Merge(src proto.Message) {
  259. xxx_messageInfo_GeoSite.Merge(m, src)
  260. }
  261. func (m *GeoSite) XXX_Size() int {
  262. return xxx_messageInfo_GeoSite.Size(m)
  263. }
  264. func (m *GeoSite) XXX_DiscardUnknown() {
  265. xxx_messageInfo_GeoSite.DiscardUnknown(m)
  266. }
  267. var xxx_messageInfo_GeoSite proto.InternalMessageInfo
  268. func (m *GeoSite) GetCountryCode() string {
  269. if m != nil {
  270. return m.CountryCode
  271. }
  272. return ""
  273. }
  274. func (m *GeoSite) GetDomain() []*Domain {
  275. if m != nil {
  276. return m.Domain
  277. }
  278. return nil
  279. }
  280. type GeoSiteList struct {
  281. Entry []*GeoSite `protobuf:"bytes,1,rep,name=entry,proto3" json:"entry,omitempty"`
  282. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  283. XXX_unrecognized []byte `json:"-"`
  284. XXX_sizecache int32 `json:"-"`
  285. }
  286. func (m *GeoSiteList) Reset() { *m = GeoSiteList{} }
  287. func (m *GeoSiteList) String() string { return proto.CompactTextString(m) }
  288. func (*GeoSiteList) ProtoMessage() {}
  289. func (*GeoSiteList) Descriptor() ([]byte, []int) {
  290. return fileDescriptor_6b1608360690c5fc, []int{5}
  291. }
  292. func (m *GeoSiteList) XXX_Unmarshal(b []byte) error {
  293. return xxx_messageInfo_GeoSiteList.Unmarshal(m, b)
  294. }
  295. func (m *GeoSiteList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  296. return xxx_messageInfo_GeoSiteList.Marshal(b, m, deterministic)
  297. }
  298. func (m *GeoSiteList) XXX_Merge(src proto.Message) {
  299. xxx_messageInfo_GeoSiteList.Merge(m, src)
  300. }
  301. func (m *GeoSiteList) XXX_Size() int {
  302. return xxx_messageInfo_GeoSiteList.Size(m)
  303. }
  304. func (m *GeoSiteList) XXX_DiscardUnknown() {
  305. xxx_messageInfo_GeoSiteList.DiscardUnknown(m)
  306. }
  307. var xxx_messageInfo_GeoSiteList proto.InternalMessageInfo
  308. func (m *GeoSiteList) GetEntry() []*GeoSite {
  309. if m != nil {
  310. return m.Entry
  311. }
  312. return nil
  313. }
  314. type RoutingRule struct {
  315. // Types that are valid to be assigned to TargetTag:
  316. // *RoutingRule_Tag
  317. // *RoutingRule_BalancingTag
  318. TargetTag isRoutingRule_TargetTag `protobuf_oneof:"target_tag"`
  319. // List of domains for target domain matching.
  320. Domain []*Domain `protobuf:"bytes,2,rep,name=domain,proto3" json:"domain,omitempty"`
  321. // List of CIDRs for target IP address matching.
  322. // The list must be sorted beforehand.
  323. Cidr []*CIDR `protobuf:"bytes,3,rep,name=cidr,proto3" json:"cidr,omitempty"` // Deprecated: Do not use.
  324. // List of GeoIPs for target IP address matching. If this entry exists, the cidr above will have no effect.
  325. // GeoIP fields with the same country code are supposed to contain exactly same content. They will be merged during runtime.
  326. // For customized GeoIPs, please leave country code empty.
  327. Geoip []*GeoIP `protobuf:"bytes,10,rep,name=geoip,proto3" json:"geoip,omitempty"`
  328. PortRange *net.PortRange `protobuf:"bytes,4,opt,name=port_range,json=portRange,proto3" json:"port_range,omitempty"`
  329. // List of networks. Deprecated. Use networks.
  330. NetworkList *net.NetworkList `protobuf:"bytes,5,opt,name=network_list,json=networkList,proto3" json:"network_list,omitempty"` // Deprecated: Do not use.
  331. // List of networks for matching.
  332. Networks []net.Network `protobuf:"varint,13,rep,packed,name=networks,proto3,enum=v2ray.core.common.net.Network" json:"networks,omitempty"`
  333. // List of CIDRs for source IP address matching.
  334. SourceCidr []*CIDR `protobuf:"bytes,6,rep,name=source_cidr,json=sourceCidr,proto3" json:"source_cidr,omitempty"` // Deprecated: Do not use.
  335. // List of GeoIPs for source IP address matching. If this entry exists, the source_cidr above will have no effect.
  336. SourceGeoip []*GeoIP `protobuf:"bytes,11,rep,name=source_geoip,json=sourceGeoip,proto3" json:"source_geoip,omitempty"`
  337. UserEmail []string `protobuf:"bytes,7,rep,name=user_email,json=userEmail,proto3" json:"user_email,omitempty"`
  338. InboundTag []string `protobuf:"bytes,8,rep,name=inbound_tag,json=inboundTag,proto3" json:"inbound_tag,omitempty"`
  339. Protocol []string `protobuf:"bytes,9,rep,name=protocol,proto3" json:"protocol,omitempty"`
  340. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  341. XXX_unrecognized []byte `json:"-"`
  342. XXX_sizecache int32 `json:"-"`
  343. }
  344. func (m *RoutingRule) Reset() { *m = RoutingRule{} }
  345. func (m *RoutingRule) String() string { return proto.CompactTextString(m) }
  346. func (*RoutingRule) ProtoMessage() {}
  347. func (*RoutingRule) Descriptor() ([]byte, []int) {
  348. return fileDescriptor_6b1608360690c5fc, []int{6}
  349. }
  350. func (m *RoutingRule) XXX_Unmarshal(b []byte) error {
  351. return xxx_messageInfo_RoutingRule.Unmarshal(m, b)
  352. }
  353. func (m *RoutingRule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  354. return xxx_messageInfo_RoutingRule.Marshal(b, m, deterministic)
  355. }
  356. func (m *RoutingRule) XXX_Merge(src proto.Message) {
  357. xxx_messageInfo_RoutingRule.Merge(m, src)
  358. }
  359. func (m *RoutingRule) XXX_Size() int {
  360. return xxx_messageInfo_RoutingRule.Size(m)
  361. }
  362. func (m *RoutingRule) XXX_DiscardUnknown() {
  363. xxx_messageInfo_RoutingRule.DiscardUnknown(m)
  364. }
  365. var xxx_messageInfo_RoutingRule proto.InternalMessageInfo
  366. type isRoutingRule_TargetTag interface {
  367. isRoutingRule_TargetTag()
  368. }
  369. type RoutingRule_Tag struct {
  370. Tag string `protobuf:"bytes,1,opt,name=tag,proto3,oneof"`
  371. }
  372. type RoutingRule_BalancingTag struct {
  373. BalancingTag string `protobuf:"bytes,12,opt,name=balancing_tag,json=balancingTag,proto3,oneof"`
  374. }
  375. func (*RoutingRule_Tag) isRoutingRule_TargetTag() {}
  376. func (*RoutingRule_BalancingTag) isRoutingRule_TargetTag() {}
  377. func (m *RoutingRule) GetTargetTag() isRoutingRule_TargetTag {
  378. if m != nil {
  379. return m.TargetTag
  380. }
  381. return nil
  382. }
  383. func (m *RoutingRule) GetTag() string {
  384. if x, ok := m.GetTargetTag().(*RoutingRule_Tag); ok {
  385. return x.Tag
  386. }
  387. return ""
  388. }
  389. func (m *RoutingRule) GetBalancingTag() string {
  390. if x, ok := m.GetTargetTag().(*RoutingRule_BalancingTag); ok {
  391. return x.BalancingTag
  392. }
  393. return ""
  394. }
  395. func (m *RoutingRule) GetDomain() []*Domain {
  396. if m != nil {
  397. return m.Domain
  398. }
  399. return nil
  400. }
  401. // Deprecated: Do not use.
  402. func (m *RoutingRule) GetCidr() []*CIDR {
  403. if m != nil {
  404. return m.Cidr
  405. }
  406. return nil
  407. }
  408. func (m *RoutingRule) GetGeoip() []*GeoIP {
  409. if m != nil {
  410. return m.Geoip
  411. }
  412. return nil
  413. }
  414. func (m *RoutingRule) GetPortRange() *net.PortRange {
  415. if m != nil {
  416. return m.PortRange
  417. }
  418. return nil
  419. }
  420. // Deprecated: Do not use.
  421. func (m *RoutingRule) GetNetworkList() *net.NetworkList {
  422. if m != nil {
  423. return m.NetworkList
  424. }
  425. return nil
  426. }
  427. func (m *RoutingRule) GetNetworks() []net.Network {
  428. if m != nil {
  429. return m.Networks
  430. }
  431. return nil
  432. }
  433. // Deprecated: Do not use.
  434. func (m *RoutingRule) GetSourceCidr() []*CIDR {
  435. if m != nil {
  436. return m.SourceCidr
  437. }
  438. return nil
  439. }
  440. func (m *RoutingRule) GetSourceGeoip() []*GeoIP {
  441. if m != nil {
  442. return m.SourceGeoip
  443. }
  444. return nil
  445. }
  446. func (m *RoutingRule) GetUserEmail() []string {
  447. if m != nil {
  448. return m.UserEmail
  449. }
  450. return nil
  451. }
  452. func (m *RoutingRule) GetInboundTag() []string {
  453. if m != nil {
  454. return m.InboundTag
  455. }
  456. return nil
  457. }
  458. func (m *RoutingRule) GetProtocol() []string {
  459. if m != nil {
  460. return m.Protocol
  461. }
  462. return nil
  463. }
  464. // XXX_OneofFuncs is for the internal use of the proto package.
  465. func (*RoutingRule) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
  466. return _RoutingRule_OneofMarshaler, _RoutingRule_OneofUnmarshaler, _RoutingRule_OneofSizer, []interface{}{
  467. (*RoutingRule_Tag)(nil),
  468. (*RoutingRule_BalancingTag)(nil),
  469. }
  470. }
  471. func _RoutingRule_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
  472. m := msg.(*RoutingRule)
  473. // target_tag
  474. switch x := m.TargetTag.(type) {
  475. case *RoutingRule_Tag:
  476. b.EncodeVarint(1<<3 | proto.WireBytes)
  477. b.EncodeStringBytes(x.Tag)
  478. case *RoutingRule_BalancingTag:
  479. b.EncodeVarint(12<<3 | proto.WireBytes)
  480. b.EncodeStringBytes(x.BalancingTag)
  481. case nil:
  482. default:
  483. return fmt.Errorf("RoutingRule.TargetTag has unexpected type %T", x)
  484. }
  485. return nil
  486. }
  487. func _RoutingRule_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
  488. m := msg.(*RoutingRule)
  489. switch tag {
  490. case 1: // target_tag.tag
  491. if wire != proto.WireBytes {
  492. return true, proto.ErrInternalBadWireType
  493. }
  494. x, err := b.DecodeStringBytes()
  495. m.TargetTag = &RoutingRule_Tag{x}
  496. return true, err
  497. case 12: // target_tag.balancing_tag
  498. if wire != proto.WireBytes {
  499. return true, proto.ErrInternalBadWireType
  500. }
  501. x, err := b.DecodeStringBytes()
  502. m.TargetTag = &RoutingRule_BalancingTag{x}
  503. return true, err
  504. default:
  505. return false, nil
  506. }
  507. }
  508. func _RoutingRule_OneofSizer(msg proto.Message) (n int) {
  509. m := msg.(*RoutingRule)
  510. // target_tag
  511. switch x := m.TargetTag.(type) {
  512. case *RoutingRule_Tag:
  513. n += 1 // tag and wire
  514. n += proto.SizeVarint(uint64(len(x.Tag)))
  515. n += len(x.Tag)
  516. case *RoutingRule_BalancingTag:
  517. n += 1 // tag and wire
  518. n += proto.SizeVarint(uint64(len(x.BalancingTag)))
  519. n += len(x.BalancingTag)
  520. case nil:
  521. default:
  522. panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
  523. }
  524. return n
  525. }
  526. type BalancingRule struct {
  527. Tag string `protobuf:"bytes,1,opt,name=tag,proto3" json:"tag,omitempty"`
  528. OutboundSelector []string `protobuf:"bytes,2,rep,name=outbound_selector,json=outboundSelector,proto3" json:"outbound_selector,omitempty"`
  529. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  530. XXX_unrecognized []byte `json:"-"`
  531. XXX_sizecache int32 `json:"-"`
  532. }
  533. func (m *BalancingRule) Reset() { *m = BalancingRule{} }
  534. func (m *BalancingRule) String() string { return proto.CompactTextString(m) }
  535. func (*BalancingRule) ProtoMessage() {}
  536. func (*BalancingRule) Descriptor() ([]byte, []int) {
  537. return fileDescriptor_6b1608360690c5fc, []int{7}
  538. }
  539. func (m *BalancingRule) XXX_Unmarshal(b []byte) error {
  540. return xxx_messageInfo_BalancingRule.Unmarshal(m, b)
  541. }
  542. func (m *BalancingRule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  543. return xxx_messageInfo_BalancingRule.Marshal(b, m, deterministic)
  544. }
  545. func (m *BalancingRule) XXX_Merge(src proto.Message) {
  546. xxx_messageInfo_BalancingRule.Merge(m, src)
  547. }
  548. func (m *BalancingRule) XXX_Size() int {
  549. return xxx_messageInfo_BalancingRule.Size(m)
  550. }
  551. func (m *BalancingRule) XXX_DiscardUnknown() {
  552. xxx_messageInfo_BalancingRule.DiscardUnknown(m)
  553. }
  554. var xxx_messageInfo_BalancingRule proto.InternalMessageInfo
  555. func (m *BalancingRule) GetTag() string {
  556. if m != nil {
  557. return m.Tag
  558. }
  559. return ""
  560. }
  561. func (m *BalancingRule) GetOutboundSelector() []string {
  562. if m != nil {
  563. return m.OutboundSelector
  564. }
  565. return nil
  566. }
  567. type Config struct {
  568. DomainStrategy Config_DomainStrategy `protobuf:"varint,1,opt,name=domain_strategy,json=domainStrategy,proto3,enum=v2ray.core.app.router.Config_DomainStrategy" json:"domain_strategy,omitempty"`
  569. Rule []*RoutingRule `protobuf:"bytes,2,rep,name=rule,proto3" json:"rule,omitempty"`
  570. BalancingRule []*BalancingRule `protobuf:"bytes,3,rep,name=balancing_rule,json=balancingRule,proto3" json:"balancing_rule,omitempty"`
  571. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  572. XXX_unrecognized []byte `json:"-"`
  573. XXX_sizecache int32 `json:"-"`
  574. }
  575. func (m *Config) Reset() { *m = Config{} }
  576. func (m *Config) String() string { return proto.CompactTextString(m) }
  577. func (*Config) ProtoMessage() {}
  578. func (*Config) Descriptor() ([]byte, []int) {
  579. return fileDescriptor_6b1608360690c5fc, []int{8}
  580. }
  581. func (m *Config) XXX_Unmarshal(b []byte) error {
  582. return xxx_messageInfo_Config.Unmarshal(m, b)
  583. }
  584. func (m *Config) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  585. return xxx_messageInfo_Config.Marshal(b, m, deterministic)
  586. }
  587. func (m *Config) XXX_Merge(src proto.Message) {
  588. xxx_messageInfo_Config.Merge(m, src)
  589. }
  590. func (m *Config) XXX_Size() int {
  591. return xxx_messageInfo_Config.Size(m)
  592. }
  593. func (m *Config) XXX_DiscardUnknown() {
  594. xxx_messageInfo_Config.DiscardUnknown(m)
  595. }
  596. var xxx_messageInfo_Config proto.InternalMessageInfo
  597. func (m *Config) GetDomainStrategy() Config_DomainStrategy {
  598. if m != nil {
  599. return m.DomainStrategy
  600. }
  601. return Config_AsIs
  602. }
  603. func (m *Config) GetRule() []*RoutingRule {
  604. if m != nil {
  605. return m.Rule
  606. }
  607. return nil
  608. }
  609. func (m *Config) GetBalancingRule() []*BalancingRule {
  610. if m != nil {
  611. return m.BalancingRule
  612. }
  613. return nil
  614. }
  615. func init() {
  616. proto.RegisterEnum("v2ray.core.app.router.Domain_Type", Domain_Type_name, Domain_Type_value)
  617. proto.RegisterEnum("v2ray.core.app.router.Config_DomainStrategy", Config_DomainStrategy_name, Config_DomainStrategy_value)
  618. proto.RegisterType((*Domain)(nil), "v2ray.core.app.router.Domain")
  619. proto.RegisterType((*CIDR)(nil), "v2ray.core.app.router.CIDR")
  620. proto.RegisterType((*GeoIP)(nil), "v2ray.core.app.router.GeoIP")
  621. proto.RegisterType((*GeoIPList)(nil), "v2ray.core.app.router.GeoIPList")
  622. proto.RegisterType((*GeoSite)(nil), "v2ray.core.app.router.GeoSite")
  623. proto.RegisterType((*GeoSiteList)(nil), "v2ray.core.app.router.GeoSiteList")
  624. proto.RegisterType((*RoutingRule)(nil), "v2ray.core.app.router.RoutingRule")
  625. proto.RegisterType((*BalancingRule)(nil), "v2ray.core.app.router.BalancingRule")
  626. proto.RegisterType((*Config)(nil), "v2ray.core.app.router.Config")
  627. }
  628. func init() {
  629. proto.RegisterFile("v2ray.com/core/app/router/config.proto", fileDescriptor_6b1608360690c5fc)
  630. }
  631. var fileDescriptor_6b1608360690c5fc = []byte{
  632. // 799 bytes of a gzipped FileDescriptorProto
  633. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0x6d, 0x6f, 0xe3, 0x44,
  634. 0x10, 0x3e, 0x3b, 0x2f, 0x57, 0x8f, 0xdd, 0x60, 0x56, 0x1c, 0x32, 0x85, 0x83, 0x60, 0x1d, 0x10,
  635. 0x09, 0xe4, 0x48, 0x39, 0xe0, 0x03, 0x12, 0x2a, 0xd7, 0x14, 0x82, 0x05, 0x94, 0x68, 0x7b, 0xc7,
  636. 0x07, 0xf8, 0x10, 0x6d, 0x9d, 0xad, 0xb1, 0x70, 0x76, 0x57, 0xeb, 0xf5, 0x71, 0xf9, 0x0b, 0xfc,
  637. 0x07, 0xfe, 0x00, 0x12, 0xff, 0x11, 0xed, 0x4b, 0xda, 0x06, 0xce, 0x10, 0xf1, 0x6d, 0x67, 0xe6,
  638. 0x99, 0x99, 0x67, 0xe7, 0x0d, 0xde, 0x7f, 0x3e, 0x93, 0x64, 0x9b, 0x15, 0x7c, 0x33, 0x2d, 0xb8,
  639. 0xa4, 0x53, 0x22, 0xc4, 0x54, 0xf2, 0x56, 0x51, 0x39, 0x2d, 0x38, 0xbb, 0xae, 0xca, 0x4c, 0x48,
  640. 0xae, 0x38, 0x7a, 0xb0, 0xc3, 0x49, 0x9a, 0x11, 0x21, 0x32, 0x8b, 0x39, 0x79, 0xf4, 0x37, 0xf7,
  641. 0x82, 0x6f, 0x36, 0x9c, 0x4d, 0x19, 0x55, 0x53, 0xc1, 0xa5, 0xb2, 0xce, 0x27, 0x1f, 0x74, 0xa3,
  642. 0x18, 0x55, 0xbf, 0x72, 0xf9, 0x8b, 0x05, 0xa6, 0xbf, 0x79, 0x30, 0x3c, 0xe7, 0x1b, 0x52, 0x31,
  643. 0xf4, 0x29, 0xf4, 0xd5, 0x56, 0xd0, 0xc4, 0x1b, 0x7b, 0x93, 0xd1, 0x2c, 0xcd, 0x5e, 0x9a, 0x3f,
  644. 0xb3, 0xe0, 0xec, 0xe9, 0x56, 0x50, 0x6c, 0xf0, 0xe8, 0x35, 0x18, 0x3c, 0x27, 0x75, 0x4b, 0x13,
  645. 0x7f, 0xec, 0x4d, 0x02, 0x6c, 0x85, 0x74, 0x06, 0x7d, 0x8d, 0x41, 0x01, 0x0c, 0x96, 0x35, 0xa9,
  646. 0x58, 0x7c, 0x4f, 0x3f, 0x31, 0x2d, 0xe9, 0x8b, 0xd8, 0x43, 0xb0, 0xcb, 0x1a, 0xfb, 0xe8, 0x08,
  647. 0xfa, 0x5f, 0xb5, 0x75, 0x1d, 0xf7, 0xd2, 0x0c, 0xfa, 0xf3, 0xfc, 0x1c, 0xa3, 0x11, 0xf8, 0x95,
  648. 0x30, 0x3c, 0x22, 0xec, 0x57, 0x02, 0xbd, 0x0e, 0x43, 0x21, 0xe9, 0x75, 0xf5, 0xc2, 0xa4, 0x38,
  649. 0xc6, 0x4e, 0x4a, 0x7f, 0x82, 0xc1, 0x82, 0xf2, 0x7c, 0x89, 0xde, 0x85, 0xa8, 0xe0, 0x2d, 0x53,
  650. 0x72, 0xbb, 0x2a, 0xf8, 0xda, 0x7e, 0x21, 0xc0, 0xa1, 0xd3, 0xcd, 0xf9, 0x9a, 0xa2, 0x29, 0xf4,
  651. 0x8b, 0x6a, 0x2d, 0x13, 0x7f, 0xdc, 0x9b, 0x84, 0xb3, 0x37, 0x3b, 0x7e, 0xa7, 0xd3, 0x63, 0x03,
  652. 0x4c, 0x4f, 0x21, 0x30, 0xc1, 0xbf, 0xad, 0x1a, 0x85, 0x66, 0x30, 0xa0, 0x3a, 0x54, 0xe2, 0x19,
  653. 0xf7, 0xb7, 0x3a, 0xdc, 0x8d, 0x03, 0xb6, 0xd0, 0xb4, 0x80, 0xfb, 0x0b, 0xca, 0x2f, 0x2b, 0x45,
  654. 0x0f, 0xe1, 0xf7, 0x09, 0x0c, 0xd7, 0xa6, 0x22, 0x8e, 0xe1, 0xc3, 0x7f, 0xad, 0x3f, 0x76, 0xe0,
  655. 0x74, 0x0e, 0xa1, 0x4b, 0x62, 0x78, 0x7e, 0xbc, 0xcf, 0xf3, 0xed, 0x6e, 0x9e, 0xda, 0x65, 0xc7,
  656. 0xf4, 0xf7, 0x01, 0x84, 0x98, 0xb7, 0xaa, 0x62, 0x25, 0x6e, 0x6b, 0x8a, 0x10, 0xf4, 0x14, 0x29,
  657. 0x2d, 0xcb, 0xaf, 0xef, 0x61, 0x2d, 0xa0, 0xf7, 0xe0, 0xf8, 0x8a, 0xd4, 0x84, 0x15, 0x15, 0x2b,
  658. 0x57, 0xda, 0x1a, 0x39, 0x6b, 0x74, 0xa3, 0x7e, 0x4a, 0xca, 0xff, 0xf9, 0x0d, 0xf4, 0xd8, 0x75,
  659. 0xa7, 0xf7, 0x9f, 0xdd, 0x39, 0xf3, 0x13, 0xcf, 0x76, 0x48, 0x37, 0xa5, 0xa4, 0xbc, 0x12, 0x09,
  660. 0x1c, 0xd2, 0x14, 0x03, 0x45, 0xa7, 0x00, 0x7a, 0x4d, 0x56, 0x92, 0xb0, 0x92, 0x26, 0xfd, 0xb1,
  661. 0x37, 0x09, 0x67, 0xe3, 0xbb, 0x8e, 0x76, 0x53, 0x32, 0x46, 0x55, 0xb6, 0xe4, 0x52, 0x61, 0x8d,
  662. 0xc3, 0x81, 0xd8, 0x3d, 0x51, 0x0e, 0x91, 0xdb, 0xa0, 0x55, 0x5d, 0x35, 0x2a, 0x19, 0x98, 0x10,
  663. 0x69, 0x47, 0x88, 0x0b, 0x0b, 0xd5, 0xbd, 0x31, 0xc4, 0x43, 0x76, 0xab, 0x40, 0x9f, 0xc1, 0x91,
  664. 0x13, 0x9b, 0xe4, 0x78, 0xdc, 0x9b, 0x8c, 0xf6, 0xfb, 0xf5, 0xcf, 0x30, 0xf8, 0x06, 0x8f, 0xbe,
  665. 0x80, 0xb0, 0xe1, 0xad, 0x2c, 0xe8, 0xca, 0xd4, 0x6d, 0x78, 0x58, 0xdd, 0xc0, 0xfa, 0xcc, 0x75,
  666. 0xf5, 0x4e, 0x21, 0x72, 0x11, 0x6c, 0x11, 0xc3, 0x03, 0x8a, 0xe8, 0x72, 0x2e, 0x4c, 0x29, 0x1f,
  667. 0x02, 0xb4, 0x0d, 0x95, 0x2b, 0xba, 0x21, 0x55, 0x9d, 0xdc, 0x1f, 0xf7, 0x26, 0x01, 0x0e, 0xb4,
  668. 0xe6, 0x4b, 0xad, 0x40, 0xef, 0x40, 0x58, 0xb1, 0x2b, 0xde, 0xb2, 0xb5, 0x19, 0x97, 0x23, 0x63,
  669. 0x07, 0xa7, 0xd2, 0xa3, 0x72, 0x02, 0x47, 0xe6, 0x06, 0x15, 0xbc, 0x4e, 0x02, 0x63, 0xbd, 0x91,
  670. 0xcf, 0x22, 0x00, 0x45, 0x64, 0x49, 0x95, 0xf6, 0x4d, 0x2f, 0xe0, 0xf8, 0x6c, 0x37, 0x64, 0x66,
  671. 0x40, 0xe3, 0x3b, 0x03, 0x6a, 0xc7, 0xf3, 0x43, 0x78, 0x95, 0xb7, 0xca, 0xa6, 0x6b, 0x68, 0x4d,
  672. 0x0b, 0xc5, 0xed, 0xae, 0x07, 0x38, 0xde, 0x19, 0x2e, 0x9d, 0x3e, 0xfd, 0xd3, 0x87, 0xe1, 0xdc,
  673. 0xdc, 0x5a, 0xf4, 0x0c, 0x5e, 0xb1, 0x23, 0xb8, 0x6a, 0x94, 0x24, 0x8a, 0x96, 0x5b, 0x77, 0xff,
  674. 0x3e, 0xea, 0xaa, 0xa5, 0xbd, 0xd1, 0x76, 0x7e, 0x2f, 0x9d, 0x0f, 0x1e, 0xad, 0xf7, 0x64, 0x7d,
  675. 0x4b, 0x65, 0x5b, 0x53, 0xb7, 0x04, 0x5d, 0xb7, 0xf4, 0xce, 0xce, 0x61, 0x83, 0x47, 0xdf, 0xc0,
  676. 0xe8, 0x76, 0xcb, 0x4c, 0x04, 0xbb, 0x11, 0x8f, 0x3a, 0x22, 0xec, 0x95, 0x05, 0xdf, 0x6e, 0xa8,
  677. 0x16, 0xd3, 0x05, 0x8c, 0xf6, 0x69, 0xea, 0x53, 0xfb, 0xa4, 0xc9, 0x1b, 0x7b, 0x8b, 0x9f, 0x35,
  678. 0x34, 0x17, 0xb1, 0x87, 0x62, 0x88, 0x72, 0x91, 0x5f, 0x5f, 0x70, 0xf6, 0x1d, 0x51, 0xc5, 0xcf,
  679. 0xb1, 0x8f, 0x46, 0x00, 0xb9, 0xf8, 0x9e, 0x9d, 0xd3, 0x0d, 0x61, 0xeb, 0xb8, 0x77, 0xf6, 0x39,
  680. 0xbc, 0x51, 0xf0, 0xcd, 0xcb, 0x29, 0x2c, 0xbd, 0x1f, 0x87, 0xf6, 0xf5, 0x87, 0xff, 0xe0, 0x87,
  681. 0x19, 0x26, 0xdb, 0x6c, 0xae, 0x11, 0x4f, 0x84, 0x30, 0xff, 0xa3, 0xf2, 0x6a, 0x68, 0xda, 0xfa,
  682. 0xf8, 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x2d, 0x46, 0xbc, 0x52, 0xfa, 0x06, 0x00, 0x00,
  683. }