Skip to main content

rtc_shared/ifaces/ffi/
mod.rs

1#[cfg(target_family = "windows")]
2mod windows;
3#[cfg(target_family = "windows")]
4pub use self::windows::ifaces;
5
6#[cfg(target_family = "unix")]
7mod unix;
8#[cfg(target_family = "unix")]
9pub use self::unix::ifaces;
10
11/// Enumerates local network interfaces.
12///
13/// This is the fallback for platforms that are neither Windows nor Unix: it always returns
14/// [`ErrorKind::Unsupported`](std::io::ErrorKind::Unsupported). ICE gathering treats that as
15/// "no host candidates from interface enumeration" and falls back to the addresses the caller
16/// supplied explicitly.
17///
18/// # Errors
19///
20/// Always fails on such platforms.
21#[cfg(not(any(target_family = "windows", target_family = "unix")))]
22pub fn ifaces() -> Result<Vec<super::Interface>, std::io::Error> {
23    Err(std::io::Error::new(
24        std::io::ErrorKind::Unsupported,
25        "ifaces is not supported on this platform",
26    ))
27}