From 3d132ce528ff9e03a5ddd3c9308aeb8f5e2cb84f Mon Sep 17 00:00:00 2001 From: Matt Mundell Date: Tue, 19 Dec 2023 19:21:21 +0200 Subject: [PATCH 1/3] Correct source location in doxy configs --- doc/Doxyfile.in | 5 ++--- doc/Doxyfile_full.in | 5 ++--- doc/Doxyfile_xml.in | 5 ++--- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in index a876c148f3..5e46206528 100644 --- a/doc/Doxyfile.in +++ b/doc/Doxyfile.in @@ -152,7 +152,7 @@ FULL_PATH_NAMES = YES # will be relative from the directory where doxygen is started. # This tag requires that the tag FULL_PATH_NAMES is set to YES. -STRIP_FROM_PATH = @CMAKE_SOURCE_DIR@/gsad +STRIP_FROM_PATH = @CMAKE_SOURCE_DIR@ # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the # path mentioned in the documentation of a class, which tells the reader which @@ -753,7 +753,7 @@ WARN_LOGFILE = # spaces. # Note: If this tag is empty the current directory is searched. -INPUT = @CMAKE_SOURCE_DIR@/gsad/src +INPUT = @CMAKE_SOURCE_DIR@/src # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses @@ -822,7 +822,6 @@ EXCLUDE_SYMBOLS = # command). EXAMPLE_PATH = @CMAKE_SOURCE_DIR@ \ - @CMAKE_SOURCE_DIR@/gsad \ @CMAKE_CURRENT_SOURCE_DIR@ # If the value of the EXAMPLE_PATH tag contains directories, you can use the diff --git a/doc/Doxyfile_full.in b/doc/Doxyfile_full.in index 5736feeb51..a94f92b57d 100644 --- a/doc/Doxyfile_full.in +++ b/doc/Doxyfile_full.in @@ -152,7 +152,7 @@ FULL_PATH_NAMES = YES # will be relative from the directory where doxygen is started. # This tag requires that the tag FULL_PATH_NAMES is set to YES. -STRIP_FROM_PATH = @CMAKE_SOURCE_DIR@/gsad +STRIP_FROM_PATH = @CMAKE_SOURCE_DIR@ # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the # path mentioned in the documentation of a class, which tells the reader which @@ -753,7 +753,7 @@ WARN_LOGFILE = # spaces. # Note: If this tag is empty the current directory is searched. -INPUT = @CMAKE_SOURCE_DIR@/gsad/src +INPUT = @CMAKE_SOURCE_DIR@/src # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses @@ -822,7 +822,6 @@ EXCLUDE_SYMBOLS = # command). EXAMPLE_PATH = @CMAKE_SOURCE_DIR@ \ - @CMAKE_SOURCE_DIR@/gsad \ @CMAKE_CURRENT_SOURCE_DIR@ # If the value of the EXAMPLE_PATH tag contains directories, you can use the diff --git a/doc/Doxyfile_xml.in b/doc/Doxyfile_xml.in index a4913783e3..bdf9c51908 100644 --- a/doc/Doxyfile_xml.in +++ b/doc/Doxyfile_xml.in @@ -152,7 +152,7 @@ FULL_PATH_NAMES = YES # will be relative from the directory where doxygen is started. # This tag requires that the tag FULL_PATH_NAMES is set to YES. -STRIP_FROM_PATH = @CMAKE_SOURCE_DIR@/gsad +STRIP_FROM_PATH = @CMAKE_SOURCE_DIR@ # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the # path mentioned in the documentation of a class, which tells the reader which @@ -753,7 +753,7 @@ WARN_LOGFILE = # spaces. # Note: If this tag is empty the current directory is searched. -INPUT = @CMAKE_SOURCE_DIR@/gsad/src +INPUT = @CMAKE_SOURCE_DIR@/src # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses @@ -822,7 +822,6 @@ EXCLUDE_SYMBOLS = # command). EXAMPLE_PATH = @CMAKE_SOURCE_DIR@ \ - @CMAKE_SOURCE_DIR@/gsad \ @CMAKE_CURRENT_SOURCE_DIR@ # If the value of the EXAMPLE_PATH tag contains directories, you can use the From 2e074626c256ee74d0fb1122ef4639122af12985 Mon Sep 17 00:00:00 2001 From: Matt Mundell Date: Tue, 19 Dec 2023 19:35:17 +0200 Subject: [PATCH 2/3] Clear doxy warnings --- src/gsad.c | 3 --- src/gsad_gmp.c | 61 ++++++++++++++++--------------------------------- src/gsad_http.c | 1 - 3 files changed, 20 insertions(+), 45 deletions(-) diff --git a/src/gsad.c b/src/gsad.c index b5c5356812..ceef11eae6 100644 --- a/src/gsad.c +++ b/src/gsad.c @@ -30,9 +30,6 @@ * \section Introduction * \verbinclude README.md * - * \section Installation - * \verbinclude INSTALL - * * \section copying License * \verbinclude LICENSE */ diff --git a/src/gsad_gmp.c b/src/gsad_gmp.c index 3d3efab33a..176d3dae2b 100644 --- a/src/gsad_gmp.c +++ b/src/gsad_gmp.c @@ -766,6 +766,13 @@ message_invalid (gvm_connection_t *connection, credentials_t *credentials, * @brief Set redirect or return a basic action_result page based on entity. * * @param[in] connection Connection to manager + * @param[in] credentials Username and password for authentication. + * @param[in] params Request parameters. + * @param[in] entity Entity. + * @param[in] action Name of the action. + * @param[in] response_data Response data. + * + * @return Enveloped XML object. */ static gchar * response_from_entity (gvm_connection_t *connection, credentials_t *credentials, @@ -798,7 +805,6 @@ response_from_entity (gvm_connection_t *connection, credentials_t *credentials, * @param[in] type Type of resource. * @param[in] credentials Username and password for authentication. * @param[in] params Request parameters. - * @param[in] extra_xml Extra XML to insert inside page element. * @param[in] arguments Extra arguments for GMP GET command. * @param[out] response_data Extra data return for the HTTP response. * @@ -942,7 +948,6 @@ get_one (gvm_connection_t *connection, const char *type, * @param[in] type Entity type. * @param[in] credentials Username and password for authentication. * @param[in] params Request parameters. - * @param[in] extra_xml Extra XML to insert inside page element. * @param[in] arguments Extra arguments for GMP GET command. * @param[out] response_data Extra data return for the HTTP response. * @@ -1397,6 +1402,7 @@ export_resource (gvm_connection_t *connection, const char *type, * @brief Export a list of resources. * * @param[in] connection Connection to manager. + * @param[in] type Type of resource. * @param[in] credentials Username and password for authentication. * @param[in] params Request parameters. * @param[out] response_data Extra data return for the HTTP response. @@ -1700,7 +1706,6 @@ move_resource_to_trash (gvm_connection_t *connection, const char *type, * @brief Delete a resource from the trashcan * * @param[in] connection Connection to manager. - * @param[in] type Type of resource. * @param[in] credentials Username and password for authentication. * @param[in] params Request parameters. * @param[out] response_data Extra data return for the HTTP response. @@ -1870,19 +1875,6 @@ resource_action (gvm_connection_t *connection, credentials_t *credentials, } \ } -/** - * @brief Returns page to create a new container task. - * - * @param[in] connection Connection to manager. - * @param[in] credentials Credentials of user issuing the action. - * @param[in] params Request parameters. - * @param[in] message If not NULL, display message. - * @param[in] extra_xml Extra XML to insert inside page element. - * @param[out] response_data Extra data return for the HTTP response. - * - * @return Enveloped XML object. - */ - /** * @brief Create a report, get all tasks, envelope the result. * @@ -3325,10 +3317,10 @@ create_credential_gmp (gvm_connection_t *connection, credentials_t *credentials, /** * @brief Get one credential, envelope the result. * - * @param[in] connection Connection to manager. + * @param[in] connection Connection to manager. * @param[in] credentials Username and password for authentication. * @param[in] params Request parameters. - * @param[in] commands Extra commands to run before the others. + * @param[in] extra_xml Extra XML to insert inside page element. * @param[out] response_data Extra data return for the HTTP response. * * @return Enveloped XML object. @@ -4313,9 +4305,7 @@ get_alerts (gvm_connection_t *connection, credentials_t *, params_t *, * @param[in] xml XML. * @param[out] data Data. * @param[out] event Event. - * - * @return 0 on success, -1 on error. - */ + */ static void append_alert_event_data (GString *xml, params_t *data, const char *event) { @@ -5588,9 +5578,8 @@ delete_target_gmp (gvm_connection_t *connection, credentials_t *credentials, * @brief Restore a resource, get all trash, envelope the result. * * @param[in] connection Connection to manager. - * @param[in] connection Connection to manager. - * @param[in] credentials Username and password for authentication. - * @param[in] params Request parameters. + * @param[in] credentials Username and password for authentication. + * @param[in] params Request parameters. * @param[out] response_data Extra data return for the HTTP response. * * @return Enveloped XML object. @@ -7815,9 +7804,7 @@ delete_report_gmp (gvm_connection_t *connection, credentials_t *credentials, * @param[in] connection Connection to manager. * @param[in] credentials Username and password for authentication. * @param[in] params Request parameters. - * @param[in] commands Extra commands to run before the others. * @param[in] extra_xml Extra XML to insert inside page element. - * @param[out] error Set to 1 if error, else 0. * @param[out] response_data Extra data return for the HTTP response. * * @return Report. @@ -10957,6 +10944,8 @@ get_trash_gmp (gvm_connection_t *connection, credentials_t *credentials, * @param[out] xml GString to write responses to. * @param[out] modify_failed_flag Pointer to an int to set to 1 on failure * to modify one of the settings. + * @param[out] response_data Extra data return for the HTTP response. + * * @return 0 on success, -1 on error. */ static int @@ -11024,10 +11013,6 @@ send_settings_filters (gvm_connection_t *connection, params_t *data, * @param[in] credentials Credentials of user issuing the action. * @param[in] params Request parameters. * @param[in] accept_language Accept-Language, from browser. - * @param[out] timezone Timezone. Caller must free. - * @param[out] password Password. Caller must free. - * @param[out] severity Severity. Caller must free. - * @param[out] language Language. Caller must free. * @param[out] response_data Extra data return for the HTTP response. * * @return Enveloped XML object. @@ -12917,9 +12902,9 @@ create_port_range_gmp (gvm_connection_t *connection, credentials_t *credentials, * @brief Get one port_list, envelope the result. * * @param[in] connection Connection to manager. - * @param[in] credentials Username and password for authentication. - * @param[in] params Request parameters. - * @param[in] commands Extra commands to run before the others. + * @param[in] credentials Username and password for authentication. + * @param[in] params Request parameters. + * @param[in] extra_xml Extra XML to insert inside page element. * @param[out] response_data Extra data return for the HTTP response. * * @return Enveloped XML object. @@ -15664,7 +15649,6 @@ get_asset_gmp (gvm_connection_t *connection, credentials_t *credentials, * @param[in] connection Connection to manager. * @param[in] credentials Credentials for the manager connection. * @param[in] params Request parameters. - * @param[in] extra_xml Extra XML to insert inside page element. * @param[out] response_data Extra data return for the HTTP response. * * @return XML enveloped assets response or error message. @@ -16844,17 +16828,12 @@ authenticate_gmp (const gchar *username, const gchar *password, gchar **role, } /** - * @brief Check authentication credentials. + * @brief Log out. * * @param[in] username Username. * @param[in] password Password. - * @param[out] role Role. - * @param[out] timezone Timezone. - * @param[out] capabilities Capabilities of manager. - * @param[out] language User Interface Language, or NULL. - * @param[out] pw_warning Password warning message, NULL if password is OK. * - * @return 0 success, 1 manager down, 2 failed, 3 timeout, -1 error. + * @return 0 success, else error. */ int logout_gmp (const gchar *username, const gchar *password) diff --git a/src/gsad_http.c b/src/gsad_http.c index 61c1e38c40..f2510e8eb2 100644 --- a/src/gsad_http.c +++ b/src/gsad_http.c @@ -860,7 +860,6 @@ add_cors_headers (http_response_t *response) * @brief Add header to forbid caching to a HTTP response. * * @param[in] response The HTTP response to add the headers to. - * @param[in] allow_caching 1 to allow caching, 0 to forbid. */ void add_forbid_caching_headers (http_response_t *response) From fea119628a55bed798cc45c0dd38a0eab811e5e0 Mon Sep 17 00:00:00 2001 From: Matt Mundell Date: Tue, 19 Dec 2023 19:42:01 +0200 Subject: [PATCH 3/3] Fix spacing --- src/gsad_gmp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gsad_gmp.c b/src/gsad_gmp.c index 79283e89ce..665ee0a65e 100644 --- a/src/gsad_gmp.c +++ b/src/gsad_gmp.c @@ -4299,13 +4299,14 @@ get_alerts (gvm_connection_t *connection, credentials_t *, params_t *, #define EVENT_TYPE_TICKET_RECEIVED "Ticket received" #define EVENT_TYPE_ASSIGNED_TICKET_CHANGED "Assigned ticket changed" #define EVENT_TYPE_OWNED_TICKET_CHANGED "Owned ticket changed" + /** * @brief Send event data for an alert. * * @param[in] xml XML. * @param[out] data Data. * @param[out] event Event. - */ + */ static void append_alert_event_data (GString *xml, params_t *data, const char *event) {