cpfsyslog/src/sysparser.h

47 lines
758 B
C
Raw Normal View History

2018-07-04 17:44:29 -07:00
#include <stdio.h>
2018-05-25 17:12:09 -07:00
#include "pfparser.h"
2018-07-04 17:44:29 -07:00
2018-05-25 17:12:09 -07:00
#define DF_MONTH_LEN 9
2018-07-04 17:44:29 -07:00
const static char* month2nummap[] __attribute__ ((unused)) =
{[1] = "Jan",
[2] = "Feb",
[3] = "Mar",
[4] = "Apr",
[5] = "May",
[6] = "Jun",
[7] = "Jul",
[8] = "Aug",
[9] = "Sep",
[10] = "Oct",
[11] = "Nov",
[12] = "Dec"};
2018-05-25 17:12:09 -07:00
/*TODO numeric indicator for month?*/
struct Datefields {
char month[DF_MONTH_LEN];
int day;
int hour;
int minute;
int second;
};
/*TODO check max app name length*/
2018-05-28 12:48:37 -07:00
#define MSG_APP_LEN 16
2018-05-25 17:12:09 -07:00
struct SysMessage {
int priority;
char application[MSG_APP_LEN];
struct Datefields date;
};
int sysmsg_parse(struct SysMessage* result, char* message);
2018-07-04 17:44:29 -07:00
int month2num(char* month);