[Openvas-commits] r3521 - in trunk/openvas-manager: . src src/tests
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Thu May 28 15:48:06 CEST 2009
Author: mattm
Date: 2009-05-28 15:48:05 +0200 (Thu, 28 May 2009)
New Revision: 3521
Added:
trunk/openvas-manager/src/tests/omp_get_version_0.c
Removed:
trunk/openvas-manager/src/tests/omp_version_0.c
Modified:
trunk/openvas-manager/ChangeLog
trunk/openvas-manager/src/omp.c
trunk/openvas-manager/src/tests/CMakeLists.txt
Log:
Rename OMP OMP_VERSION to GET_VERSION.
* src/omp.c (help_text, omp_xml_handle_start_element)
(omp_xml_handle_end_element): Rename OMP_VERSION to GET_VERSION.
* src/tests/CMakeLists.txt: Rename omp_version_0 to omp_get_version_0.
* src/tests/omp_version_0.c: Remove. Rename to omp_get_version.c.
* src/tests/omp_get_version.c: New file. Was omp_version.c. Adjust for
new name.
Modified: trunk/openvas-manager/ChangeLog
===================================================================
--- trunk/openvas-manager/ChangeLog 2009-05-28 13:36:09 UTC (rev 3520)
+++ trunk/openvas-manager/ChangeLog 2009-05-28 13:48:05 UTC (rev 3521)
@@ -1,5 +1,18 @@
2009-05-28 Matthew Mundell <mmundell at intevation.de>
+ Rename OMP OMP_VERSION to GET_VERSION.
+
+ * src/omp.c (help_text, omp_xml_handle_start_element)
+ (omp_xml_handle_end_element): Rename OMP_VERSION to GET_VERSION.
+
+ * src/tests/CMakeLists.txt: Rename omp_version_0 to omp_get_version_0.
+
+ * src/tests/omp_version_0.c: Remove. Rename to omp_get_version.c.
+ * src/tests/omp_get_version.c: New file. Was omp_version.c. Adjust for
+ new name.
+
+2009-05-28 Matthew Mundell <mmundell at intevation.de>
+
* src/omp.h (TO_CLIENT_BUFFER_SIZE): Increase, for now.
2009-05-28 Matthew Mundell <mmundell at intevation.de>
Modified: trunk/openvas-manager/src/omp.c
===================================================================
--- trunk/openvas-manager/src/omp.c 2009-05-28 13:36:09 UTC (rev 3520)
+++ trunk/openvas-manager/src/omp.c 2009-05-28 13:48:05 UTC (rev 3521)
@@ -79,7 +79,7 @@
" MODIFY_REPORT Modify an existing report.\n"
" MODIFY_TASK Update an existing task.\n"
" NEW_TASK Create a new task.\n"
-" OMP_VERSION Get the OpenVAS Manager Protocol version.\n"
+" GET_VERSION Get the OpenVAS Manager Protocol version.\n"
" START_TASK Manually start an existing task.\n"
" STATUS Get task status information.\n"
"\n"
@@ -387,7 +387,7 @@
if (current_client_task == (task_t) NULL) abort (); // FIX
set_client_state (CLIENT_NEW_TASK);
}
- else if (strncasecmp ("OMP_VERSION", element_name, 11) == 0)
+ else if (strncasecmp ("GET_VERSION", element_name, 11) == 0)
set_client_state (CLIENT_VERSION);
else if (strncasecmp ("START_TASK", element_name, 10) == 0)
{
@@ -1584,10 +1584,10 @@
break;
case CLIENT_VERSION:
- SEND_TO_CLIENT_OR_FAIL ("<omp_version_response>"
+ SEND_TO_CLIENT_OR_FAIL ("<get_version_response>"
"<status>" STATUS_OK "</status>"
"<version><preferred/>1.0</version>"
- "</omp_version_response>");
+ "</get_version_response>");
set_client_state (CLIENT_AUTHENTIC);
break;
Modified: trunk/openvas-manager/src/tests/CMakeLists.txt
===================================================================
--- trunk/openvas-manager/src/tests/CMakeLists.txt 2009-05-28 13:36:09 UTC (rev 3520)
+++ trunk/openvas-manager/src/tests/CMakeLists.txt 2009-05-28 13:48:05 UTC (rev 3521)
@@ -370,11 +370,11 @@
target_link_libraries (omp_status_4 common)
ADD_TEST (omp_status_4 omp_status_4)
-add_executable (omp_version_0 omp_version_0.c)
-target_link_libraries (omp_version_0 string)
-set_target_properties (omp_version_0 PROPERTIES COMPILE_FLAGS "-I .. ${GLIB_CFLAGS}")
-set_target_properties (omp_version_0 PROPERTIES LINK_FLAGS "${OVAS_LDFLAG} ${GLIB_LDFLAGS}")
-target_link_libraries (omp_version_0 common)
-ADD_TEST (omp_version_0 omp_version_0)
+add_executable (omp_get_version_0 omp_get_version_0.c)
+target_link_libraries (omp_get_version_0 string)
+set_target_properties (omp_get_version_0 PROPERTIES COMPILE_FLAGS "-I .. ${GLIB_CFLAGS}")
+set_target_properties (omp_get_version_0 PROPERTIES LINK_FLAGS "${OVAS_LDFLAG} ${GLIB_LDFLAGS}")
+target_link_libraries (omp_get_version_0 common)
+ADD_TEST (omp_get_version_0 omp_get_version_0)
## End
Copied: trunk/openvas-manager/src/tests/omp_get_version_0.c (from rev 3335, trunk/openvas-manager/src/tests/omp_version_0.c)
===================================================================
--- trunk/openvas-manager/src/tests/omp_version_0.c 2009-05-12 12:41:43 UTC (rev 3335)
+++ trunk/openvas-manager/src/tests/omp_get_version_0.c 2009-05-28 13:48:05 UTC (rev 3521)
@@ -0,0 +1,88 @@
+/* Test 0 of OMP GET_VERSION.
+ * $Id$
+ * Description: Test the OMP GET_VERSION command.
+ *
+ * Authors:
+ * Matthew Mundell <matt at mundell.ukfsn.org>
+ *
+ * Copyright:
+ * Copyright (C) 2009 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.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#define TRACE 1
+
+#include "common.h"
+#include "../tracef.h"
+
+int
+main ()
+{
+ int socket, ret;
+ gnutls_session_t session;
+
+ socket = connect_to_manager (&session);
+ if (socket == -1) return EXIT_FAILURE;
+
+ /* Send a version request. */
+
+ if (env_authenticate (&session))
+ {
+ close_manager_connection (socket, session);
+ return EXIT_FAILURE;
+ }
+
+ if (send_to_manager (&session, "<get_version/>\n") == -1)
+ {
+ close_manager_connection (socket, session);
+ return EXIT_FAILURE;
+ }
+
+ /* Read the response. */
+
+ entity_t entity = NULL;
+ if (read_entity (&session, &entity))
+ {
+ fprintf (stderr, "Failed to read response.\n");
+ close_manager_connection (socket, session);
+ return EXIT_FAILURE;
+ }
+
+ /* Compare. */
+
+ entity_t expected = add_entity (NULL, "get_version_response", NULL);
+ add_entity (&expected->entities, "status", "200");
+ entity_t version = add_entity (&expected->entities, "version", "1.0");
+ add_entity (&version->entities, "preferred", NULL);
+
+ if (compare_entities (entity, expected))
+ ret = EXIT_FAILURE;
+ else
+ ret = EXIT_SUCCESS;
+
+ /* Cleanup. */
+
+ close_manager_connection (socket, session);
+ free_entity (entity);
+ free_entity (expected);
+
+ return ret;
+}
Deleted: trunk/openvas-manager/src/tests/omp_version_0.c
===================================================================
--- trunk/openvas-manager/src/tests/omp_version_0.c 2009-05-28 13:36:09 UTC (rev 3520)
+++ trunk/openvas-manager/src/tests/omp_version_0.c 2009-05-28 13:48:05 UTC (rev 3521)
@@ -1,88 +0,0 @@
-/* Test 0 of OMP OMP_VERSION.
- * $Id$
- * Description: Test the OMP OMP_VERSION command.
- *
- * Authors:
- * Matthew Mundell <matt at mundell.ukfsn.org>
- *
- * Copyright:
- * Copyright (C) 2009 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.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#define TRACE 1
-
-#include "common.h"
-#include "../tracef.h"
-
-int
-main ()
-{
- int socket, ret;
- gnutls_session_t session;
-
- socket = connect_to_manager (&session);
- if (socket == -1) return EXIT_FAILURE;
-
- /* Send a version request. */
-
- if (env_authenticate (&session))
- {
- close_manager_connection (socket, session);
- return EXIT_FAILURE;
- }
-
- if (send_to_manager (&session, "<omp_version/>\n") == -1)
- {
- close_manager_connection (socket, session);
- return EXIT_FAILURE;
- }
-
- /* Read the response. */
-
- entity_t entity = NULL;
- if (read_entity (&session, &entity))
- {
- fprintf (stderr, "Failed to read response.\n");
- close_manager_connection (socket, session);
- return EXIT_FAILURE;
- }
-
- /* Compare. */
-
- entity_t expected = add_entity (NULL, "omp_version_response", NULL);
- add_entity (&expected->entities, "status", "200");
- entity_t version = add_entity (&expected->entities, "version", "1.0");
- add_entity (&version->entities, "preferred", NULL);
-
- if (compare_entities (entity, expected))
- ret = EXIT_FAILURE;
- else
- ret = EXIT_SUCCESS;
-
- /* Cleanup. */
-
- close_manager_connection (socket, session);
- free_entity (entity);
- free_entity (expected);
-
- return ret;
-}
More information about the Openvas-commits
mailing list