// source: app/router/routercommon/common.proto // source: common/protoext/extensions.proto // generate: protoc --python_out=./ ray.proto syntax = "proto3"; package routercommon; import "google/protobuf/descriptor.proto"; message FieldOpt { repeated string any_wants = 1; repeated string allowed_values = 2; repeated string allowed_value_types = 3; // convert_time_read_file_into read a file into another field, and clear this // field during input parsing string convert_time_read_file_into = 4; // forbidden marks a boolean to be inaccessible to user bool forbidden = 5; // convert_time_resource_loading read a file, and place its resource hash into // another field string convert_time_resource_loading = 6; // convert_time_parse_ip parse a string ip address, and put its binary // representation into another field string convert_time_parse_ip = 7; } extend google.protobuf.FieldOptions { FieldOpt field_opt = 50000; } // 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. RootDomain = 2; // The value is a 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; } // 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; string ip_addr = 68000 [ (field_opt).convert_time_parse_ip = "ip" ]; } message GeoIP { string country_code = 1; repeated CIDR cidr = 2; bool inverse_match = 3; // resource_hash instruct simplified config converter to load domain from geo // file. bytes resource_hash = 4; string code = 5; string file_path = 68000 [ (field_opt).convert_time_resource_loading = "resource_hash" ]; } 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; string file_path = 68000 [ (field_opt).convert_time_resource_loading = "resource_hash" ]; } message GeoSiteList { repeated GeoSite entry = 1; }