-
Notifications
You must be signed in to change notification settings - Fork 0
/
syslog.h
62 lines (46 loc) · 1.11 KB
/
syslog.h
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
#ifndef LIB_SYSLOG_H
#define LIB_SYSLOG_H
// Needed for sscanf
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <limits.h>
#include <string.h>
#ifdef __cplusplus
extern "C"{
#endif
typedef struct syslog_extended_property_value_t {
char* key;
char* value;
} syslog_extended_property_value_t;
typedef struct syslog_extended_property_t {
char* id;
syslog_extended_property_value_t * pairs;
size_t num_pairs;
char* raw_interned_message;
} syslog_extended_property_t;
typedef struct syslog_message_t {
const char* message;
const char* syslog_version;
int severity;
int facility;
int pri_value;
const char* message_id;
const char* hostname;
const char* appname;
const char* process_id;
struct tm timestamp;
enum syslog_type {
RFC5424=5424
} syslog_type;
syslog_extended_property_t * structured_data;
size_t structured_data_count;
size_t message_length;
char* raw_interned_message;
} syslog_message_t;
int parse_syslog_message_t(const char*, syslog_message_t*);
void free_syslog_message_t(syslog_message_t * syslog_message);
#ifdef __cplusplus
}
#endif
#endif