xrtSshSessionTcpConfigInit
写入指定角色的默认 transport、rekey 与空外部 connection 配置。
| 参数 | 说明 |
|---|---|
| xsshsessiontcpconfig* pConfig | 配置结构 |
| xsshrole Role | 本地角色 |
示例已编译验证
sshsessiontcpconfiginit obj; xrtSshSessionTcpConfigInit(&obj, Role);
xrtSshSessionTcpInit
使用同一动态缓冲池初始化 TCP transport 与连接级协议核心。
| 参数 | 说明 |
|---|---|
| xsshsessiontcp* pSession | 会话对象 |
| xnetbufpool* pPool | 池 |
| const xsshsessiontcpconfig* pConfig | 配置结构 |
| uint64 iNowMs | 当前毫秒时间 |
示例已编译验证
sshsessiontcpinit obj; xrtSshSessionTcpInit(&obj, pSession, pPool, iNowMs);
xrtSshSessionTcpClear
放弃未决事务、释放动态链并清除全部密码状态;不处理 Stream 和外部对象。
| 参数 | 说明 |
|---|---|
| xsshsessiontcp* pSession | 会话对象 |
示例已编译验证
/* 放弃未决事务、释放动态链并清除全部密码状态;不处理 Stream 和外部对象。 */ result = xrtSshSessionTcpClear(pSession);
xrtSshSessionTcpTransport
返回可直接访问 packet、cipher、rekey 和 TCP 动态缓冲的 transport。
| 参数 | 说明 |
|---|---|
| xsshsessiontcp* pSession | 会话对象 |
示例已编译验证
/* 返回可直接访问 packet、cipher、rekey 和 TCP 动态缓冲的 transport。 */ result = xrtSshSessionTcpTransport(pSession);
xrtSshSessionTcpTransportConst
返回只读 TCP transport;无效对象返回空。
| 参数 | 说明 |
|---|---|
| const xsshsessiontcp* pSession | 会话对象 |
示例已编译验证
/* 返回只读 TCP transport;无效对象返回空。 */ result = xrtSshSessionTcpTransportConst(pSession);
xrtSshSessionTcpCore
返回 KEX、认证和 connection 编排核心,保留全部底层访问能力。
| 参数 | 说明 |
|---|---|
| xsshsessiontcp* pSession | 会话对象 |
示例已编译验证
/* 返回 KEX、认证和 connection 编排核心,保留全部底层访问能力。 */ result = xrtSshSessionTcpCore(pSession);
xrtSshSessionTcpCoreConst
返回只读连接级协议核心;无效对象返回空。
| 参数 | 说明 |
|---|---|
| const xsshsessiontcp* pSession | 会话对象 |
示例已编译验证
/* 返回只读连接级协议核心;无效对象返回空。 */ result = xrtSshSessionTcpCoreConst(pSession);
xrtSshSessionTcpPhase
返回当前 identification、KEX、认证、connection、rekey 或失败阶段。
| 参数 | 说明 |
|---|---|
| const xsshsessiontcp* pSession | 会话对象 |
示例已编译验证
/* 返回当前 identification、KEX、认证、connection、rekey 或失败阶段。 */ result = xrtSshSessionTcpPhase(pSession);
xrtSshSessionTcpAction
返回统一的 identification、KEX、认证或 connection 下一动作。
| 参数 | 说明 |
|---|---|
| const xsshsessiontcp* pSession | 会话对象 |
示例已编译验证
/* 返回统一的 identification、KEX、认证或 connection 下一动作。 */ result = xrtSshSessionTcpAction(pSession);
xrtSshSessionTcpKexBeginWithPrivate
使用显式 Curve25519 私钥开始当前已就绪的 KEX。
| 参数 | 说明 |
|---|---|
| xsshsessiontcp* pSession | 会话对象 |
| xbytesview ServerHostKey | ServerHostKey 参数 |
| xbytesview PrivateKey | PrvateKey 参数 |
示例已编译验证
/* 使用显式 Curve25519 私钥开始当前已就绪的 KEX。 */ result = xrtSshSessionTcpKexBeginWithPrivate(pSession, ServerHostKey, PrivateKey);
xrtSshSessionTcpAuthBegin
首轮 KEX 完成后开始 USERAUTH;策略和单调时钟仍由调用方提供。
| 参数 | 说明 |
|---|---|
| xsshsessiontcp* pSession | 会话对象 |
| const xsshauthguardpolicy* pPolicy | 策略 |
| uint64 iNowMs | 当前毫秒时间 |
示例已编译验证
/* 首轮 KEX 完成后开始 USERAUTH;策略和单调时钟仍由调用方提供。 */ result = xrtSshSessionTcpAuthBegin(pSession, pPolicy, iNowMs);
xrtSshSessionTcpIdentificationWritePrepare
同时准备本端版本 transcript 与唯一 identification 线路输出。
| 参数 | 说明 |
|---|---|
| xsshsessiontcp* pSession | 会话对象 |
| xstrview Version | 版本 |
示例已编译验证
/* 同时准备本端版本 transcript 与唯一 identification 线路输出。 */ result = xrtSshSessionTcpIdentificationWritePrepare(pSession, Version);
xrtSshSessionTcpWritePrepareWithPadding
同时准备上层协议事务和使用调用方 padding 的唯一 packet 线路输出。
| 参数 | 说明 |
|---|---|
| xsshsessiontcp* pSession | 会话对象 |
| xbytesview Payload | 负载 |
| xsshchannelcore* pChannel | 通道对象 |
| xsshreplyqueue* pReplies | Reles 参数 |
| uint64 iReplyToken | RelyToken 参数 |
| xsshpaddingproc pPadding | Paddng 参数 |
| ptr pPaddingData | PaddngData 参数 |
| uint64 iNowMs | 当前毫秒时间 |
| xsshsessionpacketkind* pKind | 类型 |
示例已编译验证
/* 同时准备上层协议事务和使用调用方 padding 的唯一 packet 线路输出。 */ result = xrtSshSessionTcpWritePrepareWithPadding(pSession, Payload, pChannel, pReplies, iReplyToken, pPadding, pPaddingData, iNowMs, pKind);
xrtSshSessionTcpWriteSubmit
XRT_API xnetresult xrtSshSessionTcpWriteSubmit( xsshsessiontcp* pSession, xnetstream* pStream, uint64 iNowMs, xsshrekeydecision* pDecision );
示例已编译验证
/* XRT_API xnetresult xrtSshSessionTcpWriteSubmit( xsshsessiontcp* pSession, xnetstream* pStream, uint64 iNowMs, xsshrekeydecision* pDecision ); */ result = xrtSshSessionTcpWriteSubmit();
xrtSshSessionTcpWriteAbort
先回滚上层候选,再放弃尚未进入 TCP 队列的动态输出。
| 参数 | 说明 |
|---|---|
| xsshsessiontcp* pSession | 会话对象 |
示例已编译验证
/* 先回滚上层候选,再放弃尚未进入 TCP 队列的动态输出。 */ result = xrtSshSessionTcpWriteAbort(pSession);
xrtSshSessionTcpWriteSize
返回当前可直接重试提交的 identification 或 packet 线路字节数。
| 参数 | 说明 |
|---|---|
| const xsshsessiontcp* pSession | 会话对象 |
示例已编译验证
/* 返回当前可直接重试提交的 identification 或 packet 线路字节数。 */ result = xrtSshSessionTcpWriteSize(pSession);
xrtSshSessionTcpIdentificationReadPrepare
从分块 TCP 输入准备 peer identification,并同步保存版本 transcript。
| 参数 | 说明 |
|---|---|
| xsshsessiontcp* pSession | 会话对象 |
| xnetbuf* pInput | 输入 |
| xstrview* pVersion | 版本 |
示例已编译验证
/* 从分块 TCP 输入准备 peer identification,并同步保存版本 transcript。 */ result = xrtSshSessionTcpIdentificationReadPrepare(pSession, pInput, pVersion);
xrtSshSessionTcpReadInspect
只探测下一 packet 的线路尺寸和明文工作区需求,不改变会话状态。
| 参数 | 说明 |
|---|---|
| const xsshsessiontcp* pSession | 会话对象 |
| const xnetbuf* pInput | 输入 |
| xsshpacketneed* pNeed | Need 参数 |
示例已编译验证
/* 只探测下一 packet 的线路尺寸和明文工作区需求,不改变会话状态。 */ result = xrtSshSessionTcpReadInspect(pSession, pInput, pNeed);
xrtSshSessionTcpReadPrepare
XRT_API xsshcode xrtSshSessionTcpReadPrepare( xsshsessiontcp* pSession, xnetbuf* pInput, void* pPlain, size_t iPlainCapacity, void* pHostKeyStorage, size_t iHostKeyCapacity, size_t* pHostKeySize, uint64 iNowMs, xsshsessiontcppacket* pPacket );
示例已编译验证
/* XRT_API xsshcode xrtSshSessionTcpReadPrepare( xsshsessiontcp* pSession, xnetbuf* pInput, void* pPlain, size_t iPlainCapacity, void* pHostKeyStorage, size_t iHostKeyCapacity, size_t* pHostKeySize, uint64 iNowMs, xsshsessiontcppacket* pPacket ); */ result = xrtSshSessionTcpReadPrepare();
xrtSshSessionTcpReadCommit
先消费并提交 transport,再提交版本或协议事务并按需切换读密钥。
| 参数 | 说明 |
|---|---|
| xsshsessiontcp* pSession | 会话对象 |
| uint64 iNowMs | 当前毫秒时间 |
| xsshrekeydecision* pDecision | Decson 参数 |
示例已编译验证
/* 先消费并提交 transport,再提交版本或协议事务并按需切换读密钥。 */ result = xrtSshSessionTcpReadCommit(pSession, iNowMs, pDecision);
xrtSshSessionTcpReadAbort
拒绝当前借用输入,消费对应线路前缀并终止不可继续的 transport 与会话。
| 参数 | 说明 |
|---|---|
| xsshsessiontcp* pSession | 会话对象 |
示例已编译验证
/* 拒绝当前借用输入,消费对应线路前缀并终止不可继续的 transport 与会话。 */ result = xrtSshSessionTcpReadAbort(pSession);