aboutsummaryrefslogtreecommitdiff
path: root/src/link.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/link.rs')
-rw-r--r--src/link.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/link.rs b/src/link.rs
index 46cefab..9ada813 100644
--- a/src/link.rs
+++ b/src/link.rs
@@ -106,6 +106,18 @@ impl Connection {
Ok(())
}
+ /// Creates a WireGuard interface.
+ ///
+ /// # Arguments
+ ///
+ /// * `link` - The name of the WireGuard interface to be created.
+ #[cfg(feature = "link")]
+ pub async fn link_add_wireguard(&self, link: String) -> Result<()> {
+ self.handle().link().add().wireguard(link).execute().await?;
+
+ Ok(())
+ }
+
/// Waits for an interface to come up, including waiting for its creation.
pub async fn link_wait_up(&self, link: String) -> Result<()> {
while !self.link_exists(link.clone()).await? || !self.link_is_up(link.clone()).await? {