pub struct DataPlane {
pub wireguard: Endpoint,
pub or_out: Router,
pub ur_out: Router,
pub src_filter_in: Arc<Table<PeerId>>,
pub or_in: Router,
pub packet_filter: Arc<dyn Filter + Send + Sync>,
pub active_peers: HashMap<PeerId, Instant>,
pub events: Scheduler<Subsystem>,
pub wg_next: Option<Handle<Subsystem>>,
pub peer_gc_next: Option<Handle<Subsystem>>,
}Expand description
Transforms packets to make tailscale happen.
Fields§
§wireguard: EndpointWireguard encryption/decryption.
or_out: RouterOutbound overlay router.
ur_out: RouterOutbound underlay router.
src_filter_in: Arc<Table<PeerId>>Inbound source filter.
or_in: RouterInbound overlay router.
packet_filter: Arc<dyn Filter + Send + Sync>The packet filter.
active_peers: HashMap<PeerId, Instant>Per-peer timestamps of last outgoing data packets.
Used to determine whether we should be running path discovery for this peer.
events: Scheduler<Subsystem>Events queued for future processing.
wg_next: Option<Handle<Subsystem>>Next event for the wireguard subsystem.
peer_gc_next: Option<Handle<Subsystem>>Next event for the peer gc subsystem.
Implementations§
Source§impl DataPlane
impl DataPlane
Sourcepub fn new(my_key: NodeKeyPair) -> Self
pub fn new(my_key: NodeKeyPair) -> Self
Creates a new data plane for a wireguard node key.
Sourcepub fn process_outbound(&mut self, packets: Vec<PacketMut>) -> OutboundResult
pub fn process_outbound(&mut self, packets: Vec<PacketMut>) -> OutboundResult
Processes packets originating from the local device.
Sourcepub fn process_inbound(
&mut self,
packets: impl IntoIterator<Item = PacketMut>,
) -> InboundResult
pub fn process_inbound( &mut self, packets: impl IntoIterator<Item = PacketMut>, ) -> InboundResult
Processes packets received from elsewhere.
Sourcepub fn next_event(&self) -> Option<Instant>
pub fn next_event(&self) -> Option<Instant>
Return the next time at which DataPlane::process_events must be called.
DataPlane::process_outbound, DataPlane::process_inbound and
DataPlane::process_events may all update the next event time. Callers should prefer
calling next_event as needed to get a correct result, rather than store the returned
value.
Sourcepub fn process_events(&mut self) -> Result
pub fn process_events(&mut self) -> Result
Process all queued events that are due for processing.
Must be called at least as often as dictated by DataPlane::next_event for the
data plane to function correctly. It is harmless to call it more frequently.
Auto Trait Implementations§
impl !RefUnwindSafe for DataPlane
impl !Unpin for DataPlane
impl !UnwindSafe for DataPlane
impl Freeze for DataPlane
impl Send for DataPlane
impl Sync for DataPlane
impl UnsafeUnpin for DataPlane
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more