[Openvas-commits] r5603 - in trunk/openvas-manager: . src

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Oct 19 11:54:06 CEST 2009


Author: mattm
Date: 2009-10-19 11:54:04 +0200 (Mon, 19 Oct 2009)
New Revision: 5603

Modified:
   trunk/openvas-manager/ChangeLog
   trunk/openvas-manager/src/omp.c
Log:
	* src/omp.c (result_type_threat): New function.
	(omp_xml_handle_end_element): In CLIENT_GET_REPORT change the XML report
	TYPE to THREAT.

Modified: trunk/openvas-manager/ChangeLog
===================================================================
--- trunk/openvas-manager/ChangeLog	2009-10-19 08:36:21 UTC (rev 5602)
+++ trunk/openvas-manager/ChangeLog	2009-10-19 09:54:04 UTC (rev 5603)
@@ -1,3 +1,9 @@
+2009-10-19  Matthew Mundell <matthew.mundell at intevation.de>
+
+	* src/omp.c (result_type_threat): New function.
+	(omp_xml_handle_end_element): In CLIENT_GET_REPORT change the XML report
+	TYPE to THREAT.
+
 2009-10-17  Matthew Mundell <matthew.mundell at intevation.de>
 
 	* src/omp.c (send_to_client): Temporarily add conversion of msg from

Modified: trunk/openvas-manager/src/omp.c
===================================================================
--- trunk/openvas-manager/src/omp.c	2009-10-19 08:36:21 UTC (rev 5602)
+++ trunk/openvas-manager/src/omp.c	2009-10-19 09:54:04 UTC (rev 5603)
@@ -89,6 +89,24 @@
   return categories[ACT_UNKNOWN];
 }
 
+/** @brief Return the threat associated with a result type.
+ *
+ * @param  type  Result type.
+ *
+ * @return Threat name.
+ */
+static const char*
+result_type_threat (const char* type)
+{
+  if (strcasecmp (type, "Security Hole") == 0)
+    return "High";
+  if (strcasecmp (type, "Security Warning") == 0)
+    return "Medium";
+  if (strcasecmp (type, "Security Note") == 0)
+    return "Low";
+  return "Log";
+}
+
 
 /* Help message. */
 
@@ -2945,14 +2963,15 @@
                                              "<host>%s</host>"
                                              "<port>%s</port>"
                                              "<nvt>%s</nvt>"
-                                             "<type>%s</type>"
+                                             "<threat>%s</threat>"
                                              "<description>%s</description>"
                                              "</result>",
                                              result_iterator_subnet (&results),
                                              result_iterator_host (&results),
                                              result_iterator_port (&results),
                                              result_iterator_nvt (&results),
-                                             result_iterator_type (&results),
+                                             result_type_threat
+                                              (result_iterator_type (&results)),
                                              descr ? nl_descr : "");
                     if (descr) g_free (nl_descr);
                   }



More information about the Openvas-commits mailing list