new upstream release (3.3.0); modify package compatibility for Stretch
[ossec-hids.git] / src / os_execd / execd.h
1 /* Copyright (C) 2009 Trend Micro Inc.
2  * All rights reserved.
3  *
4  * This program is a free software; you can redistribute it
5  * and/or modify it under the terms of the GNU General Public
6  * License (version 2) as published by the FSF - Free Software
7  * Foundation.
8  */
9
10 #ifndef _EXECD_H
11 #define _EXECD_H
12
13 #ifndef ARGV0
14 #define ARGV0 "ossec-execd"
15 #endif
16
17 /* Add/delete arguments for the commands */
18 #define ADD_ENTRY       "add"
19 #define DELETE_ENTRY    "delete"
20
21 /* Maximum number of active responses active */
22 #define MAX_AR      64
23
24 /* Maximum number of command arguments */
25 #define MAX_ARGS    32
26
27 /* Execd select timeout -- in seconds */
28 #define EXECD_TIMEOUT   90
29
30 extern int repeated_offenders_timeout[];
31
32 /** Function prototypes **/
33
34 void WinExecdRun(char *exec_msg);
35 int ReadExecConfig(void);
36 char *GetCommandbyName(const char *name, int *timeout) __attribute__((nonnull));
37 void ExecCmd(char *const *cmd) __attribute__((nonnull));
38 void ExecCmd_Win32(char *cmd);
39 int ExecdConfig(const char *cfgfile) __attribute__((nonnull));
40 int WinExecd_Start(void);
41 void WinTimeoutRun(int timeout);
42
43 /* Timeout data structure */
44 typedef struct _timeout_data {
45     time_t time_of_addition;
46     int time_to_block;
47     char **command;
48 } timeout_data;
49
50 void FreeTimeoutEntry(timeout_data *timeout_entry);
51
52 #endif
53