1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
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
|