SshSession¶
Owns one SSH connection: the protocol state machine, the TCP bridge, packet framing/crypto, key exchange (including rekey), authentication, and channel multiplexing. Consumers do not construct this directly — use SshConnector (client) or SshListener (server) — and interact with it through the tag passed to their SshClientNotify / SshServerNotify callbacks.
Constructors¶
create_client¶
new tag create_client(
auth: TCPConnectAuth val,
config: SshClientConfig val,
notify: SshClientNotify tag)
: SshSession tag^
Parameters¶
- auth: TCPConnectAuth val
- config: SshClientConfig val
- notify: SshClientNotify tag
Returns¶
- SshSession tag^
create_server¶
Parameters¶
- config: SshServerConfig val
- notify: SshServerNotify tag
Returns¶
- SshSession tag^
Public Behaviours¶
set_server_bridge¶
Wire the TCP bridge for a server session. Accepted only once, right after construction; a later call (e.g. from consumer code) cannot replace the bridge of a live session.
Parameters¶
- bridge: SshServerTcpBridge tag
open_channel¶
Parameters¶
- channel_type: String val = "session"
channel_send¶
Submit at most 32768 bytes of channel data. Every call reports the original array and the length of its locally admitted prefix through ssh_channel_send_result. Admission means a packet was handed to the TCP bridge or the bounded rekey queue; it does not mean the peer received it. A blocked caller can retry data.trim(accepted) after ssh_channel_window_available. The hint reserves no window credit.
Parameters¶
channel_request_shell¶
Ask the peer to start a login shell on a channel we opened (RFC 4254 §6.5). The channel's output arrives via ssh_channel_data. A no-op unless the session is Connected and the channel is open and authorized.
Parameters¶
channel_request_exec¶
Ask the peer to run a single command on a channel we opened (RFC 4254 §6.5). The command's output arrives via ssh_channel_data. A no-op unless the session is Connected and the channel is open and authorized.
Parameters¶
channel_close¶
Parameters¶
- channel_id: U32 val
accept_host_key¶
reject_host_key¶
disconnect¶
Clean disconnect initiated by consumer.
Parameters¶
- msg: String val = ""
rekey¶
Request a key re-exchange. A no-op unless the session is Connected and no rekey is already in progress. The session also rekeys automatically as the per-key packet count grows, so consumers rarely need this.
auth_accept¶
auth_pk_ok¶
Parameters¶
auth_reject¶
Parameters¶
accept_channel¶
Parameters¶
- channel_id: U32 val
reject_channel¶
Parameters¶
accept_request¶
Parameters¶
- channel_id: U32 val
reject_request¶
Parameters¶
- channel_id: U32 val