summaryrefslogtreecommitdiff
path: root/src/include/MESA/asmis_log.h
diff options
context:
space:
mode:
authorzhangchengwei <[email protected]>2019-06-12 11:51:21 +0800
committerzhangchengwei <[email protected]>2019-06-12 11:51:21 +0800
commit36538c5b592a2cae350853da66ed40f93ddb39c7 (patch)
tree8b53c0c8002d8afd06909d6b22c292ebc7973bdf /src/include/MESA/asmis_log.h
创建
Diffstat (limited to 'src/include/MESA/asmis_log.h')
-rw-r--r--src/include/MESA/asmis_log.h73
1 files changed, 73 insertions, 0 deletions
diff --git a/src/include/MESA/asmis_log.h b/src/include/MESA/asmis_log.h
new file mode 100644
index 0000000..b04dc89
--- /dev/null
+++ b/src/include/MESA/asmis_log.h
@@ -0,0 +1,73 @@
+#ifndef __ASMIS_LOG_H
+#define __ASMIS_LOG_H
+#ifndef __cplusplus
+#error("This file should be compiled with C++ compiler")
+#endif
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <time.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+
+//#include <support/thread_safe.h>
+
+#define ASMIS_KEY 0x01
+#define ASMIS_ALARM 0x02
+#define ASMIS_OTHER 0x03
+
+#define ASMIS_LOGMSG_TIMEOUT 300 //second
+#define ASMIS_LOGMSG_LENGTH 40000 //bytes
+
+//ϵͳʹ�ö˿���Ϣ�ṹ��
+struct info_port_used {
+ unsigned short nPort;
+ unsigned char nProtocolType;
+ unsigned char nPortType;
+ char sPortDesc[128];
+};
+
+//ϵͳʵʱ������Ϣ�ṹ��
+struct info_rtd_flow {
+ char sValType[32];
+ char sBDType[32];
+ time_t nRTTS;
+ int nDuration;
+ unsigned long long nValue;
+};
+
+//ϵͳ���Ը�����Ϣ�ṹ��
+struct info_policy_update {
+ char sName[128];
+ char sDesc[256];
+ time_t nUpdateTime;
+ char sVersion[33];
+ int nTotal;
+ int nNew;
+ int nDelete;
+ int nUpdate;
+ int nSize;
+};
+
+//NetLog��ʼ��
+void* asmis_log_Init(const char *pProcName);
+//�Ǽdz���汾��Ϣ
+int asmis_log_AppVer(void* netlog_handle,const char *pVersionTime, const char *pVersionNO, const char *pVersionDesc);
+//ϵͳ������־
+int asmis_log_LogMsg(void* netlog_handle,const char *pMsg, const char *pNo, int nAlarmType);
+//�Ǽ�ϵͳʹ�ö˿�
+int asmis_log_PortUsed(void* netlog_handle,struct info_port_used *info, int nPort);
+//�Ǽ�ϵͳʵʱ������Ϣ
+int asmis_log_RtdFlow(void* netlog_handle,time_t nStartTime, int nDuration, struct info_rtd_flow *info, int nFlow);
+//�Ǽ�ϵͳ��ʼ����
+int asmis_log_RunStart(void* netlog_handle,int nContiRun);
+//�Ǽ�ϵͳֹͣ��Ϣ
+int asmis_log_RunStop(void* netlog_handle,int nContiRun);
+//������Ϣ
+int asmis_log_HeartBeat(void* netlog_handle,const char *pMsg);
+//���Ը�����Ϣ
+int asmis_log_Policy(void* netlog_handle,struct info_policy_update *info, int nPolicy);
+
+#endif