12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- #ifndef __COMM_H
- #define __COMM_H
- #include <string>
- #include <sstream>
- #include <cstdio>
- #include <vector>
- #include <cstring>
- #include <cmath>
- #include<iostream>
- #include <fstream>
- #include <algorithm>
- 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 <sys/types.h>
- #include <ifaddrs.h>
- #include <netinet/in.h>
- #include <arpa/inet.h>
- #include <unistd.h>
- 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<string>& serial_no, int& errCode, const string save_path = RUNTIME_PATH);
- bool dir_is_exist(string dirPath);
- int dir_create(string dirPath);
- #include<sys/time.h>
- #include <time.h>
- 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
|