config.pb.go 28 KB

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