"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "osp/osp.c" between
gvm-libs-11.0.0.tar.gz and gvm-libs-11.0.1.tar.gz

About: GVM Libraries for the Greenbone Vulnerability Management (GVM-10) framework (derived from the former openvas-libraries).

osp.c  (gvm-libs-11.0.0):osp.c  (gvm-libs-11.0.1)
skipping to change at line 86 skipping to change at line 86
gchar *service; /**< Service the credential is for */ gchar *service; /**< Service the credential is for */
gchar *port; /**< Port the credential is for */ gchar *port; /**< Port the credential is for */
GHashTable *auth_data; /**< Authentication data (username, password, etc.)*/ GHashTable *auth_data; /**< Authentication data (username, password, etc.)*/
}; };
/** /**
* @brief Struct holding target information. * @brief Struct holding target information.
*/ */
struct osp_target struct osp_target
{ {
GSList *credentials; /** Credentials to use in the scan */ GSList *credentials; /** Credentials to use in the scan */
gchar *exclude_hosts; /** String defining one or many hosts to exclude */ gchar *exclude_hosts; /** String defining one or many hosts to exclude */
gchar *hosts; /** String defining one or many hosts to scan */ gchar *hosts; /** String defining one or many hosts to scan */
gchar *ports; /** String defining the ports to scan */ gchar *ports; /** String defining the ports to scan */
gchar *finished_hosts; /** String defining hosts to exclude as finished */
}; };
/** /**
* @brief Struct holding vt_group information * @brief Struct holding vt_group information
*/ */
struct osp_vt_group struct osp_vt_group
{ {
gchar *filter; gchar *filter;
}; };
skipping to change at line 861 skipping to change at line 862
* @param[in,out] xml_string XML string buffer to append to. * @param[in,out] xml_string XML string buffer to append to.
* *
*/ */
static void static void
target_append_as_xml (osp_target_t *target, GString *xml_string) target_append_as_xml (osp_target_t *target, GString *xml_string)
{ {
xml_string_append (xml_string, xml_string_append (xml_string,
"<target>" "<target>"
"<hosts>%s</hosts>" "<hosts>%s</hosts>"
"<exclude_hosts>%s</exclude_hosts>" "<exclude_hosts>%s</exclude_hosts>"
"<finished_hosts>%s</finished_hosts>"
"<ports>%s</ports>", "<ports>%s</ports>",
target->hosts ? target->hosts : "", target->hosts ? target->hosts : "",
target->exclude_hosts ? target->exclude_hosts : "", target->exclude_hosts ? target->exclude_hosts : "",
target->finished_hosts ? target->finished_hosts : "",
target->ports ? target->ports : ""); target->ports ? target->ports : "");
if (target->credentials) if (target->credentials)
{ {
g_string_append (xml_string, "<credentials>"); g_string_append (xml_string, "<credentials>");
g_slist_foreach (target->credentials, g_slist_foreach (target->credentials,
(GFunc) credential_append_as_xml, (GFunc) credential_append_as_xml,
xml_string); xml_string);
g_string_append (xml_string, "</credentials>"); g_string_append (xml_string, "</credentials>");
} }
skipping to change at line 1400 skipping to change at line 1403
osp_target_new (const char *hosts, osp_target_new (const char *hosts,
const char *ports, const char *ports,
const char *exclude_hosts) const char *exclude_hosts)
{ {
osp_target_t *new_target; osp_target_t *new_target;
new_target = g_malloc0 (sizeof (osp_target_t)); new_target = g_malloc0 (sizeof (osp_target_t));
new_target->exclude_hosts = exclude_hosts ? g_strdup (exclude_hosts) : NULL; new_target->exclude_hosts = exclude_hosts ? g_strdup (exclude_hosts) : NULL;
new_target->hosts = hosts ? g_strdup (hosts) : NULL; new_target->hosts = hosts ? g_strdup (hosts) : NULL;
new_target->ports = ports ? g_strdup (ports) : NULL; new_target->ports = ports ? g_strdup (ports) : NULL;
new_target->finished_hosts = NULL;
return new_target; return new_target;
} }
/** /**
* @brief Set the finished hosts of an OSP target.
*
* @param[in] target The OSP target to modify.
* @param[in] finished_hosts The hostnames to consider finished.
*/
void
osp_target_set_finished_hosts (osp_target_t *target,
const char *finished_hosts)
{
g_free (target->finished_hosts);
target->finished_hosts = finished_hosts ? g_strdup (finished_hosts) : NULL;
}
/**
* @brief Free an OSP target, including all added credentials. * @brief Free an OSP target, including all added credentials.
* *
* @param[in] target The OSP target to free. * @param[in] target The OSP target to free.
*/ */
void void
osp_target_free (osp_target_t *target) osp_target_free (osp_target_t *target)
{ {
if (!target) if (!target)
return; return;
 End of changes. 5 change blocks. 
4 lines changed or deleted 22 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)