#ifndef __COMM_H #define __COMM_H #include #include #include #include #include #include #include #include #include using namespace std; #define EVENT_ACCESSAUTH_SUCCEED 0x50200001 // 准入成功 #define EVENT_ACCESSAUTH_FAILED 0x50280002 // 准入失败 #define EVENT_ACCESSAUTH_TIMEOUT 0x50280003 // 准入超时 #define EVENT_MOD_INITIALIZER_MK_LOADED 0x50900001 // 主密钥初始化成功 #define EVENT_MOD_INITIALIZER_MK_FAILED 0x50980002 // 主密钥初始化失败 #define PUKFILENAME_RSA "RVCPubKey.ini" #define PUKFILENAME_SM2 "RVCSM2PubKey.ini" #define PFKEYFILENAME_DES "CMBRVCKeys.dat" #define PFKEYFILENAME_SM4 "CMBRVCSm4Keys.dat" typedef unsigned char BYTE; void GetNewForm(const char* form, char* newForm); string GetOutPutStr(const char* form, ...); int str2int(const string str, int& ret); int str2int(const string str); #ifdef __linux__ #define RUNTIME_PATH "/opt/run/runinfo/runcfg" #include #include #include #include #include bool get_cpu_id_by_asm(std::string & cpu_id); bool get_cpu_id_by_system(std::string& cpu_id, const string save_path = RUNTIME_PATH); bool get_board_serial_by_system(std::string& board_serial, const string save_path = RUNTIME_PATH); bool get_disk_serial_by_system(std::vector& serial_no, int& errCode, const string save_path = RUNTIME_PATH); bool dir_is_exist(string dirPath); int dir_create(string dirPath); #include #include typedef struct { int year; int month; int day; int hour; int minute; int second; } TIME; extern "C" bool set_system_time_by_sec(int sec); #endif //__linux__ #endif // !__COMM_H