PracticeDev/study_clang/Mimic/test_messagequeue/include/CSwitchCommon.h

98 lines
4.2 KiB
C
Raw Normal View History

2022-12-20 17:31:11 +08:00
/*************************************************************************
> File Name : CSwitchCommon.h
> Author : FengChao
> EMail : smile.fengchao@gmail.com
> Created Time : Thu 23 Jul 2020 09:13:37 AM CST
************************************************************************/
#ifndef CSWITCHCOMMON_H
#define CSWITCHCOMMON_H
#define MAX_NOS_NUM 8
typedef enum Judge_Error_Code_E
{
JUDGE_ALL_SUCCESS=0, /*接收到所有执行体消息,全部一致*/
JUDGE_SUCC_WITH_TWO_STAGE, /*接收到所有执行体消息,有多数一致,但少数也一致*/
JUDGE_SUCC_WITH_MANY_STAGE, /*接收到所有执行体消息,有多数一致,但有多个少数群体*/
JUDGE_SUCC_WITH_TIMEOUT, /*未收到所有执行体消息,全部一致*/
JUDGE_SUCC_WITH_TIMEOUT_TWO_STAGE, /*未收到所有执行体消息,有多数一致,但少数也一致*/
JUDGE_SUCC_WITH_TIMEOUT_MANY_STAGE, /*未收到所有执行体消息,有多数一致,但有多个少数群体*/
JUDGE_ALL_FAIL_WITH_DIFF, /*收到所有执行体消息,全部不一致*/
JUDGE_FAIL_WITH_TWO_STAGE, /*收到所有执行体消息,分为数目相同的两个群体*/
JUDGE_FAIL_WITH_MANY_STAGE, /*收到所有执行体信息,分为多个少数群体*/
JUDGE_FAIL_WITH_TIMEOUT, /*未收到所有执行体消息,达不到裁决条件*/
JUDGE_FAIL_WITH_TIMEOUT_TWO_STAGE, /*未收到所有执行体消息,分为两个少数群体*/
JUDGE_FAIL_WITH_TIMEOUT_MANY_STAGE, /*未收到所有执行体消息,分为多个少数群体*/
ERROR_CODE_MAX
}Judge_Error_Code_T;
typedef struct Judge_Error_Msg_S
{
Judge_Error_Code_T uiErrorCode; //错误代码
#define NOS1_FLAG 1<<0
#define NOS2_FLAG 1<<1
#define NOS3_FLAG 1<<2
#define NOS4_FLAG 1<<3
#define NOS5_FLAG 1<<4
#define NOS6_FLAG 1<<5
#define NOS7_FLAG 1<<6
#define NOS8_FLAG 1<<7
#define NOS9_FLAG 1<<8
#define NOS10_FLAG 1<<9
uint uiNosIdx;
char szReserve[32];
}Judge_Error_Msg_T;
typedef enum Judge_Sys_Info_Error_Code_E
{
JUDGE_EXCESSIVE_CPU_OCCUPY, /*CPU占用率偏高*/
JUDGE_EXCESSIVE_MEM_OCCUPY, /*内存占用率偏高*/
JUDGE_EXCESSIVE_TCP_SOCKET, /*TCP SOCKET连接数过多*/
JUDGE_EXCESSIVE_PROGRESS, /*进程总数过多*/
JUDGE_SOMEONE_BROKEN_INTO, /*执行体被登入*/
JUDGE_EXCEPTION_SHELL, /*执行体运行了异常的shell命令*/
JUDGE_EXCEPTION_USER, /*执行体系统用户账户信息发生变化*/
JUDGE_EXCEPTION_GROUP, /*执行体系统用户组信息发生变化*/
JUDGE_CHANGE_CRON, /*计划任务个数产生变动*/
JUDGE_CHANGE_FILE_IN_PATH, /*PATH目录下文件个数产生变动*/
JUDGE_CHANGE_FILE_IN_HOME, /*用户目录下文件个数产生变动*/
JUDGE_EXCEPTION_APP, /*关键可执行文件被篡改*/
JUDGE_EXCEPTION_AUTOSTART, /*开机自启文件被篡改*/
JUDGE_EXCEPTION_MANAGER, /*管理进程被异常停止*/
JUDGE_EXCEPTION_PROTOCOL, /*协议进程被异常停止*/
JUDGE_EXCEPTION_LOCAL_CONFIG_MANAGER, /*本地配置管理器被异常停止*/
JUDGE_EXCEPTION_FIREWALL, /*防火墙被异常关闭*/
JUDGE_TIME_OUT /*某执行体状态信息上报超时*/
}Judge_Sys_Info_Error_Code_T;
typedef struct Judge_Sys_Info_Error_Msg_S
{
Judge_Sys_Info_Error_Code_T uiErrorCode; //错误代码
#define NOS1_FLAG 1<<0
#define NOS2_FLAG 1<<1
#define NOS3_FLAG 1<<2
#define NOS4_FLAG 1<<3
#define NOS5_FLAG 1<<4
#define NOS6_FLAG 1<<5
#define NOS7_FLAG 1<<6
#define NOS8_FLAG 1<<7
#define NOS9_FLAG 1<<8
#define NOS10_FLAG 1<<9
uint uiNosIdx;
char szReserve[32];
}Judge_Sys_Info_Error_Msg_T;
typedef enum {
HB_JUDGE_E = 1,
HB_SHD_E,
HB_MYSQL_E,
HB_WEB_E,
HB_CFG_MANAGER_E,
HB_MAX_E
}HEARBEAT_E;
#endif /*CSWITCHCOMMON_H*/