mirror of
https://mirror.suhoan.cn/https://github.com/EasyTier/EasyTier.git
synced 2025-12-16 22:57:24 +08:00
use ospf route to propogate foreign network info
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
use std::{net::Ipv4Addr, sync::Arc};
|
||||
|
||||
use crate::common::PeerId;
|
||||
use dashmap::DashMap;
|
||||
|
||||
use crate::{
|
||||
common::PeerId,
|
||||
proto::peer_rpc::{ForeignNetworkRouteInfoEntry, ForeignNetworkRouteInfoKey},
|
||||
};
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub enum NextHopPolicy {
|
||||
@@ -14,10 +19,16 @@ impl Default for NextHopPolicy {
|
||||
}
|
||||
}
|
||||
|
||||
pub type ForeignNetworkRouteInfoMap =
|
||||
DashMap<ForeignNetworkRouteInfoKey, ForeignNetworkRouteInfoEntry>;
|
||||
|
||||
#[async_trait::async_trait]
|
||||
pub trait RouteInterface {
|
||||
async fn list_peers(&self) -> Vec<PeerId>;
|
||||
fn my_peer_id(&self) -> PeerId;
|
||||
async fn list_foreign_networks(&self) -> ForeignNetworkRouteInfoMap {
|
||||
DashMap::new()
|
||||
}
|
||||
}
|
||||
|
||||
pub type RouteInterfaceBox = Box<dyn RouteInterface + Send + Sync>;
|
||||
|
||||
Reference in New Issue
Block a user