Greenbone Vulnerability Manager
21.4.2
|
GVM management layer: Report formats. More...
#include "manage_report_formats.h"
#include "gmp_report_formats.h"
#include "manage.h"
#include "manage_sql.h"
#include "manage_sql_report_formats.h"
#include "utils.h"
#include <assert.h>
#include <errno.h>
#include <glib.h>
#include <gvm/util/fileutils.h>
#include <locale.h>
#include <stdlib.h>
#include <string.h>
Macros | |
#define | G_LOG_DOMAIN "md manage" |
GLib log domain. | |
Functions | |
gboolean | find_report_format_with_permission (const char *uuid, report_format_t *report_format, const char *permission) |
Find a report format for a specific permission, given a UUID. More... | |
int | report_format_writable (report_format_t report_format) |
Return whether a report format is writable. More... | |
int | trash_report_format_writable (report_format_t report_format) |
Return whether a trashcan report_format is writable. More... | |
const char * | report_format_param_type_name (report_format_param_type_t type) |
Get the name of a report format param type. More... | |
report_format_param_type_t | report_format_param_type_from_name (const char *name) |
Get a report format param type from a name. More... | |
static int | backup_file_name (const char *name) |
Return whether a name is a backup file name. More... | |
static int | get_report_format_files (const char *dir_name, GPtrArray **start) |
Get files associated with a report format. More... | |
int | init_report_format_file_iterator (file_iterator_t *iterator, report_format_t report_format) |
Initialise a report format file iterator. More... | |
void | cleanup_file_iterator (file_iterator_t *iterator) |
Cleanup a report type iterator. More... | |
gboolean | next_file (file_iterator_t *iterator) |
Increment a report type iterator. More... | |
const char * | file_iterator_name (file_iterator_t *iterator) |
Return the name from a file iterator. More... | |
gchar * | file_iterator_content_64 (file_iterator_t *iterator) |
Return the file contents from a file iterator. More... | |
static const gchar * | feed_dir_report_formats () |
Get path to report formats in feed. More... | |
static int | update_report_format_from_file (report_format_t report_format, const gchar *path) |
Create a report format from an XML file. More... | |
static void | create_feed_report_format_permissions (const gchar *report_format_id) |
Grant 'Feed Import Roles' access to a report format. More... | |
static int | create_report_format_from_file (const gchar *path) |
Create a report format from an XML file. More... | |
static void | sync_report_format_with_feed (const gchar *path) |
Sync a single report format with the feed. More... | |
int | sync_report_formats_with_feed () |
Sync all report formats with the feed. More... | |
gboolean | report_formats_feed_dir_exists () |
Tests if the report formats feed directory exists. More... | |
void | manage_sync_report_formats () |
Sync report formats with the feed. | |
GVM management layer: Report formats.
Non-SQL report format code for the GVM management layer.
|
static |
Return whether a name is a backup file name.
[in] | name | Name. |
void cleanup_file_iterator | ( | file_iterator_t * | iterator | ) |
Cleanup a report type iterator.
[in] | iterator | Iterator. |
|
static |
Grant 'Feed Import Roles' access to a report format.
[in] | report_format_id | UUID of report format. |
|
static |
Create a report format from an XML file.
[in] | path | Path to report format XML. |
|
static |
Get path to report formats in feed.
gchar* file_iterator_content_64 | ( | file_iterator_t * | iterator | ) |
Return the file contents from a file iterator.
[in] | iterator | Iterator. |
const char* file_iterator_name | ( | file_iterator_t * | iterator | ) |
Return the name from a file iterator.
[in] | iterator | Iterator. |
gboolean find_report_format_with_permission | ( | const char * | uuid, |
report_format_t * | report_format, | ||
const char * | permission | ||
) |
Find a report format for a specific permission, given a UUID.
[in] | uuid | UUID of report format. |
[out] | report_format | Report format return, 0 if successfully failed to find report_format. |
[in] | permission | Permission. |
|
static |
Get files associated with a report format.
[in] | dir_name | Location of files. |
[out] | start | Files on success. |
int init_report_format_file_iterator | ( | file_iterator_t * | iterator, |
report_format_t | report_format | ||
) |
Initialise a report format file iterator.
[in] | iterator | Iterator. |
[in] | report_format | Single report format to iterate over, NULL for all. |
gboolean next_file | ( | file_iterator_t * | iterator | ) |
Increment a report type iterator.
The caller must stop using this after it returns FALSE.
[in] | iterator | Task iterator. |
report_format_param_type_t report_format_param_type_from_name | ( | const char * | name | ) |
Get a report format param type from a name.
[in] | name | Param type name. |
const char* report_format_param_type_name | ( | report_format_param_type_t | type | ) |
Get the name of a report format param type.
[in] | type | Param type. |
int report_format_writable | ( | report_format_t | report_format | ) |
Return whether a report format is writable.
[in] | report_format | Report Format. |
gboolean report_formats_feed_dir_exists | ( | ) |
Tests if the report formats feed directory exists.
|
static |
Sync a single report format with the feed.
[in] | path | Path to report format XML in feed. |
int sync_report_formats_with_feed | ( | ) |
Sync all report formats with the feed.
Create report formats that exists in the feed but not in the db. Update report formats in the db that have changed on the feed. Do nothing to report formats in db that have been removed from the feed.
int trash_report_format_writable | ( | report_format_t | report_format | ) |
Return whether a trashcan report_format is writable.
[in] | report_format | Report Format. |
|
static |
Create a report format from an XML file.
[in] | report_format | Existing report format. |
[in] | path | Full path to report format XML. |