ddn.net.ssh.channel
Multiplexed SSH connection-protocol channels (RFC 4254).
One SshChannelImpl instance per opened channel. The session owns the registry and the single pump that advances every channel; channels never touch the transport themselves - they enqueue messages through the session and expose flow-control visibility per the public API contract.
Types 6
Channel-side limits from the support matrix and RFC 4254.
Internal channel lifecycle beyond the public states.
Open-operation implementation driven by session pumping.
this(SshChannelImpl channel)Constructs an operation for a channel being opened.Channel-request-operation implementation.
Endpoint fields of a direct TCP/IP channel open (RFC 4254 7.2).
string hostDestination host as seen by the serverushort portDestination portstring originatorAddressOriginator address reported to the serverushort originatorPortOriginator port reported to the serverOne multiplexed channel.
Flow control: the session replenishes the receive window as the application consumes buffered data; writes respect the peer's window and maximum packet size. Consumers observe backpressure through canWrite and never manage windows themselves.
private ddn.net.ssh.session.SshSessionImpl sender_private uint localId_private uint remoteId_private SshChannelType type_private SshChannelPhase phase_private SshDirectTcpIpTarget target_private ulong initialWindow_private ulong recvWindowRemaining_private ulong pendingAdjust_private uint localMaxPacket_private ulong remoteWindow_private uint remoteMaxPacket_private ubyte[] standardData_private ubyte[] extendedData_private bool extendedDiscard_private ubyte[] writeBacklog_private size_t writeBacklogPos_private bool eofSent_private bool eofQueued_private bool eofReceived_private bool closeSent_private bool incomingUnconfirmed_private SshExitStatus exit_private SshError channelError_private SshChannelOpenOp openOp_private SshChannelRequestOp pendingRequest_private string lastRequestType_void beginIncoming(uint remoteChannel, uint initialWindow,
uint maxPacket)Registers a peer-opened channel (remote forwarding) in the open state before the accept decision: the peer may send data right after its open (RFC 4254 section 5.1).void confirmIncoming()Marks an incoming channel confirmed after an accept decision.bool incomingUnconfirmed() @property constReturns: whether an incoming channel still awaits acceptance.ubyte[] buildIncomingConfirmation()Builds the CHANNEL_OPEN_CONFIRMATION for an accepted incoming channel.void handleOpenConfirmation(uint remoteChannel,
uint initialWindow, uint maxPacket) Handles CHANNEL_OPEN_CONFIRMATION. Params: remoteChannel = Peer-assigned channel number. initialWindow = Window the peer grants us. maxPacket = Maximum packet the peer accepts.void handleOpenFailure(uint reasonCode, string description)Handles CHANNEL_OPEN_FAILURE.void handleOpenCancelled()Marks a cancelled open as closed without a wire message.void handleData(const(ubyte)[] data)Buffers incoming standard data and consumes our receive window.void handleExtendedData(const(ubyte)[] data)Buffers incoming extended data.void handleWindowAdjust(uint bytesToAdd)Handles a peer window adjustment.bool acceptInbound(const(ubyte)[] data, string what)Validates one inbound channel-data payload against the advertised receive window and maximum packet size.void handleEof()Handles peer EOF.void handleClose()Handles peer close.void handleRequestReply(bool accepted)Handles CHANNEL_SUCCESS / CHANNEL_FAILURE for the pending request.void handleExitInfo(SshWireReader reader)Handles exit-status and exit-signal channel requests.ubyte[] buildOpenPayload()Builds the CHANNEL_OPEN payload for this channel type.ubyte[] buildWindowAdjust(uint bytesToAdd)Builds a CHANNEL_WINDOW_ADJUST payload.ubyte[] buildData(const(ubyte)[] chunk)Builds a CHANNEL_DATA payload.ubyte[] buildExtendedData(const(ubyte)[] chunk)Builds a CHANNEL_EXTENDED_DATA payload.ubyte[] buildEof()Builds a CHANNEL_EOF payload.ubyte[] buildClose()Builds a CHANNEL_CLOSE payload.ubyte[] buildRequest(scope const SshChannelRequest request)Builds a CHANNEL_REQUEST payload.void handleIncomingRequest(string requestType,
SshWireReader reader)Handles a server-originated channel request (exit info).void failChannel(SshError error)Marks the channel failed independently of the session.SshResult readExtended(ubyte[] buffer)SshChannelRequestOperation request(scope const SshChannelRequest request)void sendEof()void close()void discardExtendedData(bool discard)bool pumpWrites()Sends as much of the write backlog as the remote window allows.void releaseReceive(size_t bytes)Returns: whether the receive window needs replenishing. Records application consumption of received bytes.uint takeAdjust()Removes and returns the pending re-grant when it crosses the replenish threshold.void creditGranted(uint granted)Mirrors a sent CHANNEL_WINDOW_ADJUST into the local credit view.void markClosed()this(ddn.net.ssh.session.SshSessionImpl sender, uint localId,
SshChannelType type,
scope const SshChannelOpenOptions options,
SshDirectTcpIpTarget target = SshDirectTcpIpTarget.init) Constructs a channel in the opening phase. Params: sender = Session that owns this channel. localId = Locally assigned channel number. type = Channel type. options = Flow-control...Functions 1
ubyte[] encodeTerminalModes(scope const SshTerminalMode[] modes)Encodes terminal modes for a pty-req (RFC 4254 section 8).