IConnectionInfo.cs 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using Renci.SshNet.Common;
  5. using Renci.SshNet.Messages.Authentication;
  6. using Renci.SshNet.Messages.Connection;
  7. namespace Renci.SshNet
  8. {
  9. internal interface IConnectionInfoInternal : IConnectionInfo
  10. {
  11. /// <summary>
  12. /// Signals that an authentication banner message was received from the server.
  13. /// </summary>
  14. /// <param name="sender">The session in which the banner message was received.</param>
  15. /// <param name="e">The banner message.{</param>
  16. void UserAuthenticationBannerReceived(object sender, MessageEventArgs<BannerMessage> e);
  17. /// <summary>
  18. /// Gets the supported authentication methods for this connection.
  19. /// </summary>
  20. /// <value>
  21. /// The supported authentication methods for this connection.
  22. /// </value>
  23. IList<IAuthenticationMethod> AuthenticationMethods { get; }
  24. /// <summary>
  25. /// Creates a <see cref="NoneAuthenticationMethod"/> for the credentials represented
  26. /// by the current <see cref="IConnectionInfo"/>.
  27. /// </summary>
  28. /// <returns>
  29. /// A <see cref="NoneAuthenticationMethod"/> for the credentials represented by the
  30. /// current <see cref="IConnectionInfo"/>.
  31. /// </returns>
  32. IAuthenticationMethod CreateNoneAuthenticationMethod();
  33. }
  34. /// <summary>
  35. /// Represents remote connection information.
  36. /// </summary>
  37. internal interface IConnectionInfo
  38. {
  39. /// <summary>
  40. /// Gets or sets the timeout to used when waiting for a server to acknowledge closing a channel.
  41. /// </summary>
  42. /// <value>
  43. /// The channel close timeout. The default value is 1 second.
  44. /// </value>
  45. /// <remarks>
  46. /// If a server does not send a <c>SSH2_MSG_CHANNEL_CLOSE</c> message before the specified timeout
  47. /// elapses, the channel will be closed immediately.
  48. /// </remarks>
  49. TimeSpan ChannelCloseTimeout { get; }
  50. /// <summary>
  51. /// Gets the supported channel requests for this connection.
  52. /// </summary>
  53. /// <value>
  54. /// The supported channel requests for this connection.
  55. /// </value>
  56. IDictionary<string, RequestInfo> ChannelRequests { get; }
  57. /// <summary>
  58. /// Gets the character encoding.
  59. /// </summary>
  60. /// <value>
  61. /// The character encoding.
  62. /// </value>
  63. Encoding Encoding { get; }
  64. /// <summary>
  65. /// Gets the number of retry attempts when session channel creation failed.
  66. /// </summary>
  67. /// <value>
  68. /// The number of retry attempts when session channel creation failed.
  69. /// </value>
  70. int RetryAttempts { get; }
  71. /// <summary>
  72. /// Gets or sets connection timeout.
  73. /// </summary>
  74. /// <value>
  75. /// The connection timeout. The default value is 30 seconds.
  76. /// </value>
  77. /// <example>
  78. /// <code source="..\..\src\Renci.SshNet.Tests\Classes\SshClientTest.cs" region="Example SshClient Connect Timeout" language="C#" title="Specify connection timeout" />
  79. /// </example>
  80. TimeSpan Timeout { get; }
  81. /// <summary>
  82. /// Occurs when authentication banner is sent by the server.
  83. /// </summary>
  84. event EventHandler<AuthenticationBannerEventArgs> AuthenticationBanner;
  85. }
  86. }