using System; using System.Collections.Generic; using System.Threading.Tasks; using MediaBrowser.Model.IO; using MediaBrowser.Model.Net; namespace MediaBrowser.Common.Net { public interface INetworkManager { event EventHandler NetworkChanged; /// /// Gets a random port number that is currently available /// /// System.Int32. int GetRandomUnusedTcpPort(); int GetRandomUnusedUdpPort(); Func LocalSubnetsFn { get; set; } /// /// Returns MAC Address from first Network Card in Computer /// /// [string] MAC Address List GetMacAddresses(); /// /// Determines whether [is in private address space] [the specified endpoint]. /// /// The endpoint. /// true if [is in private address space] [the specified endpoint]; otherwise, false. bool IsInPrivateAddressSpace(string endpoint); /// /// Gets the network shares. /// /// The path. /// IEnumerable{NetworkShare}. IEnumerable GetNetworkShares(string path); /// /// Gets available devices within the domain /// /// PC's in the Domain IEnumerable GetNetworkDevices(); /// /// Determines whether [is in local network] [the specified endpoint]. /// /// The endpoint. /// true if [is in local network] [the specified endpoint]; otherwise, false. bool IsInLocalNetwork(string endpoint); IpAddressInfo[] GetLocalIpAddresses(bool ignoreVirtualInterface); IpAddressInfo ParseIpAddress(string ipAddress); bool TryParseIpAddress(string ipAddress, out IpAddressInfo ipAddressInfo); Task GetHostAddressesAsync(string host); bool IsAddressInSubnets(string addressString, string[] subnets); bool IsInSameSubnet(IpAddressInfo address1, IpAddressInfo address2, IpAddressInfo subnetMask); IpAddressInfo GetLocalIpSubnetMask(IpAddressInfo address); } }