| libprelude Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
enum idmef_criterion_operator_t;
typedef idmef_criteria_t;
typedef idmef_criterion_t;
const char * idmef_criterion_operator_to_string (idmef_criterion_operator_t op);
int idmef_criterion_new (idmef_criterion_t **criterion,
idmef_path_t *path,
idmef_criterion_value_t *value,
idmef_criterion_operator_t op);
void idmef_criterion_destroy (idmef_criterion_t *criterion);
int idmef_criterion_clone (const idmef_criterion_t *criterion,
idmef_criterion_t **dst);
int idmef_criterion_print (const idmef_criterion_t *criterion,
prelude_io_t *fd);
int idmef_criterion_to_string (const idmef_criterion_t *criterion,
prelude_string_t *out);
idmef_path_t * idmef_criterion_get_path (const idmef_criterion_t *criterion);
idmef_criterion_value_t * idmef_criterion_get_value (const idmef_criterion_t *criterion);
idmef_criterion_operator_t idmef_criterion_get_operator
(const idmef_criterion_t *criterion);
int idmef_criterion_match (const idmef_criterion_t *criterion,
void *object);
int idmef_criteria_new (idmef_criteria_t **criteria);
idmef_criteria_t * idmef_criteria_ref (idmef_criteria_t *criteria);
void idmef_criteria_destroy (idmef_criteria_t *criteria);
int idmef_criteria_clone (idmef_criteria_t *src,
idmef_criteria_t **dst);
int idmef_criteria_print (const idmef_criteria_t *criteria,
prelude_io_t *fd);
int idmef_criteria_to_string (const idmef_criteria_t *criteria,
prelude_string_t *out);
prelude_bool_t idmef_criteria_is_criterion (const idmef_criteria_t *criteria);
idmef_criterion_t * idmef_criteria_get_criterion (const idmef_criteria_t *criteria);
void idmef_criteria_set_criterion (idmef_criteria_t *criteria,
idmef_criterion_t *criterion);
void idmef_criteria_or_criteria (idmef_criteria_t *criteria,
idmef_criteria_t *criteria2);
int idmef_criteria_and_criteria (idmef_criteria_t *criteria,
idmef_criteria_t *criteria2);
int idmef_criteria_match (const idmef_criteria_t *criteria,
void *object);
idmef_criteria_t * idmef_criteria_get_or (const idmef_criteria_t *criteria);
idmef_criteria_t * idmef_criteria_get_and (const idmef_criteria_t *criteria);
int idmef_criteria_new_from_string (idmef_criteria_t **criteria,
const char *str);
prelude_bool_t idmef_criteria_get_negation (const idmef_criteria_t *criteria);
void idmef_criteria_set_negation (idmef_criteria_t *criteria,
prelude_bool_t negate);
typedef enum {
IDMEF_CRITERION_OPERATOR_NOT = 0x8000,
IDMEF_CRITERION_OPERATOR_NOCASE = 0x4000,
IDMEF_CRITERION_OPERATOR_EQUAL = 0x0001,
IDMEF_CRITERION_OPERATOR_EQUAL_NOCASE = IDMEF_CRITERION_OPERATOR_EQUAL|IDMEF_CRITERION_OPERATOR_NOCASE,
IDMEF_CRITERION_OPERATOR_NOT_EQUAL = IDMEF_CRITERION_OPERATOR_NOT|IDMEF_CRITERION_OPERATOR_EQUAL,
IDMEF_CRITERION_OPERATOR_NOT_EQUAL_NOCASE = IDMEF_CRITERION_OPERATOR_NOT_EQUAL|IDMEF_CRITERION_OPERATOR_EQUAL_NOCASE,
IDMEF_CRITERION_OPERATOR_LESSER = 0x0002,
IDMEF_CRITERION_OPERATOR_LESSER_OR_EQUAL = IDMEF_CRITERION_OPERATOR_LESSER|IDMEF_CRITERION_OPERATOR_EQUAL,
IDMEF_CRITERION_OPERATOR_GREATER = 0x0004,
IDMEF_CRITERION_OPERATOR_GREATER_OR_EQUAL = IDMEF_CRITERION_OPERATOR_GREATER|IDMEF_CRITERION_OPERATOR_EQUAL,
IDMEF_CRITERION_OPERATOR_SUBSTR = 0x0008,
IDMEF_CRITERION_OPERATOR_SUBSTR_NOCASE = IDMEF_CRITERION_OPERATOR_SUBSTR|IDMEF_CRITERION_OPERATOR_NOCASE,
IDMEF_CRITERION_OPERATOR_NOT_SUBSTR = IDMEF_CRITERION_OPERATOR_NOT|IDMEF_CRITERION_OPERATOR_SUBSTR,
IDMEF_CRITERION_OPERATOR_NOT_SUBSTR_NOCASE = IDMEF_CRITERION_OPERATOR_NOT|IDMEF_CRITERION_OPERATOR_SUBSTR_NOCASE,
IDMEF_CRITERION_OPERATOR_REGEX = 0x0010,
IDMEF_CRITERION_OPERATOR_REGEX_NOCASE = IDMEF_CRITERION_OPERATOR_REGEX|IDMEF_CRITERION_OPERATOR_NOCASE,
IDMEF_CRITERION_OPERATOR_NOT_REGEX = IDMEF_CRITERION_OPERATOR_NOT|IDMEF_CRITERION_OPERATOR_REGEX,
IDMEF_CRITERION_OPERATOR_NOT_REGEX_NOCASE = IDMEF_CRITERION_OPERATOR_NOT|IDMEF_CRITERION_OPERATOR_REGEX_NOCASE,
IDMEF_CRITERION_OPERATOR_NULL = 0x0020,
IDMEF_CRITERION_OPERATOR_NOT_NULL = IDMEF_CRITERION_OPERATOR_NULL|IDMEF_CRITERION_OPERATOR_NOT
} idmef_criterion_operator_t;
const char * idmef_criterion_operator_to_string (idmef_criterion_operator_t op);
Transforms op to string.
|
idmef_criterion_operator_t type. |
Returns : |
A pointer to an operator string or NULL. |
int idmef_criterion_new (idmef_criterion_t **criterion,
idmef_path_t *path,
idmef_criterion_value_t *value,
idmef_criterion_operator_t op);
Creates a new idmef_criterion_t object and store it in criterion.
Matching this criterion will result in comparing the object value
pointed by path against the provided value, using op.
|
Address where to store the created idmef_criterion_t object. |
|
Pointer to an idmef_path_t object. |
|
Pointer to an idmef_criterion_value_t object. |
|
idmef_criterion_operator_t to use for matching this criterion. |
Returns : |
0 on success, a negative value if an error occured. |
void idmef_criterion_destroy (idmef_criterion_t *criterion);
Destroys criterion and its content.
|
Pointer to a idmef_criterion_t object. |
int idmef_criterion_clone (const idmef_criterion_t *criterion,
idmef_criterion_t **dst);
Clones criterion and stores the cloned criterion within dst.
|
Pointer to a idmef_criterion_t object to clone. |
|
Address where to store the cloned idmef_criterion_t object. |
Returns : |
0 on success, a negative value if an error occured. |
int idmef_criterion_print (const idmef_criterion_t *criterion,
prelude_io_t *fd);
Dump criterion to fd in the form of:
[path] [operator] [value]
Or if there is no value associated with the criterion: [operator] [path]
|
Pointer to a idmef_criterion_t object. |
|
Pointer to a prelude_io_t object. |
Returns : |
0 on success, a negative value if an error occured. |
int idmef_criterion_to_string (const idmef_criterion_t *criterion,
prelude_string_t *out);
Dump criterion as a string to the out buffer in the form of:
[path] [operator] [value]
Or if there is no value associated with the criterion: [operator] [path]
|
Pointer to a idmef_criterion_t object. |
|
Pointer to a prelude_string_t object. |
Returns : |
0 on success, a negative value if an error occured. |
idmef_path_t * idmef_criterion_get_path (const idmef_criterion_t *criterion);
Used to access the idmef_path_t object associated with criterion.
|
Pointer to a idmef_criterion_t object. |
Returns : |
the idmef_path_t object associated with criterion.
|
idmef_criterion_value_t * idmef_criterion_get_value (const idmef_criterion_t *criterion);
Used to access the idmef_criterion_value_t associated with criterion.
There might be no value specifically if the provided idmef_criterion_operator_t
was IDMEF_CRITERION_OPERATOR_NULL or IDMEF_CRITERION_OPERATOR_NOT_NULL.
|
Pointer to a idmef_criterion_t object. |
Returns : |
the idmef_criterion_value_t object associated with criterion.
|
idmef_criterion_operator_t idmef_criterion_get_operator
(const idmef_criterion_t *criterion);
Used to access the idmef_criterion_operator_t enumeration associated with criterion.
|
Pointer to a idmef_criterion_t object. |
Returns : |
the idmef_criterion_operator_t associated with criterion.
|
int idmef_criterion_match (const idmef_criterion_t *criterion,
void *object);
Matches message against the provided criterion. This implies retrieving the
value associated with criterion path, and matching it with the idmef_criterion_value_t
object within criterion.
|
Pointer to a idmef_criterion_t object. |
|
Pointer to a idmef_object_t object to match against criterion.
|
Returns : |
1 for a match, 0 for no match, or a negative value if an error occured. |
int idmef_criteria_new (idmef_criteria_t **criteria);
Creates a new idmef_criteria_t object and store it into criteria.
|
Address where to store the created idmef_criteria_t object. |
Returns : |
0 on success, a negative value if an error occured. |
idmef_criteria_t * idmef_criteria_ref (idmef_criteria_t *criteria);
Increases criteria reference count.
idmef_criteria_destroy() will decrease the refcount until it reaches
0, at which point criteria will be destroyed.
|
Pointer to a idmef_criteria_t object to reference. |
Returns : |
criteria.
|
void idmef_criteria_destroy (idmef_criteria_t *criteria);
Destroys criteria and its content.
|
Pointer to a idmef_criteria_t object. |
int idmef_criteria_clone (idmef_criteria_t *src,
idmef_criteria_t **dst);
Clones src and stores the cloned criteria within dst.
|
Pointer to a idmef_criteria_t object to clone. |
|
Address where to store the cloned idmef_criteria_t object. |
Returns : |
0 on success, a negative value if an error occured. |
int idmef_criteria_print (const idmef_criteria_t *criteria,
prelude_io_t *fd);
|
|
|
|
Returns : |
int idmef_criteria_to_string (const idmef_criteria_t *criteria,
prelude_string_t *out);
|
|
|
|
Returns : |
prelude_bool_t idmef_criteria_is_criterion (const idmef_criteria_t *criteria);
|
|
Returns : |
idmef_criterion_t * idmef_criteria_get_criterion (const idmef_criteria_t *criteria);
|
|
Returns : |
void idmef_criteria_set_criterion (idmef_criteria_t *criteria,
idmef_criterion_t *criterion);
|
|
|
void idmef_criteria_or_criteria (idmef_criteria_t *criteria,
idmef_criteria_t *criteria2);
|
|
|
int idmef_criteria_and_criteria (idmef_criteria_t *criteria,
idmef_criteria_t *criteria2);
|
|
|
|
Returns : |
int idmef_criteria_match (const idmef_criteria_t *criteria,
void *object);
Matches object against the provided criteria.
|
Pointer to a idmef_criteria_t object. |
|
Pointer to a idmef_object_t object. |
Returns : |
1 if criteria match, 0 if it did not, a negative value if an error occured. |
idmef_criteria_t * idmef_criteria_get_or (const idmef_criteria_t *criteria);
|
|
Returns : |
idmef_criteria_t * idmef_criteria_get_and (const idmef_criteria_t *criteria);
|
|
Returns : |
int idmef_criteria_new_from_string (idmef_criteria_t **criteria,
const char *str);
|
|
|
|
Returns : |
prelude_bool_t idmef_criteria_get_negation (const idmef_criteria_t *criteria);
|
|
Returns : |