pub struct UdpStateBuilder { /* private fields */ }
Expand description
A builder for UDP layer state.
Implementations§
Source§impl UdpStateBuilder
impl UdpStateBuilder
Sourcepub fn send_port_unreachable(
&mut self,
send_port_unreachable: bool,
) -> &mut Self
pub fn send_port_unreachable( &mut self, send_port_unreachable: bool, ) -> &mut Self
Enable or disable sending ICMP Port Unreachable messages in response to inbound UDP packets for which a corresponding local socket does not exist (default: disabled).
Responding with an ICMP Port Unreachable error is a vector for reflected Denial-of-Service (DoS) attacks. The attacker can send a UDP packet to a closed port with the source address set to the address of the victim, and ICMP response will be sent there.
According to RFC 1122 Section 4.1.3.1, “[i]f a datagram arrives addressed to a UDP port for which there is no pending LISTEN call, UDP SHOULD send an ICMP Port Unreachable message.” Since an ICMP response is not mandatory, and due to the security risks described, responses are disabled by default.
Sourcepub fn build<I: IpExt, D: WeakDeviceIdentifier, BT: UdpBindingsTypes>(
self,
) -> UdpState<I, D, BT>
pub fn build<I: IpExt, D: WeakDeviceIdentifier, BT: UdpBindingsTypes>( self, ) -> UdpState<I, D, BT>
Builds a new UdpState
for IP version I
.
Trait Implementations§
Source§impl Clone for UdpStateBuilder
impl Clone for UdpStateBuilder
Source§fn clone(&self) -> UdpStateBuilder
fn clone(&self) -> UdpStateBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Default for UdpStateBuilder
impl Default for UdpStateBuilder
Source§fn default() -> UdpStateBuilder
fn default() -> UdpStateBuilder
Auto Trait Implementations§
impl Freeze for UdpStateBuilder
impl RefUnwindSafe for UdpStateBuilder
impl Send for UdpStateBuilder
impl Sync for UdpStateBuilder
impl Unpin for UdpStateBuilder
impl UnwindSafe for UdpStateBuilder
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<O, BC> BuildableCoreContext<BC> for Owhere
O: Default,
impl<O, BC> BuildableCoreContext<BC> for Owhere
O: Default,
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)