Imported Upstream version 2.4.3
[platform/upstream/audit.git] / src / ausearch-common.h
1 /* ausearch-common.h -- 
2  * Copyright 2006-08,2010,2014 Red Hat Inc., Durham, North Carolina.
3  * Copyright (c) 2011 IBM Corp.
4  * All Rights Reserved.
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  *
20  * Authors:
21  *   Steve Grubb <sgrubb@redhat.com>
22  *   Marcelo Henrique Cerri <mhcerri@br.ibm.com>
23  * 
24  */
25
26 #ifndef AUREPORT_COMMON_H
27 #define AUREPORT_COMMON_H
28
29 #include "ausearch-string.h"
30
31 /*
32  * MAX_EVENT_DELTA_SECS is the maximum number of seconds it would take for
33  * auditd and the kernel to emit all of an events' records. Thus, when scanning
34  * a list of audit records without any End of Event marker, we can determine if
35  * all an event's records have been collected if we compare that event's time
36  * with the time of the event we are currently scanning. If
37  * MAX_EVENT_DELTA_SECS have passed, then the event is deamed to be complete
38  * and we have all it's records.
39  */
40 #define MAX_EVENT_DELTA_SECS    2
41
42 /* Global variables that describe what search is to be performed */
43 extern time_t start_time, end_time;
44 extern unsigned int event_id;
45 extern gid_t event_gid, event_egid;
46 extern pid_t event_pid;
47 extern int event_exact_match;
48 extern uid_t event_uid, event_euid, event_loginuid;
49 slist *event_node_list;
50 extern const char *event_comm;
51 extern const char *event_filename;
52 extern const char *event_hostname;
53 extern const char *event_terminal;
54 extern int event_syscall;
55 extern int event_machine;
56 extern const char *event_exe;
57 extern int event_ua, event_ga;
58 extern long long event_exit;
59 extern int event_exit_is_set;
60 extern const char *event_uuid;
61 extern const char *event_vmname;
62
63 typedef enum { F_BOTH, F_FAILED, F_SUCCESS } failed_t;
64 typedef enum { C_NEITHER, C_ADD, C_DEL } conf_act_t;
65 typedef enum { S_UNSET=-1, S_FAILED, S_SUCCESS } success_t;
66 typedef enum { RPT_RAW, RPT_DEFAULT, RPT_INTERP, RPT_PRETTY } report_t;
67
68 extern failed_t event_failed;
69 extern conf_act_t event_conf_act;
70 extern success_t event_success;
71
72 #endif
73