Files
Easytier_lkddi/easytier/src/peers/mod.rs
T

41 lines
1002 B
Rust
Raw Normal View History

2023-09-23 01:53:45 +00:00
pub mod peer;
2024-04-24 23:12:46 +08:00
// pub mod peer_conn;
pub mod peer_conn;
2024-04-24 23:12:46 +08:00
pub mod peer_conn_ping;
2023-09-23 01:53:45 +00:00
pub mod peer_manager;
pub mod peer_map;
2024-03-18 17:16:33 +08:00
pub mod peer_ospf_route;
2023-09-23 01:53:45 +00:00
pub mod peer_rpc;
pub mod route_trait;
pub mod rpc_service;
2024-03-06 20:59:17 +08:00
pub mod foreign_network_client;
pub mod foreign_network_manager;
2024-04-27 13:44:59 +08:00
pub mod encrypt;
2023-09-23 01:53:45 +00:00
#[cfg(test)]
pub mod tests;
2024-03-18 17:14:43 +08:00
2024-04-24 23:12:46 +08:00
use crate::tunnel::packet_def::ZCPacket;
2024-03-18 17:14:43 +08:00
#[async_trait::async_trait]
#[auto_impl::auto_impl(Arc)]
pub trait PeerPacketFilter {
2024-04-24 23:12:46 +08:00
async fn try_process_packet_from_peer(&self, _zc_packet: ZCPacket) -> Option<ZCPacket> {
Some(_zc_packet)
2024-03-18 17:14:43 +08:00
}
}
#[async_trait::async_trait]
#[auto_impl::auto_impl(Arc)]
pub trait NicPacketFilter {
2024-04-24 23:12:46 +08:00
async fn try_process_packet_from_nic(&self, data: &mut ZCPacket);
2024-03-18 17:14:43 +08:00
}
type BoxPeerPacketFilter = Box<dyn PeerPacketFilter + Send + Sync>;
type BoxNicPacketFilter = Box<dyn NicPacketFilter + Send + Sync>;
2024-04-24 23:12:46 +08:00
pub type PacketRecvChan = tokio::sync::mpsc::Sender<ZCPacket>;
pub type PacketRecvChanReceiver = tokio::sync::mpsc::Receiver<ZCPacket>;