IConnectionInfo.cs 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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 the supported channel requests for this connection.
  41. /// </summary>
  42. /// <value>
  43. /// The supported channel requests for this connection.
  44. /// </value>
  45. IDictionary<string, RequestInfo> ChannelRequests { get; }
  46. /// <summary>
  47. /// Gets the character encoding.
  48. /// </summary>
  49. /// <value>
  50. /// The character encoding.
  51. /// </value>
  52. Encoding Encoding { get; }
  53. /// <summary>
  54. /// Gets the number of retry attempts when session channel creation failed.
  55. /// </summary>
  56. /// <value>
  57. /// The number of retry attempts when session channel creation failed.
  58. /// </value>
  59. int RetryAttempts { get; }
  60. /// <summary>
  61. /// Gets or sets connection timeout.
  62. /// </summary>
  63. /// <value>
  64. /// The connection timeout. The default value is 30 seconds.
  65. /// </value>
  66. /// <example>
  67. /// <code source="..\..\Renci.SshNet.Tests\Classes\SshClientTest.cs" region="Example SshClient Connect Timeout" language="C#" title="Specify connection timeout" />
  68. /// </example>
  69. TimeSpan Timeout { get; }
  70. /// <summary>
  71. /// Occurs when authentication banner is sent by the server.
  72. /// </summary>
  73. event EventHandler<AuthenticationBannerEventArgs> AuthenticationBanner;
  74. }
  75. }