network fixes

This commit is contained in:
John Smith
2023-07-16 12:28:27 -04:00
parent 823db3adf2
commit 3b76b1f81f
7 changed files with 176 additions and 114 deletions

View File

@@ -467,6 +467,23 @@ impl VeilidAPI {
let routing_table = self.network_manager()?.routing_table();
Ok(routing_table.debug_info_dialinfo())
}
async fn debug_peerinfo(&self, args: String) -> VeilidAPIResult<String> {
// Dump routing table peerinfo
let args: Vec<String> = args.split_whitespace().map(|s| s.to_owned()).collect();
let routing_table = self.network_manager()?.routing_table();
let routing_domain = get_debug_argument_at(
&args,
0,
"debug_peerinfo",
"routing_domain",
get_routing_domain,
)
.ok()
.unwrap_or(RoutingDomain::PublicInternet);
Ok(routing_table.debug_info_peerinfo(routing_domain))
}
async fn debug_txtrecord(&self, _args: String) -> VeilidAPIResult<String> {
// Dump routing table txt record
@@ -1327,6 +1344,7 @@ impl VeilidAPI {
pub async fn debug_help(&self, _args: String) -> VeilidAPIResult<String> {
Ok(r#"buckets [dead|reliable]
dialinfo
peerinfo [routingdomain]
entries [dead|reliable]
entry <node>
nodeinfo
@@ -1400,6 +1418,8 @@ record list <local|remote>
self.debug_buckets(rest).await
} else if arg == "dialinfo" {
self.debug_dialinfo(rest).await
} else if arg == "peerinfo" {
self.debug_peerinfo(rest).await
} else if arg == "txtrecord" {
self.debug_txtrecord(rest).await
} else if arg == "keypair" {