mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-07-09 13:18:46 +00:00
Xray-core: Refactor geodata (#5814)
https://github.com/XTLS/Xray-core/issues/4422#issuecomment-3533007890 Breaking changes https://github.com/XTLS/Xray-core/pull/5569 Reverts https://github.com/XTLS/Xray-core/pull/5505 Closes https://github.com/XTLS/Xray-core/pull/643
This commit is contained in:
@@ -0,0 +1,90 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package xray.common.geodata;
|
||||
option csharp_namespace = "Xray.Common.Geodata";
|
||||
option go_package = "github.com/xtls/xray-core/common/geodata";
|
||||
option java_package = "com.xray.common.geodata";
|
||||
option java_multiple_files = true;
|
||||
|
||||
message Domain {
|
||||
// Type of domain value.
|
||||
enum Type {
|
||||
// The value is used as a sub string.
|
||||
Substr = 0;
|
||||
// The value is used as a regular expression.
|
||||
Regex = 1;
|
||||
// The value is a domain.
|
||||
Domain = 2;
|
||||
// The value is a full domain.
|
||||
Full = 3;
|
||||
}
|
||||
// Domain matching type.
|
||||
Type type = 1;
|
||||
|
||||
// Domain value.
|
||||
string value = 2;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
message GeoSite {
|
||||
string code = 1;
|
||||
repeated Domain domain = 2;
|
||||
}
|
||||
|
||||
message GeoSiteList {
|
||||
repeated GeoSite entry = 1;
|
||||
}
|
||||
|
||||
message GeoSiteRule {
|
||||
string file = 1;
|
||||
string code = 2;
|
||||
string attrs = 3;
|
||||
}
|
||||
|
||||
message DomainRule {
|
||||
oneof value {
|
||||
GeoSiteRule geosite = 1;
|
||||
Domain custom = 2;
|
||||
}
|
||||
}
|
||||
|
||||
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 code = 1;
|
||||
repeated CIDR cidr = 2;
|
||||
bool reverse_match = 3;
|
||||
}
|
||||
|
||||
message GeoIPList {
|
||||
repeated GeoIP entry = 1;
|
||||
}
|
||||
|
||||
message GeoIPRule {
|
||||
string file = 1;
|
||||
string code = 2;
|
||||
bool reverse_match = 3;
|
||||
}
|
||||
|
||||
message IPRule {
|
||||
oneof value {
|
||||
GeoIPRule geoip = 1;
|
||||
CIDR custom = 2;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user