config.proto 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. syntax = "proto3";
  2. package mihomo.component.geodata.router;
  3. option csharp_namespace = "Mihomo.Component.Geodata.Router";
  4. option go_package = "github.com/metacubex/mihomo/component/geodata/router";
  5. option java_package = "com.mihomo.component.geodata.router";
  6. option java_multiple_files = true;
  7. // Domain for routing decision.
  8. message Domain {
  9. // Type of domain value.
  10. enum Type {
  11. // The value is used as is.
  12. Plain = 0;
  13. // The value is used as a regular expression.
  14. Regex = 1;
  15. // The value is a root domain.
  16. Domain = 2;
  17. // The value is a domain.
  18. Full = 3;
  19. }
  20. // Domain matching type.
  21. Type type = 1;
  22. // Domain value.
  23. string value = 2;
  24. message Attribute {
  25. string key = 1;
  26. oneof typed_value {
  27. bool bool_value = 2;
  28. int64 int_value = 3;
  29. }
  30. }
  31. // Attributes of this domain. May be used for filtering.
  32. repeated Attribute attribute = 3;
  33. }
  34. // IP for routing decision, in CIDR form.
  35. message CIDR {
  36. // IP address, should be either 4 or 16 bytes.
  37. bytes ip = 1;
  38. // Number of leading ones in the network mask.
  39. uint32 prefix = 2;
  40. }
  41. message GeoIP {
  42. string country_code = 1;
  43. repeated CIDR cidr = 2;
  44. bool reverse_match = 3;
  45. }
  46. message GeoIPList {
  47. repeated GeoIP entry = 1;
  48. }
  49. message GeoSite {
  50. string country_code = 1;
  51. repeated Domain domain = 2;
  52. }
  53. message GeoSiteList {
  54. repeated GeoSite entry = 1;
  55. }