2022-01-07 09:35:21 +00:00
|
|
|
use wireguard_control::{Backend, Device};
|
|
|
|
|
|
|
|
#[cfg(target_os = "linux")]
|
|
|
|
const BACKEND: Backend = Backend::Kernel;
|
|
|
|
#[cfg(not(target_os = "linux"))]
|
|
|
|
const BACKEND: Backend = Backend::Userspace;
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let devices = Device::list(BACKEND).unwrap();
|
2023-02-03 19:53:23 +00:00
|
|
|
println!("{devices:?}");
|
2022-01-07 09:35:21 +00:00
|
|
|
}
|