40 #ifndef __EVTLOG_H_INCLUDED
41 #define __EVTLOG_H_INCLUDED
47 #include <sys/types.h>
48 #include <sys/socket.h>
49 #include <netinet/in.h>
50 #include <arpa/inet.h>
55 #define EVT_PRI_EMERG 0
56 #define EVT_PRI_ALERT 1
57 #define EVT_PRI_CRIT 2
59 #define EVT_PRI_WARNING 4
60 #define EVT_PRI_NOTICE 5
61 #define EVT_PRI_INFO 6
62 #define EVT_PRI_DEBUG 7
64 #define EVT_FAC_KERN (0<<3)
65 #define EVT_FAC_USER (1<<3)
66 #define EVT_FAC_MAIL (2<<3)
67 #define EVT_FAC_DAEMON (3<<3)
68 #define EVT_FAC_AUTH (4<<3)
69 #define EVT_FAC_SYSLOG (5<<3)
70 #define EVT_FAC_LPR (6<<3)
71 #define EVT_FAC_NEWS (7<<3)
72 #define EVT_FAC_UUCP (8<<3)
73 #define EVT_FAC_CRON (9<<3)
74 #define EVT_FAC_AUTHPRIV (10<<3)
75 #define EVT_FAC_FTP (11<<3)
78 #define EVT_FAC_LOCAL0 (16<<3)
79 #define EVT_FAC_LOCAL1 (17<<3)
80 #define EVT_FAC_LOCAL2 (18<<3)
81 #define EVT_FAC_LOCAL3 (19<<3)
82 #define EVT_FAC_LOCAL4 (20<<3)
83 #define EVT_FAC_LOCAL5 (21<<3)
84 #define EVT_FAC_LOCAL6 (22<<3)
85 #define EVT_FAC_LOCAL7 (23<<3)
109 EVTCONTEXT *
evt_ctx_init(
const char *prog,
int syslog_fac);
122 int evt_ctx_tag_hook_add(EVTCONTEXT *ctx,
int (*func)(EVTREC *e,
void *user_ptr),
void *user_ptr);
125 EVTREC *
evt_rec_init(EVTCONTEXT *ctx,
int syslog_pri,
const char *desc);
147 EVTTAG *
evt_tag_printf(
const char *tag,
const char *format, ...) G_GNUC_PRINTF(2, 3);
148 EVTTAG *
evt_tag_inaddr(const
char *tag, const struct in_addr *addr);
177 void evt_openlog(const
char *ident,
int option,
int facility);
179 void evt_vsyslog(
int pri, const
char *format, va_list ap) G_GNUC_PRINTF(2, 0);
180 void evt_syslog(
int pri, const
char *format, ...) G_GNUC_PRINTF(2, 3);
182 #ifdef EVENTLOG_SYSLOG_MACROS
184 #define openlog evt_openlog
185 #define syslog evt_syslog
186 #define vsyslog evt_vsyslog
187 #define closelog evt_closelog
void evt_rec_free(EVTREC *e)
Definition: evtrec.c:133
void evt_vsyslog(int pri, const char *format, va_list ap) G_GNUC_PRINTF(2
EVTTAG EVTTAG * evt_tag_inaddr(const char *tag, const struct in_addr *addr)
Definition: evttags.c:141
EVTTAG * evt_tag_inaddr6(const char *tag, const struct in6_addr *addr)
Definition: evttags.c:154
void void evt_syslog(int pri, const char *format,...) G_GNUC_PRINTF(2
EVTCONTEXT * evt_ctx_init(const char *prog, int syslog_fac)
Definition: evtctx.c:107
EVTTAG * evt_tag_mem(const char *tag, const void *value, size_t len)
Definition: evttags.c:84
void evt_rec_add_tag(EVTREC *e, EVTTAG *tag)
Definition: evtrec.c:45
int evt_ctx_tag_hook_add(EVTCONTEXT *ctx, int(*func)(EVTREC *e, void *user_ptr), void *user_ptr)
Definition: evtctx.c:93
char * evt_format(EVTREC *e)
Definition: evtfmt.c:89
int evt_log(EVTREC *e)
Definition: evtout.c:84
int evt_rec_get_syslog_pri(EVTREC *e)
Definition: evtrec.c:83
EVTTAG * evt_tag_int(const char *tag, int value)
Definition: evttags.c:102
void evt_rec_add_tags(EVTREC *e, EVTTAG *first,...)
Definition: evtrec.c:72
EVTTAG * evt_tag_long(const char *tag, long long value)
Definition: evttags.c:111
void evt_ctx_free(EVTCONTEXT *ctx)
Definition: evtctx.c:138
void evt_rec_add_tagsv(EVTREC *e, va_list tags)
Definition: evtrec.c:59
EVTREC * evt_rec_init(EVTCONTEXT *ctx, int syslog_pri, const char *desc)
Definition: evtrec.c:103
void evt_closelog(void)
Definition: evtsyslog.c:59
EVTTAG * evt_tag_str(const char *tag, const char *value)
Definition: evttags.c:65
void evt_openlog(const char *ident, int option, int facility)
Definition: evtsyslog.c:48
EVTTAG * evt_tag_errno(const char *tag, int err)
Definition: evttags.c:120
EVTTAG * evt_tag_printf(const char *tag, const char *format,...) G_GNUC_PRINTF(2
Definition: evt_internals.h:77
Definition: evt_internals.h:97
Definition: evt_internals.h:107
GString * value
Definition: test_decode.c:28