Greenbone Vulnerability Manager  21.4.2
Macros | Functions
manage_configs.c File Reference

GVM manage layer: Configs. More...

#include "gmp_configs.h"
#include "manage_configs.h"
#include "manage_sql.h"
#include "manage_sql_configs.h"
#include "utils.h"
#include <errno.h>
#include <glib.h>
#include <gvm/util/fileutils.h>
#include <stdlib.h>
#include <string.h>

Macros

#define G_LOG_DOMAIN   "md manage"
 GLib log domain.
 

Functions

int config_predefined_uuid (const gchar *config_id)
 Return whether a config is predefined. More...
 
static const gchar * feed_dir_configs ()
 Get path to configs in feed. More...
 
static void create_feed_config_permissions (const gchar *config_id)
 Grant 'Feed Import Roles' access to a config. More...
 
static int update_config_from_file (config_t config, const gchar *path)
 Create a config from an XML file. More...
 
static int create_config_from_file (const gchar *path)
 Create a config from an XML file. More...
 
static void sync_config_with_feed (const gchar *path)
 Sync a single config with the feed. More...
 
int sync_configs_with_feed ()
 Sync all configs with the feed. More...
 
gboolean configs_feed_dir_exists ()
 Tests if the configs feed directory exists. More...
 
void manage_sync_configs ()
 Sync configs with the feed.
 

Detailed Description

GVM manage layer: Configs.

General functions for managing scan configs.

Function Documentation

◆ config_predefined_uuid()

int config_predefined_uuid ( const gchar *  config_id)

Return whether a config is predefined.

Parameters
[in]config_idUUID of config.
Returns
1 if predefined, else 0.

◆ configs_feed_dir_exists()

gboolean configs_feed_dir_exists ( )

Tests if the configs feed directory exists.

Returns
TRUE if the directory exists.

◆ create_config_from_file()

static int create_config_from_file ( const gchar *  path)
static

Create a config from an XML file.

Parameters
[in]pathPath to config XML.
Returns
0 success, -1 error.

◆ create_feed_config_permissions()

static void create_feed_config_permissions ( const gchar *  config_id)
static

Grant 'Feed Import Roles' access to a config.

Parameters
[in]config_idUUID of config.

◆ feed_dir_configs()

static const gchar* feed_dir_configs ( )
static

Get path to configs in feed.

Returns
Path to configs in feed.

◆ sync_config_with_feed()

static void sync_config_with_feed ( const gchar *  path)
static

Sync a single config with the feed.

Parameters
[in]pathPath to config XML in feed.

◆ sync_configs_with_feed()

int sync_configs_with_feed ( )

Sync all configs with the feed.

Create configs that exists in the feed but not in the db. Update configs in the db that have changed on the feed. Do nothing to configs in db that have been removed from the feed.

Returns
0 success, -1 error.

◆ update_config_from_file()

static int update_config_from_file ( config_t  config,
const gchar *  path 
)
static

Create a config from an XML file.

Parameters
[in]configExisting config.
[in]pathFull path to config XML.
Returns
0 success, -1 error.