1#![allow(missing_docs)]
4
5use serde::{Deserialize, Serialize};
6
7#[derive(Debug, Clone, Serialize, Deserialize)]
9pub struct DebugSnapshot {
10 pub version: u32,
12 pub generated_at_unix_secs: u64,
14 pub node: DebugNodeSnapshot,
16 pub stats: DebugStatsSnapshot,
18 pub peers: Vec<DebugPeerSnapshot>,
20 pub discovered_peers: Vec<DebugDiscoveredPeerSnapshot>,
22 pub routes: Vec<DebugRouteSnapshot>,
24 pub gateways: Vec<DebugGatewaySnapshot>,
26}
27
28#[derive(Debug, Clone, Serialize, Deserialize)]
30pub struct DebugNodeSnapshot {
31 pub name: String,
32 pub node_id: String,
33 pub short_id: String,
34 pub is_gateway: bool,
35 pub mesh_ip: String,
36 pub mesh_prefix_len: u8,
37}
38
39#[derive(Debug, Clone, Serialize, Deserialize)]
41pub struct DebugStatsSnapshot {
42 pub peers: usize,
43 pub routes: usize,
44 pub packets_forwarded: u64,
45 pub bytes_forwarded: u64,
46 pub packets_dropped: u64,
47 pub congestion_drops: u64,
48 pub conntrack_size: usize,
49 pub uptime_secs: u64,
50}
51
52#[derive(Debug, Clone, Serialize, Deserialize)]
54pub struct DebugPeerSnapshot {
55 pub node_id: String,
56 pub short_id: String,
57 pub addr: Option<String>,
58 pub mechanism: Option<String>,
59 pub direct: bool,
60 pub configured: bool,
61 pub discovered: bool,
62 pub last_heartbeat_age_ms: Option<u64>,
63}
64
65#[derive(Debug, Clone, Serialize, Deserialize)]
67pub struct DebugDiscoveredPeerSnapshot {
68 pub node_id: String,
69 pub short_id: String,
70 pub addr: String,
71 pub is_client: bool,
72 pub is_relay: bool,
73 pub is_gateway: bool,
74 pub last_seen_age_ms: u64,
75}
76
77#[derive(Debug, Clone, Serialize, Deserialize)]
79pub struct DebugRouteSnapshot {
80 pub destination_id: String,
81 pub destination_short_id: String,
82 pub next_hop_id: String,
83 pub next_hop_short_id: String,
84 pub learned_from_id: String,
85 pub learned_from_short_id: String,
86 pub hops: u8,
87 pub is_gateway: bool,
88 pub gateway_load: u8,
89 pub rtt_ms: Option<u32>,
90 pub mesh_ip: Option<String>,
91 pub age_ms: u64,
92 pub next_hop_blacklisted: bool,
93}
94
95#[derive(Debug, Clone, Serialize, Deserialize)]
97pub struct DebugGatewaySnapshot {
98 pub node_id: String,
99 pub short_id: String,
100 pub next_hop_id: String,
101 pub next_hop_short_id: String,
102 pub hops: u8,
103 pub gateway_load: u8,
104 pub rtt_ms: Option<u32>,
105 pub score: u32,
106 pub selected: bool,
107 pub mesh_ip: Option<String>,
108}