IConnectionInfo.cs 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using Renci.SshNet.Messages.Authentication;
  5. using Renci.SshNet.Messages.Connection;
  6. namespace Renci.SshNet
  7. {
  8. /// <summary>
  9. /// Represents remote connection information.
  10. /// </summary>
  11. internal interface IConnectionInfo
  12. {
  13. /// <summary>
  14. /// Gets the supported channel requests for this connection.
  15. /// </summary>
  16. /// <value>
  17. /// The supported channel requests for this connection.
  18. /// </value>
  19. IDictionary<string, RequestInfo> ChannelRequests { get; }
  20. /// <summary>
  21. /// Gets the character encoding.
  22. /// </summary>
  23. /// <value>
  24. /// The character encoding.
  25. /// </value>
  26. Encoding Encoding { get; }
  27. /// <summary>
  28. /// Gets the number of retry attempts when session channel creation failed.
  29. /// </summary>
  30. /// <value>
  31. /// The number of retry attempts when session channel creation failed.
  32. /// </value>
  33. int RetryAttempts { get; }
  34. /// <summary>
  35. /// Gets or sets connection timeout.
  36. /// </summary>
  37. /// <value>
  38. /// The connection timeout. The default value is 30 seconds.
  39. /// </value>
  40. /// <example>
  41. /// <code source="..\..\Renci.SshNet.Tests\Classes\SshClientTest.cs" region="Example SshClient Connect Timeout" language="C#" title="Specify connection timeout" />
  42. /// </example>
  43. TimeSpan Timeout { get; }
  44. /// <summary>
  45. /// Gets the supported authentication methods for this connection.
  46. /// </summary>
  47. /// <value>
  48. /// The supported authentication methods for this connection.
  49. /// </value>
  50. IEnumerable<IAuthenticationMethod> AuthenticationMethods { get; }
  51. /// <summary>
  52. /// Signals that an authentication banner message was received from the server.
  53. /// </summary>
  54. /// <param name="sender">The session in which the banner message was received.</param>
  55. /// <param name="e">The banner message.{</param>
  56. void UserAuthenticationBannerReceived(object sender, MessageEventArgs<BannerMessage> e);
  57. /// <summary>
  58. /// Creates a <see cref="NoneAuthenticationMethod"/> for the credentials represented
  59. /// by the current <see cref="IConnectionInfo"/>.
  60. /// </summary>
  61. /// <returns>
  62. /// A <see cref="NoneAuthenticationMethod"/> for the credentials represented by the
  63. /// current <see cref="IConnectionInfo"/>.
  64. /// </returns>
  65. IAuthenticationMethod CreateNoneAuthenticationMethod();
  66. }
  67. }