xrtSshSessionStreamInit

复制会话配置和回调;此时不创建 Engine、Stream、会话动态块或后台任务。

bool xrtSshSessionStreamInit( xsshsessionstream* pSession, const xsshsessiontcpconfig* pConfig, const xsshsessionstreamevents* pEvents, ptr pData );
参数说明
xsshsessionstream* pSession会话对象
const xsshsessiontcpconfig* pConfig配置结构
const xsshsessionstreamevents* pEvents事件回调表
ptr pData用户数据
返回:复制会话配置和回调;此时不创建 Engine、Stream、会话动态块或后台任务。

示例已编译验证

sshsessionstreaminit obj;
xrtSshSessionStreamInit(&obj, pSession);

xrtSshSessionStreamClear

只清理尚未附着或已经关闭的驱动;活动连接必须先中止并等待 Close。

bool xrtSshSessionStreamClear(xsshsessionstream* pSession);
参数说明
xsshsessionstream* pSession会话对象
返回:只清理尚未附着或已经关闭的驱动;活动连接必须先中止并等待 Close。

示例已编译验证

/* 只清理尚未附着或已经关闭的驱动;活动连接必须先中止并等待 Close。 */
result = xrtSshSessionStreamClear(pSession);

xrtSshSessionStreamNetEvents

XRT_API const xnetstreamevents* xrtSshSessionStreamNetEvents(void);

;
返回:XRT_API const xnetstreamevents* xrtSshSessionStreamNetEvents(void);

示例已编译验证

/* XRT_API const xnetstreamevents* xrtSshSessionStreamNetEvents(void); */
result = xrtSshSessionStreamNetEvents();

xrtSshSessionStreamAttach

在 Stream Worker 上接管事件;已打开 Stream 必须尚未积压输入。

bool xrtSshSessionStreamAttach( xsshsessionstream* pSession, xnetstream* pStream );
参数说明
xsshsessionstream* pSession会话对象
xnetstream* pStream流对象
返回:在 Stream Worker 上接管事件;已打开 Stream 必须尚未积压输入。

示例已编译验证

/* 在 Stream Worker 上接管事件;已打开 Stream 必须尚未积压输入。 */
result = xrtSshSessionStreamAttach(pSession, pStream);

xrtSshSessionStreamState

返回驱动状态;无效对象返回独立 INVALID。

xsshsessionstreamstate xrtSshSessionStreamState( const xsshsessionstream* pSession );
参数说明
const xsshsessionstream* pSession会话对象
返回:返回驱动状态;无效对象返回独立 INVALID。

示例已编译验证

/* 返回驱动状态;无效对象返回独立 INVALID。 */
result = xrtSshSessionStreamState(pSession);

xrtSshSessionStreamTcp

返回已经附着且尚未关闭的借用 Stream;连接建立前也可能非空。

xnetstream* xrtSshSessionStreamTcp(xsshsessionstream* pSession);
参数说明
xsshsessionstream* pSession会话对象
返回:返回已经附着且尚未关闭的借用 Stream;连接建立前也可能非空。

示例已编译验证

/* 返回已经附着且尚未关闭的借用 Stream;连接建立前也可能非空。 */
result = xrtSshSessionStreamTcp(pSession);

xrtSshSessionStreamSession

返回可直接驱动 KEX、认证和 connection 的底层 SSH TCP 会话。

xsshsessiontcp* xrtSshSessionStreamSession( xsshsessionstream* pSession );
参数说明
xsshsessionstream* pSession会话对象
返回:返回可直接驱动 KEX、认证和 connection 的底层 SSH TCP 会话。

示例已编译验证

/* 返回可直接驱动 KEX、认证和 connection 的底层 SSH TCP 会话。 */
result = xrtSshSessionStreamSession(pSession);

xrtSshSessionStreamReader

返回按需明文和主机公钥读取器,保留完整低层事务能力。

xsshsessionreader* xrtSshSessionStreamReader( xsshsessionstream* pSession );
参数说明
xsshsessionstream* pSession会话对象
返回:返回按需明文和主机公钥读取器,保留完整低层事务能力。

示例已编译验证

/* 返回按需明文和主机公钥读取器,保留完整低层事务能力。 */
result = xrtSshSessionStreamReader(pSession);

xrtSshSessionStreamVersion

返回 HOLD 的 peer identification;其他状态返回空视图。

xstrview xrtSshSessionStreamVersion( const xsshsessionstream* pSession );
参数说明
const xsshsessionstream* pSession会话对象
返回:返回 HOLD 的 peer identification;其他状态返回空视图。

示例已编译验证

/* 返回 HOLD 的 peer identification;其他状态返回空视图。 */
result = xrtSshSessionStreamVersion(pSession);

xrtSshSessionStreamPacket

返回 HOLD 的已认证 packet;其他状态返回空指针。

const xsshsessiontcppacket* xrtSshSessionStreamPacket( const xsshsessionstream* pSession );
参数说明
const xsshsessionstream* pSession会话对象
返回:返回 HOLD 的已认证 packet;其他状态返回空指针。

示例已编译验证

/* 返回 HOLD 的已认证 packet;其他状态返回空指针。 */
result = xrtSshSessionStreamPacket(pSession);

xrtSshSessionStreamDrive

XRT_API xsshcode xrtSshSessionStreamDrive(xsshsessionstream* pSession);

;
返回:XRT_API xsshcode xrtSshSessionStreamDrive(xsshsessionstream* pSession);

示例已编译验证

/* XRT_API xsshcode xrtSshSessionStreamDrive(xsshsessionstream* pSession); */
result = xrtSshSessionStreamDrive();

xrtSshSessionStreamAccept

提交 HOLD 的 identification 或 packet,恢复读取并继续推进。

xsshcode xrtSshSessionStreamAccept(xsshsessionstream* pSession);
参数说明
xsshsessionstream* pSession会话对象
返回:提交 HOLD 的 identification 或 packet,恢复读取并继续推进。

示例已编译验证

/* 提交 HOLD 的 identification 或 packet,恢复读取并继续推进。 */
result = xrtSshSessionStreamAccept(pSession);

xrtSshSessionStreamReject

拒绝 HOLD 输入并异常关闭;返回底层读事务的中止结果。

xsshcode xrtSshSessionStreamReject(xsshsessionstream* pSession);
参数说明
xsshsessionstream* pSession会话对象
返回:拒绝 HOLD 输入并异常关闭;返回底层读事务的中止结果。

示例已编译验证

/* 拒绝 HOLD 输入并异常关闭;返回底层读事务的中止结果。 */
result = xrtSshSessionStreamReject(pSession);

xrtSshSessionStreamAbort

在所属 Worker 上回滚未进入 TCP 队列的输出、终止未决读取并请求异常关闭。

bool xrtSshSessionStreamAbort(xsshsessionstream* pSession);
参数说明
xsshsessionstream* pSession会话对象
返回:在所属 Worker 上回滚未进入 TCP 队列的输出、终止未决读取并请求异常关闭。

示例已编译验证

/* 在所属 Worker 上回滚未进入 TCP 队列的输出、终止未决读取并请求异常关闭。 */
result = xrtSshSessionStreamAbort(pSession);