Go to the source code of this file.
|
osp_connection_t * | osp_connection_new (const char *, int, const char *, const char *, const char *) |
|
int | osp_get_version (osp_connection_t *, char **, char **, char **, char **, char **, char **) |
|
int | osp_start_scan (osp_connection_t *, const char *, const char *, GHashTable *, const char *, char **) |
|
int | osp_get_scan (osp_connection_t *, const char *, char **, int, char **) |
|
int | osp_delete_scan (osp_connection_t *, const char *) |
|
int | osp_stop_scan (osp_connection_t *, const char *, char **) |
|
int | osp_get_scanner_details (osp_connection_t *, char **, GSList **) |
|
osp_param_t * | osp_param_new (void) |
|
const char * | osp_param_id (const osp_param_t *) |
|
const char * | osp_param_name (const osp_param_t *) |
|
const char * | osp_param_desc (const osp_param_t *) |
|
const char * | osp_param_default (const osp_param_t *) |
|
const char * | osp_param_type_str (const osp_param_t *) |
|
int | osp_param_mandatory (const osp_param_t *) |
|
void | osp_param_free (osp_param_t *) |
|
void | osp_connection_close (osp_connection_t *) |
|
◆ osp_connection_t
Definition at line 30 of file osp.h.
◆ osp_param_t
Definition at line 43 of file osp.h.
◆ osp_param_type_t
Enumerator |
---|
OSP_PARAM_TYPE_INT | |
OSP_PARAM_TYPE_STR | |
OSP_PARAM_TYPE_PASSWORD | |
OSP_PARAM_TYPE_FILE | |
OSP_PARAM_TYPE_BOOLEAN | |
OSP_PARAM_TYPE_OVALDEF_FILE | |
OSP_PARAM_TYPE_SELECTION | |
OSP_PARAM_TYPE_CRD_UP | |
Definition at line 32 of file osp.h.
◆ osp_connection_close()
◆ osp_connection_new()
osp_connection_t* osp_connection_new |
( |
const char * |
, |
|
|
int |
, |
|
|
const char * |
, |
|
|
const char * |
, |
|
|
const char * |
|
|
) |
| |
◆ osp_delete_scan()
Definition at line 240 of file osp.c.
249 ret = osp_send_command (connection, &entity,
"<delete_scan scan_id='%s'/>",
257 if (strcmp (status,
"200"))
const char * entity_attribute(entity_t entity, const char *name)
Get an attribute of an entity.
void free_entity(entity_t entity)
Free an entity, recursively.
◆ osp_get_scan()
int osp_get_scan |
( |
osp_connection_t * |
, |
|
|
const char * |
, |
|
|
char ** |
, |
|
|
int |
, |
|
|
char ** |
|
|
) |
| |
Definition at line 274 of file osp.c.
284 rc = osp_send_command
285 (connection, &entity,
"<get_scans scan_id='%s' details='%d'/>",
286 scan_id, details ? 1 : 0);
290 *error = g_strdup (
"Couldn't send get_scans command to scanner");
301 *error = g_strdup (text);
308 string = g_string_new (
"");
310 *report_xml = g_string_free (
string, FALSE);
const char * entity_attribute(entity_t entity, const char *name)
Get an attribute of an entity.
void print_entity_to_string(entity_t entity, GString *string)
Print an XML entity tree to a GString, appending it if string is not.
entity_t entity_child(entity_t entity, const char *name)
Get a child of an entity.
void free_entity(entity_t entity)
Free an entity, recursively.
◆ osp_get_scanner_details()
Definition at line 497 of file osp.c.
505 if (osp_send_command (connection, &entity,
"<get_scanner_details/>"))
520 child = entities->data;
532 *params = g_slist_append (*params, param);
osp_param_t * osp_param_new(void)
char * entity_text(entity_t entity)
Get the text an entity.
entities_t entities
Children.
const char * entity_attribute(entity_t entity, const char *name)
Get an attribute of an entity.
entities_t next_entities(entities_t entities)
Return all the entities from an entities_t after the first.
entity_t entity_child(entity_t entity, const char *name)
Get a child of an entity.
void free_entity(entity_t entity)
Free an entity, recursively.
◆ osp_get_version()
int osp_get_version |
( |
osp_connection_t * |
, |
|
|
char ** |
, |
|
|
char ** |
, |
|
|
char ** |
, |
|
|
char ** |
, |
|
|
char ** |
, |
|
|
char ** |
|
|
) |
| |
Definition at line 157 of file osp.c.
166 if (osp_send_command (connection, &entity,
"<get_version/>"))
171 goto err_get_version;
174 goto err_get_version;
179 goto err_get_version;
185 goto err_get_version;
188 goto err_get_version;
193 goto err_get_version;
199 goto err_get_version;
202 goto err_get_version;
207 goto err_get_version;
215 g_warning (
"Erroneous OSP <get_version/> response.");
char * entity_text(entity_t entity)
Get the text an entity.
entity_t entity_child(entity_t entity, const char *name)
Get a child of an entity.
void free_entity(entity_t entity)
Free an entity, recursively.
◆ osp_param_default()
◆ osp_param_desc()
◆ osp_param_free()
◆ osp_param_id()
◆ osp_param_mandatory()
◆ osp_param_name()
◆ osp_param_new()
◆ osp_param_type_str()
◆ osp_start_scan()
int osp_start_scan |
( |
osp_connection_t * |
, |
|
|
const char * |
, |
|
|
const char * |
, |
|
|
GHashTable * |
, |
|
|
const char * |
, |
|
|
char ** |
|
|
) |
| |
Definition at line 386 of file osp.c.
391 char *options_str = NULL;
399 g_hash_table_foreach (options, option_concat_as_xml, &options_str);
401 rc = osp_send_command (connection, &entity,
402 "<start_scan target='%s' ports='%s' scan_id='%s'>" 403 "<scanner_params>%s</scanner_params></start_scan>",
404 target, ports ?:
"", scan_id ?:
"", options_str ?:
"");
405 g_free (options_str);
409 *error = g_strdup (
"Couldn't send start_scan command to scanner");
425 *error = g_strdup (text);
const char * entity_attribute(entity_t entity, const char *name)
Get an attribute of an entity.
void free_entity(entity_t entity)
Free an entity, recursively.
◆ osp_stop_scan()
Definition at line 324 of file osp.c.
331 rc = osp_send_command
332 (connection, &entity,
"<stop_scan scan_id='%s'/>", scan_id);
336 *error = g_strdup (
"Couldn't send stop_scan command to scanner");
352 *error = g_strdup (text);
const char * entity_attribute(entity_t entity, const char *name)
Get an attribute of an entity.
void free_entity(entity_t entity)
Free an entity, recursively.