[Openvas-commits] r5641 - in trunk/openvas-client: . openvas
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Tue Oct 20 11:51:19 CEST 2009
Author: felix
Date: 2009-10-20 11:51:18 +0200 (Tue, 20 Oct 2009)
New Revision: 5641
Modified:
trunk/openvas-client/ChangeLog
trunk/openvas-client/openvas/comm.c
Log:
Moved omp related functions to openvas-libraries/omp/omp.c module.
* openvas/comm.c (omp_get_nvt_all, omp_get_nvt_feed_checksum,
omp_get_rules_503, omp_get_dependencies_503):
(Re)moved to openvas-libraries/omp/omp.c.
(omp_get_preferences_503): Removed. Duplicate in omp module already
existed.
Modified: trunk/openvas-client/ChangeLog
===================================================================
--- trunk/openvas-client/ChangeLog 2009-10-20 09:50:45 UTC (rev 5640)
+++ trunk/openvas-client/ChangeLog 2009-10-20 09:51:18 UTC (rev 5641)
@@ -1,5 +1,15 @@
2009-10-20 Felix Wolfsteller <felix.wolfsteller at intevation.de>
+ Moved omp related functions to openvas-libraries/omp/omp.c module.
+
+ * openvas/comm.c (omp_get_nvt_all, omp_get_nvt_feed_checksum,
+ omp_get_rules_503, omp_get_dependencies_503):
+ (Re)moved to openvas-libraries/omp/omp.c.
+ (omp_get_preferences_503): Removed. Duplicate in omp module already
+ existed.
+
+2009-10-20 Felix Wolfsteller <felix.wolfsteller at intevation.de>
+
* openvas/comm.c: Documentation added.
2009-10-20 Felix Wolfsteller <felix.wolfsteller at intevation.de>
Modified: trunk/openvas-client/openvas/comm.c
===================================================================
--- trunk/openvas-client/openvas/comm.c 2009-10-20 09:50:45 UTC (rev 5640)
+++ trunk/openvas-client/openvas/comm.c 2009-10-20 09:51:18 UTC (rev 5641)
@@ -64,213 +64,6 @@
int comm_send_file (struct context * context, char * file);
-/**
- * @brief Issue an OMP \<get_nvt_all\/\> command and wait for the response.
- *
- * @param[in] session Session to the server.
- * @param[out] response Entity containing the response, must be freed.
- *
- * @return 0 in case of success. -1 otherwise (e.g. invalid session).
- */
-int
-omp_get_nvt_all (gnutls_session_t* session, entity_t* response)
-{
- while (1)
- {
- const char* status;
-
- if (openvas_server_send (session, "<get_nvt_all/>"))
- return -1;
-
- *response = NULL;
- if (read_entity (session, response)) return -1;
-
- status = entity_attribute (*response, "status");
- if (status == NULL)
- {
- free_entity (*response);
- return -1;
- }
- if (strlen (status) == 0)
- {
- free_entity (*response);
- return -1;
- }
- char first = status[0];
- if (first == '2') return 0;
- if (strlen (status) == 3 && strcmp (status, "503") == 0)
- {
- sleep (1);
- continue;
- }
- free_entity (*response);
- return -1;
- }
-}
-
-/**
- * @brief Issue an OMP \<get_nvt_feed_checksum algoithm=md5/\> command and
- * @brief wait for the response.
- *
- * @param[in] session Session to the server.
- * @param[out] response Entity containing the response, must be freed.
- *
- * @return 0 in case of success. -1 otherwise (e.g. invalid session).
- */
-int
-omp_get_nvt_feed_checksum (gnutls_session_t* session, entity_t* response)
-{
- while (1)
- {
- const char* status;
-
- if (openvas_server_send (session,
- "<get_nvt_feed_checksum algorithm=\"md5\"/>"))
- return -1;
-
- *response = NULL;
- if (read_entity (session, response)) return -1;
-
- status = entity_attribute (*response, "status");
- if (status == NULL)
- {
- free_entity (*response);
- return -1;
- }
- if (strlen (status) == 0)
- {
- free_entity (*response);
- return -1;
- }
- char first = status[0];
- if (first == '2') return 0;
- if (strlen (status) == 3 && strcmp (status, "503") == 0)
- {
- sleep (0.5);
- continue;
- }
- free_entity (*response);
- return -1;
- }
-}
-
-/**
- * @brief Issue an OMP \<get_preferences\/\> command and wait for the response.
- *
- * @param[in] session Session to the server.
- * @param[out] response Entity containing the response, must be freed.
- *
- * @return 0 in case of success. -1 otherwise (e.g. invalid session).
- */
-int
-omp_get_preferences_503 (gnutls_session_t* session, entity_t* response)
-{
- while (1)
- {
- const char* status;
-
- if (openvas_server_send (session, "<get_preferences/>"))
- return -1;
-
- *response = NULL;
- if (read_entity (session, response)) return -1;
-
- status = entity_attribute (*response, "status");
- if (status == NULL)
- {
- free_entity (*response);
- return -1;
- }
- if (strlen (status) == 0)
- {
- free_entity (*response);
- return -1;
- }
- char first = status[0];
- if (first == '2') return 0;
- if (strlen (status) == 3 && strcmp (status, "503") == 0)
- {
- sleep (0.5);
- continue;
- }
- free_entity (*response);
- return -1;
- }
-}
-
-/* caller must free return */
-int
-omp_get_rules_503 (gnutls_session_t* session, entity_t* response)
-{
- while (1)
- {
- const char* status;
-
- if (openvas_server_send (session, "<get_rules/>"))
- return -1;
-
- *response = NULL;
- if (read_entity (session, response)) return -1;
-
- status = entity_attribute (*response, "status");
- if (status == NULL)
- {
- free_entity (*response);
- return -1;
- }
- if (strlen (status) == 0)
- {
- free_entity (*response);
- return -1;
- }
- char first = status[0];
- if (first == '2') return 0;
- if (strlen (status) == 3 && strcmp (status, "503") == 0)
- {
- sleep (0.5);
- continue;
- }
- free_entity (*response);
- return -1;
- }
-}
-
-/* caller must free return */
-int
-omp_get_dependencies_503 (gnutls_session_t* session, entity_t* response)
-{
- while (1)
- {
- const char* status;
-
- if (openvas_server_send (session, "<get_dependencies/>"))
- return -1;
-
- *response = NULL;
- if (read_entity (session, response)) return -1;
-
- status = entity_attribute (*response, "status");
- if (status == NULL)
- {
- free_entity (*response);
- return -1;
- }
- if (strlen (status) == 0)
- {
- free_entity (*response);
- return -1;
- }
- char first = status[0];
- if (first == '2') return 0;
- if (strlen (status) == 3 && strcmp (status, "503") == 0)
- {
- sleep (0.5);
- continue;
- }
- free_entity (*response);
- return -1;
- }
-}
#endif /* USE_OMP */
#ifdef USE_OMP
More information about the Openvas-commits
mailing list