From 666e7156677d87188a567abaa2f774193039e09a Mon Sep 17 00:00:00 2001 From: Lucy Date: Thu, 10 Feb 2022 13:03:26 -0500 Subject: [PATCH] WireGuard device support --- .../src/ui/current_networks.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/applets/cosmic-applet-network/src/ui/current_networks.rs b/applets/cosmic-applet-network/src/ui/current_networks.rs index 5969b3ca..a92ef0c7 100644 --- a/applets/cosmic-applet-network/src/ui/current_networks.rs +++ b/applets/cosmic-applet-network/src/ui/current_networks.rs @@ -173,6 +173,19 @@ async fn handle_devices(tx: Sender>) -> zbus::Result<( wpa_flags: access_point.wpa_flags().await?, }); } + Some(SpecificDevice::WireGuard(_)) => { + let mut ip_addresses = Vec::new(); + for address_data in connection.ip4_config().await?.address_data().await? { + ip_addresses.push(IpAddr::V4(address_data.address)); + } + for address_data in connection.ip6_config().await?.address_data().await? { + ip_addresses.push(IpAddr::V6(address_data.address)); + } + info.push(ActiveConnectionInfo::Vpn { + name: connection.id().await?, + ip_addresses, + }); + } _ => {} } }