12 lines
287 B
Rust
12 lines
287 B
Rust
|
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();
|
||
|
println!("{:?}", devices);
|
||
|
}
|