devicelog.h

来自「接收端的程序」· C头文件 代码 · 共 62 行

H
62
字号
#ifndef _DEVICELOG_H
#define _DEVICELOG_H
	
typedef struct eventinfo
{
	char time_stamp[20];/*the time stamp in the log*/
	char ip[16];/*the host name */
	char source[2];  /*0--syslog, 1--trap, 3--agent*/
	char facility[80]; /*the object about the event*/
	char serverity[2]; /*the lever of serverity */
	char content[5000]; /*the content of the log*/

}eventinfo;

	
int getmon();
int getmin();
int getsec();
int gethour();
	
	
/*get the current day*/	
int getday();

/*get the current year*/
int getyear();

/*get the priority from the msg*/
int getofpri(char * msg);

/*get the facility from msg*/
void getoffacility_std(char *msg,char *fac);

/*get the serverity from msg*/
void getofserverity_std(char *msg,char *serv);

/*get time style from msg*/
void getoftime_std(char *msg,char *time);

/*get the hostname from the msg*/
void getofhostname_std(char *msg,char *hostname);

/*get the content from the msg*/
void getofcontent_std(char *msg,char *content);

/*get the standard timestamp according to the database*/
void processtimestamp_std(char *msg,char *timestamp,char **month);

void processtimestamp_cisco(char *msg,char *timestamp);

void getfacility_cisco(char *msg, char *facility);

void getserverity_cisco(char *msg, char *serverity);

void getcontent_cisco(char *msg,char *content);

/*get the standard log format from string msg*/
void getmsg(char *msg,struct eventinfo *log);


#endif  /*devicelog.h*/

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?