source: trunk/include/sh_error.h@ 17

Last change on this file since 17 was 1, checked in by katerina, 19 years ago

Initial import

File size: 4.8 KB
Line 
1/* SAMHAIN file system integrity testing */
2/* Copyright (C) 1999 Rainer Wichmann */
3/* */
4/* This program is free software; you can redistribute it */
5/* and/or modify */
6/* it under the terms of the GNU General Public License as */
7/* published by */
8/* the Free Software Foundation; either version 2 of the License, or */
9/* (at your option) any later version. */
10/* */
11/* This program is distributed in the hope that it will be useful, */
12/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
13/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
14/* GNU General Public License for more details. */
15/* */
16/* You should have received a copy of the GNU General Public License */
17/* along with this program; if not, write to the Free Software */
18/* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
19
20
21/* Public interface for error routines
22 */
23#ifndef SH_ERROR_H
24#define SH_ERROR_H
25
26#include "sh_error_min.h"
27
28
29enum {
30 SH_ERR_T_START = 0,
31
32 /* 1-9 = SH_LEVEL_XXX */
33
34 SH_ERR_T_RO = SH_LEVEL_READONLY,
35 SH_ERR_T_LOGS = SH_LEVEL_LOGFILES,
36 SH_ERR_T_GLOG = SH_LEVEL_LOGGROW,
37 SH_ERR_T_NOIG = SH_LEVEL_NOIGNORE,
38 SH_ERR_T_ALLIG = SH_LEVEL_ALLIGNORE,
39 SH_ERR_T_ATTR = SH_LEVEL_ATTRIBUTES,
40 SH_ERR_T_USER0 = SH_LEVEL_USER0,
41 SH_ERR_T_USER1 = SH_LEVEL_USER1,
42 SH_ERR_T_PRELINK = SH_LEVEL_PRELINK,
43
44 SH_ERR_T_DIR = 10,
45 SH_ERR_T_FILE = 11,
46 SH_ERR_T_NAME = 12,
47
48 SH_ERR_T_END = 13
49};
50
51
52typedef struct _errFlags {
53 int debug;
54 int HaveLog;
55
56 int loglevel;
57 int loglevel_temp;
58 int printlevel;
59 int maillevel;
60 int exportlevel;
61 int sysloglevel;
62 int externallevel;
63 int databaselevel;
64
65 int log_class;
66 int print_class;
67 int mail_class;
68 int export_class;
69 int syslog_class;
70 int external_class;
71 int database_class;
72
73 /* HAVE_LIBPRELUDE */
74 int preludelevel;
75 int prelude_class;
76
77} blurb_errFlags;
78
79extern int ShDFLevel[SH_ERR_T_END];
80
81/* set mask for message class
82 */
83int sh_error_log_mask (char * c);
84int sh_error_print_mask (char * c);
85int sh_error_mail_mask (char * c);
86int sh_error_export_mask (char * c);
87int sh_error_syslog_mask (char * c);
88int sh_error_external_mask (char * c);
89int sh_error_database_mask (char * c);
90int sh_error_prelude_mask (char * c);
91
92
93int sh_error_verify (char * s);
94int sh_error_logverify_mod (char * s); /* just list, don't verify */
95int sh_error_logverify (char * s);
96
97void sh_error_dbg_switch(void);
98
99#ifdef SH_WITH_SERVER
100void sh_error_set_peer(const char * str);
101int set_flag_sep_log (char * str);
102#endif
103
104/* init or re-init log facilities that need it
105 */
106void sh_error_fixup();
107
108/* convert a string to a numeric priority
109 */
110int sh_error_convert_level (char * str_s);
111
112/* only to stderr (GOOD/BAD)
113 */
114void sh_error_only_stderr (int flag);
115
116/* set syslog facility
117 */
118int sh_log_set_facility (char * c);
119
120/* define message header
121 */
122int sh_error_ehead (/*@null@*/char * s);
123
124/* set level for error logging
125 */
126int sh_error_setlog(char * str_s);
127
128/* set severity levels
129 */
130int sh_error_set_iv (int iv, char * severity_s);
131
132/* set priorities
133 */
134int sh_error_set_level(char * str_s, int *facility);
135
136/* set level for TCP export
137 */
138int sh_error_setexport(char * str_s);
139
140/* set level for syslog
141 */
142int sh_error_set_syslog (char * flag_s);
143
144/* set level for printing
145 */
146int sh_error_setprint(char * flag_s);
147
148/* set severity for external
149 */
150int sh_error_set_external (char * str_s);
151
152/* set severity for external
153 */
154int sh_error_set_database (char * str_s);
155
156/* set severity for external
157 */
158int sh_error_set_prelude (char * str_s);
159
160
161/* set level for mailing
162 */
163int sh_error_setseverity (char * flag);
164
165/* set debug level
166 */
167int sh_error_setdebug (char * debug_s);
168
169/* error messages
170 */
171/*@owned@*/char * sh_error_message (int tellme);
172
173/* switch on/off log to file temporarily
174 */
175void sh_error_logoff(void);
176void sh_error_logrestore(void);
177
178/* (re)set the console device(s)
179 */
180int sh_log_set_console (char * address);
181void reset_count_dev_console(void);
182
183#ifdef WITH_MESSAGE_QUEUE
184/* close the message queue
185 */
186void close_ipc (void);
187
188/* enable message queue
189 */
190int enable_msgq(char * foo);
191#endif
192
193#endif
Note: See TracBrowser for help on using the repository browser.