nullnet-libappguard 0.1.11

An application-level firewall designed to secure and control network traffic
Documentation
// This file is @generated by prost-build.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthorizationRequest {
    #[prost(string, tag = "1")]
    pub uuid: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub code: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub category: ::prost::alloc::string::String,
    #[prost(string, tag = "4")]
    pub r#type: ::prost::alloc::string::String,
    #[prost(string, tag = "5")]
    pub target_os: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Authentication {
    #[prost(string, tag = "1")]
    pub app_id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub app_secret: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ClientMessage {
    #[prost(oneof = "client_message::Message", tags = "1, 2")]
    pub message: ::core::option::Option<client_message::Message>,
}
/// Nested message and enum types in `ClientMessage`.
pub mod client_message {
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Message {
        #[prost(message, tag = "1")]
        AuthorizationRequest(super::AuthorizationRequest),
        #[prost(message, tag = "2")]
        Authentication(super::Authentication),
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthenticationData {
    #[prost(string, optional, tag = "1")]
    pub app_id: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "2")]
    pub app_secret: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ServerMessage {
    #[prost(oneof = "server_message::Message", tags = "1, 2, 3, 4, 5, 6")]
    pub message: ::core::option::Option<server_message::Message>,
}
/// Nested message and enum types in `ServerMessage`.
pub mod server_message {
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Message {
        #[prost(string, tag = "1")]
        UpdateTokenCommand(::prost::alloc::string::String),
        #[prost(message, tag = "2")]
        SetFirewallDefaults(super::FirewallDefaults),
        #[prost(message, tag = "3")]
        Heartbeat(()),
        #[prost(message, tag = "4")]
        DeviceAuthorized(super::AuthenticationData),
        #[prost(message, tag = "5")]
        DeviceDeauthorized(()),
        #[prost(message, tag = "6")]
        AuthorizationRejected(()),
    }
}
#[derive(serde::Deserialize)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct FirewallDefaults {
    #[prost(uint32, tag = "1")]
    pub timeout: u32,
    #[prost(enumeration = "FirewallPolicy", tag = "2")]
    pub policy: i32,
    #[prost(bool, tag = "3")]
    pub cache: bool,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum FirewallPolicy {
    Unknown = 0,
    Allow = 1,
    Deny = 2,
}
impl FirewallPolicy {
    /// 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::Unknown => "UNKNOWN",
            Self::Allow => "ALLOW",
            Self::Deny => "DENY",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "UNKNOWN" => Some(Self::Unknown),
            "ALLOW" => Some(Self::Allow),
            "DENY" => Some(Self::Deny),
            _ => None,
        }
    }
}