27 #ifndef OPENVAS_MANAGER_MANAGE_SQL_H 28 #define OPENVAS_MANAGER_MANAGE_SQL_H 32 #include <openvas/omp/xml.h> 39 #define CONFIG_UUID_FULL_AND_FAST "daba56c8-73ec-11df-a475-002264764cea" 44 #define CONFIG_UUID_FULL_AND_FAST_ULTIMATE \ 45 "698f691e-7489-11df-9d8c-002264764cea" 50 #define CONFIG_UUID_FULL_AND_VERY_DEEP "708f25c4-7489-11df-8094-002264764cea" 55 #define CONFIG_UUID_FULL_AND_VERY_DEEP_ULTIMATE \ 56 "74db13d6-7489-11df-91b9-002264764cea" 61 #define CONFIG_UUID_EMPTY "085569ce-73ed-11df-83c3-002264764cea" 66 #define CONFIG_UUID_DISCOVERY "8715c877-47a0-438d-98a3-27c7a6ab2196" 71 #define CONFIG_UUID_HOST_DISCOVERY "2d3f051c-55ba-11e3-bf43-406186ea4fc5" 76 #define CONFIG_UUID_SYSTEM_DISCOVERY "bbca7412-a950-11e3-9109-406186ea4fc5" 81 #define LOCATION_TABLE 0 86 #define LOCATION_TRASH 1 91 #define MANAGE_NVT_SELECTOR_UUID_ALL "54b45713-d4f4-4435-b20d-304c175ed8c5" 96 #define MANAGE_NVT_SELECTOR_UUID_DISCOVERY "0d9a2738-8fe2-4e22-8f26-bb886179e759" 101 #define MANAGE_NVT_SELECTOR_UUID_HOST_DISCOVERY \ 102 "f5f80744-55c7-11e3-8dc6-406186ea4fc5" 107 #define MANAGE_NVT_SELECTOR_UUID_SYSTEM_DISCOVERY \ 108 "07045d1c-a951-11e3-8da7-406186ea4fc5" 113 #define PERMISSION_UUID_ADMIN_EVERYTHING "b3b56a8c-c2fd-11e2-a135-406186ea4fc5" 118 #define PERMISSION_UUID_SUPER_ADMIN_EVERYTHING "a9801074-6fe2-11e4-9d81-406186ea4fc5" 123 #define PORT_LIST_UUID_DEFAULT "c7e03b6c-3bbe-11e1-a057-406186ea4fc5" 128 #define PORT_LIST_UUID_ALL_TCP "fd591a34-56fd-11e1-9f27-406186ea4fc5" 133 #define PORT_LIST_UUID_ALL_TCP_NMAP_5_51_TOP_100 "730ef368-57e2-11e1-a90f-406186ea4fc5" 138 #define PORT_LIST_UUID_ALL_TCP_NMAP_5_51_TOP_1000 "9ddce1ae-57e7-11e1-b13c-406186ea4fc5" 143 #define PORT_LIST_UUID_ALL_PRIV_TCP "492b72f4-56fe-11e1-98a7-406186ea4fc5" 148 #define PORT_LIST_UUID_ALL_PRIV_TCP_UDP "5f2029f6-56fe-11e1-bb94-406186ea4fc5" 153 #define PORT_LIST_UUID_ALL_IANA_TCP_2012 "33d0cd82-57c6-11e1-8ed1-406186ea4fc5" 158 #define PORT_LIST_UUID_ALL_IANA_TCP_UDP_2012 "4a4717fe-57d2-11e1-9a26-406186ea4fc5" 163 #define PORT_LIST_UUID_NMAP_5_51_TOP_2000_TOP_100 "ab33f6b0-57f8-11e1-96f5-406186ea4fc5" 168 #define ROLE_UUID_ADMIN "7a8cb5b4-b74d-11e2-8187-406186ea4fc5" 173 #define ROLE_UUID_GUEST "cc9cac5e-39a3-11e4-abae-406186ea4fc5" 178 #define ROLE_UUID_INFO "5f8fd16c-c550-11e3-b6ab-406186ea4fc5" 183 #define ROLE_UUID_MONITOR "12cdb536-480b-11e4-8552-406186ea4fc5" 188 #define ROLE_UUID_USER "8d453140-b74d-11e2-b0be-406186ea4fc5" 193 #define ROLE_UUID_SUPER_ADMIN "9c5a6ec6-6fe2-11e4-8cb6-406186ea4fc5" 198 #define ROLE_UUID_OBSERVER "87a7ebce-b74d-11e2-a81f-406186ea4fc5" 203 #define SCANNER_UUID_DEFAULT "08b69003-5fc2-4037-a479-93b440211c73" 208 #define SCANNER_UUID_CVE "6acd0832-df90-11e4-b9d5-28d24461215b" 213 #define SETTING_UUID_ROWS_PER_PAGE "5f5a8712-8017-11e1-8556-406186ea4fc5" 218 #define SETTING_UUID_MAX_ROWS_PER_PAGE "76374a7a-0569-11e6-b6da-28d24461215b" 223 #define SETTING_UUID_DEFAULT_CA_CERT "9ac801ea-39f8-11e6-bbaa-28d24461215b" 228 #define TRUST_ERROR 0 243 #define TRUST_UNKNOWN 3 248 #define TIMEVAL_SUBTRACT_MS(a,b) ((((a).tv_sec - (b).tv_sec) * 1000) + \ 249 ((a).tv_usec - (b).tv_usec) / 1000) 272 gchar *
tag_value (
const gchar *,
const gchar *);
void auto_delete_reports()
Auto delete reports.
const char * task_file_iterator_name(iterator_t *)
task_status_t
Task statuses, also used as scan/report statuses.
gchar * task_db_name
Name of the database file.
long long int credential_t
int set_report_slave_progress(report_t, int)
Set slave progress of a report.
credential_t target_ssh_credential(target_t)
Return the SSH credential associated with a target, if any.
time_t task_schedule_iterator_initial_offset(iterator_t *)
Get the initial offset from a task schedule iterator.
gchar * resource_uuid(const gchar *, resource_t)
Get the UUID of a resource.
void reschedule_task(const gchar *)
Set a task's schedule so that it runs again next scheduling round.
const char * otp_pref_iterator_name(iterator_t *)
char * task_definitions_file(task_t)
Get definitions file from a task's config.
int set_report_scan_run_status(report_t, task_status_t)
Return the run status of the scan associated with a report.
time_t task_schedule_iterator_duration(iterator_t *)
Get the duration from a task schedule iterator.
void set_report_scheduled(report_t)
Set a report's scheduled flag.
void set_task_schedule_next_time_uuid(const gchar *, time_t)
Set the next time a scheduled task will be due.
int set_task_requested(task_t, task_status_t *)
Atomically set the run state of a task to requested.
char * alert_data(alert_t, const char *, const char *)
Return data associated with an alert.
int manage_db_empty()
Check whether database is empty.
void check_generate_scripts()
Ensure the generate scripts are all executable.
int update_from_slave(task_t, entity_t, entity_t *, int *)
Update the local task from the slave task.
void array_add_new_string(array_t *, const gchar *)
Ensure a string is in an array.
void reinit_manage_process()
Reinitialize the manage library for a process.
const char * task_schedule_iterator_task_uuid(iterator_t *)
int set_task_schedule_uuid(const gchar *, schedule_t, int)
Set the schedule of a task.
alive_test_t target_alive_tests(target_t)
Return a target's alive tests.
schedule_t task_schedule_iterator_schedule(iterator_t *)
Get the schedule from a task schedule iterator.
gboolean host_nthlast_report_host(const char *, report_host_t *, int)
Get N'th last report_host given a host.
const char * task_schedule_iterator_owner_uuid(iterator_t *)
gchar * tag_value(const gchar *, const gchar *)
Extract a tag from an OTP tag list.
char * target_port_range(target_t)
Return the port range of a target, in OTP format.
void init_task_file_iterator(iterator_t *, task_t, const char *)
Initialise a task file iterator.
const char * run_status_name_internal(task_status_t)
Get the unique name of a run status.
task_t task_schedule_iterator_task(iterator_t *)
Get the task from a task schedule iterator.
const char * otp_pref_iterator_value(iterator_t *)
void trim_report(report_t)
Prepare a partial report for restarting the scan from the beginning.
void update_config_cache_init(const char *)
Update count and growing info in config, without checking user.
int days_from_now(time_t *epoch_time)
Calculate difference between now and epoch_time in days.
long long int port_list_t
const char * task_file_iterator_content(iterator_t *)
int parse_iso_time(const char *)
Convert an ISO time into seconds since epoch.
credential_t target_esxi_credential(target_t)
Return the ESXi credential associated with a target, if any.
void insert_port_range(port_list_t, port_protocol_t, int, int)
Create a port range.
time_t task_schedule_iterator_next_time(iterator_t *)
Get the next time from a task schedule iterator.
time_t task_schedule_iterator_period_months(iterator_t *)
Get the period months from a task schedule iterator.
int delete_report_internal(report_t)
Delete a report.
gboolean task_schedule_iterator_stop_due(iterator_t *)
Get the stop due state from a task schedule iterator.
time_t task_schedule_iterator_period(iterator_t *)
Get the period from a task schedule iterator.
gboolean find_resource_with_permission(const char *, const char *, resource_t *, const char *, int)
Find a resource given a UUID and a permission.
port_list_t target_port_list(target_t)
Return the port list associated with a target, if any.
void init_otp_pref_iterator(iterator_t *, config_t, const char *)
Initialise an "OTP" preference iterator.
gchar * get_ovaldef_short_filename(char *)
Get the short file name for an OVALDEF.
int init_task_schedule_iterator(iterator_t *)
Initialise a task schedule iterator.
const char * task_schedule_iterator_owner_name(iterator_t *)
time_t task_schedule_iterator_first_time(iterator_t *)
Get the first time from a task schedule iterator.
void parse_osp_report(task_t, report_t, const char *)
Parse an OSP report.
int manage_update_nvti_cache()
Update the memory cache of NVTs, if this has been requested.
gboolean task_schedule_iterator_start_due(iterator_t *)
Get the start due state from a task schedule iterator.
long long int report_host_t
int create_current_report(task_t, char **, task_status_t)
Create the current report for a task.
credential_t target_smb_credential(target_t)
Return the SMB credential associated with a target, if any.
gboolean task_schedule_iterator_timed_out(iterator_t *)
Get if schedule of task in iterator is timed out.
void manage_session_init(const char *)
Setup session.
void set_report_slave_task_uuid(report_t, const char *)
Set the UUID of the slave task, on the local task.
void cleanup_task_schedule_iterator(iterator_t *)
Cleanup a task schedule iterator.
void set_task_schedule_next_time(task_t, time_t)
Set the next time a scheduled task will be due.
char * report_host_ip(const char *)
Get the IP of a host, using the 'hostname' report host details.
int manage_report_host_details(report_t, const char *, entity_t)
Add host details to a report host.
int valid_omp_command(const char *)
Check whether a command name is valid.
const char * task_schedule_iterator_timezone(iterator_t *)
long long int resource_t
A resource, like a task or target.