OpenVAS Libraries  9.0.3
credentials.c
Go to the documentation of this file.
1 /* openvas-libraries/base
2  * $Id$
3  * Description: Credential pairs and triples.
4  *
5  * Authors:
6  * Matthew Mundell <matthew.mundell@greenbone.net>
7  * Michael Wiegand <michael.wiegand@intevation.de>
8  * Felix Wolfsteller <felix.wolfsteller@intevation.de>
9  *
10  * Copyright:
11  * Copyright (C) 2010 Greenbone Networks GmbH
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software
25  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
26  */
27 
28 #include "credentials.h"
29 
30 #include "openvas_string.h"
31 
39 void
41 {
42  g_free (credentials->username);
43  credentials->username = NULL;
44 
45  g_free (credentials->password);
46  credentials->password = NULL;
47 
50  g_free (credentials->timezone);
51  credentials->timezone = NULL;
52 
53  g_free (credentials->role);
54  credentials->role = NULL;
55 
56  g_free (credentials->severity_class);
57  credentials->severity_class = NULL;
58 
59  credentials->dynamic_severity = 0;
60 }
61 
69 void
70 append_to_credentials_username (credentials_t * credentials, const char *text,
71  gsize length)
72 {
73  openvas_append_text (&credentials->username, text, length);
74 }
75 
83 void
84 append_to_credentials_password (credentials_t * credentials, const char *text,
85  gsize length)
86 {
87  openvas_append_text (&credentials->password, text, length);
88 }
gchar * role
Role of user.
Definition: credentials.h:52
void append_to_credentials_password(credentials_t *credentials, const char *text, gsize length)
Append text to the password of a credential pair.
Definition: credentials.c:84
void free_credentials(credentials_t *credentials)
Free credentials.
Definition: credentials.c:40
gchar * username
Login name of user.
Definition: credentials.h:38
A username password pair.
Definition: credentials.h:36
gchar * severity_class
Severity Class setting of user. Set in OpenVAS Manager.
Definition: credentials.h:48
gchar * timezone
Timezone of user. Set in OpenVAS Manager.
Definition: credentials.h:44
gchar * password
Password of user.
Definition: credentials.h:40
void openvas_append_text(gchar **var, const gchar *string, gsize length)
Append a string of a known length to a string variable.
void append_to_credentials_username(credentials_t *credentials, const char *text, gsize length)
Append text to the username of a credential pair.
Definition: credentials.c:70
int dynamic_severity
Dynamic Severity setting of user. Set in OpenVAS Manager.
Definition: credentials.h:50