Skip to content

Commit

Permalink
Add get_trash_report_configs
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmundell committed Feb 26, 2024
1 parent a244d7f commit dfa3e0c
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/gsad.c
Original file line number Diff line number Diff line change
Expand Up @@ -1614,6 +1614,7 @@ exec_gmp_get (http_connection_t *con, gsad_connection_info_t *con_info,
ELSE (get_trash_overrides)
ELSE (get_trash_permissions)
ELSE (get_trash_port_lists)
ELSE (get_trash_report_configs)
ELSE (get_trash_report_formats)
ELSE (get_trash_roles)
ELSE (get_trash_scanners)
Expand Down
28 changes: 27 additions & 1 deletion src/gsad_gmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -11555,7 +11555,7 @@ get_trash_port_lists_gmp (gvm_connection_t *connection,
* @return Enveloped XML object.
*/
char *
get_trash_report_formats_gmp (gvm_connection_t *connection,
get_trash_report_configs_gmp (gvm_connection_t *connection,
credentials_t *credentials, params_t *params,
cmd_response_data_t *response_data)
{
Expand All @@ -11566,6 +11566,32 @@ get_trash_report_formats_gmp (gvm_connection_t *connection,
GET_TRASH_RESOURCE ("GET_REPORT_CONFIGS", "get_report_configs",
"report configs");

/* Cleanup, and return transformed XML. */

g_string_append (xml, "</get_trash>");
return envelope_gmp (connection, credentials, params,
g_string_free (xml, FALSE), response_data);
}

/**
* @brief Setup trash page XML, envelope the result.
*
* @param[in] connection Connection to manager.
* @param[in] credentials Username and password for authentication.
* @param[in] params Request parameters.
* @param[out] response_data Extra data return for the HTTP response.
*
* @return Enveloped XML object.
*/
char *
get_trash_report_formats_gmp (gvm_connection_t *connection,
credentials_t *credentials, params_t *params,
cmd_response_data_t *response_data)
{
GString *xml;

xml = g_string_new ("<get_trash>");

GET_TRASH_RESOURCE ("GET_REPORT_FORMATS", "get_report_formats",
"report_formats");

Expand Down
3 changes: 3 additions & 0 deletions src/gsad_gmp.h
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,9 @@ char *
get_trash_port_lists_gmp (gvm_connection_t *, credentials_t *, params_t *params,
cmd_response_data_t *);
char *
get_trash_report_configs_gmp (gvm_connection_t *, credentials_t *,
params_t *params, cmd_response_data_t *);
char *
get_trash_report_formats_gmp (gvm_connection_t *, credentials_t *,
params_t *params, cmd_response_data_t *);
char *
Expand Down
1 change: 1 addition & 0 deletions src/gsad_validator.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ init_validator ()
"|(get_trash_overrides)"
"|(get_trash_permissions)"
"|(get_trash_port_lists)"
"|(get_trash_report_configs)"
"|(get_trash_report_formats)"
"|(get_trash_roles)"
"|(get_trash_scanners)"
Expand Down

0 comments on commit dfa3e0c

Please sign in to comment.