2 * Copyright 2006-07,2013-14 Red Hat Inc., Durham, North Carolina.
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.
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.
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
20 * Steve Grubb <sgrubb@redhat.com>
22 #ifndef AUPARSE_INTERNAL_HEADER
23 #define AUPARSE_INTERNAL_HEADER
25 #include "auparse-defs.h"
27 #include "auditd-config.h"
36 /* This is what state the parser is in */
37 typedef enum { EVENT_EMPTY, EVENT_ACCUMULATING, EVENT_EMITTED } auparser_state_t;
39 /* This is the name/value pair used by search tables */
47 ausource_t source; // Source type
48 char **source_list; // Array of buffers, or array of
50 int list_idx; // The index into the source list
51 FILE *in; // If source is file, this is the fd
52 unsigned int line_number; // line number of current file, zero
54 char *next_buf; // The current buffer being broken down
55 unsigned int off; // The current offset into next_buf
56 char *cur_buf; // The current buffer being parsed
57 int line_pushed; // True if retrieve_next_line()
59 event_list_t le; // Linked list of record in same event
60 struct expr *expr; // Search expression or NULL
61 char *find_field; // Used to store field name when
63 austop_t search_where; // Where to put the cursors on a match
64 auparser_state_t parse_state; // parsing state
65 DataBuf databuf; // input data
67 // function to call to notify user of parsing changes
68 void (*callback)(struct opaque *au, auparse_cb_event_t cb_event_type, void *user_data);
70 void *callback_user_data; // user data supplied to callback
72 // function to call when user_data is destroyed
73 void (*callback_user_data_destroy)(void *user_data);
77 void clear_config(struct daemon_conf *config) hidden;
78 int load_config(struct daemon_conf *config, log_test_t lt) hidden;
79 void free_config(struct daemon_conf *config) hidden;