* Copyright 2007,2013,2023 Red Hat Inc.
* All Rights Reserved.
*
* This software may be freely redistributed and/or modified under the
* terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2, or (at your option) any
* later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1335, USA.
*
* Authors:
* Steve Grubb <sgrubb@redhat.com>
*/
#ifndef AUDISPD_PCONFIG_H
#define AUDISPD_PCONFIG_H
#include <sys/types.h>
#include "libaudit.h"
#define MAX_PLUGIN_ARGS 3
typedef enum { A_NO, A_YES } active_t;
typedef enum { D_UNSET, D_IN, D_OUT } direction_t;
typedef enum { S_ALWAYS, S_BUILTIN } service_t;
typedef enum { F_BINARY, F_STRING } format_t;
typedef struct plugin_conf
{
active_t active;
direction_t direction;
const char *path;
service_t type;
char *args[MAX_PLUGIN_ARGS+2];
format_t format;
int plug_pipe[2];
pid_t pid;
ino_t inode;
int checked;
char *name;
unsigned restart_cnt;
} plugin_conf_t;
void clear_pconfig(plugin_conf_t *config);
int load_pconfig(plugin_conf_t *config, char *file);
void free_pconfig(plugin_conf_t *config);
#endif