INetworkManager.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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<string> 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. /// Gets the network shares.
  26. /// </summary>
  27. /// <param name="path">The path.</param>
  28. /// <returns>IEnumerable{NetworkShare}.</returns>
  29. IEnumerable<NetworkShare> GetNetworkShares(string path);
  30. /// <summary>
  31. /// Gets available devices within the domain
  32. /// </summary>
  33. /// <returns>PC's in the Domain</returns>
  34. IEnumerable<FileSystemEntryInfo> GetNetworkDevices();
  35. /// <summary>
  36. /// Parses the specified endpointstring.
  37. /// </summary>
  38. /// <param name="endpointstring">The endpointstring.</param>
  39. /// <returns>IPEndPoint.</returns>
  40. IPEndPoint Parse(string endpointstring);
  41. /// <summary>
  42. /// Determines whether [is in local network] [the specified endpoint].
  43. /// </summary>
  44. /// <param name="endpoint">The endpoint.</param>
  45. /// <returns><c>true</c> if [is in local network] [the specified endpoint]; otherwise, <c>false</c>.</returns>
  46. bool IsInLocalNetwork(string endpoint);
  47. }
  48. }