xrtSshAuthSessionInit

初始化不拥有外部资源的 client 或 server 认证会话。

bool xrtSshAuthSessionInit( xsshauthsession* pSession, xsshrole Role );
参数说明
xsshauthsession* pSession会话对象
xsshrole Role本地角色
返回:初始化不拥有外部资源的 client 或 server 认证会话。

示例已编译验证

sshauthsessioninit obj;
xrtSshAuthSessionInit(&obj, pSession, Role);

xrtSshAuthSessionClear

清除会话状态和当前借用视图,不处理 transport 或调用方缓冲。

void xrtSshAuthSessionClear(xsshauthsession* pSession);
参数说明
xsshauthsession* pSession会话对象
返回:清除会话状态和当前借用视图,不处理 transport 或调用方缓冲。

示例已编译验证

/* 清除会话状态和当前借用视图,不处理 transport 或调用方缓冲。 */
result = xrtSshAuthSessionClear(pSession);

xrtSshAuthSessionBegin

在首轮 KEX 完成后开始 service 与 USERAUTH 编排。

xsshcode xrtSshAuthSessionBegin( xsshauthsession* pSession, const xsshtransportcore* pCore, const xsshauthguardpolicy* pPolicy, uint64 iNowMs );
参数说明
xsshauthsession* pSession会话对象
const xsshtransportcore* pCore核心对象
const xsshauthguardpolicy* pPolicy策略
uint64 iNowMs当前毫秒时间
返回:在首轮 KEX 完成后开始 service 与 USERAUTH 编排。

示例已编译验证

/* 在首轮 KEX 完成后开始 service 与 USERAUTH 编排。 */
result = xrtSshAuthSessionBegin(pSession, pCore, pPolicy, iNowMs);

xrtSshAuthSessionEvent

返回当前最常见的下一动作,不推进任何状态。

xsshauthsessionevent xrtSshAuthSessionEvent( const xsshauthsession* pSession );
参数说明
const xsshauthsession* pSession会话对象
返回:返回当前最常见的下一动作,不推进任何状态。

示例已编译验证

/* 返回当前最常见的下一动作,不推进任何状态。 */
result = xrtSshAuthSessionEvent(pSession);

xrtSshAuthSessionBudget

复制当前认证资源预算,输出不借用会话内部地址。

xsshcode xrtSshAuthSessionBudget( const xsshauthsession* pSession, xsshauthguard* pBudget );
参数说明
const xsshauthsession* pSession会话对象
xsshauthguard* pBudgetBudget 参数
返回:复制当前认证资源预算,输出不借用会话内部地址。

示例已编译验证

/* 复制当前认证资源预算,输出不借用会话内部地址。 */
result = xrtSshAuthSessionBudget(pSession, pBudget);

xrtSshAuthSessionCheck

检查认证超时和资源预算;耗尽时会话进入失败状态。

xsshcode xrtSshAuthSessionCheck( xsshauthsession* pSession, uint64 iNowMs, xsshauthguarddecision* pDecision );
参数说明
xsshauthsession* pSession会话对象
uint64 iNowMs当前毫秒时间
xsshauthguarddecision* pDecisionDecson 参数
返回:检查认证超时和资源预算;耗尽时会话进入失败状态。

示例已编译验证

/* 检查认证超时和资源预算;耗尽时会话进入失败状态。 */
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 );

示例已编译验证

/* XRT_API xsshcode xrtSshAuthSessionWritePrepare( xsshauthsession* pSession, const xsshtransportcore* pCore, xbytesview Payload, uint64 iNowMs ); */
result = xrtSshAuthSessionWritePrepare();

xrtSshAuthSessionWriteCommit

transport core 已可靠提交当前输出后提交认证写事务。

xsshcode xrtSshAuthSessionWriteCommit( xsshauthsession* pSession, const xsshtransportcore* pCore );
参数说明
xsshauthsession* pSession会话对象
const xsshtransportcore* pCore核心对象
返回:transport core 已可靠提交当前输出后提交认证写事务。

示例已编译验证

/* transport core 已可靠提交当前输出后提交认证写事务。 */
result = xrtSshAuthSessionWriteCommit(pSession, pCore);

xrtSshAuthSessionWriteAbort

放弃尚未交给 transport 的认证输出,不消费状态或资源预算。

xsshcode xrtSshAuthSessionWriteAbort(xsshauthsession* pSession);
参数说明
xsshauthsession* pSession会话对象
返回:放弃尚未交给 transport 的认证输出,不消费状态或资源预算。

示例已编译验证

/* 放弃尚未交给 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 );

示例已编译验证

/* XRT_API xsshcode xrtSshAuthSessionReadPrepare( xsshauthsession* pSession, const xsshtransportcore* pCore, xbytesview Payload, uint64 iNowMs, xsshauthsessionpacket* pPacket ); */
result = xrtSshAuthSessionReadPrepare();

xrtSshAuthSessionRequest

返回当前待读事务中的通用 USERAUTH_REQUEST 借用视图。

xsshcode xrtSshAuthSessionRequest( const xsshauthsession* pSession, xsshauthrequest* pRequest );
参数说明
const xsshauthsession* pSession会话对象
xsshauthrequest* pRequest请求对象
返回:返回当前待读事务中的通用 USERAUTH_REQUEST 借用视图。

示例已编译验证

/* 返回当前待读事务中的通用 USERAUTH_REQUEST 借用视图。 */
result = xrtSshAuthSessionRequest(pSession, pRequest);

xrtSshAuthSessionFailure

返回当前待读事务中的 USERAUTH_FAILURE 借用视图。

xsshcode xrtSshAuthSessionFailure( const xsshauthsession* pSession, xsshauthfailure* pFailure );
参数说明
const xsshauthsession* pSession会话对象
xsshauthfailure* pFailureFalure 参数
返回:返回当前待读事务中的 USERAUTH_FAILURE 借用视图。

示例已编译验证

/* 返回当前待读事务中的 USERAUTH_FAILURE 借用视图。 */
result = xrtSshAuthSessionFailure(pSession, pFailure);

xrtSshAuthSessionBanner

返回当前待读事务中的 USERAUTH_BANNER 借用视图。

xsshcode xrtSshAuthSessionBanner( const xsshauthsession* pSession, xsshauthbanner* pBanner );
参数说明
const xsshauthsession* pSession会话对象
xsshauthbanner* pBanner横幅
返回:返回当前待读事务中的 USERAUTH_BANNER 借用视图。

示例已编译验证

/* 返回当前待读事务中的 USERAUTH_BANNER 借用视图。 */
result = xrtSshAuthSessionBanner(pSession, pBanner);

xrtSshAuthSessionMethod

返回当前待读事务中的方法专用完整 payload。

xsshcode xrtSshAuthSessionMethod( const xsshauthsession* pSession, xbytesview* pPayload );
参数说明
const xsshauthsession* pSession会话对象
xbytesview* pPayload负载
返回:返回当前待读事务中的方法专用完整 payload。

示例已编译验证

/* 返回当前待读事务中的方法专用完整 payload。 */
result = xrtSshAuthSessionMethod(pSession, pPayload);

xrtSshAuthSessionReadCommit

transport core 已提交当前输入后提交认证读事务。

xsshcode xrtSshAuthSessionReadCommit( xsshauthsession* pSession, const xsshtransportcore* pCore );
参数说明
xsshauthsession* pSession会话对象
const xsshtransportcore* pCore核心对象
返回:transport core 已提交当前输入后提交认证读事务。

示例已编译验证

/* transport core 已提交当前输入后提交认证读事务。 */
result = xrtSshAuthSessionReadCommit(pSession, pCore);

xrtSshAuthSessionReadAbort

放弃已认证但不能接受的认证输入,并把会话置为失败状态。

xsshcode xrtSshAuthSessionReadAbort(xsshauthsession* pSession);
参数说明
xsshauthsession* pSession会话对象
返回:放弃已认证但不能接受的认证输入,并把会话置为失败状态。

示例已编译验证

/* 放弃已认证但不能接受的认证输入,并把会话置为失败状态。 */
result = xrtSshAuthSessionReadAbort(pSession);

xrtSshAuthSessionFail

显式终止认证编排;重复调用保持失败状态。

void xrtSshAuthSessionFail(xsshauthsession* pSession);
参数说明
xsshauthsession* pSession会话对象
返回:显式终止认证编排;重复调用保持失败状态。

示例已编译验证

/* 显式终止认证编排;重复调用保持失败状态。 */
result = xrtSshAuthSessionFail(pSession);

xrtSshAuthSessionComplete

判断本端会话、预算和 transport 的 server 成功方向都已提交。

bool xrtSshAuthSessionComplete( const xsshauthsession* pSession, const xsshtransportcore* pCore );
参数说明
const xsshauthsession* pSession会话对象
const xsshtransportcore* pCore核心对象
返回:判断本端会话、预算和 transport 的 server 成功方向都已提交。

示例已编译验证

/* 判断本端会话、预算和 transport 的 server 成功方向都已提交。 */
result = xrtSshAuthSessionComplete(pSession, pCore);