WireGuard device support

This commit is contained in:
Lucy 2022-02-10 13:03:26 -05:00
parent b529f80034
commit 666e715667
No known key found for this signature in database
GPG key ID: EBC517FAD666BBF1

View file

@ -173,6 +173,19 @@ async fn handle_devices(tx: Sender<Vec<ActiveConnectionInfo>>) -> 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,
});
}
_ => {}
}
}