Extended network options (#2845)

* More network configuration options

* Filter UDP requests

* Fixed tests

* Fixed test warning
This commit is contained in:
Arkadiy Paronyan
2016-10-24 18:25:27 +02:00
committed by Gav Wood
parent 7f210b05bb
commit 1a5bae8ef1
14 changed files with 204 additions and 46 deletions

View File

@@ -56,6 +56,22 @@ impl SocketAddrExt for Ipv6Addr {
}
}
impl SocketAddrExt for IpAddr {
fn is_unspecified_s(&self) -> bool {
match *self {
IpAddr::V4(ref ip) => ip.is_unspecified_s(),
IpAddr::V6(ref ip) => ip.is_unspecified_s(),
}
}
fn is_global_s(&self) -> bool {
match *self {
IpAddr::V4(ref ip) => ip.is_global_s(),
IpAddr::V6(ref ip) => ip.is_global_s(),
}
}
}
#[cfg(not(windows))]
mod getinterfaces {
use std::{mem, io, ptr};