From a86b71899ec52c44ddc6c3018e8cc5e9d7ff4d62 Mon Sep 17 00:00:00 2001 From: Andrew Rabert Date: Thu, 27 Dec 2018 18:27:57 -0500 Subject: Add GPL modules --- MediaBrowser.Common/Net/INetworkManager.cs | 66 ++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 MediaBrowser.Common/Net/INetworkManager.cs (limited to 'MediaBrowser.Common/Net/INetworkManager.cs') diff --git a/MediaBrowser.Common/Net/INetworkManager.cs b/MediaBrowser.Common/Net/INetworkManager.cs new file mode 100644 index 0000000000..b2ff797bcf --- /dev/null +++ b/MediaBrowser.Common/Net/INetworkManager.cs @@ -0,0 +1,66 @@ +using MediaBrowser.Model.IO; +using MediaBrowser.Model.Net; +using System.Collections.Generic; +using System; +using System.Threading.Tasks; + +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(); + + IpAddressInfo ParseIpAddress(string ipAddress); + + bool TryParseIpAddress(string ipAddress, out IpAddressInfo ipAddressInfo); + + Task GetHostAddressesAsync(string host); + + bool IsAddressInSubnets(string addressString, string[] subnets); + } +} \ No newline at end of file -- cgit v1.2.3