Greenbone Vulnerability Manager  21.4.4
Functions
manage_pg_server.c File Reference

GVM management layer: Postgres server-side functions. More...

#include "manage_utils.h"
#include "postgres.h"
#include "fmgr.h"
#include "executor/spi.h"
#include "glib.h"
#include <gvm/base/hosts.h>

Functions

static char * textndup (text *text_arg, int length)
 Create a string from a portion of text. More...
 
static int get_max_hosts ()
 Get the maximum number of hosts. More...
 
 PG_FUNCTION_INFO_V1 (sql_hosts_contains)
 Define function for Postgres.
 
Datum sql_hosts_contains (PG_FUNCTION_ARGS)
 Return if argument 1 matches regular expression in argument 2. More...
 
 PG_FUNCTION_INFO_V1 (sql_level_max_severity)
 Define function for Postgres.
 
 __attribute__ ((deprecated))
 Dummy function to allow restoring gvmd-9.0 dumps. More...
 
 PG_FUNCTION_INFO_V1 (sql_level_min_severity)
 Define function for Postgres.
 
 PG_FUNCTION_INFO_V1 (sql_next_time)
 Define function for Postgres.
 
 PG_FUNCTION_INFO_V1 (sql_next_time_ical)
 Define function for Postgres.
 
Datum sql_next_time_ical (PG_FUNCTION_ARGS)
 Get the next time given schedule times. More...
 
 PG_FUNCTION_INFO_V1 (sql_max_hosts)
 Define function for Postgres.
 
Datum sql_max_hosts (PG_FUNCTION_ARGS)
 Return number of hosts. More...
 
 PG_FUNCTION_INFO_V1 (sql_severity_matches_ov)
 Define function for Postgres.
 
 PG_FUNCTION_INFO_V1 (sql_regexp)
 Define function for Postgres.
 
Datum sql_regexp (PG_FUNCTION_ARGS)
 Return if argument 1 matches regular expression in argument 2. More...
 
 PG_FUNCTION_INFO_V1 (sql_valid_db_resource_type)
 Define function for Postgres.
 

Detailed Description

GVM management layer: Postgres server-side functions.

This file contains a server-side module for Postgres, that defines SQL functions for the management layer that need to be implemented in C.

Function Documentation

◆ __attribute__()

__attribute__ ( (deprecated)  )

Dummy function to allow restoring gvmd-9.0 dumps.

Return max severity of level.

Deprecated:
This function will be removed once direct migration compatibility with gvmd 9.0 is no longer required
Returns
Postgres NULL Datum.
Deprecated:
This function will be removed once direct migration compatibility with gvmd 9.0 is no longer required
Returns
Postgres NULL Datum.
Deprecated:
This function will be removed once direct migration compatibility with gvmd 9.0 is no longer required
Returns
Postgres NULL Datum.

This is a callback for a SQL function of one argument.

Returns
Postgres Datum.
Deprecated:
This function will be removed once direct migration compatibility with gvmd 9.0 is no longer required
Returns
Postgres NULL Datum.

◆ get_max_hosts()

static int get_max_hosts ( )
static

Get the maximum number of hosts.

Returns
The maximum number of hosts.

◆ sql_hosts_contains()

Datum sql_hosts_contains ( PG_FUNCTION_ARGS  )

Return if argument 1 matches regular expression in argument 2.

This is a callback for a SQL function of two arguments.

Returns
Postgres Datum.

◆ sql_max_hosts()

Datum sql_max_hosts ( PG_FUNCTION_ARGS  )

Return number of hosts.

This is a callback for a SQL function of two arguments.

Returns
Postgres Datum.

◆ sql_next_time_ical()

Datum sql_next_time_ical ( PG_FUNCTION_ARGS  )

Get the next time given schedule times.

This is a callback for a SQL function of one to three arguments.

Returns
Postgres Datum.

◆ sql_regexp()

Datum sql_regexp ( PG_FUNCTION_ARGS  )

Return if argument 1 matches regular expression in argument 2.

This is a callback for a SQL function of two arguments.

Returns
Postgres Datum.

◆ textndup()

static char* textndup ( text *  text_arg,
int  length 
)
static

Create a string from a portion of text.

Parameters
[in]text_argText.
[in]lengthLength to create.
Returns
Freshly allocated string.