credentials.c
Go to the documentation of this file.
/* SPDX-FileCopyrightText: 2010-2023 Greenbone AG
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "credentials.h"
#include "strings.h" /* for gvm_append_text */
#include <string.h>
#undef G_LOG_DOMAIN
#define G_LOG_DOMAIN "libgvm base"
void
free_credentials (credentials_t *credentials)
{
g_free (credentials->username);
g_free (credentials->password);
g_free (credentials->uuid);
g_free (credentials->timezone);
g_free (credentials->role);
g_free (credentials->severity_class);
memset (credentials, '\0', sizeof (*credentials));
}
void
append_to_credentials_username (credentials_t *credentials, const char *text,
gsize length)
{
gvm_append_text (&credentials->username, text, length);
}
void
append_to_credentials_password (credentials_t *credentials, const char *text,
gsize length)
{
gvm_append_text (&credentials->password, text, length);
}
append_to_credentials_username
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:50
append_to_credentials_password
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:64
free_credentials
void free_credentials(credentials_t *credentials)
Free credentials.
Definition credentials.c:31
credentials.h
Credential pairs and triples.
gvm_append_text
void gvm_append_text(gchar **var, const gchar *string, gsize length)
Append a string of a known length to a string variable.
Definition strings.c:66
strings.h
String utilities.
credentials_t
A username password pair.
Definition credentials.h:20
credentials_t::role
gchar * role
Role of user.
Definition credentials.h:35
credentials_t::password
gchar * password
Password of user.
Definition credentials.h:23
credentials_t::timezone
gchar * timezone
Timezone of user.
Definition credentials.h:27
credentials_t::username
gchar * username
Login name of user.
Definition credentials.h:21
credentials_t::uuid
gchar * uuid
UUID of user.
Definition credentials.h:25
credentials_t::severity_class
gchar * severity_class
Severity Class setting of user.
Definition credentials.h:31