Support for loading IP addresses from DiploNAT autodiscovery #4
1 changed files with 16 additions and 3 deletions
|
@ -109,9 +109,22 @@ fn parse_autodiscovered_address(
|
||||||
}
|
}
|
||||||
|
|
||||||
impl AutodiscoveredAddresses {
|
impl AutodiscoveredAddresses {
|
||||||
fn strip_timestamps(&self) -> (HashMap<&str, Option<Ipv4Addr>>, HashMap<&str, Option<Ipv6Addr>>) {
|
fn strip_timestamps(
|
||||||
(self.ipv4.iter().map(|(k, v)| (k.as_str(), v.address)).collect(),
|
&self,
|
||||||
self.ipv6.iter().map(|(k, v)| (k.as_str(), v.address)).collect())
|
) -> (
|
||||||
|
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) {
|
fn dump(&self) {
|
||||||
|
|
Loading…
Reference in a new issue