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 bind_with_config(
&self,
bind_addr: Option<SocketAddr>,
socket_config: SocketConfig,
) -> Result<UdpScionSocket, ScionSocketBindError>
pub async fn bind_with_config( &self, bind_addr: Option<SocketAddr>, socket_config: SocketConfig, ) -> Result<UdpScionSocket, ScionSocketBindError>
Sourcepub async fn connect(
&self,
remote_addr: SocketAddr,
bind_addr: Option<SocketAddr>,
) -> Result<UdpScionSocket, ScionSocketConnectError>
pub async fn connect( &self, remote_addr: SocketAddr, bind_addr: Option<SocketAddr>, ) -> Result<UdpScionSocket, ScionSocketConnectError>
Sourcepub async fn connect_with_config(
&self,
remote_addr: SocketAddr,
bind_addr: Option<SocketAddr>,
socket_config: SocketConfig,
) -> Result<UdpScionSocket, ScionSocketConnectError>
pub async fn connect_with_config( &self, remote_addr: SocketAddr, bind_addr: Option<SocketAddr>, socket_config: SocketConfig, ) -> Result<UdpScionSocket, ScionSocketConnectError>
Create a connected path-aware SCION socket with custom configuration.
§Arguments
remote_addr- The remote address to connect to.bind_addr- The address to bind the socket to. If None, an available address will be used.socket_config- Configuration for the socket
§Returns
A connected path-aware SCION socket.
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 async fn quic_endpoint_with_config(
&self,
bind_addr: Option<SocketAddr>,
config: EndpointConfig,
server_config: Option<ServerConfig>,
runtime: Option<Arc<dyn Runtime>>,
socket_config: SocketConfig,
) -> Result<Endpoint>
pub async fn quic_endpoint_with_config( &self, bind_addr: Option<SocketAddr>, config: EndpointConfig, server_config: Option<ServerConfig>, runtime: Option<Arc<dyn Runtime>>, socket_config: SocketConfig, ) -> Result<Endpoint>
Create a QUIC over SCION endpoint using custom socket configuration.
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.socket_config- Scion Socket configuration
§Returns
A QUIC endpoint that can be used to accept or create QUIC connections.
Sourcepub fn local_ases(&self) -> Vec<IsdAsn>
pub fn local_ases(&self) -> Vec<IsdAsn>
Get the list of local ISD-ASes available on the endhost.
§Returns
A list of local ISD-AS identifiers.
Sourcepub fn create_path_manager(&self) -> MultiPathManager<PathFetcherImpl>
pub fn create_path_manager(&self) -> MultiPathManager<PathFetcherImpl>
Creates a path manager with default configuration.
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> 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 moreSource§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