config.pb.go 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763
  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. NetworkList *net.NetworkList `protobuf:"bytes,5,opt,name=network_list,json=networkList,proto3" json:"network_list,omitempty"`
  330. // List of CIDRs for source IP address matching.
  331. SourceCidr []*CIDR `protobuf:"bytes,6,rep,name=source_cidr,json=sourceCidr,proto3" json:"source_cidr,omitempty"` // Deprecated: Do not use.
  332. // List of GeoIPs for source IP address matching. If this entry exists, the source_cidr above will have no effect.
  333. SourceGeoip []*GeoIP `protobuf:"bytes,11,rep,name=source_geoip,json=sourceGeoip,proto3" json:"source_geoip,omitempty"`
  334. UserEmail []string `protobuf:"bytes,7,rep,name=user_email,json=userEmail,proto3" json:"user_email,omitempty"`
  335. InboundTag []string `protobuf:"bytes,8,rep,name=inbound_tag,json=inboundTag,proto3" json:"inbound_tag,omitempty"`
  336. Protocol []string `protobuf:"bytes,9,rep,name=protocol,proto3" json:"protocol,omitempty"`
  337. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  338. XXX_unrecognized []byte `json:"-"`
  339. XXX_sizecache int32 `json:"-"`
  340. }
  341. func (m *RoutingRule) Reset() { *m = RoutingRule{} }
  342. func (m *RoutingRule) String() string { return proto.CompactTextString(m) }
  343. func (*RoutingRule) ProtoMessage() {}
  344. func (*RoutingRule) Descriptor() ([]byte, []int) {
  345. return fileDescriptor_6b1608360690c5fc, []int{6}
  346. }
  347. func (m *RoutingRule) XXX_Unmarshal(b []byte) error {
  348. return xxx_messageInfo_RoutingRule.Unmarshal(m, b)
  349. }
  350. func (m *RoutingRule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  351. return xxx_messageInfo_RoutingRule.Marshal(b, m, deterministic)
  352. }
  353. func (m *RoutingRule) XXX_Merge(src proto.Message) {
  354. xxx_messageInfo_RoutingRule.Merge(m, src)
  355. }
  356. func (m *RoutingRule) XXX_Size() int {
  357. return xxx_messageInfo_RoutingRule.Size(m)
  358. }
  359. func (m *RoutingRule) XXX_DiscardUnknown() {
  360. xxx_messageInfo_RoutingRule.DiscardUnknown(m)
  361. }
  362. var xxx_messageInfo_RoutingRule proto.InternalMessageInfo
  363. type isRoutingRule_TargetTag interface {
  364. isRoutingRule_TargetTag()
  365. }
  366. type RoutingRule_Tag struct {
  367. Tag string `protobuf:"bytes,1,opt,name=tag,proto3,oneof"`
  368. }
  369. type RoutingRule_BalancingTag struct {
  370. BalancingTag string `protobuf:"bytes,12,opt,name=balancing_tag,json=balancingTag,proto3,oneof"`
  371. }
  372. func (*RoutingRule_Tag) isRoutingRule_TargetTag() {}
  373. func (*RoutingRule_BalancingTag) isRoutingRule_TargetTag() {}
  374. func (m *RoutingRule) GetTargetTag() isRoutingRule_TargetTag {
  375. if m != nil {
  376. return m.TargetTag
  377. }
  378. return nil
  379. }
  380. func (m *RoutingRule) GetTag() string {
  381. if x, ok := m.GetTargetTag().(*RoutingRule_Tag); ok {
  382. return x.Tag
  383. }
  384. return ""
  385. }
  386. func (m *RoutingRule) GetBalancingTag() string {
  387. if x, ok := m.GetTargetTag().(*RoutingRule_BalancingTag); ok {
  388. return x.BalancingTag
  389. }
  390. return ""
  391. }
  392. func (m *RoutingRule) GetDomain() []*Domain {
  393. if m != nil {
  394. return m.Domain
  395. }
  396. return nil
  397. }
  398. // Deprecated: Do not use.
  399. func (m *RoutingRule) GetCidr() []*CIDR {
  400. if m != nil {
  401. return m.Cidr
  402. }
  403. return nil
  404. }
  405. func (m *RoutingRule) GetGeoip() []*GeoIP {
  406. if m != nil {
  407. return m.Geoip
  408. }
  409. return nil
  410. }
  411. func (m *RoutingRule) GetPortRange() *net.PortRange {
  412. if m != nil {
  413. return m.PortRange
  414. }
  415. return nil
  416. }
  417. func (m *RoutingRule) GetNetworkList() *net.NetworkList {
  418. if m != nil {
  419. return m.NetworkList
  420. }
  421. return nil
  422. }
  423. // Deprecated: Do not use.
  424. func (m *RoutingRule) GetSourceCidr() []*CIDR {
  425. if m != nil {
  426. return m.SourceCidr
  427. }
  428. return nil
  429. }
  430. func (m *RoutingRule) GetSourceGeoip() []*GeoIP {
  431. if m != nil {
  432. return m.SourceGeoip
  433. }
  434. return nil
  435. }
  436. func (m *RoutingRule) GetUserEmail() []string {
  437. if m != nil {
  438. return m.UserEmail
  439. }
  440. return nil
  441. }
  442. func (m *RoutingRule) GetInboundTag() []string {
  443. if m != nil {
  444. return m.InboundTag
  445. }
  446. return nil
  447. }
  448. func (m *RoutingRule) GetProtocol() []string {
  449. if m != nil {
  450. return m.Protocol
  451. }
  452. return nil
  453. }
  454. // XXX_OneofFuncs is for the internal use of the proto package.
  455. 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{}) {
  456. return _RoutingRule_OneofMarshaler, _RoutingRule_OneofUnmarshaler, _RoutingRule_OneofSizer, []interface{}{
  457. (*RoutingRule_Tag)(nil),
  458. (*RoutingRule_BalancingTag)(nil),
  459. }
  460. }
  461. func _RoutingRule_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
  462. m := msg.(*RoutingRule)
  463. // target_tag
  464. switch x := m.TargetTag.(type) {
  465. case *RoutingRule_Tag:
  466. b.EncodeVarint(1<<3 | proto.WireBytes)
  467. b.EncodeStringBytes(x.Tag)
  468. case *RoutingRule_BalancingTag:
  469. b.EncodeVarint(12<<3 | proto.WireBytes)
  470. b.EncodeStringBytes(x.BalancingTag)
  471. case nil:
  472. default:
  473. return fmt.Errorf("RoutingRule.TargetTag has unexpected type %T", x)
  474. }
  475. return nil
  476. }
  477. func _RoutingRule_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
  478. m := msg.(*RoutingRule)
  479. switch tag {
  480. case 1: // target_tag.tag
  481. if wire != proto.WireBytes {
  482. return true, proto.ErrInternalBadWireType
  483. }
  484. x, err := b.DecodeStringBytes()
  485. m.TargetTag = &RoutingRule_Tag{x}
  486. return true, err
  487. case 12: // target_tag.balancing_tag
  488. if wire != proto.WireBytes {
  489. return true, proto.ErrInternalBadWireType
  490. }
  491. x, err := b.DecodeStringBytes()
  492. m.TargetTag = &RoutingRule_BalancingTag{x}
  493. return true, err
  494. default:
  495. return false, nil
  496. }
  497. }
  498. func _RoutingRule_OneofSizer(msg proto.Message) (n int) {
  499. m := msg.(*RoutingRule)
  500. // target_tag
  501. switch x := m.TargetTag.(type) {
  502. case *RoutingRule_Tag:
  503. n += 1 // tag and wire
  504. n += proto.SizeVarint(uint64(len(x.Tag)))
  505. n += len(x.Tag)
  506. case *RoutingRule_BalancingTag:
  507. n += 1 // tag and wire
  508. n += proto.SizeVarint(uint64(len(x.BalancingTag)))
  509. n += len(x.BalancingTag)
  510. case nil:
  511. default:
  512. panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
  513. }
  514. return n
  515. }
  516. type BalancingRule struct {
  517. Tag string `protobuf:"bytes,1,opt,name=tag,proto3" json:"tag,omitempty"`
  518. OutboundSelector []string `protobuf:"bytes,2,rep,name=outbound_selector,json=outboundSelector,proto3" json:"outbound_selector,omitempty"`
  519. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  520. XXX_unrecognized []byte `json:"-"`
  521. XXX_sizecache int32 `json:"-"`
  522. }
  523. func (m *BalancingRule) Reset() { *m = BalancingRule{} }
  524. func (m *BalancingRule) String() string { return proto.CompactTextString(m) }
  525. func (*BalancingRule) ProtoMessage() {}
  526. func (*BalancingRule) Descriptor() ([]byte, []int) {
  527. return fileDescriptor_6b1608360690c5fc, []int{7}
  528. }
  529. func (m *BalancingRule) XXX_Unmarshal(b []byte) error {
  530. return xxx_messageInfo_BalancingRule.Unmarshal(m, b)
  531. }
  532. func (m *BalancingRule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  533. return xxx_messageInfo_BalancingRule.Marshal(b, m, deterministic)
  534. }
  535. func (m *BalancingRule) XXX_Merge(src proto.Message) {
  536. xxx_messageInfo_BalancingRule.Merge(m, src)
  537. }
  538. func (m *BalancingRule) XXX_Size() int {
  539. return xxx_messageInfo_BalancingRule.Size(m)
  540. }
  541. func (m *BalancingRule) XXX_DiscardUnknown() {
  542. xxx_messageInfo_BalancingRule.DiscardUnknown(m)
  543. }
  544. var xxx_messageInfo_BalancingRule proto.InternalMessageInfo
  545. func (m *BalancingRule) GetTag() string {
  546. if m != nil {
  547. return m.Tag
  548. }
  549. return ""
  550. }
  551. func (m *BalancingRule) GetOutboundSelector() []string {
  552. if m != nil {
  553. return m.OutboundSelector
  554. }
  555. return nil
  556. }
  557. type Config struct {
  558. DomainStrategy Config_DomainStrategy `protobuf:"varint,1,opt,name=domain_strategy,json=domainStrategy,proto3,enum=v2ray.core.app.router.Config_DomainStrategy" json:"domain_strategy,omitempty"`
  559. Rule []*RoutingRule `protobuf:"bytes,2,rep,name=rule,proto3" json:"rule,omitempty"`
  560. BalancingRule []*BalancingRule `protobuf:"bytes,3,rep,name=balancing_rule,json=balancingRule,proto3" json:"balancing_rule,omitempty"`
  561. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  562. XXX_unrecognized []byte `json:"-"`
  563. XXX_sizecache int32 `json:"-"`
  564. }
  565. func (m *Config) Reset() { *m = Config{} }
  566. func (m *Config) String() string { return proto.CompactTextString(m) }
  567. func (*Config) ProtoMessage() {}
  568. func (*Config) Descriptor() ([]byte, []int) {
  569. return fileDescriptor_6b1608360690c5fc, []int{8}
  570. }
  571. func (m *Config) XXX_Unmarshal(b []byte) error {
  572. return xxx_messageInfo_Config.Unmarshal(m, b)
  573. }
  574. func (m *Config) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  575. return xxx_messageInfo_Config.Marshal(b, m, deterministic)
  576. }
  577. func (m *Config) XXX_Merge(src proto.Message) {
  578. xxx_messageInfo_Config.Merge(m, src)
  579. }
  580. func (m *Config) XXX_Size() int {
  581. return xxx_messageInfo_Config.Size(m)
  582. }
  583. func (m *Config) XXX_DiscardUnknown() {
  584. xxx_messageInfo_Config.DiscardUnknown(m)
  585. }
  586. var xxx_messageInfo_Config proto.InternalMessageInfo
  587. func (m *Config) GetDomainStrategy() Config_DomainStrategy {
  588. if m != nil {
  589. return m.DomainStrategy
  590. }
  591. return Config_AsIs
  592. }
  593. func (m *Config) GetRule() []*RoutingRule {
  594. if m != nil {
  595. return m.Rule
  596. }
  597. return nil
  598. }
  599. func (m *Config) GetBalancingRule() []*BalancingRule {
  600. if m != nil {
  601. return m.BalancingRule
  602. }
  603. return nil
  604. }
  605. func init() {
  606. proto.RegisterEnum("v2ray.core.app.router.Domain_Type", Domain_Type_name, Domain_Type_value)
  607. proto.RegisterEnum("v2ray.core.app.router.Config_DomainStrategy", Config_DomainStrategy_name, Config_DomainStrategy_value)
  608. proto.RegisterType((*Domain)(nil), "v2ray.core.app.router.Domain")
  609. proto.RegisterType((*CIDR)(nil), "v2ray.core.app.router.CIDR")
  610. proto.RegisterType((*GeoIP)(nil), "v2ray.core.app.router.GeoIP")
  611. proto.RegisterType((*GeoIPList)(nil), "v2ray.core.app.router.GeoIPList")
  612. proto.RegisterType((*GeoSite)(nil), "v2ray.core.app.router.GeoSite")
  613. proto.RegisterType((*GeoSiteList)(nil), "v2ray.core.app.router.GeoSiteList")
  614. proto.RegisterType((*RoutingRule)(nil), "v2ray.core.app.router.RoutingRule")
  615. proto.RegisterType((*BalancingRule)(nil), "v2ray.core.app.router.BalancingRule")
  616. proto.RegisterType((*Config)(nil), "v2ray.core.app.router.Config")
  617. }
  618. func init() {
  619. proto.RegisterFile("v2ray.com/core/app/router/config.proto", fileDescriptor_6b1608360690c5fc)
  620. }
  621. var fileDescriptor_6b1608360690c5fc = []byte{
  622. // 776 bytes of a gzipped FileDescriptorProto
  623. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0xdd, 0x6e, 0xeb, 0x44,
  624. 0x10, 0x3e, 0x76, 0x7e, 0x4e, 0x3d, 0x76, 0x83, 0x59, 0x71, 0x90, 0x29, 0x14, 0x82, 0x55, 0x20,
  625. 0x12, 0xc8, 0x91, 0x52, 0xe0, 0x0e, 0x95, 0x26, 0x2d, 0x21, 0x02, 0x4a, 0xb4, 0x6d, 0xb9, 0x80,
  626. 0x8b, 0x68, 0xeb, 0x6c, 0x8d, 0x85, 0xb3, 0xbb, 0x5a, 0xaf, 0x4b, 0xf3, 0x0a, 0x3c, 0x0a, 0x12,
  627. 0x8f, 0xc4, 0xbb, 0xa0, 0xdd, 0x75, 0xda, 0x06, 0xd5, 0x10, 0x9d, 0xbb, 0x9d, 0xd9, 0x6f, 0x66,
  628. 0xbe, 0xf9, 0x85, 0x8f, 0xef, 0x46, 0x92, 0xac, 0x93, 0x94, 0xaf, 0x86, 0x29, 0x97, 0x74, 0x48,
  629. 0x84, 0x18, 0x4a, 0x5e, 0x29, 0x2a, 0x87, 0x29, 0x67, 0xb7, 0x79, 0x96, 0x08, 0xc9, 0x15, 0x47,
  630. 0xaf, 0x36, 0x38, 0x49, 0x13, 0x22, 0x44, 0x62, 0x31, 0x07, 0x47, 0xff, 0x32, 0x4f, 0xf9, 0x6a,
  631. 0xc5, 0xd9, 0x90, 0x51, 0x35, 0x14, 0x5c, 0x2a, 0x6b, 0x7c, 0xf0, 0x49, 0x33, 0x8a, 0x51, 0xf5,
  632. 0x3b, 0x97, 0xbf, 0x59, 0x60, 0xfc, 0x87, 0x03, 0xdd, 0x33, 0xbe, 0x22, 0x39, 0x43, 0x5f, 0x42,
  633. 0x5b, 0xad, 0x05, 0x8d, 0x9c, 0xbe, 0x33, 0xe8, 0x8d, 0xe2, 0xe4, 0xd9, 0xf8, 0x89, 0x05, 0x27,
  634. 0x57, 0x6b, 0x41, 0xb1, 0xc1, 0xa3, 0xb7, 0xa0, 0x73, 0x47, 0x8a, 0x8a, 0x46, 0x6e, 0xdf, 0x19,
  635. 0x78, 0xd8, 0x0a, 0xf1, 0x08, 0xda, 0x1a, 0x83, 0x3c, 0xe8, 0xcc, 0x0b, 0x92, 0xb3, 0xf0, 0x85,
  636. 0x7e, 0x62, 0x9a, 0xd1, 0xfb, 0xd0, 0x41, 0xb0, 0x89, 0x1a, 0xba, 0x68, 0x0f, 0xda, 0xdf, 0x54,
  637. 0x45, 0x11, 0xb6, 0xe2, 0x04, 0xda, 0x93, 0xd9, 0x19, 0x46, 0x3d, 0x70, 0x73, 0x61, 0x78, 0x04,
  638. 0xd8, 0xcd, 0x05, 0x7a, 0x1b, 0xba, 0x42, 0xd2, 0xdb, 0xfc, 0xde, 0x84, 0xd8, 0xc7, 0xb5, 0x14,
  639. 0xff, 0x02, 0x9d, 0x29, 0xe5, 0xb3, 0x39, 0xfa, 0x10, 0x82, 0x94, 0x57, 0x4c, 0xc9, 0xf5, 0x22,
  640. 0xe5, 0x4b, 0x9b, 0x82, 0x87, 0xfd, 0x5a, 0x37, 0xe1, 0x4b, 0x8a, 0x86, 0xd0, 0x4e, 0xf3, 0xa5,
  641. 0x8c, 0xdc, 0x7e, 0x6b, 0xe0, 0x8f, 0xde, 0x6d, 0xc8, 0x4e, 0x87, 0xc7, 0x06, 0x18, 0x9f, 0x80,
  642. 0x67, 0x9c, 0x7f, 0x9f, 0x97, 0x0a, 0x8d, 0xa0, 0x43, 0xb5, 0xab, 0xc8, 0x31, 0xe6, 0xef, 0x35,
  643. 0x98, 0x1b, 0x03, 0x6c, 0xa1, 0x71, 0x0a, 0x2f, 0xa7, 0x94, 0x5f, 0xe6, 0x8a, 0xee, 0xc2, 0xef,
  644. 0x0b, 0xe8, 0x2e, 0x4d, 0x45, 0x6a, 0x86, 0x87, 0xff, 0x59, 0x7f, 0x5c, 0x83, 0xe3, 0x09, 0xf8,
  645. 0x75, 0x10, 0xc3, 0xf3, 0xf3, 0x6d, 0x9e, 0xef, 0x37, 0xf3, 0xd4, 0x26, 0x1b, 0xa6, 0x7f, 0xb7,
  646. 0xc1, 0xc7, 0xbc, 0x52, 0x39, 0xcb, 0x70, 0x55, 0x50, 0x84, 0xa0, 0xa5, 0x48, 0x66, 0x59, 0x7e,
  647. 0xfb, 0x02, 0x6b, 0x01, 0x7d, 0x04, 0xfb, 0x37, 0xa4, 0x20, 0x2c, 0xcd, 0x59, 0xb6, 0xd0, 0xbf,
  648. 0x41, 0xfd, 0x1b, 0x3c, 0xa8, 0xaf, 0x48, 0xf6, 0x9a, 0x69, 0xa0, 0xe3, 0xba, 0x3b, 0xad, 0xff,
  649. 0xed, 0xce, 0xd8, 0x8d, 0x1c, 0xdb, 0x21, 0xdd, 0x94, 0x8c, 0xf2, 0x5c, 0x44, 0xb0, 0x4b, 0x53,
  650. 0x0c, 0x14, 0x9d, 0x00, 0xe8, 0x35, 0x59, 0x48, 0xc2, 0x32, 0x1a, 0xb5, 0xfb, 0xce, 0xc0, 0x1f,
  651. 0xf5, 0x9f, 0x1a, 0xda, 0x4d, 0x49, 0x18, 0x55, 0xc9, 0x9c, 0x4b, 0x85, 0x35, 0x0e, 0x7b, 0x62,
  652. 0xf3, 0x44, 0xe7, 0x10, 0xd4, 0x1b, 0xb4, 0x28, 0xf2, 0x52, 0x45, 0x1d, 0xe3, 0x22, 0x6e, 0x70,
  653. 0x71, 0x61, 0xa1, 0xba, 0x37, 0xd8, 0x67, 0x8f, 0x02, 0xfa, 0x1a, 0xfc, 0x92, 0x57, 0x32, 0xa5,
  654. 0x0b, 0x93, 0x77, 0x77, 0xb7, 0xbc, 0xc1, 0xda, 0x4c, 0x74, 0xf6, 0x27, 0x10, 0xd4, 0x1e, 0x6c,
  655. 0x11, 0xfc, 0x1d, 0x8a, 0x50, 0xc7, 0x9c, 0x9a, 0x52, 0x1c, 0x02, 0x54, 0x25, 0x95, 0x0b, 0xba,
  656. 0x22, 0x79, 0x11, 0xbd, 0xec, 0xb7, 0x06, 0x1e, 0xf6, 0xb4, 0xe6, 0x5c, 0x2b, 0xd0, 0x07, 0xe0,
  657. 0xe7, 0xec, 0x86, 0x57, 0x6c, 0x69, 0xda, 0xbd, 0x67, 0xfe, 0xa1, 0x56, 0xe9, 0x56, 0x1f, 0xc0,
  658. 0x9e, 0xb9, 0x21, 0x29, 0x2f, 0x22, 0xcf, 0xfc, 0x3e, 0xc8, 0xe3, 0x00, 0x40, 0x11, 0x99, 0x51,
  659. 0xa5, 0x6d, 0xe3, 0x0b, 0xd8, 0x1f, 0x6f, 0x86, 0xc4, 0x0c, 0x58, 0xf8, 0x64, 0xc0, 0xec, 0x78,
  660. 0x7d, 0x0a, 0x6f, 0xf2, 0x4a, 0xd9, 0x70, 0x25, 0x2d, 0x68, 0xaa, 0xb8, 0xdd, 0x55, 0x0f, 0x87,
  661. 0x9b, 0x8f, 0xcb, 0x5a, 0x1f, 0xff, 0xe5, 0x42, 0x77, 0x62, 0x6e, 0x25, 0xba, 0x86, 0x37, 0xec,
  662. 0x08, 0x2d, 0x4a, 0x25, 0x89, 0xa2, 0xd9, 0xba, 0xbe, 0x5f, 0x9f, 0x35, 0xd5, 0xd2, 0xde, 0x58,
  663. 0x3b, 0x7f, 0x97, 0xb5, 0x0d, 0xee, 0x2d, 0xb7, 0x64, 0x7d, 0x0b, 0x65, 0x55, 0xd0, 0x7a, 0x88,
  664. 0x9b, 0x6e, 0xe1, 0x93, 0x9d, 0xc1, 0x06, 0x8f, 0xbe, 0x83, 0xde, 0xe3, 0x96, 0x18, 0x0f, 0x76,
  665. 0xa2, 0x8f, 0x1a, 0x3c, 0x6c, 0x95, 0x05, 0x3f, 0x6e, 0x98, 0x16, 0xe3, 0x29, 0xf4, 0xb6, 0x69,
  666. 0xea, 0x53, 0x79, 0x5a, 0xce, 0x4a, 0x7b, 0x4b, 0xaf, 0x4b, 0x3a, 0x13, 0xa1, 0x83, 0x42, 0x08,
  667. 0x66, 0x62, 0x76, 0x7b, 0xc1, 0xd9, 0x0f, 0x44, 0xa5, 0xbf, 0x86, 0x2e, 0xea, 0x01, 0xcc, 0xc4,
  668. 0x8f, 0xec, 0x8c, 0xae, 0x08, 0x5b, 0x86, 0xad, 0xf1, 0x57, 0xf0, 0x4e, 0xca, 0x57, 0xcf, 0x53,
  669. 0x98, 0x3b, 0x3f, 0x77, 0xed, 0xeb, 0x4f, 0xf7, 0xd5, 0x4f, 0x23, 0x4c, 0xd6, 0xc9, 0x44, 0x23,
  670. 0x4e, 0x85, 0x30, 0xf9, 0x51, 0x79, 0xd3, 0x35, 0x6d, 0x3d, 0xfe, 0x27, 0x00, 0x00, 0xff, 0xff,
  671. 0x7c, 0x01, 0x52, 0xfa, 0xba, 0x06, 0x00, 0x00,
  672. }