summaryrefslogtreecommitdiff
path: root/src/geoparsers/v2ray/proto_src/geosite.proto
diff options
context:
space:
mode:
authornamilsk <namilsk@namilsk.tech>2026-03-18 21:21:21 +0300
committernamilsk <namilsk@namilsk.tech>2026-03-18 21:21:21 +0300
commit8887a775f5c46551f8d9ea0f2197d129008eabf1 (patch)
treec37f9808af3326d8d0adf873c756bae0ebe6257f /src/geoparsers/v2ray/proto_src/geosite.proto
parentda8e70f2e3c841796c122ca90617d74cb044b763 (diff)
Written geosite protobuf parser and tests 4 it
Diffstat (limited to 'src/geoparsers/v2ray/proto_src/geosite.proto')
-rw-r--r--src/geoparsers/v2ray/proto_src/geosite.proto66
1 files changed, 66 insertions, 0 deletions
diff --git a/src/geoparsers/v2ray/proto_src/geosite.proto b/src/geoparsers/v2ray/proto_src/geosite.proto
new file mode 100644
index 0000000..e6c76dd
--- /dev/null
+++ b/src/geoparsers/v2ray/proto_src/geosite.proto
@@ -0,0 +1,66 @@
+syntax = "proto3";
+
+package types;
+
+// Domain for routing decision.
+message Domain {
+ // Type of domain value.
+ enum Type {
+ // The value is used as is.
+ Plain = 0;
+ // The value is used as a regular expression.
+ Regex = 1;
+ // The value is a root domain.
+ Domain = 2;
+ // The value is a domain.
+ Full = 3;
+ }
+
+ // Domain matching type.
+ Type type = 1;
+
+ // Domain value.
+ string value = 2;
+
+ // Attribute of the domain.
+ message Attribute {
+ string key = 1;
+ oneof typed_value {
+ bool bool_value = 2;
+ int64 int_value = 3;
+ }
+ }
+
+ // Attributes of this domain. May be used for filtering.
+ repeated Attribute attribute = 3;
+}
+
+// IP for routing decision, in CIDR form.
+message CIDR {
+ // IP address, should be either 4 or 16 bytes.
+ bytes ip = 1;
+
+ // Number of leading ones in the network mask.
+ uint32 prefix = 2;
+}
+
+message GeoIP {
+ string country_code = 1;
+ repeated CIDR cidr = 2;
+}
+
+message GeoIPList {
+ repeated GeoIP entry = 1;
+}
+
+message GeoSite {
+ string country_code = 1;
+ repeated Domain domain = 2;
+ // resource_hash instruct simplified config converter to load domain from geo file.
+ bytes resource_hash = 3;
+ string code = 4;
+}
+
+message GeoSiteList {
+ repeated GeoSite entry = 1;
+}