moved structs to their own files

added time since last state change
This commit is contained in:
2025-04-20 15:56:03 -04:00
parent 7bd745635b
commit 81bf3cf61d
8 changed files with 186 additions and 356 deletions
+21
View File
@@ -0,0 +1,21 @@
use std::net::Ipv4Addr;
use std::time::SystemTime;
#[derive(Clone)]
pub struct TargetState {
pub target: Ipv4Addr,
pub alive: bool,
pub last_rtt: u32,
pub last_alive_change: SystemTime
}
impl Default for TargetState {
fn default() -> Self {
TargetState {
target: Ipv4Addr::new(127, 0, 0, 1),
alive: false,
last_rtt: 0,
last_alive_change: SystemTime::now()
}
}
}