pub struct ScionStack { /* private fields */ }Expand description
The SCION stack can be used to create path-aware SCION sockets or even Quic over SCION connections.
The SCION stack abstracts over the underlay stack that is used for the underlying transport.
Implementations§
Source§impl ScionStack
impl ScionStack
Sourcepub async fn bind(
&self,
bind_addr: Option<SocketAddr>,
) -> Result<UdpScionSocket, ScionSocketBindError>
pub async fn bind( &self, bind_addr: Option<SocketAddr>, ) -> Result<UdpScionSocket, ScionSocketBindError>
Sourcepub async fn connect(
&self,
remote_addr: SocketAddr,
bind_addr: Option<SocketAddr>,
) -> Result<UdpScionSocket, ScionSocketBindError>
pub async fn connect( &self, remote_addr: SocketAddr, bind_addr: Option<SocketAddr>, ) -> Result<UdpScionSocket, ScionSocketBindError>
Sourcepub async fn bind_with_time(
&self,
bind_addr: Option<SocketAddr>,
now: Instant,
) -> Result<UdpScionSocket, ScionSocketBindError>
pub async fn bind_with_time( &self, bind_addr: Option<SocketAddr>, now: Instant, ) -> Result<UdpScionSocket, ScionSocketBindError>
Bind a socket with controlled time for port allocation.
This allows tests to control port reservation timing without sleeping.
Sourcepub async fn bind_scmp(
&self,
bind_addr: Option<SocketAddr>,
) -> Result<ScmpScionSocket, ScionSocketBindError>
pub async fn bind_scmp( &self, bind_addr: Option<SocketAddr>, ) -> Result<ScmpScionSocket, ScionSocketBindError>
Sourcepub async fn bind_raw(
&self,
bind_addr: Option<SocketAddr>,
) -> Result<RawScionSocket, ScionSocketBindError>
pub async fn bind_raw( &self, bind_addr: Option<SocketAddr>, ) -> Result<RawScionSocket, ScionSocketBindError>
Create a raw SCION socket. A raw SCION socket can be used to send and receive raw SCION packets. It is still bound to a specific UDP port because this is needed for packets to be routed in a dispatcherless autonomous system. See https://docs.scion.org/en/latest/dev/design/router-port-dispatch.html for a more detailed explanation.
§Arguments
bind_addr- The address to bind the socket to. If None, an available address will be used.
§Returns
A raw SCION socket.
Sourcepub async fn bind_path_unaware(
&self,
bind_addr: Option<SocketAddr>,
) -> Result<PathUnawareUdpScionSocket, ScionSocketBindError>
pub async fn bind_path_unaware( &self, bind_addr: Option<SocketAddr>, ) -> Result<PathUnawareUdpScionSocket, ScionSocketBindError>
Create a path-unaware SCION socket for advanced use cases.
This socket can send and receive datagrams, but requires explicit paths for sending. Use this when you need full control over path selection.
§Arguments
bind_addr- The address to bind the socket to. If None, an available address will be used.
§Returns
A path-unaware SCION socket.
Sourcepub async fn quic_endpoint(
&self,
bind_addr: Option<SocketAddr>,
config: EndpointConfig,
server_config: Option<ServerConfig>,
runtime: Option<Arc<dyn Runtime>>,
) -> Result<Endpoint>
pub async fn quic_endpoint( &self, bind_addr: Option<SocketAddr>, config: EndpointConfig, server_config: Option<ServerConfig>, runtime: Option<Arc<dyn Runtime>>, ) -> Result<Endpoint>
Create a QUIC over SCION endpoint.
This is a convenience method that creates a QUIC (quinn) endpoint over a SCION socket.
§Arguments
bind_addr- The address to bind the socket to. If None, an available address will be used.config- The quinn endpoint configuration.server_config- The quinn server configuration.runtime- The runtime to spawn tasks on.
§Returns
A QUIC endpoint that can be used to accept or create QUIC connections.
Sourcepub fn local_addresses(&self) -> Vec<EndhostAddr>
pub fn local_addresses(&self) -> Vec<EndhostAddr>
Get the list of local addresses assigned to the endhost.
§Returns
A list of local addresses assigned to the endhost.
Sourcepub fn default_path_manager(&self) -> Arc<CachingPathManager>
pub fn default_path_manager(&self) -> Arc<CachingPathManager>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ScionStack
impl !RefUnwindSafe for ScionStack
impl Send for ScionStack
impl Sync for ScionStack
impl Unpin for ScionStack
impl !UnwindSafe for ScionStack
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request