Imported Upstream version 2.4.3
[platform/upstream/audit.git] / auparse / auparse-defs.h
1 /* auparse-defs.h --
2  * Copyright 2006-07,09,2011-12,2014 Red Hat Inc., Durham, North Carolina.
3  * All Rights Reserved.
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  *
19  * Authors:
20  *      Steve Grubb <sgrubb@redhat.com>
21  */
22
23 #ifndef AUPARSE_DEFS_HEADER
24 #define AUPARSE_DEFS_HEADER
25
26 #include <time.h>
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31
32
33 /* Library type definitions */
34
35 /* This tells the library where the data source is located */
36 typedef enum { AUSOURCE_LOGS, AUSOURCE_FILE, AUSOURCE_FILE_ARRAY, 
37         AUSOURCE_BUFFER, AUSOURCE_BUFFER_ARRAY,
38         AUSOURCE_DESCRIPTOR, AUSOURCE_FILE_POINTER, AUSOURCE_FEED } ausource_t;
39
40 /* This used to define the types of searches that can be done.  It is not used
41    any more. */
42 typedef enum {
43         AUSEARCH_UNSET,
44         AUSEARCH_EXISTS,
45         AUSEARCH_EQUAL, AUSEARCH_NOT_EQUAL,
46         AUSEARCH_TIME_LT, AUSEARCH_TIME_LE, AUSEARCH_TIME_GE, AUSEARCH_TIME_GT,
47         AUSEARCH_TIME_EQ,
48         AUSEARCH_INTERPRETED = 0x40000000
49 } ausearch_op_t;
50
51 /* This determines where to position the cursor when a search completes */
52 typedef enum { AUSEARCH_STOP_EVENT, AUSEARCH_STOP_RECORD,
53         AUSEARCH_STOP_FIELD } austop_t;
54
55 /* This defines how search rule pieces are treated to decide when
56  * to stop a search */
57 typedef enum { AUSEARCH_RULE_CLEAR, AUSEARCH_RULE_OR,
58         AUSEARCH_RULE_AND, AUSEARCH_RULE_REGEX } ausearch_rule_t;
59
60
61 typedef struct
62 {
63         time_t sec;             // Event seconds
64         unsigned int milli;     // millisecond of the timestamp
65         unsigned long serial;   // Serial number of the event
66         const char *host;       // Machine's name
67 } au_event_t;
68
69
70 /* This indicates why the user supplied callback was invoked */
71 typedef enum {AUPARSE_CB_EVENT_READY} auparse_cb_event_t;
72
73 /* This determines the type of field at current cursor location
74  * ONLY APPEND - DO NOT DELETE or it will break ABI */
75 typedef enum {  AUPARSE_TYPE_UNCLASSIFIED,  AUPARSE_TYPE_UID, AUPARSE_TYPE_GID,
76         AUPARSE_TYPE_SYSCALL, AUPARSE_TYPE_ARCH, AUPARSE_TYPE_EXIT,
77         AUPARSE_TYPE_ESCAPED, AUPARSE_TYPE_PERM, AUPARSE_TYPE_MODE,
78         AUPARSE_TYPE_SOCKADDR, AUPARSE_TYPE_FLAGS, AUPARSE_TYPE_PROMISC,
79         AUPARSE_TYPE_CAPABILITY, AUPARSE_TYPE_SUCCESS, AUPARSE_TYPE_A0,
80         AUPARSE_TYPE_A1, AUPARSE_TYPE_A2, AUPARSE_TYPE_A3, AUPARSE_TYPE_SIGNAL, 
81         AUPARSE_TYPE_LIST, AUPARSE_TYPE_TTY_DATA,
82         AUPARSE_TYPE_SESSION, AUPARSE_TYPE_CAP_BITMAP, AUPARSE_TYPE_NFPROTO,
83         AUPARSE_TYPE_ICMPTYPE, AUPARSE_TYPE_PROTOCOL,
84         AUPARSE_TYPE_ADDR, AUPARSE_TYPE_PERSONALITY,
85         AUPARSE_TYPE_SECCOMP, AUPARSE_TYPE_OFLAG,
86         AUPARSE_TYPE_MMAP, AUPARSE_TYPE_MODE_SHORT, AUPARSE_TYPE_MAC_LABEL,
87         AUPARSE_TYPE_PROCTITLE  } auparse_type_t;
88
89 #ifdef __cplusplus
90 }
91 #endif
92  
93 #endif
94