// This file is @generated by prost-build. /// Domain for routing decision. #[derive(Clone, PartialEq, ::prost::Message)] pub struct Domain { /// Domain matching type. #[prost(enumeration = "domain::Type", tag = "1")] pub r#type: i32, /// Domain value. #[prost(string, tag = "2")] pub value: ::prost::alloc::string::String, /// Attributes of this domain. May be used for filtering. #[prost(message, repeated, tag = "3")] pub attribute: ::prost::alloc::vec::Vec, } /// Nested message and enum types in `Domain`. pub mod domain { /// Attribute of the domain. #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Attribute { #[prost(string, tag = "1")] pub key: ::prost::alloc::string::String, #[prost(oneof = "attribute::TypedValue", tags = "2, 3")] pub typed_value: ::core::option::Option, } /// Nested message and enum types in `Attribute`. pub mod attribute { #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)] pub enum TypedValue { #[prost(bool, tag = "2")] BoolValue(bool), #[prost(int64, tag = "3")] IntValue(i64), } } /// Type of domain value. #[derive( Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration )] #[repr(i32)] pub 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, } impl Type { /// String value of the enum field names used in the ProtoBuf definition. /// /// The values are not transformed in any way and thus are considered stable /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { Self::Plain => "Plain", Self::Regex => "Regex", Self::Domain => "Domain", Self::Full => "Full", } } /// Creates an enum from field names used in the ProtoBuf definition. pub fn from_str_name(value: &str) -> ::core::option::Option { match value { "Plain" => Some(Self::Plain), "Regex" => Some(Self::Regex), "Domain" => Some(Self::Domain), "Full" => Some(Self::Full), _ => None, } } } } /// IP for routing decision, in CIDR form. #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Cidr { /// IP address, should be either 4 or 16 bytes. #[prost(bytes = "vec", tag = "1")] pub ip: ::prost::alloc::vec::Vec, /// Number of leading ones in the network mask. #[prost(uint32, tag = "2")] pub prefix: u32, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct GeoIp { #[prost(string, tag = "1")] pub country_code: ::prost::alloc::string::String, #[prost(message, repeated, tag = "2")] pub cidr: ::prost::alloc::vec::Vec, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct GeoIpList { #[prost(message, repeated, tag = "1")] pub entry: ::prost::alloc::vec::Vec, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct GeoSite { #[prost(string, tag = "1")] pub country_code: ::prost::alloc::string::String, #[prost(message, repeated, tag = "2")] pub domain: ::prost::alloc::vec::Vec, /// resource_hash instruct simplified config converter to load domain from geo file. #[prost(bytes = "vec", tag = "3")] pub resource_hash: ::prost::alloc::vec::Vec, #[prost(string, tag = "4")] pub code: ::prost::alloc::string::String, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct GeoSiteList { #[prost(message, repeated, tag = "1")] pub entry: ::prost::alloc::vec::Vec, }