IConnectionInfo.cs 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using Microsoft.Extensions.Logging;
  5. using Renci.SshNet.Common;
  6. using Renci.SshNet.Messages.Connection;
  7. namespace Renci.SshNet
  8. {
  9. /// <summary>
  10. /// Represents remote connection information.
  11. /// </summary>
  12. internal interface IConnectionInfo
  13. {
  14. /// <summary>
  15. /// Gets the logger factory for this connection.
  16. /// </summary>
  17. /// <value>
  18. /// The logger factory for this connection. If <see langword="null"/> then <see cref="SshNetLoggingConfiguration.LoggerFactory"/> is used.
  19. /// </value>
  20. public ILoggerFactory LoggerFactory { get; }
  21. /// <summary>
  22. /// Gets the timeout to used when waiting for a server to acknowledge closing a channel.
  23. /// </summary>
  24. /// <value>
  25. /// The channel close timeout. The default value is 1 second.
  26. /// </value>
  27. /// <remarks>
  28. /// If a server does not send a <c>SSH2_MSG_CHANNEL_CLOSE</c> message before the specified timeout
  29. /// elapses, the channel will be closed immediately.
  30. /// </remarks>
  31. TimeSpan ChannelCloseTimeout { get; }
  32. /// <summary>
  33. /// Gets the supported channel requests for this connection.
  34. /// </summary>
  35. /// <value>
  36. /// The supported channel requests for this connection.
  37. /// </value>
  38. IDictionary<string, RequestInfo> ChannelRequests { get; }
  39. /// <summary>
  40. /// Gets the character encoding.
  41. /// </summary>
  42. /// <value>
  43. /// The character encoding.
  44. /// </value>
  45. Encoding Encoding { get; }
  46. /// <summary>
  47. /// Gets connection host.
  48. /// </summary>
  49. /// <value>
  50. /// The connection host.
  51. /// </value>
  52. string Host { get; }
  53. /// <summary>
  54. /// Gets connection port.
  55. /// </summary>
  56. /// <value>
  57. /// The connection port. The default value is 22.
  58. /// </value>
  59. int Port { get; }
  60. /// <summary>
  61. /// Gets proxy type.
  62. /// </summary>
  63. /// <value>
  64. /// The type of the proxy.
  65. /// </value>
  66. ProxyTypes ProxyType { get; }
  67. /// <summary>
  68. /// Gets proxy connection host.
  69. /// </summary>
  70. string ProxyHost { get; }
  71. /// <summary>
  72. /// Gets proxy connection port.
  73. /// </summary>
  74. int ProxyPort { get; }
  75. /// <summary>
  76. /// Gets proxy connection username.
  77. /// </summary>
  78. string ProxyUsername { get; }
  79. /// <summary>
  80. /// Gets proxy connection password.
  81. /// </summary>
  82. string ProxyPassword { get; }
  83. /// <summary>
  84. /// Gets the number of retry attempts when session channel creation failed.
  85. /// </summary>
  86. /// <value>
  87. /// The number of retry attempts when session channel creation failed.
  88. /// </value>
  89. int RetryAttempts { get; }
  90. /// <summary>
  91. /// Gets the connection timeout.
  92. /// </summary>
  93. /// <value>
  94. /// The connection timeout. The default value is 30 seconds.
  95. /// </value>
  96. TimeSpan Timeout { get; }
  97. /// <summary>
  98. /// Occurs when authentication banner is sent by the server.
  99. /// </summary>
  100. event EventHandler<AuthenticationBannerEventArgs> AuthenticationBanner;
  101. }
  102. }