pub struct DataPlane {
pub wireguard: Endpoint,
pub or_out: Router,
pub ur_out: Router,
pub src_filter_in: Arc<Table<NodePublicKey>>,
pub or_in: Router,
pub packet_filter: Arc<dyn Filter + Send + Sync>,
pub events: Scheduler<Subsystem>,
pub wg_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<NodePublicKey>>Inbound source filter.
or_in: RouterInbound overlay router.
packet_filter: Arc<dyn Filter + Send + Sync>The packet filter.
events: Scheduler<Subsystem>Events queued for future processing.
wg_next: Option<Handle<Subsystem>>Next event for the wireguard 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) -> EventResult
pub fn process_events(&mut self) -> EventResult
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 Freeze for DataPlane
impl !RefUnwindSafe for DataPlane
impl Send for DataPlane
impl Sync for DataPlane
impl Unpin for DataPlane
impl UnsafeUnpin for DataPlane
impl !UnwindSafe 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
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