public override bool Supports(NetworkInterfaceComponent networkInterfaceComponent) { Sockets.AddressFamily family = (networkInterfaceComponent == NetworkInterfaceComponent.IPv4) ? Sockets.AddressFamily.InterNetwork : Sockets.AddressFamily.InterNetworkV6; return(_addresses.Any(addr => addr.AddressFamily == family)); }
public override bool Supports(NetworkInterfaceComponent networkInterfaceComponent) { Sockets.AddressFamily family = (networkInterfaceComponent == NetworkInterfaceComponent.IPv4) ? Sockets.AddressFamily.InterNetwork : Sockets.AddressFamily.InterNetworkV6; foreach (UnixUnicastIPAddressInformation addr in _unicastAddresses) { if (addr.Address.AddressFamily == family) { return(true); } } return(false); }
/// <summary> /// Convert to model enum /// </summary> /// <param name="family"></param> /// <returns></returns> public static AddressFamily ToProxyAddressFamily(this Sockets.AddressFamily family) { switch (family) { case Sockets.AddressFamily.InterNetwork: return(AddressFamily.InterNetwork); case Sockets.AddressFamily.InterNetworkV6: return(AddressFamily.InterNetworkV6); case Sockets.AddressFamily.Unix: return(AddressFamily.Unix); case Sockets.AddressFamily.Unspecified: return(AddressFamily.Unspecified); default: return((AddressFamily)family); } }