Trigger Executor
[Event Discrimination Service]


Files

file  xdasd_trigger.c
 OpenXDAS trigger script processing engine.
file  xdasd_trigger.h
 OpenXDAS trigger script processing engine.

Functions

int xdasd_trigger_append (Parsed *parsed)
 Execute a shell script with variable expansion on a background thread.
int xdasd_trigger_init (void)
 Initialize the trigger script execution subsystem.
void xdasd_trigger_exit (void)
 Cleanup the trigger script execution subsystem.

Function Documentation

int xdasd_trigger_append ( Parsed parsed  ) 

Execute a shell script with variable expansion on a background thread.

Parameters:
[in] parsed - the parsed message and script set to be executed.
Returns:
Zero on success, -1 on exec or allocation failure.
Note:
The script text may reference one or more message fields using a variable syntax: $XDAS(fldnum). The special variable $XDAS (with no trailing value in parentheses) indicates the entire message string should be substituted. The fldnum parameter of the XDAS variable should be a decimal numeric value between 0 and 32, indicating one of the 33 fields of the XDAS message. For a visual description of the field values, see the unit test code at the bottom of this module.

Each field in the null-terminated msgflds char ptr array points to the start of one XDAS message field in the original XDAS message. These fields are NOT null-terminated, rather the end of a given field is signified by the beginning of the next (subtract one to exclude the trailing field delimiter - the colon). The last non-null pointer points to the second character beyond the end of the final field (so that all fields may be treated the same - back up one and consider that the field limit (field char + 1). Normally, this pointer would point to the byte following the null-terminator, except that XDAS messages are not null-terminated.

For internal use only.

Definition at line 151 of file xdasd_trigger.c.

References s_mq_trigger, and xdasd_mqueue_append().

Referenced by xdasd_event_check_and_submit().

void xdasd_trigger_exit ( void   ) 

Cleanup the trigger script execution subsystem.

For internal use only.

Definition at line 177 of file xdasd_trigger.c.

References s_mq_trigger, and xdasd_mqueue_destroy().

Referenced by xdasd_main_init(), and xdasd_main_run().

int xdasd_trigger_init ( void   ) 

Initialize the trigger script execution subsystem.

Returns:
Zero on success, or -1 on resource allocation failure.

For internal use only.

Definition at line 162 of file xdasd_trigger.c.

References s_mq_trigger, tr_get(), tr_process(), tr_put(), xdasd_log(), and xdasd_mqueue_create().

Referenced by xdasd_main_init().


Generated on Thu Aug 20 22:33:07 2009 for OpenXDAS by  doxygen 1.5.6