@@ -174,19 +174,19 @@ parse_datetime (const char *datetime_str)
174174}
175175
176176/**
177- * @brief Parse a scan- agent-config JSON object into a newly allocated config
177+ * @brief Parse a agent-config JSON object into a newly allocated config
178178 * struct.
179179 *
180180 * @param[in] root cJSON object representing the full scan-agent-config
181181 * payload.
182182 *
183- * @return agent_controller_scan_agent_config_t on success; NULL on failure or
183+ * @return agent_controller_agent_config_t on success; NULL on failure or
184184 * if @p root is NULL / not a JSON object.
185185 * Ownership of root remains with the caller; do not free any children
186186 * retrieved with cJSON_GetObjectItem() individually.
187187 */
188188static agent_controller_agent_config_t
189- agent_controller_parse_scan_agent_config (cJSON * root )
189+ agent_controller_parse_agent_config (cJSON * root )
190190{
191191 if (!root || !cJSON_IsObject (root ))
192192 return NULL ;
@@ -257,25 +257,25 @@ agent_controller_parse_scan_agent_config (cJSON *root)
257257}
258258
259259/**
260- * @brief Parse a scan- agent-config JSON node into a newly allocated config
260+ * @brief Parse a agent-config JSON node into a newly allocated config
261261 * struct.
262262 *
263263 * @param[in] node cJSON node representing the scan-agent-config payload.
264264 * May be an object, a JSON string, or NULL.
265265 *
266- * @return agent_controller_scan_agent_config_t on success; NULL if node is
266+ * @return agent_controller_agent_config_t on success; NULL if node is
267267 * NULL/JSON null/unparsable. Ownership of node remains with the
268268 * caller; do not free any children retrieved with cJSON_GetObjectItem()
269269 * individually.
270270 */
271271static agent_controller_agent_config_t
272- agent_controller_parse_scan_agent_config_node (cJSON * node )
272+ agent_controller_parse_agent_config_node (cJSON * node )
273273{
274274 if (!node || cJSON_IsNull (node ))
275275 return NULL ;
276276
277277 if (cJSON_IsObject (node ))
278- return agent_controller_parse_scan_agent_config (node ); /*may return NULL*/
278+ return agent_controller_parse_agent_config (node ); /*may return NULL*/
279279
280280 if (cJSON_IsString (node ) && node -> valuestring )
281281 {
@@ -294,14 +294,14 @@ agent_controller_parse_scan_agent_config_node (cJSON *node)
294294}
295295
296296/**
297- * @brief Serialize scan- agent-config struct to a minimal JSON string.
297+ * @brief Serialize agent-config struct to a minimal JSON string.
298298 *
299299 * @param [in] cfg agent config to convert as json object
300300 *
301301 * @return cJSON pointer containing scan agent config.
302302 */
303303static cJSON *
304- agent_controller_scan_agent_config_struct_to_cjson (
304+ agent_controller_agent_config_struct_to_cjson (
305305 agent_controller_agent_config_t cfg )
306306{
307307 if (!cfg )
@@ -407,7 +407,7 @@ agent_controller_parse_agent (cJSON *item)
407407
408408 /* Config */
409409 cJSON * config_obj = cJSON_GetObjectItem (item , "config" );
410- agent -> config = agent_controller_parse_scan_agent_config_node (config_obj );
410+ agent -> config = agent_controller_parse_agent_config_node (config_obj );
411411
412412 return agent ;
413413}
@@ -453,7 +453,7 @@ dup_str_ptr_array (const GPtrArray *src)
453453 * @brief Resolve and merge scan agent configuration.
454454 *
455455 * The returned configuration is heap-allocated and must be freed
456- * using agent_controller_scan_agent_config_free ().
456+ * using agent_controller_agent_config_free ().
457457 *
458458 * @param[in] agent Agent providing the base configuration.
459459 * @param[in] update_cfg Optional configuration overrides. May be NULL.
@@ -462,7 +462,7 @@ dup_str_ptr_array (const GPtrArray *src)
462462 * or NULL on error.
463463 */
464464static agent_controller_agent_config_t
465- agent_controller_build_config_with_defaults (
465+ agent_controller_build_agent_config_with_defaults (
466466 const agent_controller_agent_t agent ,
467467 const agent_controller_agent_config_t update_cfg )
468468{
@@ -575,11 +575,11 @@ agent_controller_build_patch_payload (agent_controller_agent_list_t agents,
575575 if (update && update -> config )
576576 {
577577 agent_controller_agent_config_t merged =
578- agent_controller_build_config_with_defaults (agent , update -> config );
578+ agent_controller_build_agent_config_with_defaults (agent ,
579+ update -> config );
579580 if (merged )
580581 {
581- cfg_obj =
582- agent_controller_scan_agent_config_struct_to_cjson (merged );
582+ cfg_obj = agent_controller_agent_config_struct_to_cjson (merged );
583583 cJSON_AddItemToObject (agent_obj , "config" , cfg_obj );
584584 agent_controller_agent_config_free (merged );
585585 }
@@ -704,7 +704,7 @@ parse_errors_json_into_array (const gchar *body, GPtrArray **errors)
704704 * NULL on failure
705705 */
706706static agent_controller_scan_agent_config_t
707- agent_controller_parse_scan_agent_defaults (cJSON * root )
707+ agent_controller_parse_scan_agent_config (cJSON * root )
708708{
709709 if (!root || !cJSON_IsObject (root ))
710710 return NULL ;
@@ -717,8 +717,7 @@ agent_controller_parse_scan_agent_defaults (cJSON *root)
717717 cJSON * agent_defaults = cJSON_GetObjectItem (root , "agent_defaults" );
718718 if (cJSON_IsObject (agent_defaults ))
719719 {
720- d -> agent_defaults =
721- agent_controller_parse_scan_agent_config (agent_defaults );
720+ d -> agent_defaults = agent_controller_parse_agent_config (agent_defaults );
722721 if (!d -> agent_defaults )
723722 d -> agent_defaults = agent_controller_agent_config_new ();
724723 }
@@ -1035,7 +1034,7 @@ agent_controller_convert_scan_agent_config_string (
10351034
10361035 /* agent_defaults */
10371036 cJSON * agent_defaults =
1038- agent_controller_scan_agent_config_struct_to_cjson (d -> agent_defaults );
1037+ agent_controller_agent_config_struct_to_cjson (d -> agent_defaults );
10391038 if (!agent_defaults )
10401039 agent_defaults = cJSON_CreateObject ();
10411040
@@ -1081,7 +1080,7 @@ agent_controller_parse_scan_agent_config_string (const gchar *config)
10811080 }
10821081
10831082 agent_controller_scan_agent_config_t d =
1084- agent_controller_parse_scan_agent_defaults (root );
1083+ agent_controller_parse_scan_agent_config (root );
10851084
10861085 cJSON_Delete (root );
10871086 return d ;
@@ -1396,7 +1395,7 @@ agent_controller_parse_agent_config_string (const gchar *config)
13961395 return NULL ;
13971396 }
13981397 agent_controller_agent_config_t cfg =
1399- agent_controller_parse_scan_agent_config (root );
1398+ agent_controller_parse_agent_config (root );
14001399 cJSON_Delete (root );
14011400 return cfg ;
14021401}
@@ -1408,7 +1407,7 @@ agent_controller_parse_agent_config_string (const gchar *config)
14081407 *
14091408 * @return Newly allocated agent_controller_scan_agent_config_t on success,
14101409 * NULL on failure. Caller must free the returned object with
1411- * agent_controller_scan_agent_defaults_free ().
1410+ * agent_controller_scan_agent_config_free ().
14121411 */
14131412agent_controller_scan_agent_config_t
14141413agent_controller_get_scan_agent_config (agent_controller_connector_t conn )
@@ -1443,7 +1442,7 @@ agent_controller_get_scan_agent_config (agent_controller_connector_t conn)
14431442 }
14441443
14451444 agent_controller_scan_agent_config_t cfg =
1446- agent_controller_parse_scan_agent_defaults (root );
1445+ agent_controller_parse_scan_agent_config (root );
14471446
14481447 cJSON_Delete (root );
14491448 gvm_http_response_free (response );
0 commit comments