diff --git a/misc/plugutils.c b/misc/plugutils.c index 942a43611..d95a90a67 100644 --- a/misc/plugutils.c +++ b/misc/plugutils.c @@ -392,6 +392,18 @@ post_error (const char *oid, struct script_infos *desc, int port, proto_post_error (oid, desc, port, "tcp", action); } +/** + * @brief Get the a plugins preference. + * + * Search in the preferences set by the client. If it is not + * present, search in redis cache for the default. + * + * @param[in] oid Script OID to get the preference from + * @param[in] name Name of the preference to get + * @param[in] pref_id Id of the preferences to get + * + * @return script preference on success, Null otherwise. + **/ char * get_plugin_preference (const char *oid, const char *name, int pref_id) { diff --git a/nasl/nasl_scanner_glue.c b/nasl/nasl_scanner_glue.c index 3f49f1bd8..a14ab7675 100644 --- a/nasl/nasl_scanner_glue.c +++ b/nasl/nasl_scanner_glue.c @@ -492,6 +492,16 @@ script_add_preference (lex_ctxt *lexic) return FAKE_CELL; } +/** + * @brief Get a preferences of the current script. + * + * Search the preference by preference name or by preferences id. + * + * @param[in] lexic NASL lexer. + * + * @return lex cell containing the preferences value as a string. + * Fake cell otherwise + */ tree_cell * script_get_preference (lex_ctxt *lexic) {