resolve work
This commit is contained in:
@@ -871,6 +871,47 @@ impl VeilidAPI {
|
||||
Ok(format!("{:#?}", cm))
|
||||
}
|
||||
|
||||
async fn debug_resolve(&self, args: String) -> VeilidAPIResult<String> {
|
||||
let netman = self.network_manager()?;
|
||||
let routing_table = netman.routing_table();
|
||||
|
||||
let args: Vec<String> = args.split_whitespace().map(|s| s.to_owned()).collect();
|
||||
|
||||
let dest = async_get_debug_argument_at(
|
||||
&args,
|
||||
0,
|
||||
"debug_resolve",
|
||||
"destination",
|
||||
get_destination(routing_table.clone()),
|
||||
)
|
||||
.await?;
|
||||
|
||||
match &dest {
|
||||
Destination::Direct {
|
||||
target,
|
||||
safety_selection: _,
|
||||
} => Ok(format!(
|
||||
"Destination: {:#?}\nTarget Entry:\n{}\n",
|
||||
&dest,
|
||||
routing_table.debug_info_entry(target.clone())
|
||||
)),
|
||||
Destination::Relay {
|
||||
relay,
|
||||
target,
|
||||
safety_selection: _,
|
||||
} => Ok(format!(
|
||||
"Destination: {:#?}\nTarget Entry:\n{}\nRelay Entry:\n{}\n",
|
||||
&dest,
|
||||
routing_table.clone().debug_info_entry(target.clone()),
|
||||
routing_table.debug_info_entry(relay.clone())
|
||||
)),
|
||||
Destination::PrivateRoute {
|
||||
private_route: _,
|
||||
safety_selection: _,
|
||||
} => Ok(format!("Destination: {:#?}", &dest)),
|
||||
}
|
||||
}
|
||||
|
||||
async fn debug_ping(&self, args: String) -> VeilidAPIResult<String> {
|
||||
let netman = self.network_manager()?;
|
||||
let routing_table = netman.routing_table();
|
||||
|
||||
Reference in New Issue
Block a user