Greenbone Vulnerability Manager  22.4.0~dev1
manage_preferences.h
1 /* Copyright (C) 2020-2022 Greenbone Networks GmbH
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 /*
20  * @file manage_preferences.h
21  * @brief Headers for Greenbone Vulnerability Manager: Manage lib: Preferences.
22  */
23 
24 #ifndef _GVMD_MANAGE_PREFERENCES_H
25 #define _GVMD_MANAGE_PREFERENCES_H
26 
27 #include <gvm/base/array.h>
28 
32 typedef struct
33 {
34  char *name;
35  char *id;
36  char *type;
37  char *value;
38  char *nvt_name;
39  char *nvt_oid;
40  array_t *alts;
41  char *default_value;
42  char *hr_name;
44 } preference_t;
45 
46 gpointer
47 preference_new (char *, char *, char *, char *, char *,
48  char *, array_t *, char*, char *, int);
49 
50 void
52 
53 void
54 cleanup_import_preferences (array_t *);
55 
56 #endif /* not _GVMD_MANAGE_PREFERENCES_H */
void cleanup_import_preferences(array_t *import_preferences)
Cleanup preferences array.
Definition: manage_preferences.c:99
void preference_free(preference_t *preference)
Frees a preference including its assigned values.
Definition: manage_preferences.c:72
gpointer preference_new(char *id, char *name, char *type, char *value, char *nvt_name, char *nvt_oid, array_t *alts, char *default_value, char *hr_name, int free_strings)
Create a new preference.
Definition: manage_preferences.c:45
An NVT preference.
Definition: manage_preferences.h:33
int free_strings
Whether string fields are freed by preference_free.
Definition: manage_preferences.h:43
char * name
Name of preference.
Definition: manage_preferences.h:34
char * value
Value of preference.
Definition: manage_preferences.h:37
char * nvt_oid
OID of NVT preference affects.
Definition: manage_preferences.h:39
array_t * alts
Array of gchar's. Alternate values for radio type.
Definition: manage_preferences.h:40
char * hr_name
Extended, more human-readable name.
Definition: manage_preferences.h:42
char * id
ID of preference.
Definition: manage_preferences.h:35
char * type
Type of preference (radio, password, ...).
Definition: manage_preferences.h:36
char * default_value
Default value of preference.
Definition: manage_preferences.h:41
char * nvt_name
Name of NVT preference affects.
Definition: manage_preferences.h:38