Greenbone Vulnerability Management Libraries 23.1.2
credentialutils.c File Reference

Functions for handling scan credentials. More...

#include "credentialutils.h"

Go to the source code of this file.

Data Structures

struct  scan_credential
 Struct credential information. More...

Macros

#define G_LOG_DOMAIN   "libgvm util"
 GLib logging domain.

Functions

scan_credential_tscan_credential_new (const char *type, const char *service, const char *port)
 Allocate and initialize a new scan credential.
const gchar * scan_credential_get_type (scan_credential_t *credential)
 Get the type of a scan credential.
const gchar * scan_credential_get_service (scan_credential_t *credential)
 Get the service of a scan credential.
const gchar * scan_credential_get_port (scan_credential_t *credential)
 Get the port of a scan credential.
void scan_credential_foreach_auth_data (scan_credential_t *credential, void(*func)(const char *name, const char *value, void *user_data), void *user_data)
 Iterate over each authentication data item in a scan credential.
void scan_credential_free (scan_credential_t *credential)
 Free a scan credential.
const gchar * scan_credential_get_auth_data (scan_credential_t *credential, const char *name)
 Get authentication data from a scan credential.
void scan_credential_set_auth_data (scan_credential_t *credential, const char *name, const char *value)
 Set authentication data for a scan credential.

Detailed Description

Functions for handling scan credentials.

Macro Definition Documentation

◆ G_LOG_DOMAIN

#define G_LOG_DOMAIN   "libgvm util"

GLib logging domain.

Function Documentation

◆ scan_credential_foreach_auth_data()

void scan_credential_foreach_auth_data ( scan_credential_t * credential,
void(* func )(const char *name, const char *value, void *user_data),
void * user_data )

Iterate over each authentication data item in a scan credential.

Parameters
[in]credentialThe credential to iterate over.
[in]funcThe function to call for each authentication data item.
[in]user_dataUser data to pass to the function.

◆ scan_credential_free()

void scan_credential_free ( scan_credential_t * credential)

Free a scan credential.

Parameters
[in]credentialThe credential to free.

◆ scan_credential_get_auth_data()

const gchar * scan_credential_get_auth_data ( scan_credential_t * credential,
const char * name )

Get authentication data from a scan credential.

Parameters
[in]credentialThe credential to get the data from.
[in]nameThe name of the data item to get.
Returns
The requested authentication data or NULL if not available.

◆ scan_credential_get_port()

const gchar * scan_credential_get_port ( scan_credential_t * credential)

Get the port of a scan credential.

Parameters
[in]credentialThe credential to get the port from.
Returns
The port of the credential or NULL if not available.

◆ scan_credential_get_service()

const gchar * scan_credential_get_service ( scan_credential_t * credential)

Get the service of a scan credential.

Parameters
[in]credentialThe credential to get the service from.
Returns
The service of the credential or NULL if not available.

◆ scan_credential_get_type()

const gchar * scan_credential_get_type ( scan_credential_t * credential)

Get the type of a scan credential.

Parameters
[in]credentialThe credential to get the type from.
Returns
The type of the credential or NULL if not available.

◆ scan_credential_new()

scan_credential_t * scan_credential_new ( const char * type,
const char * service,
const char * port )

Allocate and initialize a new scan credential.

Parameters
[in]typeThe credential type.
[in]serviceThe service the credential is for.
[in]portThe port.
Returns
New osp credential.

◆ scan_credential_set_auth_data()

void scan_credential_set_auth_data ( scan_credential_t * credential,
const char * name,
const char * value )

Set authentication data for a scan credential.

Parameters
[in]credentialThe credential to set the data for.
[in]nameThe name of the data item to set.
[in]valueThe authentication data or NULL to unset.