[Openvas-commits] r9226 - in trunk/openvas-manager: . doc src src/schema_formats src/schema_formats/HTML src/schema_formats/RNC src/schema_formats/XML
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Mon Oct 18 16:59:57 CEST 2010
Author: mattm
Date: 2010-10-18 16:59:53 +0200 (Mon, 18 Oct 2010)
New Revision: 9226
Added:
trunk/openvas-manager/src/schema_formats/
trunk/openvas-manager/src/schema_formats/HTML/
trunk/openvas-manager/src/schema_formats/HTML/HTML.xsl
trunk/openvas-manager/src/schema_formats/HTML/generate
trunk/openvas-manager/src/schema_formats/HTML/rnc.xsl
trunk/openvas-manager/src/schema_formats/RNC/
trunk/openvas-manager/src/schema_formats/RNC/RNC.xsl
trunk/openvas-manager/src/schema_formats/RNC/generate
trunk/openvas-manager/src/schema_formats/RNC/rnc.xsl
trunk/openvas-manager/src/schema_formats/XML/
trunk/openvas-manager/src/schema_formats/XML/OMP.xml
trunk/openvas-manager/src/schema_formats/XML/generate
Modified:
trunk/openvas-manager/ChangeLog
trunk/openvas-manager/doc/Doxyfile.in
trunk/openvas-manager/src/CMakeLists.txt
trunk/openvas-manager/src/manage.h
trunk/openvas-manager/src/manage_sql.c
trunk/openvas-manager/src/omp.c
Log:
Extend OMP HELP to return a documented partial OMP schema in various
formats.
* src/omp (help_data_t): New type.
(help_data_reset): New function.
(command_data_t): Add help.
(help_data): New variable.
(omp_xml_handle_start_element, omp_xml_handle_end_element): Add format
attribute to OMP HELP.
* src/manage_sql.c (manage_schema): New function. Returns schema in
given format.
* src/manage.h: Add header accordingly.
* src/CMakeLists.txt: Install schema formats.
* src/schema_formats/, src/schema_formats/HTML/,
src/schema_formats/HTML/HTML.xsl, src/schema_formats/HTML/generate,
src/schema_formats/HTML/rnc.xsl, src/schema_formats/RNC/,
src/schema_formats/RNC/RNC.xsl, src/schema_formats/RNC/generate,
src/schema_formats/RNC/rnc.xsl, src/schema_formats/XML/,
src/schema_formats/XML/OMP.xml, src/schema_formats/XML/generate: New dirs
and files. First schema formats.
Modified: trunk/openvas-manager/ChangeLog
===================================================================
--- trunk/openvas-manager/ChangeLog 2010-10-18 13:37:53 UTC (rev 9225)
+++ trunk/openvas-manager/ChangeLog 2010-10-18 14:59:53 UTC (rev 9226)
@@ -1,3 +1,30 @@
+2010-10-18 Matthew Mundell <matthew.mundell at greenbone.net>
+
+ Extend OMP HELP to return a documented partial OMP schema in various
+ formats.
+
+ * src/omp (help_data_t): New type.
+ (help_data_reset): New function.
+ (command_data_t): Add help.
+ (help_data): New variable.
+ (omp_xml_handle_start_element, omp_xml_handle_end_element): Add format
+ attribute to OMP HELP.
+
+ * src/manage_sql.c (manage_schema): New function. Returns schema in
+ given format.
+
+ * src/manage.h: Add header accordingly.
+
+ * src/CMakeLists.txt: Install schema formats.
+
+ * src/schema_formats/, src/schema_formats/HTML/,
+ src/schema_formats/HTML/HTML.xsl, src/schema_formats/HTML/generate,
+ src/schema_formats/HTML/rnc.xsl, src/schema_formats/RNC/,
+ src/schema_formats/RNC/RNC.xsl, src/schema_formats/RNC/generate,
+ src/schema_formats/RNC/rnc.xsl, src/schema_formats/XML/,
+ src/schema_formats/XML/OMP.xml, src/schema_formats/XML/generate: New dirs
+ and files. First schema formats.
+
2010-10-13 Matthew Mundell <matthew.mundell at greenbone.net>
* src/omp (omp_xml_handle_end_element): Terminate MODIFY_CONFIG arrays at
Modified: trunk/openvas-manager/doc/Doxyfile.in
===================================================================
--- trunk/openvas-manager/doc/Doxyfile.in 2010-10-18 13:37:53 UTC (rev 9225)
+++ trunk/openvas-manager/doc/Doxyfile.in 2010-10-18 14:59:53 UTC (rev 9226)
@@ -179,7 +179,9 @@
# will result in a user-defined paragraph with heading "Side Effects:".
# You can put \n's in the value part of an alias to insert newlines.
-ALIASES =
+#ALIASES = "OMP=page OMP \"The OpenVAS Manager Protocol\""
+ALIASES = "OMP=\xrefitem OMP \"The OpenVAS Manager Protocol\" \"The OpenVAS Manager Protocol\"" \
+ "xxx=\page xxx OpenVAS Manager Protocol"
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
# sources only. Doxygen will then generate output that is more tailored for C.
Modified: trunk/openvas-manager/src/CMakeLists.txt
===================================================================
--- trunk/openvas-manager/src/CMakeLists.txt 2010-10-18 13:37:53 UTC (rev 9225)
+++ trunk/openvas-manager/src/CMakeLists.txt 2010-10-18 14:59:53 UTC (rev 9226)
@@ -200,6 +200,23 @@
DESTINATION ${OPENVAS_SYSCONF_DIR}/openvasmd/global_report_formats/d5da9f67-8551-4e51-807b-b6a873d70e34/
PERMISSIONS OWNER_WRITE OWNER_READ GROUP_WRITE GROUP_READ)
+install (FILES schema_formats/HTML/generate
+ schema_formats/RNC/rnc.xsl
+ schema_formats/HTML/HTML.xsl
+ DESTINATION ${OPENVAS_SYSCONF_DIR}/openvasmd/global_schema_formats/02052818-dab6-11df-9be4-002264764cea/
+ PERMISSIONS OWNER_WRITE OWNER_READ GROUP_WRITE GROUP_READ)
+
+install (FILES schema_formats/RNC/generate
+ schema_formats/RNC/rnc.xsl
+ schema_formats/RNC/RNC.xsl
+ DESTINATION ${OPENVAS_SYSCONF_DIR}/openvasmd/global_schema_formats/787a4a18-dabc-11df-9486-002264764cea/
+ PERMISSIONS OWNER_WRITE OWNER_READ GROUP_WRITE GROUP_READ)
+
+install (FILES schema_formats/XML/generate
+ schema_formats/XML/OMP.xml
+ DESTINATION ${OPENVAS_SYSCONF_DIR}/openvasmd/global_schema_formats/18e826fc-dab6-11df-b913-002264764cea/
+ PERMISSIONS OWNER_WRITE OWNER_READ GROUP_WRITE GROUP_READ)
+
## Tests
# enable_testing ()
Modified: trunk/openvas-manager/src/manage.h
===================================================================
--- trunk/openvas-manager/src/manage.h 2010-10-18 13:37:53 UTC (rev 9225)
+++ trunk/openvas-manager/src/manage.h 2010-10-18 14:59:53 UTC (rev 9226)
@@ -1722,6 +1722,12 @@
slave_task_iterator_uuid (iterator_t*);
+/* Schema. */
+
+int
+manage_schema (gchar *, gchar **, gsize *, gchar **, gchar **);
+
+
/* Tags. */
void
Modified: trunk/openvas-manager/src/manage_sql.c
===================================================================
--- trunk/openvas-manager/src/manage_sql.c 2010-10-18 13:37:53 UTC (rev 9225)
+++ trunk/openvas-manager/src/manage_sql.c 2010-10-18 14:59:53 UTC (rev 9226)
@@ -20705,4 +20705,219 @@
*/
DEF_ACCESS (slave_task_iterator_uuid, 1);
+
+/* Schema. */
+
+/**
+ * @brief Generate the OMP schema.
+ *
+ * @param[in] format Name of schema format, "XML" or NULL for XML.
+ * @param[out] output_length NULL or location for length of return.
+ * @param[out] extension NULL or location for report format extension.
+ * @param[out] content_type NULL or location for report format content type.
+ *
+ * @return 0 success, 1 failed to find schema format, -1 error.
+ */
+int
+manage_schema (gchar *format, gchar **output_return, gsize *output_length,
+ gchar **extension, gchar **content_type)
+{
+ /* Pass the XML file to the report format generate script, sending the output
+ * to a file. */
+
+ {
+ gchar *script, *script_dir;
+ gchar *uuid_format;
+ char output_dir[] = "/tmp/openvasmd_schema_XXXXXX";
+
+ if (mkdtemp (output_dir) == NULL)
+ {
+ g_warning ("%s: mkdtemp failed\n", __FUNCTION__);
+ return -1;
+ }
+
+ /* Setup file names. */
+
+ if (format == NULL)
+ {
+ if (extension)
+ *extension = g_strdup ("xml");
+ if (content_type)
+ *content_type = g_strdup ("text/xml");
+ uuid_format = "18e826fc-dab6-11df-b913-002264764cea";
+ }
+ else if (strcasecmp (format, "HTML") == 0)
+ {
+ if (extension)
+ *extension = g_strdup ("html");
+ if (content_type)
+ *content_type = g_strdup ("text/html");
+ uuid_format = "02052818-dab6-11df-9be4-002264764cea";
+ }
+ else if (strcasecmp (format, "RNC") == 0)
+ {
+ if (extension)
+ *extension = g_strdup ("rnc");
+ if (content_type)
+ *content_type = g_strdup ("text/x-rnc");
+ uuid_format = "787a4a18-dabc-11df-9486-002264764cea";
+ }
+ else if (strcasecmp (format, "XML") == 0)
+ {
+ if (extension)
+ *extension = g_strdup ("xml");
+ if (content_type)
+ *content_type = g_strdup ("text/xml");
+ uuid_format = "18e826fc-dab6-11df-b913-002264764cea";
+ }
+ else
+ return 1;
+
+ script_dir = g_build_filename (OPENVAS_SYSCONF_DIR,
+ "openvasmd",
+ "global_schema_formats",
+ uuid_format,
+ NULL);
+
+ script = g_build_filename (script_dir, "generate", NULL);
+
+ if (!g_file_test (script, G_FILE_TEST_EXISTS))
+ {
+ g_free (script);
+ g_free (script_dir);
+ if (extension) g_free (*extension);
+ if (content_type) g_free (*content_type);
+ return -1;
+ }
+
+ {
+ gchar *output_file, *command;
+ char *previous_dir;
+ int ret;
+
+ /* Change into the script directory. */
+
+ /** @todo NULL arg is glibc extension. */
+ previous_dir = getcwd (NULL, 0);
+ if (previous_dir == NULL)
+ {
+ g_warning ("%s: Failed to getcwd: %s\n",
+ __FUNCTION__,
+ strerror (errno));
+ g_free (previous_dir);
+ g_free (script);
+ g_free (script_dir);
+ if (extension) g_free (*extension);
+ if (content_type) g_free (*content_type);
+ return -1;
+ }
+
+ if (chdir (script_dir))
+ {
+ g_warning ("%s: Failed to chdir: %s\n",
+ __FUNCTION__,
+ strerror (errno));
+ g_free (previous_dir);
+ g_free (script);
+ g_free (script_dir);
+ if (extension) g_free (*extension);
+ if (content_type) g_free (*content_type);
+ return -1;
+ }
+ g_free (script_dir);
+
+ output_file = g_strdup_printf ("%s/report.out", output_dir);
+
+ /* Call the script. */
+
+ command = g_strdup_printf ("/bin/sh %s " OPENVAS_SYSCONF_DIR
+ "/openvasmd/global_schema_formats"
+ "/18e826fc-dab6-11df-b913-002264764cea/OMP.xml"
+ " > %s"
+ " 2> /dev/null",
+ script,
+ output_file);
+ g_free (script);
+
+ g_message (" command: %s\n", command);
+
+ /* RATS: ignore, command is defined above. */
+ if (ret = system (command),
+ /** @todo ret is always -1. */
+ 0 && ((ret) == -1
+ || WEXITSTATUS (ret)))
+ {
+ g_warning ("%s: system failed with ret %i, %i, %s\n",
+ __FUNCTION__,
+ ret,
+ WEXITSTATUS (ret),
+ command);
+ if (chdir (previous_dir))
+ g_warning ("%s: and chdir failed\n",
+ __FUNCTION__);
+ g_free (previous_dir);
+ g_free (command);
+ g_free (output_file);
+ if (extension) g_free (*extension);
+ if (content_type) g_free (*content_type);
+ return -1;
+ }
+
+ {
+ GError *get_error;
+ gchar *output;
+ gsize output_len;
+
+ g_free (command);
+
+ /* Change back to the previous directory. */
+
+ if (chdir (previous_dir))
+ {
+ g_warning ("%s: Failed to chdir back: %s\n",
+ __FUNCTION__,
+ strerror (errno));
+ g_free (previous_dir);
+ if (extension) g_free (*extension);
+ if (content_type) g_free (*content_type);
+ return -1;
+ }
+ g_free (previous_dir);
+
+ /* Read the script output from file. */
+
+ get_error = NULL;
+ g_file_get_contents (output_file,
+ &output,
+ &output_len,
+ &get_error);
+ g_free (output_file);
+ if (get_error)
+ {
+ g_warning ("%s: Failed to get output: %s\n",
+ __FUNCTION__,
+ get_error->message);
+ g_error_free (get_error);
+ if (extension) g_free (*extension);
+ if (content_type) g_free (*content_type);
+ return -1;
+ }
+
+ /* Remove the output directory. */
+
+ file_utils_rmdir_rf (output_dir);
+
+ /* Return the output. */
+
+ if (output_length) *output_length = output_len;
+
+ if (output_return) *output_return = output;
+ return 0;
+ }
+ }
+ }
+}
+
+
+
#undef DEF_ACCESS
Modified: trunk/openvas-manager/src/omp.c
===================================================================
--- trunk/openvas-manager/src/omp.c 2010-10-18 13:37:53 UTC (rev 9225)
+++ trunk/openvas-manager/src/omp.c 2010-10-18 14:59:53 UTC (rev 9226)
@@ -1881,11 +1881,32 @@
}
/**
+ * @brief Command data for the help command.
+ */
+typedef struct
+{
+ char *format; ///< Format.
+} help_data_t;
+
+/**
* @brief Reset command data.
*
* @param[in] data Command data.
*/
static void
+help_data_reset (help_data_t *data)
+{
+ free (data->format);
+
+ memset (data, 0, sizeof (help_data_t));
+}
+
+/**
+ * @brief Reset command data.
+ *
+ * @param[in] data Command data.
+ */
+static void
modify_config_data_reset (modify_config_data_t *data)
{
free (data->config_id);
@@ -2339,6 +2360,7 @@
get_system_reports_data_t get_system_reports; ///< get_system_reports
get_targets_data_t get_targets; ///< get_targets
get_tasks_data_t get_tasks; ///< get_tasks
+ help_data_t help; ///< help
modify_config_data_t modify_config; ///< modify_config
modify_lsc_credential_data_t modify_lsc_credential; ///< modify_lsc_credential
modify_report_data_t modify_report; ///< modify_report
@@ -2625,6 +2647,12 @@
= &(command_data.get_tasks);
/**
+ * @brief Parser callback data for HELP.
+ */
+help_data_t *help_data
+ = &(command_data.help);
+
+/**
* @brief Parser callback data for CREATE_CONFIG (import).
*/
import_config_data_t *import_config_data
@@ -4186,7 +4214,11 @@
else if (strcasecmp ("GET_VERSION", element_name) == 0)
set_client_state (CLIENT_GET_VERSION_AUTHENTIC);
else if (strcasecmp ("HELP", element_name) == 0)
- set_client_state (CLIENT_HELP);
+ {
+ append_attribute (attribute_names, attribute_values, "format",
+ &help_data->format);
+ set_client_state (CLIENT_HELP);
+ }
else if (strcasecmp ("MODIFY_CONFIG", element_name) == 0)
{
append_attribute (attribute_names, attribute_values, "config_id",
@@ -9442,11 +9474,105 @@
break;
case CLIENT_HELP:
- SEND_TO_CLIENT_OR_FAIL ("<help_response"
- " status=\"" STATUS_OK "\""
- " status_text=\"" STATUS_OK_TEXT "\">");
- SEND_TO_CLIENT_OR_FAIL (help_text);
- SEND_TO_CLIENT_OR_FAIL ("</help_response>");
+ if (help_data->format == NULL
+ || (strcmp (help_data->format, "text") == 0))
+ {
+ SEND_TO_CLIENT_OR_FAIL ("<help_response"
+ " status=\"" STATUS_OK "\""
+ " status_text=\"" STATUS_OK_TEXT "\">");
+ SEND_TO_CLIENT_OR_FAIL (help_text);
+ SEND_TO_CLIENT_OR_FAIL ("</help_response>");
+ }
+ else
+ {
+ gchar *extension, *content_type, *output;
+ gsize output_len;
+
+ switch (manage_schema (help_data->format,
+ &output,
+ &output_len,
+ &extension,
+ &content_type))
+ {
+ case 0:
+ break;
+ case 1:
+ assert (help_data->format);
+ if (send_find_error_to_client ("help",
+ "schema_format",
+ help_data->format,
+ write_to_client,
+ write_to_client_data))
+ {
+ error_send_to_client (error);
+ return;
+ }
+ help_data_reset (help_data);
+ set_client_state (CLIENT_AUTHENTIC);
+ return;
+ break;
+ default:
+ SEND_TO_CLIENT_OR_FAIL (XML_INTERNAL_ERROR ("help"));
+ help_data_reset (help_data);
+ set_client_state (CLIENT_AUTHENTIC);
+ return;
+ break;
+ }
+
+ SENDF_TO_CLIENT_OR_FAIL ("<help_response"
+ " status=\"" STATUS_OK "\""
+ " status_text=\"" STATUS_OK_TEXT "\">"
+ "<schema"
+ " format=\"%s\""
+ " extension=\"%s\""
+ " content_type=\"%s\">",
+ help_data->format
+ ? help_data->format
+ : "XML",
+ extension,
+ content_type);
+ g_free (extension);
+ g_free (content_type);
+
+ if (output && strlen (output))
+ {
+ /* Encode and send the output. */
+
+ if (help_data->format
+ && strcasecmp (help_data->format, "XML"))
+ {
+ gchar *base64;
+
+ base64 = g_base64_encode ((guchar*) output, output_len);
+ if (send_to_client (base64,
+ write_to_client,
+ write_to_client_data))
+ {
+ g_free (output);
+ g_free (base64);
+ error_send_to_client (error);
+ return;
+ }
+ g_free (base64);
+ }
+ else
+ {
+ /* Special case the XML schema, bah. */
+ if (send_to_client (output,
+ write_to_client,
+ write_to_client_data))
+ {
+ g_free (output);
+ error_send_to_client (error);
+ return;
+ }
+ }
+ }
+ g_free (output);
+ SEND_TO_CLIENT_OR_FAIL ("</schema>"
+ "</help_response>");
+ }
+ help_data_reset (help_data);
set_client_state (CLIENT_AUTHENTIC);
break;
Added: trunk/openvas-manager/src/schema_formats/HTML/HTML.xsl
===================================================================
--- trunk/openvas-manager/src/schema_formats/HTML/HTML.xsl 2010-10-18 13:37:53 UTC (rev 9225)
+++ trunk/openvas-manager/src/schema_formats/HTML/HTML.xsl 2010-10-18 14:59:53 UTC (rev 9226)
@@ -0,0 +1,370 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet
+ version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:str="http://exslt.org/strings"
+ extension-element-prefixes="str">
+ <xsl:output method="html"
+ doctype-system="http://www.w3.org/TR/html4/strict.dtd"
+ doctype-public="-//W3C//DTD HTML 4.01//EN"
+ encoding="UTF-8" />
+ <xsl:strip-space elements="pretty"/>
+
+<!--
+OpenVAS Manager
+$Id$
+Description: OpenVAS Manager Protocol (OMP) single page HTML doc generator.
+
+Authors:
+Matthew Mundell <matthew.mundell at greenbone.de>
+
+Copyright:
+Copyright (C) 2010 Greenbone Networks GmbH
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License version 2,
+or, at your option, any later version as published by the Free
+Software Foundation
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+-->
+
+ <xsl:variable name="rnc-comments">0</xsl:variable>
+ <xsl:include href="rnc.xsl"/>
+
+ <!-- Helpers. -->
+
+ <xsl:template name="newline">
+ <xsl:text>
+</xsl:text>
+ </xsl:template>
+
+ <xsl:template match="description">
+ <xsl:choose>
+ <xsl:when test="(count(p) = 0) and (string-length(normalize-space(text())) > 0)">
+ <p><xsl:value-of select="text()"/></p>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:for-each select="p">
+ <p><xsl:value-of select="text()"/></p>
+ </xsl:for-each>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- Called within a PRE. -->
+ <xsl:template name="print-space">
+ <xsl:param name="count">1</xsl:param>
+ <xsl:text> </xsl:text>
+ <xsl:if test="$count > 0">
+ <xsl:call-template name="print-space">
+ <xsl:with-param name="count" select="$count - 1"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- Called within a PRE. -->
+ <xsl:template name="print-attributes">
+ <xsl:for-each select="attribute::*">
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="name()"/>
+ <xsl:text>="</xsl:text>
+ <xsl:value-of select="."/>
+ <xsl:text>"</xsl:text>
+ </xsl:for-each>
+ </xsl:template>
+
+ <!-- Called within a PRE. -->
+ <xsl:template name="pretty">
+ <xsl:param name="level">0</xsl:param>
+ <xsl:call-template name="print-space">
+ <xsl:with-param name="count" select="$level * 2"/>
+ </xsl:call-template>
+ <xsl:choose>
+ <xsl:when test="name()='truncated'">
+ <xsl:text>...</xsl:text>
+ <xsl:call-template name="newline"/>
+ </xsl:when>
+ <xsl:when test="(count(*) = 0) and (string-length(normalize-space(text())) = 0)">
+ <xsl:text><</xsl:text>
+ <xsl:value-of select="name()"/>
+ <xsl:call-template name="print-attributes"/>
+ <xsl:text>/></xsl:text>
+ <xsl:call-template name="newline"/>
+ </xsl:when>
+ <xsl:when test="(count(*) = 0) and (string-length(text()) <= 60)">
+ <xsl:text><</xsl:text>
+ <xsl:value-of select="name()"/>
+ <xsl:call-template name="print-attributes"/>
+ <xsl:text>></xsl:text>
+ <xsl:value-of select="text()"/>
+ <xsl:text></</xsl:text>
+ <xsl:value-of select="name()"/>
+ <xsl:text>></xsl:text>
+ <xsl:call-template name="newline"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text><</xsl:text>
+ <xsl:value-of select="name()"/>
+ <xsl:call-template name="print-attributes"/>
+ <xsl:text>></xsl:text>
+ <xsl:call-template name="newline"/>
+ <xsl:if test="string-length(normalize-space(text())) > 0">
+ <xsl:call-template name="print-space">
+ <xsl:with-param name="count" select="$level * 2"/>
+ </xsl:call-template>
+ <xsl:value-of select="text()"/>
+ <xsl:call-template name="newline"/>
+ </xsl:if>
+ <xsl:for-each select="*">
+ <xsl:call-template name="pretty">
+ <xsl:with-param name="level" select="$level + 1"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ <xsl:call-template name="print-space">
+ <xsl:with-param name="count" select="$level * 2"/>
+ </xsl:call-template>
+ <xsl:text></</xsl:text>
+ <xsl:value-of select="name()"/>
+ <xsl:text>></xsl:text>
+ <xsl:call-template name="newline"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- Commands. -->
+
+ <xsl:template name="command-relax">
+ <pre><xsl:call-template name="command-body"/></pre>
+ </xsl:template>
+
+ <xsl:template name="response-relax">
+ <pre><xsl:call-template name="response-body"/></pre>
+ </xsl:template>
+
+ <xsl:template name="breakdown-line">
+ <xsl:param name="line-element"/>
+ <xsl:param name="element-suffix"/>
+ <xsl:choose>
+ <xsl:when test="name() = 'any'">
+ <xsl:for-each select="*">
+ <xsl:call-template name="breakdown-line">
+ <xsl:with-param name="line-element" select="$line-element"/>
+ <xsl:with-param name="element-suffix" select="'*'"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:when test="name() = 'attrib'">
+ <li>
+ <b>"<xsl:value-of select="name"/>"</b>
+ (<xsl:value-of select="type"/>)
+ <xsl:if test="summary">
+ <xsl:value-of select="summary"/>.
+ </xsl:if>
+ </li>
+ </xsl:when>
+ <xsl:when test="name() = 'e'">
+ <li>
+ <xsl:variable name="element-name" select="text()"/>
+ <xsl:variable name="new-line-element"
+ select="$line-element/ele[name=$element-name]"/>
+ <b>
+ <<xsl:value-of select="text()"/>><xsl:value-of select="$element-suffix"/>
+ </b>
+ <xsl:if test="$new-line-element/summary">
+ <div style="margin-left: 15px; display: inline;"><xsl:value-of select="$new-line-element/summary"/>.</div>
+ </xsl:if>
+ <ul style="list-style: none">
+ <xsl:for-each select="$new-line-element/pattern/*">
+ <xsl:call-template name="breakdown-line">
+ <xsl:with-param name="line-element" select="$new-line-element"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </ul>
+ </li>
+ </xsl:when>
+ <xsl:when test="name() = 'o'">
+ <xsl:for-each select="*">
+ <xsl:call-template name="breakdown-line">
+ <xsl:with-param name="line-element" select="$line-element"/>
+ <xsl:with-param name="element-suffix" select="'?'"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:when test="name() = 'or'">
+ <li>
+ <i>One of</i>
+ <ul style="list-style: none">
+ <xsl:for-each select="*">
+ <xsl:call-template name="breakdown-line">
+ <xsl:with-param name="line-element" select="$line-element"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </ul>
+ </li>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template name="command-breakdown">
+ <ul style="list-style: none">
+ <xsl:choose>
+ <xsl:when test="(count(pattern/*) = 0) and (string-length(normalize-space(pattern)) = 0)">
+ <i>Empty single element.</i>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="command" select="."/>
+ <xsl:for-each select="pattern/*">
+ <xsl:call-template name="breakdown-line">
+ <xsl:with-param name="line-element" select="$command"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:otherwise>
+ </xsl:choose>
+ </ul>
+ </xsl:template>
+
+ <xsl:template match="command">
+ <xsl:param name="index">2.<xsl:value-of select="position()"/></xsl:param>
+ <div>
+ <div>
+ <h3 id="{name}">
+ <xsl:value-of select="$index"/>
+ Command <tt><xsl:value-of select="name"/></tt></h3>
+ </div>
+
+ <p><b>In short: </b><xsl:value-of select="summary"/>.</p>
+
+ <xsl:apply-templates select="description"/>
+
+ <h4><xsl:value-of select="$index"/>.1 Breakdown</h4>
+
+ <ul style="list-style: none">
+ <li>
+ <div style="font-weight:bold;">Command</div>
+ <xsl:call-template name="command-breakdown"/>
+ </li>
+ <li>
+ <div style="font-weight:bold;">Response</div>
+ <xsl:for-each select="response">
+ <xsl:call-template name="command-breakdown"/>
+ </xsl:for-each>
+ </li>
+ </ul>
+
+ <h4><xsl:value-of select="$index"/>.2 RNC</h4>
+
+ <div style="border: 1px solid; padding:10px; width: 75%; align: center; margin-left: auto; margin-right: auto; background: #d5d5d5;">
+ <div style="font-weight:bold;">Command</div>
+ <xsl:call-template name="command-relax"/>
+ <div style="font-weight:bold;">Response</div>
+ <xsl:call-template name="response-relax"/>
+ </div>
+
+ <xsl:choose>
+ <xsl:when test="count(example) > 0">
+ <xsl:for-each select="example">
+ <h4><xsl:value-of select="$index"/>.1 Example: <xsl:value-of select="summary"/></h4>
+ <xsl:apply-templates select="description"/>
+ <b>Client:</b><br/>
+ <xsl:for-each select="request/*">
+ <pre>
+ <xsl:call-template name="pretty"/>
+ </pre>
+ </xsl:for-each>
+ <br/>
+ <b>Manager:</b><br/>
+ <xsl:for-each select="response/*">
+ <pre>
+ <xsl:call-template name="pretty"/>
+ </pre>
+ </xsl:for-each>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ </div>
+ </xsl:template>
+
+ <xsl:template match="command" mode="index">
+ <tr id="index">
+ <td id="index"><a href="#{name}"><xsl:value-of select="name"/></a></td>
+ <td id="index"><div style="margin-left: 15px;"><xsl:value-of select="summary"/>.</div></td>
+ </tr>
+ </xsl:template>
+
+ <xsl:template name="command-summary">
+ <h2 id="command_summary">1 Summary of Commands</h2>
+ <table id="index">
+ <xsl:apply-templates select="command" mode="index"/>
+ </table>
+ </xsl:template>
+
+ <xsl:template name="command-details">
+ <h2 id="command_summary">2 Command Details</h2>
+ <xsl:apply-templates select="command"/>
+ </xsl:template>
+
+ <!-- Root. -->
+
+ <xsl:template match="protocol">
+ <html>
+ <head>
+ <title>
+ <xsl:choose>
+ <xsl:when test="abbreviation">
+ <xsl:value-of select="abbreviation"/>
+ </xsl:when>
+ <xsl:when test="name">
+ <xsl:value-of select="name"/>
+ </xsl:when>
+ <xsl:otherwise>
+ Protocol definition
+ </xsl:otherwise>
+ </xsl:choose>
+ </title>
+ </head>
+ <body style="background-color: #FFFFFF; margin: 0px; font: small Verdana, sans-serif; font-size: 12px; color: #1A1A1A;">
+ <div style="width: 98%; width:700px; align: center; margin-left: auto; margin-right: auto;">
+ <table style="width: 100%;" cellpadding="3" cellspacing="0">
+ <tr>
+ <td valign="top">
+ <h1>
+ <xsl:if test="abbreviation">
+ <xsl:value-of select="abbreviation"/>:
+ </xsl:if>
+ <xsl:value-of select="name"/>
+ </h1>
+
+ <xsl:if test="summary">
+ <p><xsl:value-of select="summary"/>.</p>
+ </xsl:if>
+
+ <xsl:call-template name="command-summary"/>
+ <xsl:call-template name="command-details"/>
+
+ <div style="text-align: center; padding: 5px;">
+ This file was automatically generated.
+ </div>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </body>
+ </html>
+ </xsl:template>
+
+ <xsl:template match="/">
+ <xsl:apply-templates select="protocol"/>
+ </xsl:template>
+
+</xsl:stylesheet>
Added: trunk/openvas-manager/src/schema_formats/HTML/generate
===================================================================
--- trunk/openvas-manager/src/schema_formats/HTML/generate 2010-10-18 13:37:53 UTC (rev 9225)
+++ trunk/openvas-manager/src/schema_formats/HTML/generate 2010-10-18 14:59:53 UTC (rev 9226)
@@ -0,0 +1,30 @@
+#!/bin/sh
+#
+# OpenVAS
+# $Id$
+# Description: Schema generator script: HTML.
+#
+# This schema generator creates a single HTML file from the XML schema using
+# an XSL transformation via the tool xsltproc.
+#
+# Authors:
+# Matthew Mundell <matthew.mundell at greenbone.net>
+#
+# Copyright:
+# Copyright (C) 2010 Greenbone Networks GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2,
+# or, at your option, any later version as published by the Free
+# Software Foundation
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+xsltproc ./HTML.xsl $1
Added: trunk/openvas-manager/src/schema_formats/HTML/rnc.xsl
===================================================================
--- trunk/openvas-manager/src/schema_formats/HTML/rnc.xsl 2010-10-18 13:37:53 UTC (rev 9225)
+++ trunk/openvas-manager/src/schema_formats/HTML/rnc.xsl 2010-10-18 14:59:53 UTC (rev 9226)
@@ -0,0 +1,218 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet
+ version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:str="http://exslt.org/strings"
+ extension-element-prefixes="str">
+ <xsl:strip-space elements="*"/>
+
+<!--
+OpenVAS Manager
+$Id$
+Description: OpenVAS Manager Protocol (OMP) RNC support templates.
+
+Authors:
+Matthew Mundell <matthew.mundell at intevation.de>
+
+Copyright:
+Copyright (C) 2010 Greenbone Networks GmbH
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License version 2,
+or, at your option, any later version as published by the Free
+Software Foundation
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+-->
+
+ <!-- Commands. -->
+
+ <xsl:template name="attrib" match="attrib">
+ <xsl:if test="($rnc-comments = 1) and summary">
+ <xsl:text># </xsl:text>
+ <xsl:value-of select="summary"/>
+ <xsl:text>.</xsl:text>
+ <xsl:call-template name="newline"/>
+ <xsl:text> </xsl:text>
+ </xsl:if>
+ <xsl:text>attribute </xsl:text>
+ <xsl:value-of select="name"/>
+ <xsl:text> { </xsl:text>
+ <xsl:value-of select="type"/>
+ <xsl:text> }</xsl:text>
+ <xsl:choose>
+ <xsl:when test="required=1"></xsl:when>
+ <xsl:otherwise><xsl:text>?</xsl:text></xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template name="c" match="c">
+ <xsl:value-of select="text()"/>
+ </xsl:template>
+
+ <xsl:template name="e" match="e">
+ <xsl:param name="parent-name"/>
+ <xsl:value-of select="$parent-name"/>
+ <xsl:value-of select="text()"/>
+ </xsl:template>
+
+ <xsl:template name="t" match="t">
+ <xsl:value-of select="text()"/>
+ </xsl:template>
+
+ <xsl:template name="pattern-part">
+ <xsl:param name="parent-name"/>
+ <xsl:choose>
+ <xsl:when test="name()='any'">
+ <xsl:for-each select="*">
+ <xsl:call-template name="pattern-part">
+ <xsl:with-param name="parent-name" select="$parent-name"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ <xsl:text>*</xsl:text>
+ </xsl:when>
+ <xsl:when test="name()='attrib'">
+ <xsl:call-template name="attrib"/>
+ </xsl:when>
+ <xsl:when test="name()='c'">
+ <xsl:call-template name="c"/>
+ </xsl:when>
+ <xsl:when test="name()='e'">
+ <xsl:call-template name="e">
+ <xsl:with-param name="parent-name" select="$parent-name"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="name()='o'">
+ <xsl:for-each select="*">
+ <xsl:call-template name="pattern-part">
+ <xsl:with-param name="parent-name" select="$parent-name"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ <xsl:text>?</xsl:text>
+ </xsl:when>
+ <xsl:when test="name()='or'">
+ <xsl:text>( </xsl:text>
+ <xsl:for-each select="*">
+ <xsl:choose>
+ <xsl:when test="preceding-sibling::*">
+ <xsl:text> | </xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:call-template name="pattern-part">
+ <xsl:with-param name="parent-name" select="$parent-name"/>
+ </xsl:call-template>
+ <xsl:if test="following-sibling::*">
+ <xsl:call-template name="newline"/>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:text> )</xsl:text>
+ </xsl:when>
+ <xsl:when test="name()='t'">
+ <xsl:call-template name="t"/>
+ </xsl:when>
+ <xsl:otherwise>
+ ERROR
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template name="pattern" match="pattern">
+ <xsl:param name="parent-name"/>
+ <xsl:for-each select="*">
+ <xsl:choose>
+ <xsl:when test="preceding-sibling::*">
+ <xsl:text> & </xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text> </xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:call-template name="pattern-part">
+ <xsl:with-param name="parent-name" select="$parent-name"/>
+ </xsl:call-template>
+ <xsl:call-template name="newline"/>
+ </xsl:for-each>
+ </xsl:template>
+
+ <xsl:template name="ele">
+ <xsl:param name="parent-name"/>
+ <xsl:if test="($rnc-comments = 1) and summary">
+ <xsl:text># </xsl:text>
+ <xsl:value-of select="summary"/>
+ <xsl:text>.</xsl:text>
+ <xsl:call-template name="newline"/>
+ </xsl:if>
+ <xsl:call-template name="command-body">
+ <xsl:with-param name="parent-name" select="$parent-name"/>
+ </xsl:call-template>
+ </xsl:template>
+
+ <xsl:template name="command-body">
+ <xsl:param name="parent-name"/>
+ <xsl:variable name="command-name" select="concat ($parent-name, name)"/>
+ <xsl:value-of select="$command-name"/>
+ <xsl:call-template name="newline"/>
+ <xsl:text> = element </xsl:text>
+ <xsl:value-of select="name"/>
+ <xsl:call-template name="newline"/>
+ <xsl:text> {</xsl:text>
+ <xsl:call-template name="newline"/>
+ <xsl:for-each select="pattern">
+ <xsl:call-template name="pattern">
+ <xsl:with-param name="parent-name" select="concat ($command-name, '_')"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ <xsl:if test="count (pattern/*) = 0">
+ <xsl:text> ""</xsl:text>
+ <xsl:call-template name="newline"/>
+ </xsl:if>
+ <xsl:text> }</xsl:text>
+ <xsl:call-template name="newline"/>
+ <xsl:for-each select="ele">
+ <xsl:call-template name="newline"/>
+ <xsl:call-template name="ele">
+ <xsl:with-param name="parent-name" select="concat ($command-name, '_')"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:template>
+
+ <!-- Responses. -->
+
+ <xsl:template name="response-body">
+ <xsl:variable name="command-name" select="concat (name, '_response')"/>
+ <xsl:value-of select="$command-name"/>
+ <xsl:call-template name="newline"/>
+ <xsl:text> = element </xsl:text>
+ <xsl:value-of select="$command-name"/>
+ <xsl:call-template name="newline"/>
+ <xsl:text> {</xsl:text>
+ <xsl:call-template name="newline"/>
+ <xsl:for-each select="response/pattern">
+ <xsl:call-template name="pattern">
+ <xsl:with-param name="parent-name" select="concat ($command-name, '_')"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ <xsl:if test="count (response/pattern/*) = 0">
+ <xsl:text> ""</xsl:text>
+ <xsl:call-template name="newline"/>
+ </xsl:if>
+ <xsl:text> }</xsl:text>
+ <xsl:call-template name="newline"/>
+ <xsl:for-each select="response/ele">
+ <xsl:call-template name="newline"/>
+ <xsl:call-template name="ele">
+ <xsl:with-param name="parent-name" select="concat ($command-name, '_')"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:template>
+
+</xsl:stylesheet>
Added: trunk/openvas-manager/src/schema_formats/RNC/RNC.xsl
===================================================================
--- trunk/openvas-manager/src/schema_formats/RNC/RNC.xsl 2010-10-18 13:37:53 UTC (rev 9225)
+++ trunk/openvas-manager/src/schema_formats/RNC/RNC.xsl 2010-10-18 14:59:53 UTC (rev 9226)
@@ -0,0 +1,183 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet
+ version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:str="http://exslt.org/strings"
+ extension-element-prefixes="str">
+ <xsl:output method="text" encoding="string" indent="no"/>
+ <xsl:strip-space elements="*"/>
+
+<!--
+OpenVAS Manager
+$Id$
+Description: OpenVAS Manager Protocol (OMP) RNC generator.
+
+Authors:
+Matthew Mundell <matthew.mundell at greenbone.de>
+
+Copyright:
+Copyright (C) 2010 Greenbone Networks GmbH
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License version 2,
+or, at your option, any later version as published by the Free
+Software Foundation
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+-->
+
+ <xsl:variable name="rnc-comments">1</xsl:variable>
+ <xsl:include href="rnc.xsl"/>
+
+ <!-- Helpers. -->
+
+ <xsl:template name="newline">
+ <xsl:text>
+</xsl:text>
+ </xsl:template>
+
+ <!-- Preamble. -->
+
+ <xsl:template name="preamble">
+ <xsl:text>### Preamble
+
+start = command | response
+
+command
+ = </xsl:text>
+ <xsl:for-each select="command">
+ <xsl:value-of select="name"/>
+ <xsl:if test="following-sibling::command">
+ <xsl:call-template name="newline"/>
+ <xsl:text> | </xsl:text>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:text>
+
+response
+ = </xsl:text>
+ <xsl:for-each select="command">
+ <xsl:value-of select="name"/>
+ <xsl:text>_response</xsl:text>
+ <xsl:if test="following-sibling::command">
+ <xsl:call-template name="newline"/>
+ <xsl:text> | </xsl:text>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:call-template name="newline"/>
+ </xsl:template>
+
+ <!-- Data types. -->
+
+ <xsl:template name="types">
+ <xsl:text>### Data Types</xsl:text>
+ <xsl:call-template name="newline"/>
+ <xsl:call-template name="newline"/>
+ <xsl:for-each select="type">
+ <xsl:if test="($rnc-comments = 1) and summary">
+ <xsl:text># </xsl:text>
+ <xsl:value-of select="summary"/>
+ <xsl:text>.</xsl:text>
+ </xsl:if>
+ <xsl:call-template name="newline"/>
+ <xsl:value-of select="name"/>
+ <xsl:text> = </xsl:text>
+ <xsl:value-of select="pattern"/>
+ <xsl:call-template name="newline"/>
+ </xsl:for-each>
+ </xsl:template>
+
+ <!-- Commands. -->
+
+ <xsl:template name="commands">
+ <xsl:text>### Commands</xsl:text>
+ <xsl:call-template name="newline"/>
+ <xsl:for-each select="command">
+ <xsl:call-template name="newline"/>
+ <xsl:text>## Command </xsl:text>
+ <xsl:value-of select="name"/>
+ <xsl:call-template name="newline"/>
+ <xsl:if test="($rnc-comments = 1) and summary">
+ <xsl:text>##</xsl:text>
+ <xsl:call-template name="newline"/>
+ <xsl:text>## </xsl:text>
+ <xsl:value-of select="summary"/>
+ <xsl:text>.</xsl:text>
+ <xsl:call-template name="newline"/>
+ </xsl:if>
+ <xsl:call-template name="newline"/>
+ <xsl:call-template name="command-body"/>
+ </xsl:for-each>
+ </xsl:template>
+
+ <!-- Responses. -->
+
+ <xsl:template name="responses">
+ <xsl:text>### Responses</xsl:text>
+ <xsl:call-template name="newline"/>
+ <xsl:for-each select="command">
+ <xsl:call-template name="newline"/>
+ <xsl:text>## Response to </xsl:text>
+ <xsl:value-of select="name"/>
+ <xsl:call-template name="newline"/>
+ <xsl:if test="($rnc-comments = 1) and response/summary">
+ <xsl:text>#</xsl:text>
+ <xsl:call-template name="newline"/>
+ <xsl:text># </xsl:text>
+ <xsl:value-of select="summary"/>
+ <xsl:text>.</xsl:text>
+ <xsl:call-template name="newline"/>
+ </xsl:if>
+ <xsl:call-template name="newline"/>
+ <xsl:call-template name="response-body"/>
+ </xsl:for-each>
+ </xsl:template>
+
+ <!-- Root. -->
+
+ <xsl:template match="protocol">
+ <xsl:if test="name">
+ <xsl:text>#### </xsl:text>
+ <xsl:value-of select="name"/>
+ <xsl:if test="abbreviation">
+ <xsl:text> (</xsl:text>
+ <xsl:value-of select="abbreviation"/>
+ <xsl:text>)</xsl:text>
+ </xsl:if>
+ <xsl:call-template name="newline"/>
+ </xsl:if>
+ <xsl:choose>
+ <xsl:when test="($rnc-comments = 1) and summary">
+ <xsl:text>####</xsl:text>
+ <xsl:call-template name="newline"/>
+ <xsl:text>#### </xsl:text>
+ <xsl:value-of select="summary"/>
+ <xsl:text>.</xsl:text>
+ <xsl:call-template name="newline"/>
+ <xsl:call-template name="newline"/>
+ </xsl:when>
+ <xsl:when test="name">
+ <xsl:call-template name="newline"/>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:call-template name="preamble"/>
+ <xsl:call-template name="newline"/>
+ <xsl:call-template name="types"/>
+ <xsl:call-template name="newline"/>
+ <xsl:call-template name="commands"/>
+ <xsl:call-template name="newline"/>
+ <xsl:call-template name="responses"/>
+ </xsl:template>
+
+ <xsl:template match="/">
+ <xsl:apply-templates select="protocol"/>
+ </xsl:template>
+
+</xsl:stylesheet>
Added: trunk/openvas-manager/src/schema_formats/RNC/generate
===================================================================
--- trunk/openvas-manager/src/schema_formats/RNC/generate 2010-10-18 13:37:53 UTC (rev 9225)
+++ trunk/openvas-manager/src/schema_formats/RNC/generate 2010-10-18 14:59:53 UTC (rev 9226)
@@ -0,0 +1,30 @@
+#!/bin/sh
+#
+# OpenVAS
+# $Id$
+# Description: Schema generator script: HTML.
+#
+# This schema generator creates a single HTML file from the XML schema using
+# an XSL transformation via the tool xsltproc.
+#
+# Authors:
+# Matthew Mundell <matthew.mundell at greenbone.net>
+#
+# Copyright:
+# Copyright (C) 2010 Greenbone Networks GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2,
+# or, at your option, any later version as published by the Free
+# Software Foundation
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+xsltproc ./RNC.xsl $1
Added: trunk/openvas-manager/src/schema_formats/RNC/rnc.xsl
===================================================================
--- trunk/openvas-manager/src/schema_formats/RNC/rnc.xsl 2010-10-18 13:37:53 UTC (rev 9225)
+++ trunk/openvas-manager/src/schema_formats/RNC/rnc.xsl 2010-10-18 14:59:53 UTC (rev 9226)
@@ -0,0 +1,218 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet
+ version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:str="http://exslt.org/strings"
+ extension-element-prefixes="str">
+ <xsl:strip-space elements="*"/>
+
+<!--
+OpenVAS Manager
+$Id$
+Description: OpenVAS Manager Protocol (OMP) RNC support templates.
+
+Authors:
+Matthew Mundell <matthew.mundell at intevation.de>
+
+Copyright:
+Copyright (C) 2010 Greenbone Networks GmbH
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License version 2,
+or, at your option, any later version as published by the Free
+Software Foundation
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+-->
+
+ <!-- Commands. -->
+
+ <xsl:template name="attrib" match="attrib">
+ <xsl:if test="($rnc-comments = 1) and summary">
+ <xsl:text># </xsl:text>
+ <xsl:value-of select="summary"/>
+ <xsl:text>.</xsl:text>
+ <xsl:call-template name="newline"/>
+ <xsl:text> </xsl:text>
+ </xsl:if>
+ <xsl:text>attribute </xsl:text>
+ <xsl:value-of select="name"/>
+ <xsl:text> { </xsl:text>
+ <xsl:value-of select="type"/>
+ <xsl:text> }</xsl:text>
+ <xsl:choose>
+ <xsl:when test="required=1"></xsl:when>
+ <xsl:otherwise><xsl:text>?</xsl:text></xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template name="c" match="c">
+ <xsl:value-of select="text()"/>
+ </xsl:template>
+
+ <xsl:template name="e" match="e">
+ <xsl:param name="parent-name"/>
+ <xsl:value-of select="$parent-name"/>
+ <xsl:value-of select="text()"/>
+ </xsl:template>
+
+ <xsl:template name="t" match="t">
+ <xsl:value-of select="text()"/>
+ </xsl:template>
+
+ <xsl:template name="pattern-part">
+ <xsl:param name="parent-name"/>
+ <xsl:choose>
+ <xsl:when test="name()='any'">
+ <xsl:for-each select="*">
+ <xsl:call-template name="pattern-part">
+ <xsl:with-param name="parent-name" select="$parent-name"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ <xsl:text>*</xsl:text>
+ </xsl:when>
+ <xsl:when test="name()='attrib'">
+ <xsl:call-template name="attrib"/>
+ </xsl:when>
+ <xsl:when test="name()='c'">
+ <xsl:call-template name="c"/>
+ </xsl:when>
+ <xsl:when test="name()='e'">
+ <xsl:call-template name="e">
+ <xsl:with-param name="parent-name" select="$parent-name"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="name()='o'">
+ <xsl:for-each select="*">
+ <xsl:call-template name="pattern-part">
+ <xsl:with-param name="parent-name" select="$parent-name"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ <xsl:text>?</xsl:text>
+ </xsl:when>
+ <xsl:when test="name()='or'">
+ <xsl:text>( </xsl:text>
+ <xsl:for-each select="*">
+ <xsl:choose>
+ <xsl:when test="preceding-sibling::*">
+ <xsl:text> | </xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:call-template name="pattern-part">
+ <xsl:with-param name="parent-name" select="$parent-name"/>
+ </xsl:call-template>
+ <xsl:if test="following-sibling::*">
+ <xsl:call-template name="newline"/>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:text> )</xsl:text>
+ </xsl:when>
+ <xsl:when test="name()='t'">
+ <xsl:call-template name="t"/>
+ </xsl:when>
+ <xsl:otherwise>
+ ERROR
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template name="pattern" match="pattern">
+ <xsl:param name="parent-name"/>
+ <xsl:for-each select="*">
+ <xsl:choose>
+ <xsl:when test="preceding-sibling::*">
+ <xsl:text> & </xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text> </xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:call-template name="pattern-part">
+ <xsl:with-param name="parent-name" select="$parent-name"/>
+ </xsl:call-template>
+ <xsl:call-template name="newline"/>
+ </xsl:for-each>
+ </xsl:template>
+
+ <xsl:template name="ele">
+ <xsl:param name="parent-name"/>
+ <xsl:if test="($rnc-comments = 1) and summary">
+ <xsl:text># </xsl:text>
+ <xsl:value-of select="summary"/>
+ <xsl:text>.</xsl:text>
+ <xsl:call-template name="newline"/>
+ </xsl:if>
+ <xsl:call-template name="command-body">
+ <xsl:with-param name="parent-name" select="$parent-name"/>
+ </xsl:call-template>
+ </xsl:template>
+
+ <xsl:template name="command-body">
+ <xsl:param name="parent-name"/>
+ <xsl:variable name="command-name" select="concat ($parent-name, name)"/>
+ <xsl:value-of select="$command-name"/>
+ <xsl:call-template name="newline"/>
+ <xsl:text> = element </xsl:text>
+ <xsl:value-of select="name"/>
+ <xsl:call-template name="newline"/>
+ <xsl:text> {</xsl:text>
+ <xsl:call-template name="newline"/>
+ <xsl:for-each select="pattern">
+ <xsl:call-template name="pattern">
+ <xsl:with-param name="parent-name" select="concat ($command-name, '_')"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ <xsl:if test="count (pattern/*) = 0">
+ <xsl:text> ""</xsl:text>
+ <xsl:call-template name="newline"/>
+ </xsl:if>
+ <xsl:text> }</xsl:text>
+ <xsl:call-template name="newline"/>
+ <xsl:for-each select="ele">
+ <xsl:call-template name="newline"/>
+ <xsl:call-template name="ele">
+ <xsl:with-param name="parent-name" select="concat ($command-name, '_')"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:template>
+
+ <!-- Responses. -->
+
+ <xsl:template name="response-body">
+ <xsl:variable name="command-name" select="concat (name, '_response')"/>
+ <xsl:value-of select="$command-name"/>
+ <xsl:call-template name="newline"/>
+ <xsl:text> = element </xsl:text>
+ <xsl:value-of select="$command-name"/>
+ <xsl:call-template name="newline"/>
+ <xsl:text> {</xsl:text>
+ <xsl:call-template name="newline"/>
+ <xsl:for-each select="response/pattern">
+ <xsl:call-template name="pattern">
+ <xsl:with-param name="parent-name" select="concat ($command-name, '_')"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ <xsl:if test="count (response/pattern/*) = 0">
+ <xsl:text> ""</xsl:text>
+ <xsl:call-template name="newline"/>
+ </xsl:if>
+ <xsl:text> }</xsl:text>
+ <xsl:call-template name="newline"/>
+ <xsl:for-each select="response/ele">
+ <xsl:call-template name="newline"/>
+ <xsl:call-template name="ele">
+ <xsl:with-param name="parent-name" select="concat ($command-name, '_')"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:template>
+
+</xsl:stylesheet>
Added: trunk/openvas-manager/src/schema_formats/XML/OMP.xml
===================================================================
--- trunk/openvas-manager/src/schema_formats/XML/OMP.xml 2010-10-18 13:37:53 UTC (rev 9225)
+++ trunk/openvas-manager/src/schema_formats/XML/OMP.xml 2010-10-18 14:59:53 UTC (rev 9226)
@@ -0,0 +1,475 @@
+<!--
+OpenVAS Manager
+$Id$
+Description: OMP schema with embedded documentation, in OMP.
+
+Authors:
+Matthew Mundell <matthew.mundell at greenbone.de>
+
+Copyright:
+Copyright (C) 2010 Greenbone Networks GmbH
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License version 2,
+or, at your option, any later version as published by the Free
+Software Foundation
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+-->
+
+<protocol>
+ <name>OpenVAS Management Protocol</name>
+ <abbreviation>OMP</abbreviation>
+ <summary>The "management" protocol of the Open Vulnerability Assessment System</summary>
+ <version>1.0</version>
+ <type>
+ <name>base64</name>
+ <summary>Base64 encoded data</summary>
+ <pattern>xsd:base64Binary</pattern>
+ </type>
+ <type>
+ <name>boolean</name>
+ <pattern>text</pattern>
+ </type>
+ <type>
+ <name>boolean_atoi</name>
+ <pattern>text</pattern>
+ </type>
+ <type>
+ <name>name</name>
+ <pattern>xsd:string</pattern>
+ </type>
+ <type>
+ <name>oid</name>
+ <pattern>xsd:token { pattern = "[0-9\.]{1,80}" }</pattern>
+ </type>
+ <type>
+ <name>sort_order</name>
+ <pattern>text</pattern>
+ </type>
+ <type>
+ <name>status</name>
+ <pattern>xsd:token { pattern = "200|201|202|400|401|403|404|409|500|503" }</pattern>
+ </type>
+ <type>
+ <name>uuid</name>
+ <pattern>xsd:token { pattern = "[0-9abcdefABCDEF\-]{1,40}" }</pattern>
+ </type>
+ <command>
+ <name>commands</name>
+ <summary>Run a list of commands</summary>
+ <description>
+ The client uses the commands command to run a list of commands. The
+ elements are executed as OMP commands in the given sequence. The reply
+ contains the result of each command, in the same order as the given
+ commands.
+ </description>
+ <pattern><any><c>command</c></any></pattern>
+ <response>
+ <pattern>
+ <attrib>
+ <name>status</name>
+ <type>status</type>
+ <required>1</required>
+ </attrib>
+ <attrib>
+ <name>status_text</name>
+ <type>text</type>
+ <required>1</required>
+ </attrib>
+ <any><c>response</c></any>
+ </pattern>
+ </response>
+ </command>
+ <command>
+ <name>delete_config</name>
+ <summary>Delete a config</summary>
+ <description>
+ <p>
+ The client uses the delete_config command to delete an existing config.
+ </p>
+ <p>
+ Since this is a destructive command, the client is advised to ask
+ for confirmation from the user before sending this command to the Manager.
+ </p>
+ </description>
+ <pattern>
+ <attrib>
+ <name>config_id</name>
+ <type>uuid</type>
+ <required>1</required>
+ </attrib>
+ </pattern>
+ <response>
+ <pattern>
+ <attrib>
+ <name>status</name>
+ <type>status</type>
+ <required>1</required>
+ </attrib>
+ <attrib>
+ <name>status_text</name>
+ <type>text</type>
+ <required>1</required>
+ </attrib>
+ </pattern>
+ </response>
+ </command>
+ <command>
+ <name>get_notes</name>
+ <summary>Get all notes</summary>
+ <description>
+ The client uses the get_notes command to get note information.
+ If the command sent by the client was valid, the manager will
+ reply with a list of notes to the client.
+ </description>
+ <pattern>
+ <attrib>
+ <name>note_id</name>
+ <summary>ID of single note to get</summary>
+ <type>uuid</type>
+ </attrib>
+ <attrib>
+ <name>nvt_id</name>
+ <type>oid</type>
+ </attrib>
+ <attrib>
+ <name>task_id</name>
+ <type>uuid</type>
+ </attrib>
+ <attrib>
+ <name>details</name>
+ <type>boolean</type>
+ </attrib>
+ <attrib>
+ <name>result</name>
+ <type>boolean</type>
+ </attrib>
+ <attrib>
+ <name>sort_order</name>
+ <type>sort_order</type>
+ </attrib>
+ <attrib>
+ <name>sort_field</name>
+ <type>text</type>
+ </attrib>
+ </pattern>
+ <response>
+ <pattern>
+ <attrib>
+ <name>status</name>
+ <type>status</type>
+ <required>1</required>
+ </attrib>
+ <attrib>
+ <name>status_text</name>
+ <type>text</type>
+ <required>1</required>
+ </attrib>
+ </pattern>
+ </response>
+ <example>
+ <summary>Get all notes</summary>
+ <request>
+ <get_notes></get_notes>
+ </request>
+ <response>
+ <get_notes_response status="200" status_text="OK">
+ <note id="b76b81a7-9df8-42df-afff-baa9d4620128">
+ <nvt oid="1.3.6.1.4.1.25623.1.0.75">
+ <name>Test NVT: long lines</name>
+ </nvt>
+ <text excerpt="0">This is the full text of the note.</text>
+ <orphan>1</orphan>
+ </note>
+ <truncated>...</truncated>
+ </get_notes_response>
+ </response>
+ </example>
+ </command>
+ <command>
+ <name>get_version</name>
+ <summary>Get the OpenVAS Manager Protocol version</summary>
+ <pattern></pattern>
+ <response>
+ <pattern>
+ <attrib>
+ <name>status</name>
+ <type>status</type>
+ <required>1</required>
+ </attrib>
+ <attrib>
+ <name>status_text</name>
+ <type>text</type>
+ <required>1</required>
+ </attrib>
+ </pattern>
+ </response>
+ </command>
+ <command>
+ <name>help</name>
+ <summary>Get the help text</summary>
+ <pattern></pattern>
+ <response>
+ <pattern>
+ <attrib>
+ <name>status</name>
+ <type>status</type>
+ <required>1</required>
+ </attrib>
+ <attrib>
+ <name>status_text</name>
+ <type>text</type>
+ <required>1</required>
+ </attrib>
+ </pattern>
+ </response>
+ </command>
+ <command>
+ <name>modify_config</name>
+ <summary>Update an existing config</summary>
+ <description>
+ <p>
+ This command can take three forms: with a preference, with a family selection
+ or with an NVT selection.
+ </p>
+ <p>
+ The first form modifies a preference on the config.
+ If the preference includes an NVT, then the preference is an NVT preference,
+ otherwise the preference is a scanner preference. If the preference includes
+ a value then the manager updates the value of the preference, otherwise the
+ manager removes the preference.
+ </p>
+
+ <p>
+ The second form, with a family selection, lets the client modify the
+ NVTs selected by the config at a family level. The idea is that the
+ client modifies the entire family selection at once, so a client will
+ often need to include many families in a family selection.
+ </p>
+
+ <p>
+ The family_selection may include a growing element to indicate whether new
+ families should be added to the selection. It may also include any number
+ of family elements.
+ </p>
+
+ <p>
+ A family element must always include a name and may include a growing element
+ and an all element. The all element indicates whether all NVTs in the family
+ should be selected. The growing element indicates whether new NVTs in the
+ family should be added to the selection as they arrive. Leaving a family
+ out of the family_selection is equivalent to including the family with all
+ 0 and growing 0.
+ </p>
+
+ <p>
+ The effect of the all 0 and growing 0 case is subtle: if
+ all NVTs were selected then all are removed (effectively removing the
+ family from the config). However if some NVTs were selected then they
+ remain selected. As a result the client must include in the
+ family_selection all families that must have all NVTs selected.
+ </p>
+
+ <p>
+ The third option, an NVT selection, must include a family and may include any
+ number of NVTs. The manager updates the given family in the config to
+ include only the given NVTs.
+ </p>
+
+ <p>
+ If there was no error with the command sent by the client, the manager will
+ apply the changes to the config and will reply with a response code indicating
+ success.
+ </p>
+ </description>
+ <pattern>
+ <attrib>
+ <name>config_id</name>
+ <summary>ID of config to modify</summary>
+ <type>uuid</type>
+ <required>1</required>
+ </attrib>
+ <or>
+ <e>preference</e>
+ <e>family_selection</e>
+ <e>nvt_selection</e>
+ </or>
+ </pattern>
+ <ele>
+ <name>preference</name>
+ <pattern>
+ <e>name</e>
+ <o><e>nvt</e></o>
+ <o><e>value</e></o>
+ </pattern>
+ <ele>
+ <name>name</name>
+ <summary>The name of the preference to modify</summary>
+ <pattern><t>name</t></pattern>
+ </ele>
+ <ele>
+ <name>nvt</name>
+ <summary>NVT associated with preference to modify</summary>
+ <description>
+ If this element is present then the preference is an NVT
+ preference, otherwise it is a Scanner preference.
+ </description>
+ <pattern>
+ <attrib>
+ <name>oid</name>
+ <type>oid</type>
+ <required>1</required>
+ </attrib>
+ </pattern>
+ </ele>
+ <ele>
+ <name>value</name>
+ <summary>New value for preference</summary>
+ <pattern><t>base64</t></pattern>
+ </ele>
+ </ele>
+ <ele>
+ <name>family_selection</name>
+ <pattern>
+ <o><e>growing</e></o>
+ <any><e>family</e></any>
+ </pattern>
+ <ele>
+ <name>growing</name>
+ <summary>Whether new families should be added to the config</summary>
+ <pattern><t>boolean_atoi</t></pattern>
+ </ele>
+ <ele>
+ <name>family</name>
+ <pattern>
+ <o><e>all</e></o>
+ <o><e>growing</e></o>
+ <e>name</e>
+ </pattern>
+ <ele>
+ <name>all</name>
+ <summary>Whether to select all NVTs initially</summary>
+ <pattern><t>boolean_atoi</t></pattern>
+ </ele>
+ <ele>
+ <name>growing</name>
+ <summary>Whether to add newly arrived nvts to the selection</summary>
+ <pattern><t>boolean_atoi</t></pattern>
+ </ele>
+ <ele>
+ <name>name</name>
+ <pattern><t>name</t></pattern>
+ </ele>
+ </ele>
+ </ele>
+ <ele>
+ <name>nvt_selection</name>
+ <pattern>
+ <e>family</e>
+ <any><e>nvt</e></any>
+ </pattern>
+ <ele>
+ <name>family</name>
+ <summary>Name of family to modify</summary>
+ <pattern><t>name</t></pattern>
+ </ele>
+ <ele>
+ <name>nvt</name>
+ <pattern>
+ <attrib>
+ <name>oid</name>
+ <type>oid</type>
+ <required>1</required>
+ </attrib>
+ </pattern>
+ </ele>
+ </ele>
+ <response>
+ <pattern>
+ <attrib>
+ <name>status</name>
+ <type>status</type>
+ <required>1</required>
+ </attrib>
+ <attrib>
+ <name>status_text</name>
+ <type>text</type>
+ <required>1</required>
+ </attrib>
+ </pattern>
+ </response>
+ <example>
+ <summary>Modify a config preference</summary>
+ <request>
+ <modify_config config_id="254cd3ef-bbe1-4d58-859d-21b8d0c046c6">
+ <preference>
+ <nvt oid="1.3.6.1.4.1.25623.1.0.14259"></nvt>
+ <name>Nmap (NASL wrapper)[checkbox]:UDP port scan</name>
+ <value>eWVz</value>
+ </preference>
+ </modify_config>
+ </request>
+ <response>
+ <modify_config_response status="200" status_text="OK">
+ </modify_config_response>
+ </response>
+ </example>
+ <example>
+ <summary>Modify the families that a config selects</summary>
+ <description>
+ <p>
+ The outer "growing" element sets the config to add any new families
+ that arrive.
+ </p>
+ <p>
+ The client requests the Manager to keep a single selected
+ family (Debian Local Security Checks), to select all NVTs in
+ this family, and to automatically add any new NVTs in this family
+ to the config.
+ </p>
+ </description>
+ <request>
+ <modify_config config_id="254cd3ef-bbe1-4d58-859d-21b8d0c046c6">
+ <family_selection>
+ <growing>1</growing>
+ <family>
+ <name>Debian Local Security Checks</name>
+ <all>1</all>
+ <growing>1</growing>
+ </family>
+ </family_selection>
+ </modify_config>
+ </request>
+ <response>
+ <modify_config_response status="200" status_text="OK">
+ </modify_config_response>
+ </response>
+ </example>
+ <example>
+ <summary>Modify the NVTs that a config selects in a particular family</summary>
+ <request>
+ <modify_config config_id="254cd3ef-bbe1-4d58-859d-21b8d0c046c6">
+ <nvt_selection>
+ <family>Debian Local Security Checks</family>
+ <nvt oid="1.3.6.1.4.1.25623.1.0.53797"></nvt>
+ <nvt oid="1.3.6.1.4.1.25623.1.0.63272"></nvt>
+ <nvt oid="1.3.6.1.4.1.25623.1.0.55615"></nvt>
+ <nvt oid="1.3.6.1.4.1.25623.1.0.53546"></nvt>
+ </nvt_selection>
+ </modify_config>
+ </request>
+ <response>
+ <modify_config_response status="200" status_text="OK">
+ </modify_config_response>
+ </response>
+ </example>
+ </command>
+</protocol>
Added: trunk/openvas-manager/src/schema_formats/XML/generate
===================================================================
--- trunk/openvas-manager/src/schema_formats/XML/generate 2010-10-18 13:37:53 UTC (rev 9225)
+++ trunk/openvas-manager/src/schema_formats/XML/generate 2010-10-18 14:59:53 UTC (rev 9226)
@@ -0,0 +1,30 @@
+#!/bin/sh
+#
+# OpenVAS
+# $Id$
+# Description: Schema generator script: OMP XML.
+#
+# This schema generator is the most trivial one as it simply passes on the
+# OMP XML schema as is.
+#
+# Authors:
+# Matthew Mundell <matthew.mundell at greenbone.net>
+#
+# Copyright:
+# Copyright (C) 2010 Greenbone Networks GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2,
+# or, at your option, any later version as published by the Free
+# Software Foundation
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+cat $1
More information about the Openvas-commits
mailing list