OpenVAS Manager
7.0.3~git
|
#include <time.h>
Go to the source code of this file.
Macros | |
#define | SEVERITY_LOG 0.0 |
#define | SEVERITY_FP -1.0 |
#define | SEVERITY_DEBUG -2.0 |
#define | SEVERITY_ERROR -3.0 |
#define | SEVERITY_MISSING -99.0 |
#define | SEVERITY_UNDEFINED -98.0 |
#define | SEVERITY_MAX 10.0 |
#define | SEVERITY_SUBDIVISIONS 10 |
Functions | |
long | time_offset (const char *, time_t) |
Get the offset from UTC of a timezone at a particular time. More... | |
long | current_offset (const char *) |
Get the current offset from UTC of a timezone. More... | |
time_t | add_months (time_t, int) |
Add months to a time. More... | |
time_t | months_between (time_t, time_t) |
Count number of full months between two times. More... | |
time_t | next_time (time_t, int, int, const char *, int) |
Calculate the next time from now given a start time and a period. More... | |
int | manage_count_hosts_max (const char *, const char *, int) |
Return number of hosts described by a hosts string. More... | |
double | level_min_severity (const char *, const char *) |
Get the minimum severity for a severity level and class. More... | |
double | level_max_severity (const char *, const char *) |
Get the minimum severity for a severity level and class. More... | |
int | valid_db_resource_type (const char *) |
Check whether a resource type table name is valid. More... | |
#define SEVERITY_DEBUG -2.0 |
Definition at line 36 of file manage_utils.h.
Referenced by level_max_severity(), level_min_severity(), manage_create_sql_functions(), severity_data_index(), severity_to_level(), and severity_to_type().
#define SEVERITY_ERROR -3.0 |
Definition at line 38 of file manage_utils.h.
Referenced by create_tables(), level_max_severity(), level_min_severity(), manage_create_sql_functions(), resource_count(), severity_data_index(), severity_to_level(), severity_to_type(), and task_result_count().
#define SEVERITY_FP -1.0 |
Definition at line 34 of file manage_utils.h.
Referenced by level_max_severity(), level_min_severity(), manage_create_sql_functions(), severity_data_index(), severity_to_level(), and severity_to_type().
#define SEVERITY_LOG 0.0 |
Definition at line 32 of file manage_utils.h.
Referenced by create_tables(), level_max_severity(), level_min_severity(), manage_create_sql_functions(), severity_to_level(), and severity_to_type().
#define SEVERITY_MAX 10.0 |
Definition at line 44 of file manage_utils.h.
Referenced by init_severity_data(), and severity_data_value().
#define SEVERITY_MISSING -99.0 |
Definition at line 40 of file manage_utils.h.
Referenced by init_severity_data(), severity_data_value(), task_severity(), and task_severity_double().
#define SEVERITY_SUBDIVISIONS 10 |
Definition at line 46 of file manage_utils.h.
Referenced by init_severity_data(), severity_data_index(), and severity_data_value().
#define SEVERITY_UNDEFINED -98.0 |
Definition at line 42 of file manage_utils.h.
Referenced by level_max_severity(), and level_min_severity().
time_t add_months | ( | time_t | time, |
int | months | ||
) |
Add months to a time.
[in] | time | Time. |
[in] | months | Months. |
Definition at line 267 of file manage_utils.c.
Referenced by next_time().
long current_offset | ( | const char * | zone | ) |
Get the current offset from UTC of a timezone.
[in] | zone | Timezone, or NULL for UTC. |
Definition at line 117 of file manage_utils.c.
Referenced by next_time().
double level_max_severity | ( | const char * | level, |
const char * | class | ||
) |
Get the minimum severity for a severity level and class.
[in] | level | The name of the severity level. |
[in] | class | The severity class. |
Definition at line 454 of file manage_utils.c.
References SEVERITY_DEBUG, SEVERITY_ERROR, SEVERITY_FP, SEVERITY_LOG, and SEVERITY_UNDEFINED.
Referenced by severity_data_level_counts().
double level_min_severity | ( | const char * | level, |
const char * | class | ||
) |
Get the minimum severity for a severity level and class.
[in] | level | The name of the severity level. |
[in] | class | The severity class, NULL to get from current user setting. |
Definition at line 403 of file manage_utils.c.
References SEVERITY_DEBUG, SEVERITY_ERROR, SEVERITY_FP, SEVERITY_LOG, and SEVERITY_UNDEFINED.
Referenced by severity_data_level_counts().
int manage_count_hosts_max | ( | const char * | given_hosts, |
const char * | exclude_hosts, | ||
int | max_hosts | ||
) |
Return number of hosts described by a hosts string.
[in] | given_hosts | String describing hosts. |
[in] | exclude_hosts | String describing hosts excluded from given set. |
[in] | max_hosts | Max hosts. |
Definition at line 374 of file manage_utils.c.
time_t months_between | ( | time_t | time1, |
time_t | time2 | ||
) |
Count number of full months between two times.
There are two full months between 0h00.00 1 February 2010 and 0h00.00 1 April 2010. There is one full month between 0h00.00 1 February 2010 and 23h59.59 31 March 2010.
[in] | time1 | Earlier time. |
[in] | time2 | Later time. |
Definition at line 202 of file manage_utils.c.
References MONTHS_WITHIN_YEAR.
Referenced by next_time().
time_t next_time | ( | time_t | first, |
int | period, | ||
int | period_months, | ||
const char * | timezone, | ||
int | periods_offset | ||
) |
Calculate the next time from now given a start time and a period.
[in] | first | The first time. |
[in] | period | The period in seconds. |
[in] | period_months | The period in months. |
[in] | timezone | The timezone to use. |
[in] | periods_offset | Number of periods to offset. e.g. 0 = next time, -1 current/last time |
Definition at line 287 of file manage_utils.c.
References add_months(), current_offset(), months_between(), and time_offset().
Referenced by manage_schedule(), sql_next_time(), and task_schedule_next_time().
long time_offset | ( | const char * | zone, |
time_t | time | ||
) |
Get the offset from UTC of a timezone at a particular time.
[in] | zone | Timezone, or NULL for UTC. |
[in] | time | Time. |
Definition at line 48 of file manage_utils.c.
Referenced by next_time().
int valid_db_resource_type | ( | const char * | type | ) |
Check whether a resource type table name is valid.
[in] | type | Type of resource. |
Definition at line 504 of file manage_utils.c.