IChannelSession.cs 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. using System.Collections.Generic;
  2. using Renci.SshNet.Common;
  3. namespace Renci.SshNet.Channels
  4. {
  5. /// <summary>
  6. /// Session SSH channel.
  7. /// </summary>
  8. internal interface IChannelSession : IChannel
  9. {
  10. /// <summary>
  11. /// Opens the channel.
  12. /// </summary>
  13. void Open();
  14. /// <summary>
  15. /// Sends the pseudo terminal request.
  16. /// </summary>
  17. /// <param name="environmentVariable">The environment variable.</param>
  18. /// <param name="columns">The columns.</param>
  19. /// <param name="rows">The rows.</param>
  20. /// <param name="width">The width.</param>
  21. /// <param name="height">The height.</param>
  22. /// <param name="terminalModeValues">The terminal mode values.</param>
  23. /// <returns>
  24. /// <c>true</c> if request was successful; otherwise <c>false</c>.
  25. /// </returns>
  26. bool SendPseudoTerminalRequest(string environmentVariable, uint columns, uint rows, uint width, uint height,
  27. IDictionary<TerminalModes, uint> terminalModeValues);
  28. /// <summary>
  29. /// Sends the X11 forwarding request.
  30. /// </summary>
  31. /// <param name="isSingleConnection">if set to <c>true</c> the it is single connection.</param>
  32. /// <param name="protocol">The protocol.</param>
  33. /// <param name="cookie">The cookie.</param>
  34. /// <param name="screenNumber">The screen number.</param>
  35. /// <returns>
  36. /// <c>true</c> if request was successful; otherwise <c>false</c>.
  37. /// </returns>
  38. bool SendX11ForwardingRequest(bool isSingleConnection, string protocol, byte[] cookie, uint screenNumber);
  39. /// <summary>
  40. /// Sends the environment variable request.
  41. /// </summary>
  42. /// <param name="variableName">Name of the variable.</param>
  43. /// <param name="variableValue">The variable value.</param>
  44. /// <returns>
  45. /// <c>true</c> if request was successful; otherwise <c>false</c>.
  46. /// </returns>
  47. bool SendEnvironmentVariableRequest(string variableName, string variableValue);
  48. /// <summary>
  49. /// Sends the shell request.
  50. /// </summary>
  51. /// <returns>
  52. /// <c>true</c> if request was successful; otherwise <c>false</c>.
  53. /// </returns>
  54. bool SendShellRequest();
  55. /// <summary>
  56. /// Sends the exec request.
  57. /// </summary>
  58. /// <param name="command">The command.</param>
  59. /// <returns>
  60. /// <c>true</c> if request was successful; otherwise <c>false</c>.
  61. /// </returns>
  62. bool SendExecRequest(string command);
  63. /// <summary>
  64. /// Sends the exec request.
  65. /// </summary>
  66. /// <param name="breakLength">Length of the break.</param>
  67. /// <returns>
  68. /// <c>true</c> if request was successful; otherwise <c>false</c>.
  69. /// </returns>
  70. bool SendBreakRequest(uint breakLength);
  71. /// <summary>
  72. /// Sends the subsystem request.
  73. /// </summary>
  74. /// <param name="subsystem">The subsystem.</param>
  75. /// <returns>
  76. /// <c>true</c> if request was successful; otherwise <c>false</c>.
  77. /// </returns>
  78. bool SendSubsystemRequest(string subsystem);
  79. /// <summary>
  80. /// Sends the window change request.
  81. /// </summary>
  82. /// <param name="columns">The columns.</param>
  83. /// <param name="rows">The rows.</param>
  84. /// <param name="width">The width.</param>
  85. /// <param name="height">The height.</param>
  86. /// <returns>
  87. /// <c>true</c> if request was successful; otherwise <c>false</c>.
  88. /// </returns>
  89. bool SendWindowChangeRequest(uint columns, uint rows, uint width, uint height);
  90. /// <summary>
  91. /// Sends the local flow request.
  92. /// </summary>
  93. /// <param name="clientCanDo">if set to <c>true</c> [client can do].</param>
  94. /// <returns>
  95. /// <c>true</c> if request was successful; otherwise <c>false</c>.
  96. /// </returns>
  97. bool SendLocalFlowRequest(bool clientCanDo);
  98. /// <summary>
  99. /// Sends the signal request.
  100. /// </summary>
  101. /// <param name="signalName">Name of the signal.</param>
  102. /// <returns>
  103. /// <c>true</c> if request was successful; otherwise <c>false</c>.
  104. /// </returns>
  105. bool SendSignalRequest(string signalName);
  106. /// <summary>
  107. /// Sends the exit status request.
  108. /// </summary>
  109. /// <param name="exitStatus">The exit status.</param>
  110. /// <returns>
  111. /// <c>true</c> if request was successful; otherwise <c>false</c>.
  112. /// </returns>
  113. bool SendExitStatusRequest(uint exitStatus);
  114. /// <summary>
  115. /// Sends the exit signal request.
  116. /// </summary>
  117. /// <param name="signalName">Name of the signal.</param>
  118. /// <param name="coreDumped">if set to <c>true</c> [core dumped].</param>
  119. /// <param name="errorMessage">The error message.</param>
  120. /// <param name="language">The language.</param>
  121. /// <returns>
  122. /// <c>true</c> if request was successful; otherwise <c>false</c>.
  123. /// </returns>
  124. bool SendExitSignalRequest(string signalName, bool coreDumped, string errorMessage, string language);
  125. /// <summary>
  126. /// Sends eow@openssh.com request.
  127. /// </summary>
  128. /// <returns>
  129. /// <c>true</c> if request was successful; otherwise <c>false</c>.
  130. /// </returns>
  131. bool SendEndOfWriteRequest();
  132. /// <summary>
  133. /// Sends keepalive@openssh.com request.
  134. /// </summary>
  135. /// <returns>
  136. /// <c>true</c> if request was successful; otherwise <c>false</c>.
  137. /// </returns>
  138. bool SendKeepAliveRequest();
  139. }
  140. }