|
Greenbone Security Assistant
7.0.3~git
|
Validation mechanism. More...

Go to the source code of this file.
Macros | |
| #define | G_LOG_DOMAIN "gsad vali" |
| GLib log domain. More... | |
Functions | |
| validator_rule_t * | openvas_validator_rule_new (const char *regex) |
| Create a new validator rule. More... | |
| void | openvas_validator_rule_free (validator_rule_t *rule) |
| Free a validator rule. More... | |
| validator_t | openvas_validator_new () |
| Create a new validator. More... | |
| void | openvas_validator_add (validator_t validator, const char *name, const char *regex) |
| Add or overwrite a validation rule. More... | |
| int | openvas_validator_alias (validator_t validator, const char *alias, const char *name) |
| Make an alias for a rule name. More... | |
| gchar * | openvas_validator_alias_for (validator_t validator, const char *alias) |
| Get the name of the rule for which a rule is an alias. More... | |
| int | openvas_validate (validator_t validator, const char *name, const char *value) |
| Validate a string for a given rule. More... | |
| void | openvas_validator_free (validator_t validator) |
| Free a validator. More... | |
Validation mechanism.
Defines a mechanism to validate strings according to named rules.
openvas_validator_new creates a new validator which must be freed with openvas_validator_free. openvas_validator_add adds a regular expression to a validator as a rule. openvas_validate checks that a given string matches a given rule.
Definition in file validator.c.
| #define G_LOG_DOMAIN "gsad vali" |
GLib log domain.
Definition at line 35 of file validator.c.
| int openvas_validate | ( | validator_t | validator, |
| const char * | name, | ||
| const char * | value | ||
| ) |
Validate a string for a given rule.
| validator | Validator to validate from. |
| name | Name of rule. |
| value | Value to validate. |
Definition at line 182 of file validator.c.
References validator_rule::regex, and validator.
| void openvas_validator_add | ( | validator_t | validator, |
| const char * | name, | ||
| const char * | regex | ||
| ) |
Add or overwrite a validation rule.
| validator | Validator to add rule to. |
| name | Name of the rule. |
| regex | Validation rule as a regular expression. |
Definition at line 106 of file validator.c.
References openvas_validator_rule_new(), and validator.
Referenced by init_validator().


| int openvas_validator_alias | ( | validator_t | validator, |
| const char * | alias, | ||
| const char * | name | ||
| ) |
Make an alias for a rule name.
| validator | Validator to add alias to. |
| alias | Name of alias for rule. |
| name | Name of the rule. |
Definition at line 125 of file validator.c.
References validator_rule::alias_for, openvas_validator_rule_new(), validator_rule::regex, and validator.
Referenced by init_validator().


| gchar* openvas_validator_alias_for | ( | validator_t | validator, |
| const char * | alias | ||
| ) |
Get the name of the rule for which a rule is an alias.
| validator | Validator. |
| alias | Name of alias. |
alias is an alias, else NULL. Freed by openvas_validator_free. Definition at line 157 of file validator.c.
References validator_rule::alias_for, and validator.
| void openvas_validator_free | ( | validator_t | validator | ) |
Free a validator.
| validator | Validator. |
Definition at line 247 of file validator.c.
References validator.
| validator_t openvas_validator_new | ( | ) |
Create a new validator.
The validator must be freed with openvas_validator_free.
Definition at line 90 of file validator.c.
References openvas_validator_rule_free().
Referenced by init_validator().


| void openvas_validator_rule_free | ( | validator_rule_t * | rule | ) |
Free a validator rule.
| rule | Validator rule. |
Definition at line 73 of file validator.c.
References validator_rule::alias_for, and validator_rule::regex.
Referenced by openvas_validator_new().

| validator_rule_t* openvas_validator_rule_new | ( | const char * | regex | ) |
Create a new validator rule.
The validator must be freed with openvas_validator_rule_free.
Definition at line 57 of file validator.c.
References validator_rule::alias_for, and validator_rule::regex.
Referenced by openvas_validator_add(), and openvas_validator_alias().
