config.pb.go 28 KB

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