Greenbone Vulnerability Management Libraries  22.8.0
credentials.c File Reference

Credential pairs and triples. More...

#include "credentials.h"
#include "strings.h"
#include <string.h>
Include dependency graph for credentials.c:

Go to the source code of this file.

Macros

#define G_LOG_DOMAIN   "libgvm base"
 GLib log domain. More...
 

Functions

void free_credentials (credentials_t *credentials)
 Free credentials. More...
 
void append_to_credentials_username (credentials_t *credentials, const char *text, gsize length)
 Append text to the username of a credential pair. More...
 
void append_to_credentials_password (credentials_t *credentials, const char *text, gsize length)
 Append text to the password of a credential pair. More...
 

Detailed Description

Credential pairs and triples.

Definition in file credentials.c.

Macro Definition Documentation

◆ G_LOG_DOMAIN

#define G_LOG_DOMAIN   "libgvm base"

GLib log domain.

Definition at line 21 of file credentials.c.

Function Documentation

◆ 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.

Parameters
[in]credentialsCredentials.
[in]textThe text to append.
[in]lengthLength of the text.

Definition at line 64 of file credentials.c.

66 {
67  gvm_append_text (&credentials->password, text, length);
68 }

References gvm_append_text(), and credentials_t::password.

Here is the call graph for this function:

◆ 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.

Parameters
[in]credentialsCredentials.
[in]textThe text to append.
[in]lengthLength of the text.

Definition at line 50 of file credentials.c.

52 {
53  gvm_append_text (&credentials->username, text, length);
54 }

References gvm_append_text(), and credentials_t::username.

Here is the call graph for this function:

◆ free_credentials()

void free_credentials ( credentials_t credentials)

Free credentials.

Free the members of a credentials pair.

Parameters
[in]credentialsPointer to the credentials.

Definition at line 31 of file credentials.c.

32 {
33  g_free (credentials->username);
34  g_free (credentials->password);
35  g_free (credentials->uuid);
36  g_free (credentials->timezone);
37  g_free (credentials->role);
38  g_free (credentials->severity_class);
39  memset (credentials, '\0', sizeof (*credentials));
40 }

References credentials_t::password, credentials_t::role, credentials_t::severity_class, credentials_t::timezone, credentials_t::username, and credentials_t::uuid.

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::severity_class
gchar * severity_class
Severity Class setting of user.
Definition: credentials.h:31
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
credentials_t::password
gchar * password
Password of user.
Definition: credentials.h:23
credentials_t::uuid
gchar * uuid
UUID of user.
Definition: credentials.h:25
credentials_t::role
gchar * role
Role of user.
Definition: credentials.h:35