Support for loading IP addresses from DiploNAT autodiscovery #4

Merged
lx merged 6 commits from diplonat-autodiscovery into main 2023-04-21 14:00:06 +00:00
Showing only changes of commit b60f5b1694 - Show all commits

View file

@ -109,9 +109,22 @@ fn parse_autodiscovered_address(
}
impl AutodiscoveredAddresses {
fn strip_timestamps(&self) -> (HashMap<&str, Option<Ipv4Addr>>, HashMap<&str, Option<Ipv6Addr>>) {
(self.ipv4.iter().map(|(k, v)| (k.as_str(), v.address)).collect(),
self.ipv6.iter().map(|(k, v)| (k.as_str(), v.address)).collect())
fn strip_timestamps(
&self,
) -> (
HashMap<&str, Option<Ipv4Addr>>,
HashMap<&str, Option<Ipv6Addr>>,
) {
(
self.ipv4
.iter()
.map(|(k, v)| (k.as_str(), v.address))
.collect(),
self.ipv6
.iter()
.map(|(k, v)| (k.as_str(), v.address))
.collect(),
)
}
fn dump(&self) {