#![allow(missing_docs)]
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DebugSnapshot {
pub version: u32,
pub generated_at_unix_secs: u64,
pub node: DebugNodeSnapshot,
pub stats: DebugStatsSnapshot,
pub peers: Vec<DebugPeerSnapshot>,
pub discovered_peers: Vec<DebugDiscoveredPeerSnapshot>,
pub routes: Vec<DebugRouteSnapshot>,
pub gateways: Vec<DebugGatewaySnapshot>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DebugNodeSnapshot {
pub name: String,
pub node_id: String,
pub short_id: String,
pub is_gateway: bool,
pub mesh_ip: String,
pub mesh_prefix_len: u8,
pub request_dynamic_ip: bool,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DebugStatsSnapshot {
pub peers: usize,
pub routes: usize,
pub packets_forwarded: u64,
pub bytes_forwarded: u64,
pub packets_dropped: u64,
pub congestion_drops: u64,
pub conntrack_size: usize,
pub uptime_secs: u64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DebugPeerSnapshot {
pub node_id: String,
pub short_id: String,
pub addr: Option<String>,
pub mechanism: Option<String>,
pub direct: bool,
pub configured: bool,
pub discovered: bool,
pub last_heartbeat_age_ms: Option<u64>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DebugDiscoveredPeerSnapshot {
pub node_id: String,
pub short_id: String,
pub addr: String,
pub is_client: bool,
pub is_relay: bool,
pub is_gateway: bool,
pub last_seen_age_ms: u64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DebugRouteSnapshot {
pub destination_id: String,
pub destination_short_id: String,
pub next_hop_id: String,
pub next_hop_short_id: String,
pub learned_from_id: String,
pub learned_from_short_id: String,
pub hops: u8,
pub is_gateway: bool,
pub gateway_load: u8,
pub rtt_ms: Option<u32>,
pub mesh_ip: Option<String>,
pub age_ms: u64,
pub next_hop_blacklisted: bool,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DebugGatewaySnapshot {
pub node_id: String,
pub short_id: String,
pub next_hop_id: String,
pub next_hop_short_id: String,
pub hops: u8,
pub gateway_load: u8,
pub rtt_ms: Option<u32>,
pub score: u32,
pub selected: bool,
pub mesh_ip: Option<String>,
}