suricata
util-syslog.c
Go to the documentation of this file.
1 /* Copyright (C) 2007-2013 Open Information Security Foundation
2  *
3  * You can copy, redistribute or modify this Program under the terms of
4  * the GNU General Public License version 2 as published by the Free
5  * Software Foundation.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * version 2 along with this program; if not, write to the Free Software
14  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15  * 02110-1301, USA.
16  */
17 
18 /**
19  * \file
20  *
21  * \author Gurvinder Singh <gurvindersinghdahiya@gmail.com>
22  *
23  * Syslog utility file
24  *
25  */
26 
27 #include "suricata-common.h"
28 #include "util-syslog.h"
29 
30 /* holds the string-enum mapping for the syslog facility in SCLogOPIfaceCtx */
32  { "auth", LOG_AUTH },
33  { "authpriv", LOG_AUTHPRIV },
34  { "cron", LOG_CRON },
35  { "daemon", LOG_DAEMON },
36  { "ftp", LOG_FTP },
37  { "kern", LOG_KERN },
38  { "lpr", LOG_LPR },
39  { "mail", LOG_MAIL },
40  { "news", LOG_NEWS },
41  { "security", LOG_AUTH },
42  { "syslog", LOG_SYSLOG },
43  { "user", LOG_USER },
44  { "uucp", LOG_UUCP },
45  { "local0", LOG_LOCAL0 },
46  { "local1", LOG_LOCAL1 },
47  { "local2", LOG_LOCAL2 },
48  { "local3", LOG_LOCAL3 },
49  { "local4", LOG_LOCAL4 },
50  { "local5", LOG_LOCAL5 },
51  { "local6", LOG_LOCAL6 },
52  { "local7", LOG_LOCAL7 },
53  { NULL, -1 }
54 };
55 
56 /** \brief returns the syslog facility enum map */
58 {
60 }
61 
63  { "Emergency", LOG_EMERG },
64  { "Alert", LOG_ALERT },
65  { "Critical", LOG_CRIT },
66  { "Error", LOG_ERR },
67  { "Warning", LOG_WARNING },
68  { "Notice", LOG_NOTICE },
69  { "Info", LOG_INFO },
70  { "Debug", LOG_DEBUG },
71  { NULL, -1 }
72 };
73 
74 /** \brief returns the syslog facility enum map */
76 {
77  return sc_syslog_level_map;
78 }
79 
#define LOG_USER
Definition: win32-syslog.h:49
SCEnumCharMap sc_syslog_facility_map[]
Definition: util-syslog.c:31
#define LOG_WARNING
Definition: win32-syslog.h:43
#define LOG_LOCAL3
Definition: win32-syslog.h:65
#define LOG_LOCAL1
Definition: win32-syslog.h:63
#define LOG_LOCAL2
Definition: win32-syslog.h:64
#define LOG_FTP
Definition: win32-syslog.h:59
SCEnumCharMap * SCSyslogGetFacilityMap(void)
returns the syslog facility enum map
Definition: util-syslog.c:57
#define LOG_LOCAL0
Definition: win32-syslog.h:62
#define LOG_MAIL
Definition: win32-syslog.h:50
#define LOG_SYSLOG
Definition: win32-syslog.h:53
#define LOG_AUTHPRIV
Definition: win32-syslog.h:58
#define LOG_LOCAL6
Definition: win32-syslog.h:68
#define LOG_INFO
Definition: win32-syslog.h:45
#define LOG_ERR
Definition: win32-syslog.h:42
#define LOG_CRON
Definition: win32-syslog.h:57
#define LOG_LPR
Definition: win32-syslog.h:54
#define LOG_NEWS
Definition: win32-syslog.h:55
#define LOG_CRIT
Definition: win32-syslog.h:41
#define LOG_NOTICE
Definition: win32-syslog.h:44
#define LOG_LOCAL5
Definition: win32-syslog.h:67
#define LOG_DAEMON
Definition: win32-syslog.h:51
SCEnumCharMap * SCSyslogGetLogLevelMap(void)
returns the syslog facility enum map
Definition: util-syslog.c:75
#define LOG_ALERT
Definition: win32-syslog.h:40
#define LOG_DEBUG
Definition: win32-syslog.h:46
#define LOG_EMERG
Definition: win32-syslog.h:39
SCEnumCharMap sc_syslog_level_map[]
Definition: util-syslog.c:62
#define LOG_KERN
Definition: win32-syslog.h:48
#define LOG_LOCAL4
Definition: win32-syslog.h:66
#define LOG_UUCP
Definition: win32-syslog.h:56
#define LOG_LOCAL7
Definition: win32-syslog.h:69
#define LOG_AUTH
Definition: win32-syslog.h:52