INetworkManager.cs 2.2 KB

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