17#include <gnutls/gnutls.h>
22#include <sys/socket.h>
30#define G_LOG_DOMAIN "libgvm osp"
130 const char *cert,
const char *key)
134 if (host && *host ==
'/')
136 struct sockaddr_un addr;
139 if (strlen (host) >=
sizeof (addr.sun_path))
141 g_warning (
"%s: given host / socket path too long (%zu > %zu bytes)",
142 __func__, strlen (host),
sizeof (addr.sun_path) - 1);
146 connection = g_malloc0 (
sizeof (*connection));
147 connection->
socket = socket (AF_UNIX, SOCK_STREAM, 0);
148 if (connection->
socket == -1)
154 addr.sun_family = AF_UNIX;
155 memset (addr.sun_path, 0, sizeof (addr.sun_path));
156 memcpy (addr.sun_path, host, strlen (host));
157 len = strlen (addr.sun_path) +
sizeof (addr.sun_family);
163 setsockopt (connection->
socket, SOL_SOCKET, SO_RCVTIMEO, &tv,
164 sizeof (
struct timeval));
165 setsockopt (connection->
socket, SOL_SOCKET, SO_SNDTIMEO, &tv,
166 sizeof (
struct timeval));
168 if (connect (connection->
socket, (
struct sockaddr *) &addr, len) == -1)
170 close (connection->
socket);
177 if (port <= 0 || port > 65535)
181 if (!cert || !key || !cacert)
184 connection = g_malloc0 (
sizeof (*connection));
186 &connection->
session, host, port, cacert, cert, key);
188 if (connection->
socket == -1)
194 connection->
host = g_strdup (host);
195 connection->
port = port;
210 const char *fmt, ...)
217 if (!connection || !fmt || !response)
220 if (*connection->
host ==
'/')
260 const char *fmt, ...)
271 if (!connection || !fmt)
274 if (*connection->
host ==
'/')
314 if (*connection->
host ==
'/')
315 close (connection->
socket);
318 g_free (connection->
host);
338 int *self_test_exit_error,
char **self_test_error_msg,
341 entity_t entity, feed, lockfile_entity, exit_error_entity, error_msg_entity;
342 const char *status, *status_text;
352 if (status != NULL && !strcmp (status,
"400"))
355 g_debug (
"%s: %s - %s.", __func__, status, status_text);
357 *cmd_error = g_strdup (status_text);
365 g_warning (
"%s: element FEED missing.", __func__);
370 lockfile_entity =
entity_child (feed,
"lockfile_in_use");
371 exit_error_entity =
entity_child (feed,
"self_test_exit_error");
372 error_msg_entity =
entity_child (feed,
"self_test_error_msg");
377 *lockfile_in_use = atoi (
entity_text (lockfile_entity));
380 g_warning (
"%s: element LOCKFILE_IN_USE missing.", __func__);
381 *lockfile_in_use = -1;
385 if (self_test_exit_error)
387 if (exit_error_entity)
388 *self_test_exit_error = atoi (
entity_text (exit_error_entity));
391 g_warning (
"%s: element SELF_TEST_EXIT_ERROR missing.", __func__);
392 *self_test_exit_error = -1;
396 if (self_test_error_msg)
398 if (error_msg_entity)
401 *self_test_error_msg = g_strdup (
entity_text (error_msg_entity));
403 *self_test_error_msg = NULL;
407 g_warning (
"%s: element SELF_TEST_ERROR_MSG missing.", __func__);
408 *self_test_error_msg = NULL;
431 char **d_name,
char **d_version,
char **p_name,
444 goto err_get_version;
447 goto err_get_version;
452 goto err_get_version;
458 goto err_get_version;
461 goto err_get_version;
466 goto err_get_version;
472 goto err_get_version;
475 goto err_get_version;
480 goto err_get_version;
488 g_warning (
"Erroneous OSP <get_version/> response.");
520 const char *status, *status_text;
526 get_vts_opts = osp_get_vts_opts_default;
533 if (status != NULL && !strcmp (status,
"400"))
536 g_debug (
"%s: %s - %s.", __func__, status, status_text);
538 *error = g_strdup (status_text);
546 g_warning (
"%s: element VTS missing.", __func__);
554 *vts_version = g_strdup (version);
574 char **feed_name,
char **feed_vendor,
char **feed_home,
578 const char *version, *name, *vendor, *home;
579 const char *status, *status_text;
585 get_vts_opts = osp_get_vts_opts_default;
592 if (status != NULL && !strcmp (status,
"400"))
595 g_debug (
"%s: %s - %s.", __func__, status, status_text);
597 *error = g_strdup (status_text);
605 g_warning (
"%s: element VTS missing.", __func__);
616 *vts_version = version ? g_strdup (version) : NULL;
618 *feed_name = name ? g_strdup (name) : NULL;
620 *feed_vendor = vendor ? g_strdup (vendor) : NULL;
622 *feed_home = home ? g_strdup (home) : NULL;
755 if (strcmp (status,
"200"))
784 *error = g_strdup (
"Couldn't send get_performance command "
785 "to scanner. Not valid connection");
792 || opts.
start > now || opts.
end < 0 || opts.
end > now)
795 *error = g_strdup (
"Couldn't send get_performance command "
796 "to scanner. Bad or missing parameters.");
801 "<get_performance start='%d' "
802 "end='%d' titles='%s'/>",
808 *error = g_strdup (
"Couldn't send get_performance command to scanner");
820 *error = g_strdup (text);
849 *error = g_strdup (
"Couldn't send get_scans command "
850 "to scanner. Not valid connection");
856 "<get_scans scan_id='%s'"
858 " pop_results='0'/>",
864 *error = g_strdup (
"Couldn't send get_scans command to scanner");
875 *error = g_strdup (text);
911 char **report_xml,
int details,
int pop_results,
char **error)
920 *error = g_strdup (
"Couldn't send get_scan command "
921 "to scanner. Not valid connection");
926 "<get_scans scan_id='%s'"
928 " pop_results='%d'/>",
929 scan_id, pop_results ? 1 : 0, details ? 1 : 0);
933 *error = g_strdup (
"Couldn't send get_scans command to scanner");
944 *error = g_strdup (text);
953 string = g_string_new (
"");
955 *report_xml = g_string_free (
string, FALSE);
974 char **report_xml,
int details,
char **error)
976 return osp_get_scan_pop (connection, scan_id, report_xml, details, 0, error);
997 *error = g_strdup (
"Couldn't send stop_scan command "
998 "to scanner. Not valid connection");
1007 *error = g_strdup (
"Couldn't send stop_scan command to scanner");
1023 *error = g_strdup (text);
1040 char *options_str, *tmp, *key_escaped, *value_escaped;
1042 options_str = *(
char **) pstr;
1044 key_escaped = g_markup_escape_text ((
char *) key, -1);
1045 value_escaped = g_markup_escape_text ((
char *) value, -1);
1046 tmp = g_strdup_printf (
"%s<%s>%s</%s>", options_str ? options_str :
"",
1047 key_escaped, value_escaped, key_escaped);
1049 g_free (options_str);
1050 g_free (key_escaped);
1051 g_free (value_escaped);
1052 *(
char **) pstr = tmp;
1069 const char *ports, GHashTable *options,
const char *scan_id,
1073 char *options_str = NULL;
1080 *error = g_strdup (
"Couldn't send start_scan command "
1081 "to scanner. Not valid connection");
1091 "<start_scan target='%s' ports='%s' scan_id='%s'>"
1092 "<scanner_params>%s</scanner_params></start_scan>",
1093 target, ports ? ports :
"", scan_id ? scan_id :
"",
1094 options_str ? options_str :
"");
1095 g_free (options_str);
1099 *error = g_strdup (
"Couldn't send start_scan command to scanner");
1115 *error = g_strdup (text);
1132 if (!key || !value || !xml_string)
1153 xml_string,
"<credential type=\"%s\" service=\"%s\" port=\"%s\">",
1154 type ? type :
"", service ? service :
"", port ? port :
"");
1175 "<exclude_hosts>%s</exclude_hosts>"
1176 "<finished_hosts>%s</finished_hosts>"
1177 "<ports>%s</ports>",
1189 else if (target->
icmp == TRUE || target->
tcp_syn == TRUE
1190 || target->
tcp_ack == TRUE || target->
arp == TRUE
1194 "<alive_test_methods>"
1196 "<tcp_syn>%d</tcp_syn>"
1197 "<tcp_ack>%d</tcp_ack>"
1199 "<consider_alive>%d</consider_alive>"
1200 "</alive_test_methods>",
1207 "<reverse_lookup_unify>%d</reverse_lookup_unify>",
1211 "<reverse_lookup_only>%d</reverse_lookup_only>",
1216 g_string_append (xml_string,
"<credentials>");
1219 g_string_append (xml_string,
"</credentials>");
1248 id ?
id :
"", value ? value :
"");
1279 gchar *scanner_params_xml = NULL;
1286 char filename[] =
"/tmp/osp-cmd-XXXXXX";
1292 *error = g_strdup (
"Couldn't send start_scan command "
1293 "to scanner. Not valid connection");
1297 fd = mkstemp (filename);
1298 FILE *file = fdopen (fd,
"w");
1300 xml = g_string_sized_new (10240);
1301 g_string_append (xml,
"<start_scan");
1304 g_string_append (xml,
"<targets>");
1306 g_string_append (xml,
"</targets>");
1308 g_string_append (xml,
"<scanner_params>");
1311 scanner_params_xml = NULL;
1313 &scanner_params_xml);
1314 if (scanner_params_xml)
1315 g_string_append (xml, scanner_params_xml);
1316 g_free (scanner_params_xml);
1318 g_string_append (xml,
"</scanner_params>");
1320 g_string_append (xml,
"<vt_selection>");
1323 fprintf (file,
"%s", xml->str);
1325 g_string_free (xml, TRUE);
1327 xml = g_string_new (
"");
1328 list_item = opts.
vts;
1335 list_item = list_item->next;
1337 if (list_count == 1000)
1339 fprintf (file,
"%s", xml->str);
1341 g_string_free (xml, TRUE);
1342 xml = g_string_new (
"");
1347 g_string_append (xml,
"</vt_selection>");
1348 g_string_append (xml,
"</start_scan>");
1350 fprintf (file,
"%s", xml->str);
1353 g_string_free (xml, TRUE);
1355 g_file_get_contents (filename, &cmd, NULL, NULL);
1365 *error = g_strdup (
"Could not send start_scan command to scanner");
1381 *error = g_strdup (text);
1403 if (!strcmp (str,
"integer"))
1405 else if (!strcmp (str,
"string"))
1407 else if (!strcmp (str,
"password"))
1409 else if (!strcmp (str,
"file"))
1411 else if (!strcmp (str,
"boolean"))
1413 else if (!strcmp (str,
"ovaldef_file"))
1415 else if (!strcmp (str,
"selection"))
1417 else if (!strcmp (str,
"credential_up"))
1448 return "ovaldef_file";
1452 return "credential_up";
1473 assert (connection);
1490 child = entities->data;
1502 *params = g_slist_append (*params, param);
1614 g_free (param->
name);
1615 g_free (param->
desc);
1616 g_free (param->
def);
1634 int alive_test,
int reverse_lookup_unify,
1635 int reverse_lookup_only)
1640 new_target->
exclude_hosts = exclude_hosts ? g_strdup (exclude_hosts) : NULL;
1641 new_target->
hosts = hosts ? g_strdup (hosts) : NULL;
1642 new_target->
ports = ports ? g_strdup (ports) : NULL;
1644 new_target->
alive_test = alive_test ? alive_test : 0;
1646 reverse_lookup_unify ? reverse_lookup_unify : 0;
1648 reverse_lookup_only ? reverse_lookup_only : 0;
1663 target->
finished_hosts = finished_hosts ? g_strdup (finished_hosts) : NULL;
1680 g_free (target->
hosts);
1681 g_free (target->
ports);
1697 gboolean tcp_syn, gboolean tcp_ack,
1698 gboolean arp, gboolean consider_alive)
1703 target->
icmp = icmp;
1719 if (!target || !credential)
1738 new_vt_group->
filter = filter ? g_strdup (filter) : NULL;
1740 return new_vt_group;
1754 g_free (vt_group->
filter);
1771 new_vt_single->
vt_id = vt_id ? g_strdup (vt_id) : NULL;
1773 g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
1775 return new_vt_single;
1789 g_hash_table_destroy (vt_single->
vt_values);
1791 g_free (vt_single->
vt_id);
1807 g_hash_table_replace (vt_single->
vt_values, g_strdup (name),
const gchar * scan_credential_get_port(scan_credential_t *credential)
Get the port of a scan credential.
Definition credentialutils.c:93
void scan_credential_free(scan_credential_t *credential)
Free a scan credential.
Definition credentialutils.c:134
const gchar * scan_credential_get_type(scan_credential_t *credential)
Get the type of a scan credential.
Definition credentialutils.c:63
void scan_credential_foreach_auth_data(scan_credential_t *credential, void(*func)(const char *name, const char *value, void *user_data), void *user_data)
Iterate over each authentication data item in a scan credential.
Definition credentialutils.c:109
const gchar * scan_credential_get_service(scan_credential_t *credential)
Get the service of a scan credential.
Definition credentialutils.c:78
struct scan_credential scan_credential_t
Definition credentialutils.h:16
int gvm_get_host_type(const gchar *str_stripped)
Determines the host type in a buffer.
Definition hosts.c:814
Protos and data structures for Hosts collections and single hosts objects.
__attribute__((weak))
Definition networking_tests.c:1036
void osp_target_add_credential(osp_target_t *target, scan_credential_t *credential)
Add a credential to an OSP target.
Definition osp.c:1717
int osp_check_feed(osp_connection_t *connection, int *lockfile_in_use, int *self_test_exit_error, char **self_test_error_msg, char **cmd_error)
Gets additional status info about the feed.
Definition osp.c:337
void osp_connection_close(osp_connection_t *connection)
Close a connection to an OSP server.
Definition osp.c:309
int osp_get_vts_ext_str(osp_connection_t *connection, osp_get_vts_opts_t opts, gchar **str)
Get filtered set of VTs from an OSP server.
Definition osp.c:700
static int osp_send_command(osp_connection_t *, entity_t *, static intosp_send_command_str(osp_connection_t const char *,...)
Definition osp.c:98
int osp_start_scan_ext(osp_connection_t *connection, osp_start_scan_opts_t opts, char **error)
Start an OSP scan against a target.
Definition osp.c:1276
void osp_vt_group_free(osp_vt_group_t *vt_group)
Free a OSP VT group.
Definition osp.c:1749
void osp_target_add_alive_test_methods(osp_target_t *target, gboolean icmp, gboolean tcp_syn, gboolean tcp_ack, gboolean arp, gboolean consider_alive)
Add alive test methods to OSP target.
Definition osp.c:1696
osp_vt_group_t * osp_vt_group_new(const char *filter)
Create a new OSP VT group.
Definition osp.c:1733
int osp_get_vts_feed_info(osp_connection_t *connection, char **vts_version, char **feed_name, char **feed_vendor, char **feed_home, char **error)
Get the VTs version as well as other feed info from an OSP server.
Definition osp.c:573
void osp_target_set_finished_hosts(osp_target_t *target, const char *finished_hosts)
Set the finished hosts of an OSP target.
Definition osp.c:1660
static osp_param_type_t osp_param_str_to_type(const char *str)
Get an OSP parameter's type from its string format.
Definition osp.c:1400
static void add_auth_data_key_value_as_xml(const char *key, const char *value, void *xml_string)
Add authentication data key value as XML.
Definition osp.c:1129
int osp_get_vts(osp_connection_t *connection, entity_t *vts)
Get all VTs from an OSP server.
Definition osp.c:637
int osp_get_scanner_details(osp_connection_t *connection, char **desc, GSList **params)
Get an OSP scanner's details.
Definition osp.c:1467
const char * osp_param_desc(const osp_param_t *param)
Get an OSP parameter's description.
Definition osp.c:1566
int osp_delete_scan(osp_connection_t *connection, const char *scan_id)
Delete a scan from an OSP server.
Definition osp.c:738
void osp_target_free(osp_target_t *target)
Free an OSP target, including all added credentials.
Definition osp.c:1672
int osp_get_vts_ext(osp_connection_t *connection, osp_get_vts_opts_t opts, entity_t *vts)
Get filtered set of VTs from an OSP server.
Definition osp.c:661
void osp_vt_single_add_value(osp_vt_single_t *vt_single, const char *name, const char *value)
Add a preference value to an OSP VT. This creates a copy of the name and value.
Definition osp.c:1804
static void vt_single_append_as_xml(osp_vt_single_t *vt_single, GString *xml_string)
Append single VTs as XML to a string buffer.
Definition osp.c:1258
osp_vt_single_t * osp_vt_single_new(const char *vt_id)
Create a new single OSP VT.
Definition osp.c:1766
static void credential_append_as_xml(scan_credential_t *credential, GString *xml_string)
Concatenate a credential as XML.
Definition osp.c:1145
int osp_get_scan(osp_connection_t *connection, const char *scan_id, char **report_xml, int details, char **error)
Get a scan from an OSP server.
Definition osp.c:973
int osp_get_scan_pop(osp_connection_t *connection, const char *scan_id, char **report_xml, int details, int pop_results, char **error)
Get a scan from an OSP server, optionally removing the results.
Definition osp.c:910
static void vt_value_append_as_xml(gpointer id, gchar *value, GString *xml_string)
Append VT values as XML to a string buffer.
Definition osp.c:1245
int osp_start_scan(osp_connection_t *connection, const char *target, const char *ports, GHashTable *options, const char *scan_id, char **error)
Start an OSP scan against a target.
Definition osp.c:1068
static void target_append_as_xml(osp_target_t *target, GString *xml_string)
Concatenate a target as XML.
Definition osp.c:1170
static void vt_group_append_as_xml(osp_vt_group_t *vt_group, GString *xml_string)
Append VT groups as XML to a string buffer.
Definition osp.c:1231
void osp_vt_single_free(osp_vt_single_t *vt_single)
Free a single OSP VT, including all preference values.
Definition osp.c:1784
static void option_concat_as_xml(gpointer key, gpointer value, gpointer pstr)
Concatenate options as xml.
Definition osp.c:1038
time_t osp_connection_timeout
Definition osp.c:43
osp_param_t * osp_param_new(void)
Create a new OSP parameter.
Definition osp.c:1523
osp_target_t * osp_target_new(const char *hosts, const char *ports, const char *exclude_hosts, int alive_test, int reverse_lookup_unify, int reverse_lookup_only)
Create a new OSP target.
Definition osp.c:1633
int osp_get_version(osp_connection_t *connection, char **s_name, char **s_version, char **d_name, char **d_version, char **p_name, char **p_version)
Get the scanner version from an OSP server.
Definition osp.c:430
time_t osp_get_connection_timeout(void)
Definition osp.c:112
const char * osp_param_type_str(const osp_param_t *param)
Get an OSP parameter in string format form its type.
Definition osp.c:1431
static int osp_send_command_str(osp_connection_t *connection, gchar **str, const char *fmt,...)
Send a command to an OSP server.
Definition osp.c:259
int osp_stop_scan(osp_connection_t *connection, const char *scan_id, char **error)
Stop a scan on an OSP server.
Definition osp.c:989
int osp_get_performance_ext(osp_connection_t *connection, osp_get_performance_opts_t opts, char **graph, char **error)
Get performance graphics from an OSP server.
Definition osp.c:773
const char * osp_param_name(const osp_param_t *param)
Get an OSP parameter's name.
Definition osp.c:1551
int osp_param_mandatory(const osp_param_t *param)
Get an OSP parameter's mandatory value.
Definition osp.c:1596
void osp_param_free(osp_param_t *param)
Free an OSP parameter.
Definition osp.c:1609
int osp_get_vts_version(osp_connection_t *connection, char **vts_version, char **error)
Get the VTs version from an OSP server.
Definition osp.c:515
osp_scan_status_t osp_get_scan_status_ext(osp_connection_t *connection, osp_get_scan_status_opts_t opts, char **error)
Get a scan status from an OSP server.
Definition osp.c:839
const char * osp_param_id(const osp_param_t *param)
Get an OSP parameter's id.
Definition osp.c:1536
osp_connection_t * osp_connection_new(const char *host, int port, const char *cacert, const char *cert, const char *key)
Open a new connection to an OSP server.
Definition osp.c:129
const char * osp_param_default(const osp_param_t *param)
Get an OSP parameter's default value.
Definition osp.c:1581
API for Open Scanner Protocol communication.
void osp_set_connection_timeout(time_t)
#define OSP_DEFAULT_CONNECTION_TIMEOUT
Definition osp.h:74
struct osp_connection osp_connection_t
Definition osp.h:21
struct osp_target osp_target_t
Definition osp.h:23
struct osp_vt_group osp_vt_group_t
Definition osp.h:25
osp_scan_status_t
OSP scan status.
Definition osp.h:48
@ OSP_SCAN_STATUS_QUEUED
Definition osp.h:54
@ OSP_SCAN_STATUS_STOPPED
Definition osp.h:52
@ OSP_SCAN_STATUS_INTERRUPTED
Definition osp.h:55
@ OSP_SCAN_STATUS_FINISHED
Definition osp.h:53
@ OSP_SCAN_STATUS_RUNNING
Definition osp.h:51
@ OSP_SCAN_STATUS_ERROR
Definition osp.h:49
@ OSP_SCAN_STATUS_INIT
Definition osp.h:50
struct osp_vt_single osp_vt_single_t
Definition osp.h:27
struct osp_param osp_param_t
Definition osp.h:70
osp_param_type_t
OSP parameter types.
Definition osp.h:33
@ OSP_PARAM_TYPE_BOOLEAN
Definition osp.h:38
@ OSP_PARAM_TYPE_STR
Definition osp.h:35
@ OSP_PARAM_TYPE_INT
Definition osp.h:34
@ OSP_PARAM_TYPE_SELECTION
Definition osp.h:40
@ OSP_PARAM_TYPE_PASSWORD
Definition osp.h:36
@ OSP_PARAM_TYPE_FILE
Definition osp.h:37
@ OSP_PARAM_TYPE_CRD_UP
Definition osp.h:41
@ OSP_PARAM_TYPE_OVALDEF_FILE
Definition osp.h:39
int gvm_server_open_with_cert(gnutls_session_t *session, const char *host, int port, const char *ca_mem, const char *pub_mem, const char *priv_mem)
Connect to the server using a given host, port and cert.
Definition serverutils.c:479
int gvm_server_vsendf(gnutls_session_t *session, const char *fmt, va_list ap)
Send a string to the server.
Definition serverutils.c:749
int gvm_server_close(int socket, gnutls_session_t session)
Close a server connection and its socket.
Definition serverutils.c:511
int gvm_socket_vsendf(int socket, const char *fmt, va_list ap)
Send a string to the server.
Definition serverutils.c:764
GnuTLS based functions for server communication - header file.
entities_t entities
Children.
Definition xmlutils.h:56
Connection.
Definition serverutils.h:38
gint port
Port of server.
Definition serverutils.h:47
int tls
Whether uses TCP-TLS (vs UNIX socket).
Definition serverutils.h:39
int socket
Socket.
Definition serverutils.h:40
gchar * host_string
Server host string.
Definition serverutils.h:45
gnutls_session_t session
Session.
Definition serverutils.h:41
Struct holding options for OSP connection.
Definition osp.c:36
int port
Definition osp.c:40
int socket
Definition osp.c:38
char * host
Definition osp.c:39
gnutls_session_t session
Definition osp.c:37
const char * scan_id
UUID of the scan which get the status from.
Definition osp.h:60
char * filter
the filter to apply for a vt sub-selection.
Definition osp.h:109
int version_only
if get only feed info or the vt collection
Definition osp.h:110
Struct holding options for OSP parameters.
Definition osp.c:49
char * def
Definition osp.c:53
char * id
Definition osp.c:50
int mandatory
Definition osp.c:55
char * name
Definition osp.c:51
osp_param_type_t type
Definition osp.c:54
char * desc
Definition osp.c:52
GSList * targets
Target hosts to scan.
Definition osp.h:130
GSList * vts
Single VTs to use for the scan.
Definition osp.h:132
GSList * vt_groups
VT groups to use for the scan.
Definition osp.h:131
GHashTable * scanner_params
Table of scanner parameters.
Definition osp.h:133
const char * scan_id
UUID to set for scan, null otherwise.
Definition osp.h:134
Struct holding target information.
Definition osp.c:62
int reverse_lookup_only
Definition osp.c:77
gchar * hosts
Definition osp.c:65
GSList * credentials
Definition osp.c:63
gboolean tcp_syn
Definition osp.c:72
int reverse_lookup_unify
Definition osp.c:76
int alive_test
Definition osp.c:70
gboolean arp
Definition osp.c:74
gchar * exclude_hosts
Definition osp.c:64
gboolean icmp
Definition osp.c:71
gboolean consider_alive
Definition osp.c:75
gchar * ports
Definition osp.c:66
gboolean tcp_ack
Definition osp.c:73
gchar * finished_hosts
Definition osp.c:67
Struct holding vt_group information.
Definition osp.c:84
gchar * filter
Definition osp.c:85
Struct holding vt_group information.
Definition osp.c:92
GHashTable * vt_values
Definition osp.c:94
gchar * vt_id
Definition osp.c:93
const char * entity_attribute(entity_t entity, const char *name)
Get an attribute of an entity.
Definition xmlutils.c:216
char * entity_text(entity_t entity)
Get the text an entity.
Definition xmlutils.c:145
int read_entity(gnutls_session_t *session, entity_t *entity)
Read an XML entity tree from the manager.
Definition xmlutils.c:1469
entities_t next_entities(entities_t entities)
Return all the entities from an entities_t after the first.
Definition xmlutils.c:67
void free_entity(entity_t entity)
Free an entity, recursively.
Definition xmlutils.c:115
int read_text_c(gvm_connection_t *connection, char **text)
Read text from the server.
Definition xmlutils.c:1366
entity_t entity_child(entity_t entity, const char *name)
Get a child of an entity.
Definition xmlutils.c:193
int read_entity_s(int socket, entity_t *entity)
Read an XML entity tree from the socket.
Definition xmlutils.c:1483
void xml_string_append(GString *xml, const char *format,...)
Append formatted escaped XML to a string.
Definition xmlutils.c:1849
void print_entity_to_string(entity_t entity, GString *string)
Print an XML entity tree to a GString, appending it if string is not.
Definition xmlutils.c:1616
struct entity_s * entity_t
Definition xmlutils.h:58
GSList * entities_t
Entities.
Definition xmlutils.h:46