21#include "hitls_build.h"
52int32_t ALERT_Init(TLS_Ctx *ctx);
61void ALERT_Deinit(TLS_Ctx *ctx);
73bool ALERT_GetFlag(
const TLS_Ctx *ctx);
83void ALERT_GetInfo(
const TLS_Ctx *ctx,
ALERT_Info *info);
91void ALERT_CleanInfo(
const TLS_Ctx *ctx);
102void ALERT_Send(
const TLS_Ctx *ctx, ALERT_Level level, ALERT_Description description);
113int32_t ALERT_Flush(TLS_Ctx *ctx);
124int32_t ProcessDecryptedAlert(TLS_Ctx *ctx,
const uint8_t *data, uint32_t dataLen);
135int32_t ProcessPlainAlert(TLS_Ctx *ctx,
const uint8_t *data, uint32_t dataLen);
144void ALERT_ClearWarnCount(TLS_Ctx *ctx, uint32_t recordType);
154bool ALERT_HaveExceeded(TLS_Ctx *ctx, uint8_t threshold);
157int32_t ReturnAlertProcess(TLS_Ctx *ctx, int32_t err, uint32_t logId,
const void *logStr,
158 ALERT_Description description);
160#define RETURN_ALERT_PROCESS(ctx, err, logId, logStr, description) \
161 ReturnAlertProcess(ctx, err, logId, LOG_STR(logStr), description)
165#define RETURN_ALERT_PROCESS(ctx, err, logId, logStr, description) \
166 (ctx)->method.sendAlert(ctx, ALERT_LEVEL_FATAL, description), (err)