OpenVAS Manager  7.0.3~git
manage_utils.h
Go to the documentation of this file.
1 /* OpenVAS Manager
2  * $Id$
3  * Description: Module for OpenVAS Manager: Manage library utilities.
4  *
5  * Authors:
6  * Matthew Mundell <matthew.mundell@greenbone.net>
7  *
8  * Copyright:
9  * Copyright (C) 2014 Greenbone Networks GmbH
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
24  */
25 
26 #ifndef OPENVAS_MANAGER_MANAGE_UTILS_H
27 #define OPENVAS_MANAGER_MANAGE_UTILS_H
28 
29 #include <time.h>
30 
31 // Log message severity constant
32 #define SEVERITY_LOG 0.0
33 // False positive severity constant
34 #define SEVERITY_FP -1.0
35 // Debug message severity constant
36 #define SEVERITY_DEBUG -2.0
37 // Error message severity constant
38 #define SEVERITY_ERROR -3.0
39 // Constant for missing or invalid severity
40 #define SEVERITY_MISSING -99.0
41 // Constant for undefined severity (for ranges)
42 #define SEVERITY_UNDEFINED -98.0
43 // Maximum possible severity
44 #define SEVERITY_MAX 10.0
45 // Number of subdivisions for 1 severity point (10 => step size 0.1)
46 #define SEVERITY_SUBDIVISIONS 10
47 
48 long
49 time_offset (const char *, time_t);
50 
51 long
52 current_offset (const char *);
53 
54 time_t add_months (time_t, int);
55 
56 time_t months_between (time_t, time_t);
57 
58 time_t
59 next_time (time_t, int, int, const char*, int);
60 
61 int
62 manage_count_hosts_max (const char *, const char *, int);
63 
64 double
65 level_min_severity (const char*, const char*);
66 
67 double
68 level_max_severity (const char*, const char*);
69 
70 int
71 valid_db_resource_type (const char*);
72 
73 #endif /* not OPENVAS_MANAGER_MANAGE_UTILS_H */
double level_min_severity(const char *, const char *)
Get the minimum severity for a severity level and class.
Definition: manage_utils.c:403
int valid_db_resource_type(const char *)
Check whether a resource type table name is valid.
Definition: manage_utils.c:504
time_t next_time(time_t, int, int, const char *, int)
Calculate the next time from now given a start time and a period.
Definition: manage_utils.c:287
double level_max_severity(const char *, const char *)
Get the minimum severity for a severity level and class.
Definition: manage_utils.c:454
time_t add_months(time_t, int)
Add months to a time.
Definition: manage_utils.c:267
time_t months_between(time_t, time_t)
Count number of full months between two times.
Definition: manage_utils.c:202
int manage_count_hosts_max(const char *, const char *, int)
Return number of hosts described by a hosts string.
Definition: manage_utils.c:374
long time_offset(const char *, time_t)
Get the offset from UTC of a timezone at a particular time.
Definition: manage_utils.c:48
long current_offset(const char *)
Get the current offset from UTC of a timezone.
Definition: manage_utils.c:117