network class refactor checkpoint

This commit is contained in:
John Smith
2022-04-22 21:30:09 -04:00
parent 5b0ade9f49
commit 99dc4e16f9
10 changed files with 571 additions and 394 deletions

View File

@@ -162,6 +162,10 @@ impl Network {
self.inner.lock().network_needs_restart
}
pub fn restart_network(&self) {
self.inner.lock().network_needs_restart = true;
}
pub async fn shutdown(&self) {
trace!("stopping network");
@@ -178,6 +182,18 @@ impl Network {
trace!("network stopped");
}
pub fn with_interface_addresses<F, R>(&self, f: F) -> R
where
F: FnOnce(&[IpAddr]) -> R,
{
f(&[])
}
pub async fn check_interface_addresses(&self) -> Result<bool, String> {
Ok(false)
}
//////////////////////////////////////////
pub fn get_network_class(&self) -> Option<NetworkClass> {
// xxx eventually detect tor browser?