xrtSshClientConfigInit
写入没有隐藏 Engine、默认拒绝未知主机且预算有界的客户端配置。
| 参数 | 说明 |
|---|---|
| xsshclientconfig* pConfig | 配置结构 |
示例已编译验证
sshclientconfiginit obj; xrtSshClientConfigInit(&obj);
xrtSshClientInit
初始化未附着客户端;配置中的文本、策略数据和回调上下文保持借用。
| 参数 | 说明 |
|---|---|
| xsshclient* pClient | 客户端对象 |
| const xsshclientconfig* pConfig | 配置结构 |
| const xsshclientevents* pEvents | 事件回调表 |
| ptr pData | 用户数据 |
示例已编译验证
sshclientinit obj; xrtSshClientInit(&obj, pClient);
xrtSshClientClear
只清理尚未附着或已经关闭的客户端及其全部动态 channel 数据。
| 参数 | 说明 |
|---|---|
| xsshclient* pClient | 客户端对象 |
示例已编译验证
/* 只清理尚未附着或已经关闭的客户端及其全部动态 channel 数据。 */ result = xrtSshClientClear(pClient);
xrtSshClientNetEvents
返回交给 xrtNetStreamConnect 的事件表和 data 指针。
示例已编译验证
/* 返回交给 xrtNetStreamConnect 的事件表和 data 指针。 */ result = xrtSshClientNetEvents();
xrtSshClientNetData
XRT_API ptr xrtSshClientNetData(xsshclient* pClient);
示例已编译验证
/* XRT_API ptr xrtSshClientNetData(xsshclient* pClient); */ result = xrtSshClientNetData();
xrtSshClientAttach
在 Stream 所属 Worker 中接管已打开且尚无积压输入的 TCP Stream。
| 参数 | 说明 |
|---|---|
| xsshclient* pClient | 客户端对象 |
| xnetstream* pStream | 流对象 |
示例已编译验证
/* 在 Stream 所属 Worker 中接管已打开且尚无积压输入的 TCP Stream。 */ result = xrtSshClientAttach(pClient, pStream);
xrtSshClientState
返回客户端生命周期以及完整底层对象,保留高级用户的直接控制能力。
| 参数 | 说明 |
|---|---|
| const xsshclient* pClient | 客户端对象 |
示例已编译验证
/* 返回客户端生命周期以及完整底层对象,保留高级用户的直接控制能力。 */ result = xrtSshClientState(pClient);
xrtSshClientIsCurrent
XRT_API bool xrtSshClientIsCurrent(const xsshclient* pClient);
示例已编译验证
/* XRT_API bool xrtSshClientIsCurrent(const xsshclient* pClient); */ result = xrtSshClientIsCurrent();
xrtSshClientStream
XRT_API xsshsessionstream* xrtSshClientStream(xsshclient* pClient);
示例已编译验证
/* XRT_API xsshsessionstream* xrtSshClientStream(xsshclient* pClient); */ result = xrtSshClientStream();
xrtSshClientSession
XRT_API xsshsessiontcp* xrtSshClientSession(xsshclient* pClient);
示例已编译验证
/* XRT_API xsshsessiontcp* xrtSshClientSession(xsshclient* pClient); */ result = xrtSshClientSession();
xrtSshClientReader
XRT_API xsshsessionreader* xrtSshClientReader(xsshclient* pClient);
示例已编译验证
/* XRT_API xsshsessionreader* xrtSshClientReader(xsshclient* pClient); */ result = xrtSshClientReader();
xrtSshClientChannels
XRT_API xsshchannels* xrtSshClientChannels(xsshclient* pClient);
示例已编译验证
/* XRT_API xsshchannels* xrtSshClientChannels(xsshclient* pClient); */ result = xrtSshClientChannels();
xrtSshClientOwnsChannel
判断借用 channel 是否仍由当前客户端拥有。
| 参数 | 说明 |
|---|---|
| const xsshclient* pClient | 客户端对象 |
| const xsshchannel* pChannel | 通道对象 |
示例已编译验证
/* 判断借用 channel 是否仍由当前客户端拥有。 */ result = xrtSshClientOwnsChannel(pClient, pChannel);
xrtSshClientChannelAccept
在 CHANNEL_OPEN Packet/HOLD 期间暂存接受或拒绝决定。
| 参数 | 说明 |
|---|---|
| xsshclient* pClient | 客户端对象 |
| const xsshchannelopen* pOpen | Oen 参数 |
| xsshchannel** ppChannel | 通道对象 |
示例已编译验证
/* 在 CHANNEL_OPEN Packet/HOLD 期间暂存接受或拒绝决定。 */ result = xrtSshClientChannelAccept(pClient, pOpen, ppChannel);
xrtSshClientChannelReject
XRT_API xsshcode xrtSshClientChannelReject( xsshclient* pClient, const xsshchannelopen* pOpen, uint32 iReason );
示例已编译验证
/* XRT_API xsshcode xrtSshClientChannelReject( xsshclient* pClient, const xsshchannelopen* pOpen, uint32 iReason ); */ result = xrtSshClientChannelReject();
xrtSshClientGlobalReplies
返回全局 request reply FIFO,并按需扩展其有界 token 存储。
| 参数 | 说明 |
|---|---|
| xsshclient* pClient | 客户端对象 |
示例已编译验证
/* 返回全局 request reply FIFO,并按需扩展其有界 token 存储。 */ result = xrtSshClientGlobalReplies(pClient);
xrtSshClientGlobalReplyReserve
XRT_API xsshcode xrtSshClientGlobalReplyReserve( xsshclient* pClient, size_t iCapacity );
示例已编译验证
/* XRT_API xsshcode xrtSshClientGlobalReplyReserve( xsshclient* pClient, size_t iCapacity ); */ result = xrtSshClientGlobalReplyReserve();
xrtSshClientContinue
凭据或其他外部认证数据就绪后,重新推进当前客户端动作。
| 参数 | 说明 |
|---|---|
| xsshclient* pClient | 客户端对象 |
示例已编译验证
/* 凭据或其他外部认证数据就绪后,重新推进当前客户端动作。 */ result = xrtSshClientContinue(pClient);
xrtSshClientHostKeyAccept
完成被 HostKey 回调延迟的信任决定。
| 参数 | 说明 |
|---|---|
| xsshclient* pClient | 客户端对象 |
示例已编译验证
/* 完成被 HostKey 回调延迟的信任决定。 */ result = xrtSshClientHostKeyAccept(pClient);
xrtSshClientHostKeyReject
XRT_API xsshcode xrtSshClientHostKeyReject(xsshclient* pClient);
示例已编译验证
/* XRT_API xsshcode xrtSshClientHostKeyReject(xsshclient* pClient); */ result = xrtSshClientHostKeyReject();
xrtSshClientPacketAccept
提交或拒绝用户 Packet 回调保留的输入;Retry 专门重试内部 OOM 暂停。
| 参数 | 说明 |
|---|---|
| xsshclient* pClient | 客户端对象 |
示例已编译验证
/* 提交或拒绝用户 Packet 回调保留的输入;Retry 专门重试内部 OOM 暂停。 */ result = xrtSshClientPacketAccept(pClient);
xrtSshClientPacketReject
XRT_API xsshcode xrtSshClientPacketReject(xsshclient* pClient);
示例已编译验证
/* XRT_API xsshcode xrtSshClientPacketReject(xsshclient* pClient); */ result = xrtSshClientPacketReject();
xrtSshClientPacketRetry
XRT_API xsshcode xrtSshClientPacketRetry(xsshclient* pClient);
示例已编译验证
/* XRT_API xsshcode xrtSshClientPacketRetry(xsshclient* pClient); */ result = xrtSshClientPacketRetry();
xrtSshClientSend
直接把完整 payload 编码并提交给有界 TCP 队列;视图只借用到函数返回。
| 参数 | 说明 |
|---|---|
| xsshclient* pClient | 客户端对象 |
| xbytesview Payload | 负载 |
| xsshchannel* pChannel | 通道对象 |
| xsshreplyqueue* pReplies | Reles 参数 |
| uint64 iReplyToken | RelyToken 参数 |
示例已编译验证
/* 直接把完整 payload 编码并提交给有界 TCP 队列;视图只借用到函数返回。 */ result = xrtSshClientSend(pClient, Payload, pChannel, pReplies, iReplyToken);
xrtSshClientBuild
在动态连续 scratch 中构建并发送一个控制报文,SPACE 会按上限扩容重试。
| 参数 | 说明 |
|---|---|
| xsshclient* pClient | 客户端对象 |
| xsshclientbuildproc pBuild | 构建 |
| ptr pBuildData | BuldData 参数 |
| xsshchannel* pChannel | 通道对象 |
| xsshreplyqueue* pReplies | Reles 参数 |
| uint64 iReplyToken | RelyToken 参数 |
示例已编译验证
/* 在动态连续 scratch 中构建并发送一个控制报文,SPACE 会按上限扩容重试。 */ result = xrtSshClientBuild(pClient, pBuild, pBuildData, pChannel, pReplies, iReplyToken);
xrtSshClientChannelOpen
创建动态 channel,并用类型专用构建器发送唯一 CHANNEL_OPEN。
| 参数 | 说明 |
|---|---|
| xsshclient* pClient | 客户端对象 |
| xsshclientchannelopenproc pOpen | Oen 参数 |
| ptr pOpenData | OenData 参数 |
| xsshchannel** ppChannel | 通道对象 |
示例已编译验证
/* 创建动态 channel,并用类型专用构建器发送唯一 CHANNEL_OPEN。 */ result = xrtSshClientChannelOpen(pClient, pOpen, pOpenData, ppChannel);
xrtSshClientChannelFlush
把指定 channel 发送队首封装为一条受窗口和最大包约束的数据消息。
| 参数 | 说明 |
|---|---|
| xsshclient* pClient | 客户端对象 |
| xsshchannel* pChannel | 通道对象 |
| xsshchanneliostream Stream | 流 |
示例已编译验证
/* 把指定 channel 发送队首封装为一条受窗口和最大包约束的数据消息。 */ result = xrtSshClientChannelFlush(pClient, pChannel, Stream);
xrtSshClientChannelAdjust
发送当前已消费接收数据对应的 WINDOW_ADJUST;无额度时返回 NEED_MORE。
| 参数 | 说明 |
|---|---|
| xsshclient* pClient | 客户端对象 |
| xsshchannel* pChannel | 通道对象 |
示例已编译验证
/* 发送当前已消费接收数据对应的 WINDOW_ADJUST;无额度时返回 NEED_MORE。 */ result = xrtSshClientChannelAdjust(pClient, pChannel);
xrtSshClientChannelEof
发送 channel 写方向 EOF 或双向关闭消息。
| 参数 | 说明 |
|---|---|
| xsshclient* pClient | 客户端对象 |
| xsshchannel* pChannel | 通道对象 |
示例已编译验证
/* 发送 channel 写方向 EOF 或双向关闭消息。 */ result = xrtSshClientChannelEof(pClient, pChannel);
xrtSshClientChannelClose
XRT_API xsshcode xrtSshClientChannelClose( xsshclient* pClient, xsshchannel* pChannel );
示例已编译验证
/* XRT_API xsshcode xrtSshClientChannelClose( xsshclient* pClient, xsshchannel* pChannel ); */ result = xrtSshClientChannelClose();
xrtSshClientAbort
中止未决 SSH 事务并异常关闭底层 TCP Stream。
| 参数 | 说明 |
|---|---|
| xsshclient* pClient | 客户端对象 |
示例已编译验证
/* 中止未决 SSH 事务并异常关闭底层 TCP Stream。 */ result = xrtSshClientAbort(pClient);