use async_net::Ipv4Addr;
use async_trait::async_trait;
use nanorpc::nanorpc_derive;
use serde::{Deserialize, Serialize};
use smol_str::SmolStr;
use crate::binder::protocol::BlindToken;
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct ClientTelemetry {
pub version: SmolStr,
pub platform: SmolStr,
}
#[nanorpc_derive]
#[async_trait]
pub trait ClientExitProtocol {
async fn validate(&self, token: BlindToken) -> bool;
async fn telemetry_heartbeat(&self, tele: ClientTelemetry);
async fn get_vpn_ipv4(&self) -> Option<Ipv4Addr>;
}
pub const CLIENT_EXIT_PSEUDOHOST: &str = "@client-exit";