pub struct DatagramApi<I, C, S>(/* private fields */);
Expand description
The shared datagram socket API.
Implementations§
Source§impl<I, C, S> DatagramApi<I, C, S>
impl<I, C, S> DatagramApi<I, C, S>
Source§impl<I, C, S> DatagramApi<I, C, S>where
I: IpExt,
C: ContextPair,
C::BindingsContext: DatagramStateBindingsContext<I, S>,
C::CoreContext: DatagramStateContext<I, C::BindingsContext, S>,
S: DatagramSocketSpec,
impl<I, C, S> DatagramApi<I, C, S>where
I: IpExt,
C: ContextPair,
C::BindingsContext: DatagramStateBindingsContext<I, S>,
C::CoreContext: DatagramStateContext<I, C::BindingsContext, S>,
S: DatagramSocketSpec,
Sourcepub fn create(
&mut self,
external_data: S::ExternalData<I>,
) -> S::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>
pub fn create( &mut self, external_data: S::ExternalData<I>, ) -> S::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>
Creates a new datagram socket and inserts it into the list of all open
datagram sockets for the provided spec S
.
The caller is responsible for calling [close
] when it’s done with the
resource.
Sourcepub fn collect_all_sockets(
&mut self,
) -> Vec<S::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>>
pub fn collect_all_sockets( &mut self, ) -> Vec<S::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>>
Collects all currently opened sockets.
Sourcepub fn close(
&mut self,
id: <S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>,
) -> RemoveResourceResultWithContext<S::ExternalData<I>, C::BindingsContext>
pub fn close( &mut self, id: <S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>, ) -> RemoveResourceResultWithContext<S::ExternalData<I>, C::BindingsContext>
Closes the socket.
Sourcepub fn get_info(
&mut self,
id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>,
) -> SocketInfo<I::Addr, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>
pub fn get_info( &mut self, id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>, ) -> SocketInfo<I::Addr, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>
Returns the socket’s bound/connection state information.
Sourcepub fn listen(
&mut self,
id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>,
addr: Option<ZonedAddr<SpecifiedAddr<I::Addr>, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>>,
local_id: Option<<S::AddrSpec as SocketMapAddrSpec>::LocalIdentifier>,
) -> Result<(), Either<ExpectedUnboundError, LocalAddressError>>
pub fn listen( &mut self, id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>, addr: Option<ZonedAddr<SpecifiedAddr<I::Addr>, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>>, local_id: Option<<S::AddrSpec as SocketMapAddrSpec>::LocalIdentifier>, ) -> Result<(), Either<ExpectedUnboundError, LocalAddressError>>
Binds the socket to a local address and port.
Sourcepub fn connect(
&mut self,
id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>,
remote_ip: Option<ZonedAddr<SpecifiedAddr<I::Addr>, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>>,
remote_id: <S::AddrSpec as SocketMapAddrSpec>::RemoteIdentifier,
extra: S::ConnStateExtra,
) -> Result<(), ConnectError>
pub fn connect( &mut self, id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>, remote_ip: Option<ZonedAddr<SpecifiedAddr<I::Addr>, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>>, remote_id: <S::AddrSpec as SocketMapAddrSpec>::RemoteIdentifier, extra: S::ConnStateExtra, ) -> Result<(), ConnectError>
Connects the datagram socket.
Sourcepub fn disconnect_connected(
&mut self,
id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>,
) -> Result<(), ExpectedConnError>
pub fn disconnect_connected( &mut self, id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>, ) -> Result<(), ExpectedConnError>
Disconnects a connected socket.
Sourcepub fn get_shutdown_connected(
&mut self,
id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>,
) -> Option<ShutdownType>
pub fn get_shutdown_connected( &mut self, id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>, ) -> Option<ShutdownType>
Returns the socket’s shutdown state.
Sourcepub fn shutdown_connected(
&mut self,
id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>,
which: ShutdownType,
) -> Result<(), ExpectedConnError>
pub fn shutdown_connected( &mut self, id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>, which: ShutdownType, ) -> Result<(), ExpectedConnError>
Shuts down the socket.
which
determines the shutdown type.
Sourcepub fn send_conn<B: BufferMut>(
&mut self,
id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>,
body: B,
) -> Result<(), SendError<S::SerializeError>>
pub fn send_conn<B: BufferMut>( &mut self, id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>, body: B, ) -> Result<(), SendError<S::SerializeError>>
Sends data over a connected datagram socket.
Sourcepub fn send_to<B: BufferMut>(
&mut self,
id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>,
remote_ip: Option<ZonedAddr<SpecifiedAddr<I::Addr>, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>>,
remote_identifier: <S::AddrSpec as SocketMapAddrSpec>::RemoteIdentifier,
body: B,
) -> Result<(), Either<LocalAddressError, SendToError<S::SerializeError>>>
pub fn send_to<B: BufferMut>( &mut self, id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>, remote_ip: Option<ZonedAddr<SpecifiedAddr<I::Addr>, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>>, remote_identifier: <S::AddrSpec as SocketMapAddrSpec>::RemoteIdentifier, body: B, ) -> Result<(), Either<LocalAddressError, SendToError<S::SerializeError>>>
Sends a datagram to the provided remote node.
Sourcepub fn get_bound_device(
&mut self,
id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>,
) -> Option<<<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>
pub fn get_bound_device( &mut self, id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>, ) -> Option<<<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>
Returns the bound device for the socket.
Sourcepub fn set_device(
&mut self,
id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>,
new_device: Option<&<<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>,
) -> Result<(), SocketError>
pub fn set_device( &mut self, id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>, new_device: Option<&<<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>, ) -> Result<(), SocketError>
Sets the socket’s bound device to new_device
.
Sourcepub fn set_multicast_membership(
&mut self,
id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>,
multicast_group: MulticastAddr<I::Addr>,
interface: MulticastMembershipInterfaceSelector<I::Addr, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>,
want_membership: bool,
) -> Result<(), SetMulticastMembershipError>
pub fn set_multicast_membership( &mut self, id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>, multicast_group: MulticastAddr<I::Addr>, interface: MulticastMembershipInterfaceSelector<I::Addr, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>, want_membership: bool, ) -> Result<(), SetMulticastMembershipError>
Sets the specified socket’s membership status for the given group.
An error is returned if the membership change request is invalid (e.g. leaving a group that was not joined, or joining a group multiple times) or if the device to use to join is unspecified or conflicts with the existing socket state.
Sourcepub fn update_ip_hop_limit(
&mut self,
id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>,
update: impl FnOnce(&mut SocketHopLimits<I>),
)
pub fn update_ip_hop_limit( &mut self, id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>, update: impl FnOnce(&mut SocketHopLimits<I>), )
Updates the socket’s IP hop limits.
Sourcepub fn get_ip_hop_limits(
&mut self,
id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>,
) -> HopLimits
pub fn get_ip_hop_limits( &mut self, id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>, ) -> HopLimits
Returns the socket’s IP hop limits.
Sourcepub fn with_other_stack_ip_options_mut_if_unbound<R>(
&mut self,
id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>,
cb: impl FnOnce(&mut S::OtherStackIpOptions<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>) -> R,
) -> Result<R, ExpectedUnboundError>
pub fn with_other_stack_ip_options_mut_if_unbound<R>( &mut self, id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>, cb: impl FnOnce(&mut S::OtherStackIpOptions<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>) -> R, ) -> Result<R, ExpectedUnboundError>
Calls the callback with mutable access to [S::OtherStackIpOptions<I, D>
].
If the socket is bound, the callback is not called, and instead an
ExpectedUnboundError
is returned.
Sourcepub fn with_other_stack_ip_options_mut<R>(
&mut self,
id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>,
cb: impl FnOnce(&mut S::OtherStackIpOptions<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>) -> R,
) -> R
pub fn with_other_stack_ip_options_mut<R>( &mut self, id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>, cb: impl FnOnce(&mut S::OtherStackIpOptions<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>) -> R, ) -> R
Calls the callback with mutable access to [S::OtherStackIpOptions<I, D>
].
Sourcepub fn with_other_stack_ip_options<R>(
&mut self,
id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>,
cb: impl FnOnce(&S::OtherStackIpOptions<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>) -> R,
) -> R
pub fn with_other_stack_ip_options<R>( &mut self, id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>, cb: impl FnOnce(&S::OtherStackIpOptions<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>) -> R, ) -> R
Calls the callback with access to [S::OtherStackIpOptions<I, D>
].
Sourcepub fn with_other_stack_ip_options_and_default_hop_limits<R>(
&mut self,
id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>,
cb: impl FnOnce(&S::OtherStackIpOptions<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>, HopLimits) -> R,
) -> Result<R, NotDualStackCapableError>
pub fn with_other_stack_ip_options_and_default_hop_limits<R>( &mut self, id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>, cb: impl FnOnce(&S::OtherStackIpOptions<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>, HopLimits) -> R, ) -> Result<R, NotDualStackCapableError>
Calls the callback with access to [S::OtherStackIpOptions<I, D>
], and the
default [HopLimits
] for I::OtherVersion
.
If dualstack operations are not supported, the callback is not called, and
instead NotDualStackCapableError
is returned.
Sourcepub fn with_both_stacks_ip_options_mut<R>(
&mut self,
id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>,
cb: impl FnOnce(&mut DatagramIpSpecificSocketOptions<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>, &mut S::OtherStackIpOptions<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>) -> R,
) -> R
pub fn with_both_stacks_ip_options_mut<R>( &mut self, id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>, cb: impl FnOnce(&mut DatagramIpSpecificSocketOptions<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>, &mut S::OtherStackIpOptions<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>) -> R, ) -> R
Calls the callback with mutable access to
DatagramIpSpecificSocketOptions<I,D>
and
[S::OtherStackIpOptions<I, D>
].
Sourcepub fn with_both_stacks_ip_options<R>(
&mut self,
id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>,
cb: impl FnOnce(&DatagramIpSpecificSocketOptions<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>, &S::OtherStackIpOptions<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>) -> R,
) -> R
pub fn with_both_stacks_ip_options<R>( &mut self, id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>, cb: impl FnOnce(&DatagramIpSpecificSocketOptions<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>, &S::OtherStackIpOptions<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>) -> R, ) -> R
Calls the callback with access to DatagramIpSpecificSocketOptions<I, D>
and [S::OtherStackIpOptions<I, D>
].
Sourcepub fn update_sharing(
&mut self,
id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>,
f: impl FnOnce(&mut S::SharingState),
) -> Result<(), ExpectedUnboundError>
pub fn update_sharing( &mut self, id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>, f: impl FnOnce(&mut S::SharingState), ) -> Result<(), ExpectedUnboundError>
Updates the socket’s sharing state to the result of f
.
f
is given mutable access to the sharing state and is called under the
socket lock, allowing for atomic updates to the sharing state.
Sourcepub fn get_sharing(
&mut self,
id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>,
) -> S::SharingState
pub fn get_sharing( &mut self, id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>, ) -> S::SharingState
Returns the socket’s sharing state.
Sourcepub fn set_ip_transparent(
&mut self,
id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>,
value: bool,
)
pub fn set_ip_transparent( &mut self, id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>, value: bool, )
Sets the IP transparent option.
Sourcepub fn get_ip_transparent(
&mut self,
id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>,
) -> bool
pub fn get_ip_transparent( &mut self, id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>, ) -> bool
Returns the IP transparent option.
Sourcepub fn set_mark(
&mut self,
id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>,
domain: MarkDomain,
mark: Mark,
)
pub fn set_mark( &mut self, id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>, domain: MarkDomain, mark: Mark, )
Sets the socket mark at domain
.
Sourcepub fn get_mark(
&mut self,
id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>,
domain: MarkDomain,
) -> Mark
pub fn get_mark( &mut self, id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>, domain: MarkDomain, ) -> Mark
Returns the socket mark at domain
.
Sourcepub fn set_broadcast(
&mut self,
id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>,
value: Option<I::BroadcastMarker>,
)
pub fn set_broadcast( &mut self, id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>, value: Option<I::BroadcastMarker>, )
Sets the broadcast option.
Sourcepub fn get_broadcast(
&mut self,
id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>,
) -> Option<I::BroadcastMarker>
pub fn get_broadcast( &mut self, id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>, ) -> Option<I::BroadcastMarker>
Returns the broadcast option.
Sourcepub fn set_multicast_interface(
&mut self,
id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>,
value: Option<&<<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>,
)
pub fn set_multicast_interface( &mut self, id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>, value: Option<&<<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::DeviceId>, )
Sets the multicast interface for outgoing multicast packets.
Sourcepub fn get_multicast_interface(
&mut self,
id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>,
) -> Option<<<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>
pub fn get_multicast_interface( &mut self, id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>, ) -> Option<<<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>
Returns the configured multicast interface.
Sourcepub fn set_multicast_loop(
&mut self,
id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>,
value: bool,
)
pub fn set_multicast_loop( &mut self, id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>, value: bool, )
Sets the multicast loopback flag.
Sourcepub fn get_multicast_loop(
&mut self,
id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>,
) -> bool
pub fn get_multicast_loop( &mut self, id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>, ) -> bool
Returns the multicast loopback flag.
Sourcepub fn set_dscp_and_ecn(
&mut self,
id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>,
value: DscpAndEcn,
)
pub fn set_dscp_and_ecn( &mut self, id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>, value: DscpAndEcn, )
Sets the Traffic Class option.
Sourcepub fn get_dscp_and_ecn(
&mut self,
id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>,
) -> DscpAndEcn
pub fn get_dscp_and_ecn( &mut self, id: &<S as DatagramSocketSpec>::SocketId<I, <<C as ContextPair>::CoreContext as DeviceIdContext<AnyDevice>>::WeakDeviceId>, ) -> DscpAndEcn
Returns the Traffic Class option.