196 |
static void addeuid(uid_t); |
static void addeuid(uid_t); |
197 |
static void addegid(gid_t); |
static void addegid(gid_t); |
198 |
static void addeventaction(EventAction_T *, int, int); |
static void addeventaction(EventAction_T *, int, int); |
199 |
|
static void seteventaction(EventAction_T *, int, int); |
200 |
static void prepare_urlrequest(URL_T U); |
static void prepare_urlrequest(URL_T U); |
201 |
static void seturlrequest(int, char *); |
static void seturlrequest(int, char *); |
202 |
static void setlogfile(char *); |
static void setlogfile(char *); |
262 |
%token BYTE KILOBYTE MEGABYTE GIGABYTE |
%token BYTE KILOBYTE MEGABYTE GIGABYTE |
263 |
%token INODE SPACE PERMISSION SIZE |
%token INODE SPACE PERMISSION SIZE |
264 |
%token EXEC UNMONITOR ICMP ICMPECHO NONEXIST INVALID DATA RECOVERED |
%token EXEC UNMONITOR ICMP ICMPECHO NONEXIST INVALID DATA RECOVERED |
265 |
%token URL CONTENT |
%token URL CONTENT PID PPID |
266 |
%token <url> URLOBJECT |
%token <url> URLOBJECT |
267 |
|
|
268 |
%left GREATER LESS EQUAL NOTEQUAL |
%left GREATER LESS EQUAL NOTEQUAL |
300 |
|
|
301 |
optproc : start |
optproc : start |
302 |
| stop |
| stop |
303 |
|
| pid |
304 |
|
| ppid |
305 |
| connection |
| connection |
306 |
| connectionunix |
| connectionunix |
307 |
| timeout |
| timeout |
832 |
} |
} |
833 |
; |
; |
834 |
|
|
835 |
|
pid : IF CHANGED PID THEN action1 { |
836 |
|
seteventaction(&(current)->action_PID, $<number>5, |
837 |
|
ACTION_IGNORE); |
838 |
|
} |
839 |
|
; |
840 |
|
|
841 |
|
ppid : IF CHANGED PPID THEN action1 { |
842 |
|
seteventaction(&(current)->action_PPID, $<number>5, |
843 |
|
ACTION_IGNORE); |
844 |
|
} |
845 |
|
; |
846 |
|
|
847 |
nettimeout : /* EMPTY */ { |
nettimeout : /* EMPTY */ { |
848 |
$<number>$= NET_TIMEOUT; |
$<number>$= NET_TIMEOUT; |
849 |
} |
} |
1493 |
current->check= check; |
current->check= check; |
1494 |
|
|
1495 |
createinfo(); |
createinfo(); |
1496 |
|
Util_resetInfo(current); |
1497 |
|
|
1498 |
/* Initialize general event handlers */ |
/* Initialize general event handlers */ |
1499 |
addeventaction(&(current)->action_DATA, ACTION_ALERT, ACTION_ALERT); |
addeventaction(&(current)->action_DATA, ACTION_ALERT, ACTION_ALERT); |
1501 |
addeventaction(&(current)->action_INVALID, ACTION_RESTART, ACTION_ALERT); |
addeventaction(&(current)->action_INVALID, ACTION_RESTART, ACTION_ALERT); |
1502 |
addeventaction(&(current)->action_NONEXIST, ACTION_RESTART, ACTION_ALERT); |
addeventaction(&(current)->action_NONEXIST, ACTION_RESTART, ACTION_ALERT); |
1503 |
addeventaction(&(current)->action_TIMEOUT, ACTION_UNMONITOR, ACTION_ALERT); |
addeventaction(&(current)->action_TIMEOUT, ACTION_UNMONITOR, ACTION_ALERT); |
1504 |
|
addeventaction(&(current)->action_PID, ACTION_ALERT, ACTION_IGNORE); |
1505 |
|
addeventaction(&(current)->action_PPID, ACTION_ALERT, ACTION_IGNORE); |
1506 |
|
|
1507 |
pthread_mutex_init(¤t->mutex, NULL); |
pthread_mutex_init(¤t->mutex, NULL); |
1508 |
|
|
1958 |
|
|
1959 |
|
|
1960 |
/* |
/* |
1961 |
|
* Redefine EventAction object (used for default action overloading) |
1962 |
|
*/ |
1963 |
|
static void seteventaction(EventAction_T *_ea, int failed, int passed) { |
1964 |
|
|
1965 |
|
EventAction_T ea = *_ea; |
1966 |
|
|
1967 |
|
ASSERT(ea); |
1968 |
|
ASSERT(ea->failed); |
1969 |
|
ASSERT(ea->passed); |
1970 |
|
|
1971 |
|
ea->failed->id= failed; |
1972 |
|
ea->passed->id= passed; |
1973 |
|
|
1974 |
|
if(failed == ACTION_EXEC) { |
1975 |
|
ASSERT(command1); |
1976 |
|
ea->failed->exec = command1; |
1977 |
|
command1 = NULL; |
1978 |
|
} |
1979 |
|
if(passed == ACTION_EXEC) { |
1980 |
|
ASSERT(command2); |
1981 |
|
ea->passed->exec = command2; |
1982 |
|
command2 = NULL; |
1983 |
|
} |
1984 |
|
} |
1985 |
|
|
1986 |
|
|
1987 |
|
/* |
1988 |
* Adds runtime info to current service |
* Adds runtime info to current service |
1989 |
*/ |
*/ |
1990 |
static void createinfo() { |
static void createinfo() { |
1992 |
Info_T inf; |
Info_T inf; |
1993 |
|
|
1994 |
NEW(inf); |
NEW(inf); |
1995 |
|
|
1996 |
current->inf= inf; |
current->inf= inf; |
1997 |
|
|
1998 |
} |
} |