INetworkManager.cs 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. using MediaBrowser.Model.IO;
  2. using MediaBrowser.Model.Net;
  3. using System.Collections.Generic;
  4. using System;
  5. using System.Threading.Tasks;
  6. namespace MediaBrowser.Common.Net
  7. {
  8. public interface INetworkManager
  9. {
  10. event EventHandler NetworkChanged;
  11. /// <summary>
  12. /// Gets a random port number that is currently available
  13. /// </summary>
  14. /// <returns>System.Int32.</returns>
  15. int GetRandomUnusedTcpPort();
  16. int GetRandomUnusedUdpPort();
  17. /// <summary>
  18. /// Returns MAC Address from first Network Card in Computer
  19. /// </summary>
  20. /// <returns>[string] MAC Address</returns>
  21. string GetMacAddress();
  22. /// <summary>
  23. /// Determines whether [is in private address space] [the specified endpoint].
  24. /// </summary>
  25. /// <param name="endpoint">The endpoint.</param>
  26. /// <returns><c>true</c> if [is in private address space] [the specified endpoint]; otherwise, <c>false</c>.</returns>
  27. bool IsInPrivateAddressSpace(string endpoint);
  28. /// <summary>
  29. /// Gets the network shares.
  30. /// </summary>
  31. /// <param name="path">The path.</param>
  32. /// <returns>IEnumerable{NetworkShare}.</returns>
  33. IEnumerable<NetworkShare> GetNetworkShares(string path);
  34. /// <summary>
  35. /// Gets available devices within the domain
  36. /// </summary>
  37. /// <returns>PC's in the Domain</returns>
  38. IEnumerable<FileSystemEntryInfo> GetNetworkDevices();
  39. /// <summary>
  40. /// Determines whether [is in local network] [the specified endpoint].
  41. /// </summary>
  42. /// <param name="endpoint">The endpoint.</param>
  43. /// <returns><c>true</c> if [is in local network] [the specified endpoint]; otherwise, <c>false</c>.</returns>
  44. bool IsInLocalNetwork(string endpoint);
  45. List<IpAddressInfo> GetLocalIpAddresses();
  46. IpAddressInfo ParseIpAddress(string ipAddress);
  47. bool TryParseIpAddress(string ipAddress, out IpAddressInfo ipAddressInfo);
  48. Task<IpAddressInfo[]> GetHostAddressesAsync(string host);
  49. }
  50. }