INetworkManager.cs 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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 a random port number that is currently available
  11. /// </summary>
  12. /// <returns>System.Int32.</returns>
  13. int GetRandomUnusedPort();
  14. /// <summary>
  15. /// Returns MAC Address from first Network Card in Computer
  16. /// </summary>
  17. /// <returns>[string] MAC Address</returns>
  18. string GetMacAddress();
  19. /// <summary>
  20. /// Determines whether [is in private address space] [the specified endpoint].
  21. /// </summary>
  22. /// <param name="endpoint">The endpoint.</param>
  23. /// <returns><c>true</c> if [is in private address space] [the specified endpoint]; otherwise, <c>false</c>.</returns>
  24. bool IsInPrivateAddressSpace(string endpoint);
  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. /// Determines whether [is in local network] [the specified endpoint].
  38. /// </summary>
  39. /// <param name="endpoint">The endpoint.</param>
  40. /// <returns><c>true</c> if [is in local network] [the specified endpoint]; otherwise, <c>false</c>.</returns>
  41. bool IsInLocalNetwork(string endpoint);
  42. /// <summary>
  43. /// Generates a self signed certificate at the locatation specified by <paramref name="certificatePath"/>.
  44. /// </summary>
  45. /// <param name="certificatePath">The path to generate the certificate.</param>
  46. /// <param name="hostname">The common name for the certificate.</param>
  47. void GenerateSelfSignedSslCertificate(string certificatePath, string hostname);
  48. }
  49. }