config.pb.go 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834
  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. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  427. XXX_unrecognized []byte `json:"-"`
  428. XXX_sizecache int32 `json:"-"`
  429. }
  430. func (m *RoutingRule) Reset() { *m = RoutingRule{} }
  431. func (m *RoutingRule) String() string { return proto.CompactTextString(m) }
  432. func (*RoutingRule) ProtoMessage() {}
  433. func (*RoutingRule) Descriptor() ([]byte, []int) {
  434. return fileDescriptor_6b1608360690c5fc, []int{6}
  435. }
  436. func (m *RoutingRule) XXX_Unmarshal(b []byte) error {
  437. return xxx_messageInfo_RoutingRule.Unmarshal(m, b)
  438. }
  439. func (m *RoutingRule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  440. return xxx_messageInfo_RoutingRule.Marshal(b, m, deterministic)
  441. }
  442. func (m *RoutingRule) XXX_Merge(src proto.Message) {
  443. xxx_messageInfo_RoutingRule.Merge(m, src)
  444. }
  445. func (m *RoutingRule) XXX_Size() int {
  446. return xxx_messageInfo_RoutingRule.Size(m)
  447. }
  448. func (m *RoutingRule) XXX_DiscardUnknown() {
  449. xxx_messageInfo_RoutingRule.DiscardUnknown(m)
  450. }
  451. var xxx_messageInfo_RoutingRule proto.InternalMessageInfo
  452. type isRoutingRule_TargetTag interface {
  453. isRoutingRule_TargetTag()
  454. }
  455. type RoutingRule_Tag struct {
  456. Tag string `protobuf:"bytes,1,opt,name=tag,proto3,oneof"`
  457. }
  458. type RoutingRule_BalancingTag struct {
  459. BalancingTag string `protobuf:"bytes,12,opt,name=balancing_tag,json=balancingTag,proto3,oneof"`
  460. }
  461. func (*RoutingRule_Tag) isRoutingRule_TargetTag() {}
  462. func (*RoutingRule_BalancingTag) isRoutingRule_TargetTag() {}
  463. func (m *RoutingRule) GetTargetTag() isRoutingRule_TargetTag {
  464. if m != nil {
  465. return m.TargetTag
  466. }
  467. return nil
  468. }
  469. func (m *RoutingRule) GetTag() string {
  470. if x, ok := m.GetTargetTag().(*RoutingRule_Tag); ok {
  471. return x.Tag
  472. }
  473. return ""
  474. }
  475. func (m *RoutingRule) GetBalancingTag() string {
  476. if x, ok := m.GetTargetTag().(*RoutingRule_BalancingTag); ok {
  477. return x.BalancingTag
  478. }
  479. return ""
  480. }
  481. func (m *RoutingRule) GetDomain() []*Domain {
  482. if m != nil {
  483. return m.Domain
  484. }
  485. return nil
  486. }
  487. // Deprecated: Do not use.
  488. func (m *RoutingRule) GetCidr() []*CIDR {
  489. if m != nil {
  490. return m.Cidr
  491. }
  492. return nil
  493. }
  494. func (m *RoutingRule) GetGeoip() []*GeoIP {
  495. if m != nil {
  496. return m.Geoip
  497. }
  498. return nil
  499. }
  500. // Deprecated: Do not use.
  501. func (m *RoutingRule) GetPortRange() *net.PortRange {
  502. if m != nil {
  503. return m.PortRange
  504. }
  505. return nil
  506. }
  507. func (m *RoutingRule) GetPortList() *net.PortList {
  508. if m != nil {
  509. return m.PortList
  510. }
  511. return nil
  512. }
  513. // Deprecated: Do not use.
  514. func (m *RoutingRule) GetNetworkList() *net.NetworkList {
  515. if m != nil {
  516. return m.NetworkList
  517. }
  518. return nil
  519. }
  520. func (m *RoutingRule) GetNetworks() []net.Network {
  521. if m != nil {
  522. return m.Networks
  523. }
  524. return nil
  525. }
  526. // Deprecated: Do not use.
  527. func (m *RoutingRule) GetSourceCidr() []*CIDR {
  528. if m != nil {
  529. return m.SourceCidr
  530. }
  531. return nil
  532. }
  533. func (m *RoutingRule) GetSourceGeoip() []*GeoIP {
  534. if m != nil {
  535. return m.SourceGeoip
  536. }
  537. return nil
  538. }
  539. func (m *RoutingRule) GetUserEmail() []string {
  540. if m != nil {
  541. return m.UserEmail
  542. }
  543. return nil
  544. }
  545. func (m *RoutingRule) GetInboundTag() []string {
  546. if m != nil {
  547. return m.InboundTag
  548. }
  549. return nil
  550. }
  551. func (m *RoutingRule) GetProtocol() []string {
  552. if m != nil {
  553. return m.Protocol
  554. }
  555. return nil
  556. }
  557. // XXX_OneofWrappers is for the internal use of the proto package.
  558. func (*RoutingRule) XXX_OneofWrappers() []interface{} {
  559. return []interface{}{
  560. (*RoutingRule_Tag)(nil),
  561. (*RoutingRule_BalancingTag)(nil),
  562. }
  563. }
  564. type BalancingRule struct {
  565. Tag string `protobuf:"bytes,1,opt,name=tag,proto3" json:"tag,omitempty"`
  566. OutboundSelector []string `protobuf:"bytes,2,rep,name=outbound_selector,json=outboundSelector,proto3" json:"outbound_selector,omitempty"`
  567. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  568. XXX_unrecognized []byte `json:"-"`
  569. XXX_sizecache int32 `json:"-"`
  570. }
  571. func (m *BalancingRule) Reset() { *m = BalancingRule{} }
  572. func (m *BalancingRule) String() string { return proto.CompactTextString(m) }
  573. func (*BalancingRule) ProtoMessage() {}
  574. func (*BalancingRule) Descriptor() ([]byte, []int) {
  575. return fileDescriptor_6b1608360690c5fc, []int{7}
  576. }
  577. func (m *BalancingRule) XXX_Unmarshal(b []byte) error {
  578. return xxx_messageInfo_BalancingRule.Unmarshal(m, b)
  579. }
  580. func (m *BalancingRule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  581. return xxx_messageInfo_BalancingRule.Marshal(b, m, deterministic)
  582. }
  583. func (m *BalancingRule) XXX_Merge(src proto.Message) {
  584. xxx_messageInfo_BalancingRule.Merge(m, src)
  585. }
  586. func (m *BalancingRule) XXX_Size() int {
  587. return xxx_messageInfo_BalancingRule.Size(m)
  588. }
  589. func (m *BalancingRule) XXX_DiscardUnknown() {
  590. xxx_messageInfo_BalancingRule.DiscardUnknown(m)
  591. }
  592. var xxx_messageInfo_BalancingRule proto.InternalMessageInfo
  593. func (m *BalancingRule) GetTag() string {
  594. if m != nil {
  595. return m.Tag
  596. }
  597. return ""
  598. }
  599. func (m *BalancingRule) GetOutboundSelector() []string {
  600. if m != nil {
  601. return m.OutboundSelector
  602. }
  603. return nil
  604. }
  605. type Config struct {
  606. DomainStrategy Config_DomainStrategy `protobuf:"varint,1,opt,name=domain_strategy,json=domainStrategy,proto3,enum=v2ray.core.app.router.Config_DomainStrategy" json:"domain_strategy,omitempty"`
  607. Rule []*RoutingRule `protobuf:"bytes,2,rep,name=rule,proto3" json:"rule,omitempty"`
  608. BalancingRule []*BalancingRule `protobuf:"bytes,3,rep,name=balancing_rule,json=balancingRule,proto3" json:"balancing_rule,omitempty"`
  609. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  610. XXX_unrecognized []byte `json:"-"`
  611. XXX_sizecache int32 `json:"-"`
  612. }
  613. func (m *Config) Reset() { *m = Config{} }
  614. func (m *Config) String() string { return proto.CompactTextString(m) }
  615. func (*Config) ProtoMessage() {}
  616. func (*Config) Descriptor() ([]byte, []int) {
  617. return fileDescriptor_6b1608360690c5fc, []int{8}
  618. }
  619. func (m *Config) XXX_Unmarshal(b []byte) error {
  620. return xxx_messageInfo_Config.Unmarshal(m, b)
  621. }
  622. func (m *Config) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  623. return xxx_messageInfo_Config.Marshal(b, m, deterministic)
  624. }
  625. func (m *Config) XXX_Merge(src proto.Message) {
  626. xxx_messageInfo_Config.Merge(m, src)
  627. }
  628. func (m *Config) XXX_Size() int {
  629. return xxx_messageInfo_Config.Size(m)
  630. }
  631. func (m *Config) XXX_DiscardUnknown() {
  632. xxx_messageInfo_Config.DiscardUnknown(m)
  633. }
  634. var xxx_messageInfo_Config proto.InternalMessageInfo
  635. func (m *Config) GetDomainStrategy() Config_DomainStrategy {
  636. if m != nil {
  637. return m.DomainStrategy
  638. }
  639. return Config_AsIs
  640. }
  641. func (m *Config) GetRule() []*RoutingRule {
  642. if m != nil {
  643. return m.Rule
  644. }
  645. return nil
  646. }
  647. func (m *Config) GetBalancingRule() []*BalancingRule {
  648. if m != nil {
  649. return m.BalancingRule
  650. }
  651. return nil
  652. }
  653. func init() {
  654. proto.RegisterEnum("v2ray.core.app.router.Domain_Type", Domain_Type_name, Domain_Type_value)
  655. proto.RegisterEnum("v2ray.core.app.router.Config_DomainStrategy", Config_DomainStrategy_name, Config_DomainStrategy_value)
  656. proto.RegisterType((*Domain)(nil), "v2ray.core.app.router.Domain")
  657. proto.RegisterType((*Domain_Attribute)(nil), "v2ray.core.app.router.Domain.Attribute")
  658. proto.RegisterType((*CIDR)(nil), "v2ray.core.app.router.CIDR")
  659. proto.RegisterType((*GeoIP)(nil), "v2ray.core.app.router.GeoIP")
  660. proto.RegisterType((*GeoIPList)(nil), "v2ray.core.app.router.GeoIPList")
  661. proto.RegisterType((*GeoSite)(nil), "v2ray.core.app.router.GeoSite")
  662. proto.RegisterType((*GeoSiteList)(nil), "v2ray.core.app.router.GeoSiteList")
  663. proto.RegisterType((*RoutingRule)(nil), "v2ray.core.app.router.RoutingRule")
  664. proto.RegisterType((*BalancingRule)(nil), "v2ray.core.app.router.BalancingRule")
  665. proto.RegisterType((*Config)(nil), "v2ray.core.app.router.Config")
  666. }
  667. func init() {
  668. proto.RegisterFile("v2ray.com/core/app/router/config.proto", fileDescriptor_6b1608360690c5fc)
  669. }
  670. var fileDescriptor_6b1608360690c5fc = []byte{
  671. // 897 bytes of a gzipped FileDescriptorProto
  672. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0xdd, 0x6e, 0xe3, 0x44,
  673. 0x14, 0xae, 0xed, 0x24, 0x1b, 0x1f, 0x27, 0xc1, 0x8c, 0x58, 0x64, 0x0a, 0xa5, 0xc1, 0x5a, 0xd8,
  674. 0x48, 0x20, 0x47, 0xca, 0x02, 0x17, 0x08, 0xb4, 0x34, 0xe9, 0xd2, 0x46, 0x40, 0xa9, 0xa6, 0xbb,
  675. 0x7b, 0x01, 0x17, 0x91, 0xe3, 0x4c, 0x8d, 0xb5, 0xce, 0xcc, 0x68, 0x3c, 0x5e, 0x36, 0xaf, 0x84,
  676. 0xc4, 0x33, 0xf0, 0x28, 0xbc, 0x0a, 0x9a, 0x9f, 0x34, 0x0d, 0x34, 0x25, 0xe2, 0x6e, 0xce, 0x39,
  677. 0xdf, 0x39, 0xf3, 0xcd, 0xf9, 0x1b, 0xf8, 0xe4, 0xf5, 0x48, 0xa4, 0xab, 0x24, 0x63, 0xcb, 0x61,
  678. 0xc6, 0x04, 0x19, 0xa6, 0x9c, 0x0f, 0x05, 0xab, 0x25, 0x11, 0xc3, 0x8c, 0xd1, 0xeb, 0x22, 0x4f,
  679. 0xb8, 0x60, 0x92, 0xa1, 0x87, 0x6b, 0x9c, 0x20, 0x49, 0xca, 0x79, 0x62, 0x30, 0x87, 0x8f, 0xfe,
  680. 0xe1, 0x9e, 0xb1, 0xe5, 0x92, 0xd1, 0x21, 0x25, 0x72, 0xc8, 0x99, 0x90, 0xc6, 0xf9, 0xf0, 0xf1,
  681. 0x6e, 0x14, 0x25, 0xf2, 0x37, 0x26, 0x5e, 0x19, 0x60, 0xfc, 0xa7, 0x0b, 0xad, 0x53, 0xb6, 0x4c,
  682. 0x0b, 0x8a, 0xbe, 0x84, 0x86, 0x5c, 0x71, 0x12, 0x39, 0x7d, 0x67, 0xd0, 0x1b, 0xc5, 0xc9, 0x9d,
  683. 0xf7, 0x27, 0x06, 0x9c, 0x3c, 0x5f, 0x71, 0x82, 0x35, 0x1e, 0xbd, 0x03, 0xcd, 0xd7, 0x69, 0x59,
  684. 0x93, 0xc8, 0xed, 0x3b, 0x03, 0x1f, 0x1b, 0x01, 0x3d, 0x03, 0x3f, 0x95, 0x52, 0x14, 0xf3, 0x5a,
  685. 0x92, 0xc8, 0xeb, 0x7b, 0x83, 0x60, 0xf4, 0xf8, 0xfe, 0x90, 0x27, 0x6b, 0x38, 0xde, 0x78, 0x1e,
  686. 0x96, 0xe0, 0xdf, 0xe8, 0x51, 0x08, 0xde, 0x2b, 0xb2, 0xd2, 0x04, 0x7d, 0xac, 0x8e, 0xe8, 0x18,
  687. 0x60, 0xce, 0x58, 0x39, 0xdb, 0x10, 0x68, 0x9f, 0x1f, 0x60, 0x5f, 0xe9, 0x5e, 0x6a, 0x1a, 0x47,
  688. 0xe0, 0x17, 0x54, 0x5a, 0xbb, 0xd7, 0x77, 0x06, 0xde, 0xf9, 0x01, 0x6e, 0x17, 0x54, 0x6a, 0xf3,
  689. 0xb8, 0x0b, 0x81, 0x7a, 0xc3, 0xc2, 0x00, 0xe2, 0x11, 0x34, 0xd4, 0xc3, 0x90, 0x0f, 0xcd, 0xcb,
  690. 0x32, 0x2d, 0x68, 0x78, 0xa0, 0x8e, 0x98, 0xe4, 0xe4, 0x4d, 0xe8, 0x20, 0x58, 0xa7, 0x2a, 0x74,
  691. 0x51, 0x1b, 0x1a, 0xdf, 0xd5, 0x65, 0x19, 0x7a, 0x71, 0x02, 0x8d, 0xc9, 0xf4, 0x14, 0xa3, 0x1e,
  692. 0xb8, 0x05, 0xd7, 0xdc, 0x3a, 0xd8, 0x2d, 0x38, 0x7a, 0x17, 0x5a, 0x5c, 0x90, 0xeb, 0xe2, 0x8d,
  693. 0xa6, 0xd5, 0xc5, 0x56, 0x8a, 0x7f, 0x81, 0xe6, 0x19, 0x61, 0xd3, 0x4b, 0xf4, 0x11, 0x74, 0x32,
  694. 0x56, 0x53, 0x29, 0x56, 0xb3, 0x8c, 0x2d, 0x88, 0x7d, 0x56, 0x60, 0x75, 0x13, 0xb6, 0x20, 0x68,
  695. 0x08, 0x8d, 0xac, 0x58, 0x88, 0xc8, 0xd5, 0xf9, 0x7b, 0x7f, 0x47, 0xfe, 0xd4, 0xf5, 0x58, 0x03,
  696. 0xe3, 0xa7, 0xe0, 0xeb, 0xe0, 0x3f, 0x14, 0x95, 0x44, 0x23, 0x68, 0x12, 0x15, 0x2a, 0x72, 0xb4,
  697. 0xfb, 0x07, 0x3b, 0xdc, 0xb5, 0x03, 0x36, 0xd0, 0x38, 0x83, 0x07, 0x67, 0x84, 0x5d, 0x15, 0x92,
  698. 0xec, 0xc3, 0xef, 0x0b, 0x68, 0x2d, 0x74, 0x46, 0x2c, 0xc3, 0xa3, 0x7b, 0x2b, 0x8c, 0x2d, 0x38,
  699. 0x9e, 0x40, 0x60, 0x2f, 0xd1, 0x3c, 0x3f, 0xdf, 0xe6, 0xf9, 0xe1, 0x6e, 0x9e, 0xca, 0x65, 0xcd,
  700. 0xf4, 0xaf, 0x26, 0x04, 0x98, 0xd5, 0xb2, 0xa0, 0x39, 0xae, 0x4b, 0x82, 0x10, 0x78, 0x32, 0xcd,
  701. 0x0d, 0xcb, 0xf3, 0x03, 0xac, 0x04, 0xf4, 0x31, 0x74, 0xe7, 0x69, 0x99, 0xd2, 0xac, 0xa0, 0xf9,
  702. 0x4c, 0x59, 0x3b, 0xd6, 0xda, 0xb9, 0x51, 0x3f, 0x4f, 0xf3, 0xff, 0xf9, 0x0c, 0xf4, 0xc4, 0x56,
  703. 0xc7, 0xfb, 0xcf, 0xea, 0x8c, 0xdd, 0xc8, 0x31, 0x15, 0x52, 0x45, 0xc9, 0x09, 0x2b, 0x78, 0x04,
  704. 0xfb, 0x14, 0x45, 0x43, 0xd1, 0x04, 0x40, 0xcd, 0xf6, 0x4c, 0xa4, 0x34, 0x27, 0x51, 0xa3, 0xef,
  705. 0x0c, 0x82, 0x51, 0xff, 0xb6, 0xa3, 0x19, 0xef, 0x84, 0x12, 0x99, 0x5c, 0x32, 0x21, 0xb1, 0xc2,
  706. 0xe9, 0x3b, 0x7d, 0xbe, 0x16, 0xd1, 0xd7, 0xa0, 0x85, 0x59, 0x59, 0x54, 0x32, 0xea, 0xe9, 0x18,
  707. 0xc7, 0xf7, 0xc4, 0x50, 0x95, 0xc1, 0x6d, 0x6e, 0x4f, 0x68, 0x0a, 0x1d, 0xbb, 0x38, 0x4c, 0x80,
  708. 0xa6, 0x0e, 0x10, 0xef, 0x08, 0x70, 0x61, 0xa0, 0xca, 0x53, 0xd3, 0x08, 0xe8, 0x46, 0x81, 0xbe,
  709. 0x82, 0xb6, 0x15, 0xab, 0xa8, 0xdb, 0xf7, 0x06, 0xbd, 0xed, 0x8a, 0xff, 0x3b, 0x0c, 0xbe, 0xc1,
  710. 0xa3, 0x6f, 0x21, 0xa8, 0x58, 0x2d, 0x32, 0x32, 0xd3, 0x99, 0x6f, 0xed, 0x97, 0x79, 0x30, 0x3e,
  711. 0x13, 0x95, 0xff, 0xa7, 0xd0, 0xb1, 0x11, 0x4c, 0x19, 0x82, 0x3d, 0xca, 0x60, 0xef, 0x3c, 0xd3,
  712. 0xc5, 0x38, 0x02, 0xa8, 0x2b, 0x22, 0x66, 0x64, 0x99, 0x16, 0x65, 0xf4, 0xa0, 0xef, 0x0d, 0x7c,
  713. 0xec, 0x2b, 0xcd, 0x33, 0xa5, 0x40, 0xc7, 0x10, 0x14, 0x74, 0xce, 0x6a, 0xba, 0xd0, 0x0d, 0xd7,
  714. 0xd6, 0x76, 0xb0, 0x2a, 0xd5, 0x6c, 0x87, 0xd0, 0xd6, 0xab, 0x37, 0x63, 0x65, 0xe4, 0x6b, 0xeb,
  715. 0x8d, 0x3c, 0xee, 0x00, 0xc8, 0x54, 0xe4, 0x44, 0x2a, 0xdf, 0xf8, 0x02, 0xba, 0xe3, 0x75, 0x9b,
  716. 0xea, 0x16, 0x0f, 0x6f, 0xb5, 0xb8, 0x69, 0xf0, 0x4f, 0xe1, 0x6d, 0x56, 0x4b, 0x73, 0x5d, 0x45,
  717. 0x4a, 0x92, 0x49, 0x66, 0xb6, 0x85, 0x8f, 0xc3, 0xb5, 0xe1, 0xca, 0xea, 0xe3, 0x3f, 0x5c, 0x68,
  718. 0x4d, 0xf4, 0x17, 0x83, 0x5e, 0xc0, 0x5b, 0xa6, 0x89, 0x67, 0x95, 0x14, 0xa9, 0x24, 0xf9, 0xca,
  719. 0xae, 0xfd, 0xcf, 0x76, 0xe5, 0xd2, 0x7c, 0x4d, 0x66, 0x02, 0xae, 0xac, 0x0f, 0xee, 0x2d, 0xb6,
  720. 0x64, 0xf5, 0x85, 0x88, 0xba, 0x24, 0x76, 0x8c, 0x76, 0x7d, 0x21, 0xb7, 0xa6, 0x16, 0x6b, 0x3c,
  721. 0xfa, 0x1e, 0x7a, 0x9b, 0x39, 0xd5, 0x11, 0xcc, 0x4c, 0x3d, 0xda, 0x11, 0x61, 0x2b, 0x2d, 0x78,
  722. 0x33, 0xe3, 0x4a, 0x8c, 0xcf, 0xa0, 0xb7, 0x4d, 0x53, 0x2d, 0xeb, 0x93, 0x6a, 0x5a, 0x99, 0x6d,
  723. 0xfe, 0xa2, 0x22, 0x53, 0x1e, 0x3a, 0x28, 0x84, 0xce, 0x94, 0x4f, 0xaf, 0x2f, 0x18, 0xfd, 0x31,
  724. 0x95, 0xd9, 0xaf, 0xa1, 0x8b, 0x7a, 0x00, 0x53, 0xfe, 0x13, 0x3d, 0x25, 0xcb, 0x94, 0x2e, 0x42,
  725. 0x6f, 0xfc, 0x0d, 0xbc, 0x97, 0xb1, 0xe5, 0xdd, 0x14, 0x2e, 0x9d, 0x9f, 0x5b, 0xe6, 0xf4, 0xbb,
  726. 0xfb, 0xf0, 0xe5, 0x08, 0xa7, 0xab, 0x64, 0xa2, 0x10, 0x27, 0x9c, 0xeb, 0xf7, 0x11, 0x31, 0x6f,
  727. 0xe9, 0xb2, 0x3e, 0xf9, 0x3b, 0x00, 0x00, 0xff, 0xff, 0xb2, 0x28, 0x0d, 0x41, 0xf1, 0x07, 0x00,
  728. 0x00,
  729. }