common.proto 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. syntax = "proto3";
  2. package v2ray.core.app.router.routercommon;
  3. option csharp_namespace = "V2Ray.Core.App.Router.Routercommon";
  4. option go_package = "github.com/v2fly/v2ray-core/v4/app/router/routercommon";
  5. option java_package = "com.v2ray.core.app.router.routercommon";
  6. option java_multiple_files = true;
  7. import "common/protoext/extensions.proto";
  8. // Domain for routing decision.
  9. message Domain {
  10. // Type of domain value.
  11. enum Type {
  12. // The value is used as is.
  13. Plain = 0;
  14. // The value is used as a regular expression.
  15. Regex = 1;
  16. // The value is a root domain.
  17. RootDomain = 2;
  18. // The value is a domain.
  19. Full = 3;
  20. }
  21. // Domain matching type.
  22. Type type = 1;
  23. // Domain value.
  24. string value = 2;
  25. message Attribute {
  26. string key = 1;
  27. oneof typed_value {
  28. bool bool_value = 2;
  29. int64 int_value = 3;
  30. }
  31. }
  32. // Attributes of this domain. May be used for filtering.
  33. repeated Attribute attribute = 3;
  34. }
  35. // IP for routing decision, in CIDR form.
  36. message CIDR {
  37. // IP address, should be either 4 or 16 bytes.
  38. bytes ip = 1;
  39. // Number of leading ones in the network mask.
  40. uint32 prefix = 2;
  41. string ip_addr = 68000 [(v2ray.core.common.protoext.field_opt).convert_time_parse_ip = "ip"];
  42. }
  43. message GeoIP {
  44. string country_code = 1;
  45. repeated CIDR cidr = 2;
  46. bool inverse_match = 3;
  47. // resource_hash instruct simplified config converter to load domain from geo file.
  48. bytes resource_hash = 4;
  49. string code = 5;
  50. string file_path = 68000[(v2ray.core.common.protoext.field_opt).convert_time_resource_loading = "resource_hash"];
  51. }
  52. message GeoIPList {
  53. repeated GeoIP entry = 1;
  54. }
  55. message GeoSite {
  56. string country_code = 1;
  57. repeated Domain domain = 2;
  58. // resource_hash instruct simplified config converter to load domain from geo file.
  59. bytes resource_hash = 3;
  60. string code = 4;
  61. string file_path = 68000[(v2ray.core.common.protoext.field_opt).convert_time_resource_loading = "resource_hash"];
  62. }
  63. message GeoSiteList {
  64. repeated GeoSite entry = 1;
  65. }