wireguard-control 1.7.1

High level bindings to the WireGuard embeddable C library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use wireguard_control::{Backend, Device};

#[cfg(target_os = "linux")]
const BACKEND: Backend = Backend::Kernel;
#[cfg(target_os = "openbsd")]
const BACKEND: Backend = Backend::OpenBSD;
#[cfg(not(any(target_os = "linux", target_os = "openbsd")))]
const BACKEND: Backend = Backend::Userspace;

fn main() {
    let devices = Device::list(BACKEND).unwrap();
    println!("{devices:?}");
}