Greenbone Vulnerability Manager 22.5.2
manage_sql_report_formats.h
1/* Copyright (C) 2020-2022 Greenbone AG
2 *
3 * SPDX-License-Identifier: AGPL-3.0-or-later
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Affero General Public License as
7 * published by the Free Software Foundation, either version 3 of the
8 * License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Affero General Public License for more details.
14 *
15 * You should have received a copy of the GNU Affero General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef _GVMD_MANAGE_SQL_REPORT_FORMATS_H
20#define _GVMD_MANAGE_SQL_REPORT_FORMATS_H
21
22#include "manage.h"
23#include "manage_sql.h"
24
25#include <glib.h>
26
27gboolean
28lookup_report_format (const char*, report_format_t*);
29
30gboolean
31find_report_format_no_acl (const char *, report_format_t *);
32
33gboolean
34find_trash_report_format_no_acl (const char *, report_format_t *);
35
36int
37create_report_format_no_acl (const char *, const char *, const char *,
38 const char *, const char *, const char *,
39 array_t *, array_t *, array_t *, const char *,
40 int, report_format_t *);
41
42const char**
44
47
48int
49restore_report_format (const char *);
50
51gchar *
52apply_report_format (gchar *, gchar *, gchar *, gchar *,
53 GList **);
54
55gboolean
57
58void
60
61int
63
64gboolean
65inherit_report_formats (user_t, user_t, iterator_t *);
66
67void
68inherit_report_format_dir (const gchar *, const gchar *, user_t);
69
70void
71update_report_format (report_format_t, const gchar *, const gchar *,
72 const gchar *, const gchar *, const gchar *,
73 const gchar *, const gchar *, array_t *, array_t *,
74 array_t *);
75
76int
77report_format_updated_in_feed (report_format_t, const gchar *);
78
79int
81
82int
84
85int
87
88int
89print_report_xml_end (gchar *, gchar *, report_format_t);
90
91#endif /* not _GVMD_MANAGE_SQL_REPORT_FORMATS_H */
int print_report_xml_end(gchar *xml_start, gchar *xml_full, report_format_t report_format)
Completes a report by adding report format info.
Definition: manage_sql_report_formats.c:3595
void delete_report_format_dirs_user(const gchar *user_id, iterator_t *rows)
Delete all report formats owned by a user.
Definition: manage_sql_report_formats.c:4079
column_t * report_format_select_columns()
Get select columns.
Definition: manage_sql_report_formats.c:2674
void update_report_format(report_format_t report_format, const gchar *report_id, const gchar *name, const gchar *content_type, const gchar *extension, const gchar *summary, const gchar *description, const gchar *signature, array_t *files, array_t *params, array_t *params_options)
Update a report format from an XML file.
Definition: manage_sql_report_formats.c:4134
gboolean find_trash_report_format_no_acl(const char *uuid, report_format_t *report_format)
Find a trash report format given a UUID.
Definition: manage_sql_report_formats.c:509
gboolean find_report_format_no_acl(const char *uuid, report_format_t *report_format)
Find a report format given a UUID.
Definition: manage_sql_report_formats.c:470
const char ** report_format_filter_columns()
Get filter columns.
Definition: manage_sql_report_formats.c:2662
gboolean inherit_report_formats(user_t user, user_t inheritor, iterator_t *rows)
Change ownership of report formats, for user deletion.
Definition: manage_sql_report_formats.c:4010
int check_db_report_formats_trash()
Ensure that the report formats trash directory matches the database.
Definition: manage_sql_report_formats.c:4583
int report_format_updated_in_feed(report_format_t report_format, const gchar *path)
Check if a report format has been updated in the feed.
Definition: manage_sql_report_formats.c:4220
int empty_trashcan_report_formats()
Empty trashcan.
Definition: manage_sql_report_formats.c:3887
gboolean lookup_report_format(const char *name, report_format_t *report_format)
Find a report format given a name.
Definition: manage_sql_report_formats.c:418
int migrate_predefined_report_formats()
Migrate old ownerless report formats to the Feed Owner.
Definition: manage_sql_report_formats.c:4249
int restore_report_format(const char *report_format_id)
Try restore a report format.
Definition: manage_sql_report_formats.c:1968
int check_db_report_formats()
Ensure the predefined report formats exist.
Definition: manage_sql_report_formats.c:4551
gboolean delete_report_formats_user(user_t user, iterator_t *rows)
Delete all report formats owned by a user.
Definition: manage_sql_report_formats.c:4034
int create_report_format_no_acl(const char *uuid, const char *name, const char *content_type, const char *extension, const char *summary, const char *description, array_t *files, array_t *params, array_t *params_options, const char *signature, int predefined, report_format_t *report_format)
Create a report format.
Definition: manage_sql_report_formats.c:1251
void inherit_report_format_dir(const gchar *report_format_id, const gchar *user_id, user_t inheritor)
Change ownership of report formats, for user deletion.
Definition: manage_sql_report_formats.c:3961
gchar * apply_report_format(gchar *report_format_id, gchar *xml_start, gchar *xml_file, gchar *xml_dir, GList **used_rfps)
Applies a report format to an XML report.
Definition: manage_sql_report_formats.c:3657
Iterator column.
Definition: manage_sql.h:217
A generic SQL iterator structure.
Definition: iterator.h:50