[Openvas-commits] r1325 - in trunk/openvas-client: . nessus

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Sep 10 14:57:24 CEST 2008


Author: jan
Date: 2008-09-10 14:57:23 +0200 (Wed, 10 Sep 2008)
New Revision: 1325

Modified:
   trunk/openvas-client/ChangeLog
   trunk/openvas-client/nessus/xml_output_ng.c
Log:
Migrate the XML export format to a new version that now also
uses OID as a base. Many node names have changed. There is currently
no old version supported.

* nessus/xml_output_ng.c (xml_plugins_plugin, xml_config_scanners): Change
nodes "plugin id=" to "nvt oid=".
(xml_config_plugins, xml_plugins): Renamed node "plugins" to "nvts".
(backend_to_xml_ng): Renamed node "report" to "openvas-report". Renamed
nessus.xsl to openvas-report.xsl, despite the fact neither previous
nor the new exists. Version set to 1.0.
(xml_info_nessusd): Renamed node "nessusd" to "openvasd", "libnasl" to
"openvas-libnasl" and "libnessus" to "opnevas-libraries".



Modified: trunk/openvas-client/ChangeLog
===================================================================
--- trunk/openvas-client/ChangeLog	2008-09-10 12:54:03 UTC (rev 1324)
+++ trunk/openvas-client/ChangeLog	2008-09-10 12:57:23 UTC (rev 1325)
@@ -1,5 +1,20 @@
 2008-09-10  Jan-Oliver Wagner <jan-oliver.wagner at intevation.de>
 
+	Migrate the XML export format to a new version that now also
+	uses OID as a base. Many node names have changed. There is currently
+	no old version supported.
+
+	* nessus/xml_output_ng.c (xml_plugins_plugin, xml_config_scanners): Change
+	nodes "plugin id=" to "nvt oid=".
+	(xml_config_plugins, xml_plugins): Renamed node "plugins" to "nvts".
+	(backend_to_xml_ng): Renamed node "report" to "openvas-report". Renamed
+	nessus.xsl to openvas-report.xsl, despite the fact neither previous
+	nor the new exists. Version set to 1.0.
+	(xml_info_nessusd): Renamed node "nessusd" to "openvasd", "libnasl" to
+	"openvas-libnasl" and "libnessus" to "opnevas-libraries".
+
+2008-09-10  Jan-Oliver Wagner <jan-oliver.wagner at intevation.de>
+
 	Migrate the LONG_ATTACK command to use OID instead of IDs.
 
 	* nessus/attack.c (setup_plug_list): Create a ;-separated list of OIDs

Modified: trunk/openvas-client/nessus/xml_output_ng.c
===================================================================
--- trunk/openvas-client/nessus/xml_output_ng.c	2008-09-10 12:54:03 UTC (rev 1324)
+++ trunk/openvas-client/nessus/xml_output_ng.c	2008-09-10 12:57:23 UTC (rev 1325)
@@ -236,17 +236,17 @@
 {
  if (t)
  {
-  xml_fprintf (fd, indent, "<nessusd>\n");
+  xml_fprintf (fd, indent, "<openvasd>\n");
   xml_fprintf_element (fd, indent+1, "version", (char *) arg_get_value (t, "server_info_nessusd_version"));
-  xml_fprintf_element (fd, indent+1, "libnasl", (char *) arg_get_value (t, "server_info_libnasl_version"));
-  xml_fprintf_element (fd, indent+1, "libnessus", (char *) arg_get_value (t, "server_info_libnessus_version"));
+  xml_fprintf_element (fd, indent+1, "openvas-libnasl", (char *) arg_get_value (t, "server_info_libnasl_version"));
+  xml_fprintf_element (fd, indent+1, "openvas-libraries", (char *) arg_get_value (t, "server_info_libnessus_version"));
   xml_fprintf_element (fd, indent+1, "thread", (char *) arg_get_value (t, "server_info_thread_manager"));
-  xml_fprintf (fd, indent, "</nessusd>\n");
+  xml_fprintf (fd, indent, "</openvasd>\n");
  } else {
-  show_error("xml_output: No nessusd informations.\n");
-  xml_fprintf (fd, indent, "<nessusd>\n");
+  show_error("xml_output: No openvasd informations.\n");
+  xml_fprintf (fd, indent, "<openvasd>\n");
   xml_fprintf (fd, indent+1, "<!-- no version information found -->\n");
-  xml_fprintf (fd, indent, "</nessusd>\n");
+  xml_fprintf (fd, indent, "</openvasd>\n");
  }
 } /* xml_info_nessusd */
 
@@ -277,7 +277,7 @@
   while( t->next != NULL )
   {
         char* esc_name = escape_string(t->name);
-	xml_fprintf (fd, indent+1, "<plugin id=\"%s\" value=\"%s\"/>\n", esc_name, (t->value?"yes":"no"));
+	xml_fprintf (fd, indent+1, "<nvt oid=\"%s\" value=\"%s\"/>\n", esc_name, (t->value?"yes":"no"));
         efree(&esc_name);
 	t = t->next;
   }
@@ -325,7 +325,7 @@
 static void
 xml_config_plugins (FILE* fd, int indent, struct arglist* t)
 {
-  xml_fprintf (fd, indent, "<plugins>\n");
+  xml_fprintf (fd, indent, "<nvts>\n");
   while( t->next )
   {
    if (t->type == ARG_STRING)
@@ -334,7 +334,7 @@
      xml_setting (fd, indent+1, t->name, (t->value?"yes":"no"));
    t = t->next;
   }
-  xml_fprintf (fd, indent, "</plugins>\n");
+  xml_fprintf (fd, indent, "</nvts>\n");
 } /* xml_config_server */
 
 static void
@@ -390,7 +390,7 @@
 {  
     char * s = nessus_plugin_get_description(u);
 
-     xml_fprintf (fd, indent, "<plugin id=\"%d\">\n", u->id);
+     xml_fprintf (fd, indent, "<nvt oid=\"%s\">\n", u->oid);
      xml_fprintf_element (fd, indent+1, "name",  u->name);
      xml_fprintf_element (fd, indent+1, "version", u->version);
      xml_fprintf_element (fd, indent+1, "family",  u->family);
@@ -408,7 +408,7 @@
 { 
  struct nessus_plugin * t;
 
- xml_fprintf (fd, indent, "<plugins>\n");
+ xml_fprintf (fd, indent, "<nvts>\n");
 
   if ( Context->parent != NULL )
 	t = Context->parent->scanners;
@@ -439,10 +439,10 @@
     t = t->next;
    }
   else
-   xml_fprintf (fd, indent+1, "<error txt=\"No plugins list.\"/>\n");
+   xml_fprintf (fd, indent+1, "<error txt=\"No NVT list.\"/>\n");
 
 
-  xml_fprintf (fd, indent, "</plugins>\n");
+  xml_fprintf (fd, indent, "</nvts>\n");
 }
 
 
@@ -715,17 +715,14 @@
  }
 
  xml_fprintf (fd, 0, "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n");
- xml_fprintf (fd, 0, "<!-- nessus.xsl can be found in the nessus-tools directory -->\n");
 
- xml_fprintf (fd, 0, "<?xml-stylesheet type=\"text/xsl\" href=\"nessus.xsl\"?>\n");
- xml_fprintf (fd, 0, "<report version=\"1.4\">\n");
- /* don't need this: fprintf (fd, "\t<scan>\n"); */
+  xml_fprintf (fd, 0, "<?xml-stylesheet type=\"text/xsl\" href=\"openvas-report.xsl\"?>\n");
+  xml_fprintf (fd, 0, "<openvas-report version=\"1.0\">\n");
   xml_info (be, fd, 1); 
   xml_config (fd, 1); 
   xml_plugins (fd, 1);
   xml_results(fd, 1, be);
- /* dont't need this: fprintf (fd, "\t</scan>\n"); */
- xml_fprintf (fd, 0, "</report>\n");
+  xml_fprintf (fd, 0, "</openvas-report>\n");
 
  fclose(fd);
  return 0; 



More information about the Openvas-commits mailing list