forked from Deuxfleurs/diplonat
14 lines
319 B
Rust
14 lines
319 B
Rust
use igd::aio::Gateway;
|
|
use igd::aio::search_gateway;
|
|
use anyhow::{Result, Context};
|
|
use log::*;
|
|
|
|
pub async fn get_gateway() -> Result<igd::aio::Gateway> {
|
|
let gw = search_gateway(Default::default())
|
|
.await
|
|
.context("Failed to find gateway")?;
|
|
|
|
info!("Gateway: {}", gw);
|
|
return Ok(gw);
|
|
}
|