$Revision: 1.7 $
Error reporting (er) er_paths.c - parser callback functions for path
& filter creation/modification/deletion
Status: NOT REVUED, PARTLY TESTED
Design and implementation by: Marek Bukowy
Included Files
Adds an argument to a dynamically build argv array of arguments for
a path of EXEC type.
void er_add_exec_arg ( er_path_t* pathptr, char* arg )
- er_path_t* pathptr
- path structure
- char* arg
- new argument
Adds a filter to the filter chain for the given path.
er_ret_t
er_add_filter always returns ER_OK.
er_ret_t er_add_filter ( er_path_t* pathptr, er_filter_t* filter )
- er_path_t* pathptr
- pointer to path
- er_filter_t* filter
- pointer to the filter
Finds a path by identifier and adds a list of filters to the filter
chain for that path.
er_ret_t
er_attach_filter_chain returns ER_INVKEY if the path cannot be found
or ER_OK on success.
er_ret_t er_attach_filter_chain ( char* key, GList* filterlist )
- char* key
- path identifier
- GList* filterlist
- list of filters
Deletes a filter from the list of filters of the path specified by
identifier. The filter is specified by its position in the list,
starting with 0.
er_ret_t
er_delete_filter returns ER_INVKEY if the path or filter cannot be found
er_ret_t er_delete_filter ( char* key, unsigned filterid )
- char* key
- path identifier
- unsigned filterid
- filter position
finds and removes a path identified by identifier
er_ret_t
er_delete_path ER_OK on success, ER_INVKEY if path not found
er_ret_t er_delete_path ( char* key )
- char* key
- path identifier
free dynamic elements of the path structure
void er_free_dynadescr ( er_path_t* pathptr )
- er_path_t* pathptr
- path structure
Finds the path by identified and replaces its definition without touching
the filters
er_ret_t
er_modify_path returns ER_INVKEY if the path cannot be found
or ER_OK on success.
er_ret_t er_modify_path ( er_path_t* newpath, char* key )
- er_path_t* newpath
- new path structure
- char* key
- path identifier
Registers a path in the chain of paths.
er_ret_t
er_register_path returns ER_DUPENT if a path with that identifier
already exists, returns ER_INSANE if the sanity check
is not passed, or ER_OK on success.
er_ret_t er_register_path ( er_path_t* path, char* key )
- er_path_t* path
- new path structure
- char* key
- path identifier
Updates the array of currently active aspects. Must be used after any change
of filters/paths.
The "asp" array describes the "OR" of all filters' aspects. This is to allow
fast dropping of messages that would be dropped anyway
This function clears the array and regenerates it by going through
all filters and setting appropriate bits of aspects per facility.
void er_upd_asparray ( void )
finds path by identifier
er_path_t *
er_find_path_byname returns the pointer to it if found or NULL if not found
static er_path_t* er_find_path_byname ( char* key )
- char* key
- path identifier
basic sanity checks for a path definition. Currently only checking
if a specified socket exists.
int
er_path_safeguard Returns 0 on success, -1 on failure
static int er_path_safeguard ( er_path_t* path )
- er_path_t* path
- new path structure