mirror of
https://github.com/tonarino/innernet.git
synced 2024-11-15 03:58:52 +08:00
09e68c2c01
also introduces a new `netlink-request` crate to help modularize the netlink code. this currently depends on a fork of the `netlink` project, but we should be able to use the official version soon.
11 lines
287 B
Rust
11 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);
|
|
}
|