Skip to content

SshSession

[Source]

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.

actor tag SshSession

Constructors

create_client

[Source]

new tag create_client(
  auth: TCPConnectAuth val,
  config: SshClientConfig val,
  notify: SshClientNotify tag)
: SshSession tag^

Parameters

Returns


create_server

[Source]

new tag create_server(
  config: SshServerConfig val,
  notify: SshServerNotify tag)
: SshSession tag^

Parameters

Returns


Public Behaviours

set_server_bridge

[Source]

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.

be set_server_bridge(
  bridge: SshServerTcpBridge tag)

Parameters


open_channel

[Source]

be open_channel(
  channel_type: String val = "session")

Parameters

  • channel_type: String val = "session"

channel_send

[Source]

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.

be channel_send(
  channel_id: U32 val,
  data: Array[U8 val] val)

Parameters


channel_request_shell

[Source]

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.

be channel_request_shell(
  channel_id: U32 val,
  want_reply: Bool val = true)

Parameters

  • channel_id: U32 val
  • want_reply: Bool val = true

channel_request_exec

[Source]

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.

be channel_request_exec(
  channel_id: U32 val,
  command: String val,
  want_reply: Bool val = true)

Parameters

  • channel_id: U32 val
  • command: String val
  • want_reply: Bool val = true

channel_close

[Source]

be channel_close(
  channel_id: U32 val)

Parameters

  • channel_id: U32 val

accept_host_key

[Source]

be accept_host_key()

reject_host_key

[Source]

be reject_host_key()

disconnect

[Source]

Clean disconnect initiated by consumer.

be disconnect(
  msg: String val = "")

Parameters


rekey

[Source]

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.

be rekey()

auth_accept

[Source]

be auth_accept()

auth_pk_ok

[Source]

be auth_pk_ok(
  algorithm: String val,
  public_key: Array[U8 val] val)

Parameters


auth_reject

[Source]

be auth_reject(
  remaining: Array[String val] val)

Parameters


accept_channel

[Source]

be accept_channel(
  channel_id: U32 val)

Parameters

  • channel_id: U32 val

reject_channel

[Source]

be reject_channel(
  channel_id: U32 val,
  reason: U32 val)

Parameters

  • channel_id: U32 val
  • reason: U32 val

accept_request

[Source]

be accept_request(
  channel_id: U32 val)

Parameters

  • channel_id: U32 val

reject_request

[Source]

be reject_request(
  channel_id: U32 val)

Parameters

  • channel_id: U32 val