Greenbone Vulnerability Manager  9.0.1
Data Structures | Macros | Functions | Variables
gmp_configs.c File Reference

GVM GMP layer: Configs. More...

#include "gmp_configs.h"
#include "gmp_base.h"
#include "gmp_get.h"
#include "manage_configs.h"
#include <assert.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <gvm/util/xmlutils.h>

Data Structures

struct  create_config_t
 The create_config command. More...
 

Macros

#define G_LOG_DOMAIN   "md gmp"
 GLib log domain.
 

Functions

static gpointer nvt_selector_new (char *name, char *type, int include, char *family_or_nvt)
 Create a new NVT selector. More...
 
static void create_config_reset ()
 Reset command data.
 
void create_config_start (gmp_parser_t *gmp_parser, const gchar **attribute_names, const gchar **attribute_values)
 Start a command. More...
 
void create_config_element_start (gmp_parser_t *gmp_parser, const gchar *name, const gchar **attribute_names, const gchar **attribute_values)
 Start element. More...
 
static gchar * text_or_null (entity_t entity)
 Get the text of entity. More...
 
static gchar * attr_or_null (entity_t entity, const gchar *name)
 Get the attribute of entity. More...
 
static void cleanup_import_preferences (array_t *import_preferences)
 Cleanup preferences array. More...
 
void create_config_run (gmp_parser_t *gmp_parser, GError **error)
 Execute command. More...
 
int create_config_element_end (gmp_parser_t *gmp_parser, GError **error, const gchar *name)
 End element. More...
 
void create_config_element_text (const gchar *text, gsize text_len)
 Add text to element. More...
 

Variables

static create_config_t create_config_data
 Parser callback data. More...
 

Detailed Description

GVM GMP layer: Configs.

GMP configs.

Function Documentation

◆ attr_or_null()

static gchar* attr_or_null ( entity_t  entity,
const gchar *  name 
)
static

Get the attribute of entity.

Parameters
[in]entityEntity. Can be NULL.
[in]nameName of attribute.
Returns
Entity attribute if there's an entity, else NULL.

◆ cleanup_import_preferences()

static void cleanup_import_preferences ( array_t *  import_preferences)
static

Cleanup preferences array.

Parameters
[in]import_preferencesImport preferences.

◆ create_config_element_end()

int create_config_element_end ( gmp_parser_t gmp_parser,
GError **  error,
const gchar *  name 
)

End element.

Parameters
[in]gmp_parserGMP parser.
[in]errorError parameter.
[in]nameElement name.
Returns
0 success, 1 command finished.

◆ create_config_element_start()

void create_config_element_start ( gmp_parser_t gmp_parser,
const gchar *  name,
const gchar **  attribute_names,
const gchar **  attribute_values 
)

Start element.

Parameters
[in]gmp_parserGMP parser.
[in]nameElement name.
[in]attribute_namesAll attribute names.
[in]attribute_valuesAll attribute values.

◆ create_config_element_text()

void create_config_element_text ( const gchar *  text,
gsize  text_len 
)

Add text to element.

Parameters
[in]textText.
[in]text_lenText length.

◆ create_config_run()

void create_config_run ( gmp_parser_t gmp_parser,
GError **  error 
)

Execute command.

Parameters
[in]gmp_parserGMP parser.
[in]errorError parameter.

◆ create_config_start()

void create_config_start ( gmp_parser_t gmp_parser,
const gchar **  attribute_names,
const gchar **  attribute_values 
)

Start a command.

Parameters
[in]gmp_parserGMP parser.
[in]attribute_namesAll attribute names.
[in]attribute_valuesAll attribute values.

◆ nvt_selector_new()

static gpointer nvt_selector_new ( char *  name,
char *  type,
int  include,
char *  family_or_nvt 
)
static

Create a new NVT selector.

Parameters
[in]nameName of NVT selector.
[in]typeType of NVT selector.
[in]includeInclude/exclude flag.
[in]family_or_nvtFamily or NVT.
Returns
Newly allocated NVT selector.

◆ text_or_null()

static gchar* text_or_null ( entity_t  entity)
static

Get the text of entity.

Parameters
[in]entityEntity. Can be NULL.
Returns
Entity text if there's an entity, else NULL.

Variable Documentation

◆ create_config_data

create_config_t create_config_data
static

Parser callback data.

This is initially 0 because it's a global variable.