xrtSshAuthSessionInit
初始化不拥有外部资源的 client 或 server 认证会话。
| 参数 | 说明 |
|---|---|
| xsshauthsession* pSession | 会话对象 |
| xsshrole Role | 本地角色 |
示例已编译验证
sshauthsessioninit obj; xrtSshAuthSessionInit(&obj, pSession, Role);
xrtSshAuthSessionClear
清除会话状态和当前借用视图,不处理 transport 或调用方缓冲。
| 参数 | 说明 |
|---|---|
| xsshauthsession* pSession | 会话对象 |
示例已编译验证
/* 清除会话状态和当前借用视图,不处理 transport 或调用方缓冲。 */ result = xrtSshAuthSessionClear(pSession);
xrtSshAuthSessionBegin
在首轮 KEX 完成后开始 service 与 USERAUTH 编排。
| 参数 | 说明 |
|---|---|
| xsshauthsession* pSession | 会话对象 |
| const xsshtransportcore* pCore | 核心对象 |
| const xsshauthguardpolicy* pPolicy | 策略 |
| uint64 iNowMs | 当前毫秒时间 |
示例已编译验证
/* 在首轮 KEX 完成后开始 service 与 USERAUTH 编排。 */ result = xrtSshAuthSessionBegin(pSession, pCore, pPolicy, iNowMs);
xrtSshAuthSessionEvent
返回当前最常见的下一动作,不推进任何状态。
| 参数 | 说明 |
|---|---|
| const xsshauthsession* pSession | 会话对象 |
示例已编译验证
/* 返回当前最常见的下一动作,不推进任何状态。 */ result = xrtSshAuthSessionEvent(pSession);
xrtSshAuthSessionBudget
复制当前认证资源预算,输出不借用会话内部地址。
| 参数 | 说明 |
|---|---|
| const xsshauthsession* pSession | 会话对象 |
| xsshauthguard* pBudget | Budget 参数 |
示例已编译验证
/* 复制当前认证资源预算,输出不借用会话内部地址。 */ result = xrtSshAuthSessionBudget(pSession, pBudget);
xrtSshAuthSessionCheck
检查认证超时和资源预算;耗尽时会话进入失败状态。
| 参数 | 说明 |
|---|---|
| xsshauthsession* pSession | 会话对象 |
| uint64 iNowMs | 当前毫秒时间 |
| xsshauthguarddecision* pDecision | Decson 参数 |
示例已编译验证
/* 检查认证超时和资源预算;耗尽时会话进入失败状态。 */ result = xrtSshAuthSessionCheck(pSession, iNowMs, pDecision);
xrtSshAuthSessionWritePrepare
XRT_API xsshcode xrtSshAuthSessionWritePrepare( xsshauthsession* pSession, const xsshtransportcore* pCore, xbytesview Payload, uint64 iNowMs );
示例已编译验证
/* XRT_API xsshcode xrtSshAuthSessionWritePrepare( xsshauthsession* pSession, const xsshtransportcore* pCore, xbytesview Payload, uint64 iNowMs ); */ result = xrtSshAuthSessionWritePrepare();
xrtSshAuthSessionWriteCommit
transport core 已可靠提交当前输出后提交认证写事务。
| 参数 | 说明 |
|---|---|
| xsshauthsession* pSession | 会话对象 |
| const xsshtransportcore* pCore | 核心对象 |
示例已编译验证
/* transport core 已可靠提交当前输出后提交认证写事务。 */ result = xrtSshAuthSessionWriteCommit(pSession, pCore);
xrtSshAuthSessionWriteAbort
放弃尚未交给 transport 的认证输出,不消费状态或资源预算。
| 参数 | 说明 |
|---|---|
| xsshauthsession* pSession | 会话对象 |
示例已编译验证
/* 放弃尚未交给 transport 的认证输出,不消费状态或资源预算。 */ result = xrtSshAuthSessionWriteAbort(pSession);
xrtSshAuthSessionReadPrepare
XRT_API xsshcode xrtSshAuthSessionReadPrepare( xsshauthsession* pSession, const xsshtransportcore* pCore, xbytesview Payload, uint64 iNowMs, xsshauthsessionpacket* pPacket );
示例已编译验证
/* XRT_API xsshcode xrtSshAuthSessionReadPrepare( xsshauthsession* pSession, const xsshtransportcore* pCore, xbytesview Payload, uint64 iNowMs, xsshauthsessionpacket* pPacket ); */ result = xrtSshAuthSessionReadPrepare();
xrtSshAuthSessionRequest
返回当前待读事务中的通用 USERAUTH_REQUEST 借用视图。
| 参数 | 说明 |
|---|---|
| const xsshauthsession* pSession | 会话对象 |
| xsshauthrequest* pRequest | 请求对象 |
示例已编译验证
/* 返回当前待读事务中的通用 USERAUTH_REQUEST 借用视图。 */ result = xrtSshAuthSessionRequest(pSession, pRequest);
xrtSshAuthSessionFailure
返回当前待读事务中的 USERAUTH_FAILURE 借用视图。
| 参数 | 说明 |
|---|---|
| const xsshauthsession* pSession | 会话对象 |
| xsshauthfailure* pFailure | Falure 参数 |
示例已编译验证
/* 返回当前待读事务中的 USERAUTH_FAILURE 借用视图。 */ result = xrtSshAuthSessionFailure(pSession, pFailure);
xrtSshAuthSessionBanner
返回当前待读事务中的 USERAUTH_BANNER 借用视图。
| 参数 | 说明 |
|---|---|
| const xsshauthsession* pSession | 会话对象 |
| xsshauthbanner* pBanner | 横幅 |
示例已编译验证
/* 返回当前待读事务中的 USERAUTH_BANNER 借用视图。 */ result = xrtSshAuthSessionBanner(pSession, pBanner);
xrtSshAuthSessionMethod
返回当前待读事务中的方法专用完整 payload。
| 参数 | 说明 |
|---|---|
| const xsshauthsession* pSession | 会话对象 |
| xbytesview* pPayload | 负载 |
示例已编译验证
/* 返回当前待读事务中的方法专用完整 payload。 */ result = xrtSshAuthSessionMethod(pSession, pPayload);
xrtSshAuthSessionReadCommit
transport core 已提交当前输入后提交认证读事务。
| 参数 | 说明 |
|---|---|
| xsshauthsession* pSession | 会话对象 |
| const xsshtransportcore* pCore | 核心对象 |
示例已编译验证
/* transport core 已提交当前输入后提交认证读事务。 */ result = xrtSshAuthSessionReadCommit(pSession, pCore);
xrtSshAuthSessionReadAbort
放弃已认证但不能接受的认证输入,并把会话置为失败状态。
| 参数 | 说明 |
|---|---|
| xsshauthsession* pSession | 会话对象 |
示例已编译验证
/* 放弃已认证但不能接受的认证输入,并把会话置为失败状态。 */ result = xrtSshAuthSessionReadAbort(pSession);
xrtSshAuthSessionFail
显式终止认证编排;重复调用保持失败状态。
| 参数 | 说明 |
|---|---|
| xsshauthsession* pSession | 会话对象 |
示例已编译验证
/* 显式终止认证编排;重复调用保持失败状态。 */ result = xrtSshAuthSessionFail(pSession);
xrtSshAuthSessionComplete
判断本端会话、预算和 transport 的 server 成功方向都已提交。
| 参数 | 说明 |
|---|---|
| const xsshauthsession* pSession | 会话对象 |
| const xsshtransportcore* pCore | 核心对象 |
示例已编译验证
/* 判断本端会话、预算和 transport 的 server 成功方向都已提交。 */ result = xrtSshAuthSessionComplete(pSession, pCore);