pub struct SubscriptionConfig {
pub group: IpAddr,
pub source: SourceFilter,
pub dst_port: u16,
pub interface: Option<IpAddr>,
pub interface_index: Option<u32>,
}Expand description
Configuration for a multicast receive subscription.
This defines the multicast group, source filtering mode (ASM or SSM), destination port, and optionally the local interface to join on.
Fields§
§group: IpAddrThe destination multicast group to join.
source: SourceFilterThe source filtering mode for the subscription.
dst_port: u16The destination UDP port to receive on.
interface: Option<IpAddr>The local interface address to join on, if explicitly specified.
interface_index: Option<u32>The local IPv6 interface index to join on, if explicitly specified.
This is primarily useful for scoped/link-local IPv6 multicast where an interface address alone may be ambiguous across multiple adapters.
Implementations§
Source§impl SubscriptionConfig
impl SubscriptionConfig
Sourcepub fn validate(&self) -> Result<(), McrxError>
pub fn validate(&self) -> Result<(), McrxError>
Validates the configuration and returns an error if it is not usable.
Sourcepub fn family(&self) -> SubscriptionAddressFamily
pub fn family(&self) -> SubscriptionAddressFamily
Returns the configured address family.
Sourcepub fn source_addr(&self) -> Option<IpAddr>
pub fn source_addr(&self) -> Option<IpAddr>
Returns the configured source address, if any.
Sourcepub fn asm(group: Ipv4Addr, port: u16) -> Self
pub fn asm(group: Ipv4Addr, port: u16) -> Self
Creates an ASM ((*, G)) subscription configuration.
Sourcepub fn asm_v6(group: Ipv6Addr, port: u16) -> Self
pub fn asm_v6(group: Ipv6Addr, port: u16) -> Self
Creates an IPv6 ASM ((*, G)) subscription configuration.
Sourcepub fn asm_ip(group: IpAddr, port: u16) -> Self
pub fn asm_ip(group: IpAddr, port: u16) -> Self
Creates an ASM ((*, G)) subscription configuration from any IP family.
Sourcepub fn ssm(group: Ipv4Addr, source: Ipv4Addr, port: u16) -> Self
pub fn ssm(group: Ipv4Addr, source: Ipv4Addr, port: u16) -> Self
Creates an SSM ((S, G)) subscription configuration.
Trait Implementations§
Source§impl Clone for SubscriptionConfig
impl Clone for SubscriptionConfig
Source§fn clone(&self) -> SubscriptionConfig
fn clone(&self) -> SubscriptionConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SubscriptionConfig
impl Debug for SubscriptionConfig
Source§impl PartialEq for SubscriptionConfig
impl PartialEq for SubscriptionConfig
Source§fn eq(&self, other: &SubscriptionConfig) -> bool
fn eq(&self, other: &SubscriptionConfig) -> bool
self and other values to be equal, and is used by ==.