use std::time::SystemTime;
use serde::{Deserialize, Serialize};
use crate::vortix_core::profile::ProfileId;
#[derive(Debug, Clone, Serialize, Deserialize)]
#[non_exhaustive]
pub enum UserCommand {
Connect {
profile_id: ProfileId,
},
Disconnect,
Reconnect,
ForceDisconnect,
UserAnswered {
prompt_id: String,
answer: String,
},
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[non_exhaustive]
pub enum LinkState {
Up,
Down,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[non_exhaustive]
pub enum ProfileChange {
Renamed {
profile_id: ProfileId,
old_display_name: String,
new_display_name: String,
},
Deleted {
profile_id: ProfileId,
},
Imported {
profile_id: ProfileId,
},
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[non_exhaustive]
pub enum TunnelStatusObservation {
Active {
profile_id: ProfileId,
interface_name: String,
started_at: SystemTime,
},
Inactive {
profile_id: ProfileId,
},
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[non_exhaustive]
pub enum TelemetryReport {
Ip(Option<String>),
Latency(u64),
PacketLoss(f32),
Jitter(u64),
Dns(String),
Ipv6Leak(bool),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[non_exhaustive]
pub enum Input {
UserCommand(UserCommand),
Tick,
NetworkLinkChanged(LinkState),
TelemetryReport(TelemetryReport),
ProfileChanged(ProfileChange),
TunnelStatusObserved(TunnelStatusObservation),
}