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
|
/* Copyright (c) 2005-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "syslog-util.h"
#include <syslog.h>
struct syslog_facility_list syslog_facilities[] = {
#ifdef LOG_AUTH
{ "auth", LOG_AUTH },
#endif
#ifdef LOG_AUTHPRIV
{ "authpriv", LOG_AUTHPRIV },
#endif
#ifdef LOG_CRON
{ "cron", LOG_CRON },
#endif
#ifdef LOG_DAEMON
{ "daemon", LOG_DAEMON },
#endif
#ifdef LOG_FTP
{ "ftp", LOG_FTP },
#endif
#ifdef LOG_KERN
{ "kern", LOG_KERN },
#endif
#ifdef LOG_LPR
{ "lpr", LOG_LPR },
#endif
#ifdef LOG_MAIL
{ "mail", LOG_MAIL },
#endif
#ifdef LOG_NEWS
{ "news", LOG_NEWS },
#endif
#ifdef LOG_SYSLOG
{ "syslog", LOG_SYSLOG },
#endif
#ifdef LOG_UUCP
{ "uucp", LOG_UUCP },
#endif
{ "user", LOG_USER },
{ "local0", LOG_LOCAL0 },
{ "local1", LOG_LOCAL1 },
{ "local2", LOG_LOCAL2 },
{ "local3", LOG_LOCAL3 },
{ "local4", LOG_LOCAL4 },
{ "local5", LOG_LOCAL5 },
{ "local6", LOG_LOCAL6 },
{ "local7", LOG_LOCAL7 },
{ NULL, 0 }
};
bool syslog_facility_find(const char *name, int *facility_r)
{
int i;
for (i = 0; syslog_facilities[i].name != NULL; i++) {
if (strcmp(syslog_facilities[i].name, name) == 0) {
*facility_r = syslog_facilities[i].facility;
return TRUE;
}
}
return FALSE;
}
|