INetworkManager.cs 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. using MediaBrowser.Model.IO;
  2. using MediaBrowser.Model.Net;
  3. using System.Collections.Generic;
  4. using System.Net;
  5. namespace MediaBrowser.Common.Net
  6. {
  7. public interface INetworkManager
  8. {
  9. /// <summary>
  10. /// Gets the machine's local ip address
  11. /// </summary>
  12. /// <returns>IPAddress.</returns>
  13. IEnumerable<IPAddress> GetLocalIpAddresses();
  14. /// <summary>
  15. /// Gets a random port number that is currently available
  16. /// </summary>
  17. /// <returns>System.Int32.</returns>
  18. int GetRandomUnusedPort();
  19. /// <summary>
  20. /// Returns MAC Address from first Network Card in Computer
  21. /// </summary>
  22. /// <returns>[string] MAC Address</returns>
  23. string GetMacAddress();
  24. /// <summary>
  25. /// Determines whether [is in private address space] [the specified endpoint].
  26. /// </summary>
  27. /// <param name="endpoint">The endpoint.</param>
  28. /// <returns><c>true</c> if [is in private address space] [the specified endpoint]; otherwise, <c>false</c>.</returns>
  29. bool IsInPrivateAddressSpace(string endpoint);
  30. /// <summary>
  31. /// Gets the network shares.
  32. /// </summary>
  33. /// <param name="path">The path.</param>
  34. /// <returns>IEnumerable{NetworkShare}.</returns>
  35. IEnumerable<NetworkShare> GetNetworkShares(string path);
  36. /// <summary>
  37. /// Gets available devices within the domain
  38. /// </summary>
  39. /// <returns>PC's in the Domain</returns>
  40. IEnumerable<FileSystemEntryInfo> GetNetworkDevices();
  41. /// <summary>
  42. /// Parses the specified endpointstring.
  43. /// </summary>
  44. /// <param name="endpointstring">The endpointstring.</param>
  45. /// <returns>IPEndPoint.</returns>
  46. IPEndPoint Parse(string endpointstring);
  47. /// <summary>
  48. /// Determines whether [is in local network] [the specified endpoint].
  49. /// </summary>
  50. /// <param name="endpoint">The endpoint.</param>
  51. /// <returns><c>true</c> if [is in local network] [the specified endpoint]; otherwise, <c>false</c>.</returns>
  52. bool IsInLocalNetwork(string endpoint);
  53. /// <summary>
  54. /// Generates a self signed certificate at the locatation specified by <paramref name="certificatePath"/>.
  55. /// </summary>
  56. /// <param name="certificatePath">The path to generate the certificate.</param>
  57. /// <param name="hostname">The common name for the certificate.</param>
  58. void GenerateSelfSignedSslCertificate(string certificatePath, string hostname);
  59. }
  60. }