pub struct RawIpSocketConfig {
pub family: Option<PublicationAddressFamily>,
pub bind_addr: Option<IpAddr>,
pub interface_addr: Option<IpAddr>,
pub interface_index: Option<u32>,
}Expand description
Configuration for one generic raw-IP transmit socket.
An egress selector is mandatory. Supplying a local bind address or an interface address resolves a concrete interface index; supplying only an interface index requires an explicit address family.
Fields§
§family: Option<PublicationAddressFamily>Expected IP family. It is inferred from an IP-address selector when omitted, but is required for an index-only configuration.
bind_addr: Option<IpAddr>Optional exact local address used to bind the raw socket.
interface_addr: Option<IpAddr>Optional local address identifying the required egress interface.
interface_index: Option<u32>Optional required egress interface index.
Implementations§
Source§impl RawIpSocketConfig
impl RawIpSocketConfig
Sourcepub fn with_family(self, family: PublicationAddressFamily) -> Self
pub fn with_family(self, family: PublicationAddressFamily) -> Self
Pins the expected family for supplied datagrams.
Sourcepub fn with_bind_addr(self, bind_addr: impl Into<IpAddr>) -> Self
pub fn with_bind_addr(self, bind_addr: impl Into<IpAddr>) -> Self
Binds the raw socket to this exact local IP address when the platform supports it.
Sourcepub fn with_interface_addr(self, interface_addr: impl Into<IpAddr>) -> Self
pub fn with_interface_addr(self, interface_addr: impl Into<IpAddr>) -> Self
Selects the required egress interface by one of its local addresses.
Sourcepub fn with_interface_index(self, interface_index: u32) -> Self
pub fn with_interface_index(self, interface_index: u32) -> Self
Selects the required egress interface by its operating-system index.
Trait Implementations§
Source§impl Clone for RawIpSocketConfig
impl Clone for RawIpSocketConfig
Source§fn clone(&self) -> RawIpSocketConfig
fn clone(&self) -> RawIpSocketConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more