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 
LOG_KERN
#define LOG_KERN
Definition: win32-syslog.h:48
LOG_LPR
#define LOG_LPR
Definition: win32-syslog.h:54
LOG_NEWS
#define LOG_NEWS
Definition: win32-syslog.h:55
LOG_FTP
#define LOG_FTP
Definition: win32-syslog.h:59
LOG_LOCAL0
#define LOG_LOCAL0
Definition: win32-syslog.h:62
LOG_MAIL
#define LOG_MAIL
Definition: win32-syslog.h:50
LOG_LOCAL7
#define LOG_LOCAL7
Definition: win32-syslog.h:69
LOG_DAEMON
#define LOG_DAEMON
Definition: win32-syslog.h:51
util-syslog.h
LOG_DEBUG
#define LOG_DEBUG
Definition: win32-syslog.h:46
LOG_LOCAL3
#define LOG_LOCAL3
Definition: win32-syslog.h:65
SCSyslogGetFacilityMap
SCEnumCharMap * SCSyslogGetFacilityMap(void)
returns the syslog facility enum map
Definition: util-syslog.c:57
LOG_NOTICE
#define LOG_NOTICE
Definition: win32-syslog.h:44
LOG_LOCAL5
#define LOG_LOCAL5
Definition: win32-syslog.h:67
LOG_LOCAL4
#define LOG_LOCAL4
Definition: win32-syslog.h:66
SCSyslogGetLogLevelMap
SCEnumCharMap * SCSyslogGetLogLevelMap(void)
returns the syslog facility enum map
Definition: util-syslog.c:75
LOG_ALERT
#define LOG_ALERT
Definition: win32-syslog.h:40
LOG_EMERG
#define LOG_EMERG
Definition: win32-syslog.h:39
LOG_USER
#define LOG_USER
Definition: win32-syslog.h:49
suricata-common.h
SCEnumCharMap_
Definition: util-enum.h:27
LOG_UUCP
#define LOG_UUCP
Definition: win32-syslog.h:56
sc_syslog_facility_map
SCEnumCharMap sc_syslog_facility_map[]
Definition: util-syslog.c:31
LOG_WARNING
#define LOG_WARNING
Definition: win32-syslog.h:43
LOG_CRIT
#define LOG_CRIT
Definition: win32-syslog.h:41
LOG_CRON
#define LOG_CRON
Definition: win32-syslog.h:57
LOG_LOCAL1
#define LOG_LOCAL1
Definition: win32-syslog.h:63
LOG_AUTH
#define LOG_AUTH
Definition: win32-syslog.h:52
LOG_LOCAL2
#define LOG_LOCAL2
Definition: win32-syslog.h:64
LOG_SYSLOG
#define LOG_SYSLOG
Definition: win32-syslog.h:53
sc_syslog_level_map
SCEnumCharMap sc_syslog_level_map[]
Definition: util-syslog.c:62
LOG_AUTHPRIV
#define LOG_AUTHPRIV
Definition: win32-syslog.h:58
LOG_LOCAL6
#define LOG_LOCAL6
Definition: win32-syslog.h:68
LOG_INFO
#define LOG_INFO
Definition: win32-syslog.h:45
LOG_ERR
#define LOG_ERR
Definition: win32-syslog.h:42