Protos for CVSS utility functions.
More...
#include <glib.h>
Go to the source code of this file.
Protos for CVSS utility functions.
This file contains the protos for cvss.c
Definition in file cvss.h.
◆ cvss_as_str()
gchar* cvss_as_str |
( |
double |
| ) |
|
◆ get_cvss_score_from_base_metrics()
double get_cvss_score_from_base_metrics |
( |
const char * |
cvss_str | ) |
|
Calculate CVSS Score.
- Parameters
-
cvss_str | Base vector string from which to compute score. |
- Returns
- The resulting score. -1 upon error during parsing.
Definition at line 317 of file cvss.c.
322 memset(&
cvss, 0x00,
sizeof(
struct cvss));
324 if (cvss_str == NULL)
327 base_str =
base_metrics = g_strdup_printf (
"%s/", cvss_str);
332 char *metric_name = token2;
339 if (metric_name == NULL)
342 metric_value = strtok (NULL,
":");
344 if (metric_value == NULL)
347 rc = toenum (metric_name, &mval);
351 if (set_impact_from_str (metric_value, mval, &
cvss))
358 return __get_cvss_score (&
cvss);