Greenbone Vulnerability Manager  8.0.0~git
manage.h
1 /* Copyright (C) 2009-2018 Greenbone Networks GmbH
2  *
3  * SPDX-License-Identifier: GPL-2.0-or-later
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version 2
8  * of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 /*
21  * @file manage.h
22  * @brief Headers for Greenbone Vulnerability Manager: the Manage library.
23  */
24 
25 #ifndef _GVMD_MANAGE_H
26 #define _GVMD_MANAGE_H
27 
28 #include "iterator.h"
29 
30 #include <glib.h>
31 #include <gnutls/gnutls.h>
32 #include <gvm/base/array.h> /* for array_t */
33 #include <gvm/base/credentials.h> /* for credentials_t */
34 #include <gvm/base/networking.h> /* for port_protocol_t */
35 #include <gvm/base/nvti.h> /* for nvti_t */
36 #include <gvm/osp/osp.h> /* for osp_connection_t */
37 #include <gvm/util/authutils.h> /* for auth_method_t */
38 #include <gvm/util/serverutils.h> /* for gvm_connection_t */
39 #include <stdio.h>
40 
44 #define ALL_LOG_LEVELS \
45  (G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION)
46 
50 #ifndef g_info
51 #define g_info(...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_INFO, __VA_ARGS__)
52 #endif /* g_info not defined */
53 
57 typedef struct
58 {
59  gchar *name;
60  gchar *value;
61 } name_value_t;
62 
66 typedef int (*manage_connection_forker_t) (gvm_connection_t *conn,
67  const gchar *uuid);
68 
69 int
70 init_manage (GSList *,
71  int,
72  const gchar *,
73  int,
74  int,
75  int,
76  int,
77  manage_connection_forker_t,
78  int);
79 
80 int
81 init_manage_helper (GSList *, const gchar *, int);
82 
83 void
84 init_manage_process (int, const gchar *);
85 
86 void cleanup_manage_process (gboolean);
87 
88 void
90 
91 void
93 
94 /* Commands. */
95 
99 typedef struct
100 {
101  gchar *name;
102  gchar *summary;
103 } command_t;
104 
108 extern command_t gmp_commands[];
109 
110 /* Certificate and key management. */
111 
112 gchar *
113 truncate_certificate (const gchar *);
114 
115 gchar *
116 truncate_private_key (const gchar *);
117 
118 int
119 get_certificate_info (const gchar *, time_t *, time_t *, gchar **, gchar **);
120 
121 gchar *certificate_iso_time (time_t);
122 
123 const gchar *certificate_time_status (time_t, time_t);
124 
125 /* Credentials. */
126 
127 extern credentials_t current_credentials;
128 
129 int
130 authenticate (credentials_t *);
131 
132 /* Database. */
133 
134 int
135 manage_backup_db (const gchar *);
136 
137 int
139 
140 int
142 
143 int
145 
146 int
148 
149 int
151 
152 int
154 
155 char *
156 port_name_formatted (const char *);
157 
158 void
159 set_db_version (int version);
160 
161 char *
162 manage_port_name (int, const char *);
163 
164 int
165 manage_migrate (GSList *, const gchar *);
166 
167 int
168 manage_encrypt_all_credentials (GSList *, const gchar *);
169 
170 int
171 manage_decrypt_all_credentials (GSList *, const gchar *);
172 
173 void
174 manage_session_set_timezone (const char *);
175 
176 void
178 
179 void manage_transaction_stop (gboolean);
180 
181 /* Task structures. */
182 
183 extern short scanner_active;
184 
189 typedef struct
190 {
191  unsigned int number;
192  port_protocol_t protocol;
193  char *string;
194 } port_t;
195 
200 typedef struct
201 {
202  char *host;
203  char *hostname;
205  char *description;
206  char *oid;
207 } message_t;
208 
215 typedef enum
216 {
217  TASK_STATUS_DELETE_REQUESTED = 0,
218  TASK_STATUS_DONE = 1,
219  TASK_STATUS_NEW = 2,
220  TASK_STATUS_REQUESTED = 3,
221  TASK_STATUS_RUNNING = 4,
222  TASK_STATUS_STOP_REQUESTED = 10,
223  TASK_STATUS_STOP_WAITING = 11,
224  TASK_STATUS_STOPPED = 12,
225  TASK_STATUS_INTERRUPTED = 13,
226  TASK_STATUS_DELETE_ULTIMATE_REQUESTED = 14,
227  TASK_STATUS_STOP_REQUESTED_GIVEUP = 15,
228  TASK_STATUS_DELETE_WAITING = 16,
229  TASK_STATUS_DELETE_ULTIMATE_WAITING = 17
230 } task_status_t;
231 
235 #define AUTO_DELETE_KEEP_MIN 2
236 
240 #define AUTO_DELETE_KEEP_MAX 1200
241 
248 typedef enum
249 {
250  ALIVE_TEST_TCP_ACK_SERVICE = 1,
251  ALIVE_TEST_ICMP = 2,
252  ALIVE_TEST_ARP = 4,
253  ALIVE_TEST_CONSIDER_ALIVE = 8,
254  ALIVE_TEST_TCP_SYN_SERVICE = 16
255 } alive_test_t;
256 
263 typedef enum scanner_type
264 {
265  SCANNER_TYPE_NONE = 0,
266  SCANNER_TYPE_OSP,
267  SCANNER_TYPE_OPENVAS,
268  SCANNER_TYPE_CVE,
269  SCANNER_TYPE_GMP,
270  SCANNER_TYPE_MAX,
271 } scanner_type_t;
272 
273 typedef long long int agent_t;
274 typedef long long int config_t;
275 typedef long long int credential_t;
276 typedef long long int alert_t;
277 typedef long long int filter_t;
278 typedef long long int group_t;
279 typedef long long int host_t;
280 typedef long long int tag_t;
281 typedef long long int target_t;
282 typedef long long int task_t;
283 typedef long long int ticket_t;
284 typedef long long int result_t;
285 typedef long long int report_t;
286 typedef long long int report_host_t;
287 typedef long long int report_format_t;
288 typedef long long int report_format_param_t;
289 typedef long long int role_t;
290 typedef long long int note_t;
291 typedef long long int nvt_t;
292 typedef long long int override_t;
293 typedef long long int permission_t;
294 typedef long long int port_list_t;
295 typedef long long int port_range_t;
296 typedef long long int schedule_t;
297 typedef long long int scanner_t;
298 typedef long long int setting_t;
299 typedef long long int user_t;
300 
301 /* GMP GET. */
302 
306 #define FILT_ID_NONE "0"
307 
311 #define FILT_ID_USER_SETTING "-2"
312 
316 typedef struct
317 {
318  int details;
319  char *filt_id;
320  char *filter;
323  char *id;
324  int trash;
325  gchar *type;
326  gchar *subtype;
328  int ignore_pagination;
330  int minimal;
331 } get_data_t;
332 
333 void
335 
338 
339 const char *
340 get_iterator_uuid (iterator_t *);
341 
342 const char *
343 get_iterator_name (iterator_t *);
344 
345 const char *
347 
348 const char *
349 get_iterator_creation_time (iterator_t *);
350 
351 const char *
352 get_iterator_modification_time (iterator_t *);
353 
354 const char *
355 get_iterator_owner_name (iterator_t *);
356 
357 user_t
359 
360 /* Resources. */
361 
362 int
363 manage_resource_name (const char *, const char *, char **);
364 
365 int
366 manage_trash_resource_name (const char *, const char *, char **);
367 
368 int
369 resource_count (const char *, const get_data_t *);
370 
371 int
372 resource_id_exists (const char *, const char *);
373 
374 int
375 trash_id_exists (const char *, const char *);
376 
377 gboolean
378 find_resource (const char *, const char *, resource_t *);
379 
380 const char *
381 type_name_plural (const char *);
382 
383 const char *
384 type_name (const char *);
385 
386 int
387 type_is_scap (const char *);
388 
389 int
390 delete_resource (const char *, const char *, int);
391 
392 /* Events and Alerts. */
393 
397 typedef struct
398 {
399  gchar *local_filename;
401  gchar *content_type;
404 
405 void
407 
408 void
410 
414 #define ALERT_MESSAGE_INCLUDE \
415  "Task '$n': $e\n" \
416  "\n" \
417  "After the event $e,\n" \
418  "the following condition was met: $c\n" \
419  "\n" \
420  "This email escalation is configured to apply report format '$r'.\n" \
421  "Full details and other report formats are available on the scan engine.\n" \
422  "\n" \
423  "$t" \
424  "\n" \
425  "$i" \
426  "\n" \
427  "\n" \
428  "Note:\n" \
429  "This email was sent to you as a configured security scan escalation.\n" \
430  "Please contact your local system administrator if you think you\n" \
431  "should not have received it.\n"
432 
436 #define SECINFO_ALERT_MESSAGE_INCLUDE \
437  "Task '$n': $e\n" \
438  "\n" \
439  "After the event $e,\n" \
440  "the following condition was met: $c\n" \
441  "\n" \
442  "This email escalation is configured to apply report format '$r'.\n" \
443  "Full details and other report formats are available on the scan engine.\n" \
444  "\n" \
445  "$t" \
446  "\n" \
447  "$i" \
448  "\n" \
449  "\n" \
450  "Note:\n" \
451  "This email was sent to you as a configured security scan escalation.\n" \
452  "Please contact your local system administrator if you think you\n" \
453  "should not have received it.\n"
454 
458 #define ALERT_MESSAGE_ATTACH \
459  "Task '$n': $e\n" \
460  "\n" \
461  "After the event $e,\n" \
462  "the following condition was met: $c\n" \
463  "\n" \
464  "This email escalation is configured to attach report format '$r'.\n" \
465  "Full details and other report formats are available on the scan engine.\n" \
466  "\n" \
467  "$t" \
468  "\n" \
469  "Note:\n" \
470  "This email was sent to you as a configured security scan escalation.\n" \
471  "Please contact your local system administrator if you think you\n" \
472  "should not have received it.\n"
473 
477 #define SECINFO_ALERT_MESSAGE_ATTACH \
478  "Task '$n': $e\n" \
479  "\n" \
480  "After the event $e,\n" \
481  "the following condition was met: $c\n" \
482  "\n" \
483  "This email escalation is configured to attach report format '$r'.\n" \
484  "Full details and other report formats are available on the scan engine.\n" \
485  "\n" \
486  "$t" \
487  "\n" \
488  "Note:\n" \
489  "This email was sent to you as a configured security scan escalation.\n" \
490  "Please contact your local system administrator if you think you\n" \
491  "should not have received it.\n"
492 
496 #define ALERT_VFIRE_CALL_DESCRIPTION \
497  "GVM Task '$n': $e\n" \
498  "\n" \
499  "After the event $e,\n" \
500  "the following condition was met: $c\n" \
501  "\n" \
502  "This ticket includes reports in the following format(s):\n" \
503  "$r.\n" \
504  "Full details and other report formats are available on the scan engine.\n" \
505  "\n" \
506  "$t" \
507  "\n" \
508  "Note:\n" \
509  "This ticket was created automatically as a security scan escalation.\n" \
510  "Please contact your local system administrator if you think it\n" \
511  "was created or assigned erroneously.\n"
512 
516 typedef enum
517 {
518  EVENT_ERROR,
519  EVENT_TASK_RUN_STATUS_CHANGED,
520  EVENT_NEW_SECINFO,
521  EVENT_UPDATED_SECINFO,
522  EVENT_TICKET_RECEIVED,
523  EVENT_ASSIGNED_TICKET_CHANGED,
524  EVENT_OWNED_TICKET_CHANGED
525 } event_t;
526 
530 typedef enum
531 {
532  ALERT_METHOD_ERROR,
533  ALERT_METHOD_EMAIL,
534  ALERT_METHOD_HTTP_GET,
535  ALERT_METHOD_SOURCEFIRE,
536  ALERT_METHOD_START_TASK,
537  ALERT_METHOD_SYSLOG,
538  ALERT_METHOD_VERINICE,
539  ALERT_METHOD_SEND,
540  ALERT_METHOD_SCP,
541  ALERT_METHOD_SNMP,
542  ALERT_METHOD_SMB,
543  ALERT_METHOD_TIPPINGPOINT,
544  ALERT_METHOD_VFIRE,
545 } alert_method_t;
546 
550 typedef enum
551 {
552  ALERT_CONDITION_ERROR,
553  ALERT_CONDITION_ALWAYS,
554  ALERT_CONDITION_SEVERITY_AT_LEAST,
555  ALERT_CONDITION_SEVERITY_CHANGED,
556  ALERT_CONDITION_FILTER_COUNT_AT_LEAST,
557  ALERT_CONDITION_FILTER_COUNT_CHANGED
558 } alert_condition_t;
559 
560 int
561 manage_check_alerts (GSList *, const gchar *);
562 
563 int
564 create_alert (const char *,
565  const char *,
566  const char *,
567  const char *,
568  event_t,
569  GPtrArray *,
570  alert_condition_t,
571  GPtrArray *,
572  alert_method_t,
573  GPtrArray *,
574  alert_t *);
575 
576 int
577 copy_alert (const char *, const char *, const char *, alert_t *);
578 
579 int
580 modify_alert (const char *,
581  const char *,
582  const char *,
583  const char *,
584  const char *,
585  event_t,
586  GPtrArray *,
587  alert_condition_t,
588  GPtrArray *,
589  alert_method_t,
590  GPtrArray *);
591 
592 int
593 delete_alert (const char *, int);
594 
595 char *alert_uuid (alert_t);
596 
597 gboolean
598 find_alert_with_permission (const char *, alert_t *, const char *);
599 
600 int
601 manage_alert (const char *, const char *, event_t, const void *, gchar **);
602 
603 int
604 manage_test_alert (const char *, gchar **);
605 
606 int alert_in_use (alert_t);
607 
608 int trash_alert_in_use (alert_t);
609 
610 int alert_writable (alert_t);
611 
612 int trash_alert_writable (alert_t);
613 
614 int
615 alert_count (const get_data_t *);
616 
617 int
619 
620 int
622 
623 int
625 
626 int
628 
629 char *
631 
632 char *
634 
635 int
637 
638 int
640 
641 int
643 
644 const char *alert_condition_name (alert_condition_t);
645 
646 gchar *alert_condition_description (alert_condition_t, alert_t);
647 
648 const char *event_name (event_t);
649 
650 gchar *
651 event_description (event_t, const void *, const char *);
652 
653 const char *alert_method_name (alert_method_t);
654 
655 alert_condition_t
656 alert_condition_from_name (const char *);
657 
658 event_t
659 event_from_name (const char *);
660 
661 alert_method_t
662 alert_method_from_name (const char *);
663 
664 void
665 init_alert_data_iterator (iterator_t *, alert_t, int, const char *);
666 
667 const char *
669 
670 const char *
672 
673 void
674 init_alert_task_iterator (iterator_t *, alert_t, int);
675 
676 const char *
678 
679 const char *
681 
682 int
684 
685 void
687 
688 const char *
689 task_alert_iterator_uuid (iterator_t *);
690 
691 const char *
692 task_alert_iterator_name (iterator_t *);
693 
694 /* Task global variables and preprocessor variables. */
695 
699 extern task_t current_scanner_task;
700 
701 extern report_t global_current_report;
702 
703 /* Task code specific to the representation of tasks. */
704 
705 unsigned int
706 task_count (const get_data_t *);
707 
708 int
710 
711 task_status_t
713 
714 const char *
716 
717 int
719 
720 int
722 
723 const char *
725 
726 const char *
728 
729 report_t
731 
732 const char *
734 
735 scanner_t
737 
738 int
739 task_uuid (task_t, char **);
740 
741 int task_in_trash (task_t);
742 
743 int
744 task_in_trash_id (const gchar *);
745 
746 int task_in_use (task_t);
747 
748 int trash_task_in_use (task_t);
749 
750 int task_writable (task_t);
751 
752 int task_alterable (task_t);
753 
754 int trash_task_writable (task_t);
755 
756 int task_average_scan_duration (task_t);
757 
758 char *task_owner_name (task_t);
759 
760 char *task_name (task_t);
761 
762 char *task_comment (task_t);
763 
764 char *task_hosts_ordering (task_t);
765 
766 scanner_t task_scanner (task_t);
767 
768 int task_scanner_in_trash (task_t);
769 
770 config_t task_config (task_t);
771 
772 char *task_config_uuid (task_t);
773 
774 char *task_config_name (task_t);
775 
776 int task_config_in_trash (task_t);
777 
778 void set_task_config (task_t, config_t);
779 
780 target_t task_target (task_t);
781 
782 int task_target_in_trash (task_t);
783 
784 void set_task_target (task_t, target_t);
785 
786 void
787 set_task_hosts_ordering (task_t, const char *);
788 
789 void set_task_scanner (task_t, scanner_t);
790 
791 char *task_description (task_t);
792 
793 void
794 set_task_description (task_t, char *, gsize);
795 
796 task_status_t task_run_status (task_t);
797 
798 void set_task_run_status (task_t, task_status_t);
799 
800 int
801 task_result_count (task_t, int);
802 
803 report_t task_running_report (task_t);
804 
805 int task_upload_progress (task_t);
806 
807 void
808 set_task_start_time_epoch (task_t, int);
809 
810 void
811 set_task_start_time_otp (task_t, char *);
812 
813 void
814 set_task_end_time (task_t task, char *time);
815 
816 void set_task_end_time_epoch (task_t, time_t);
817 
818 void add_task_alert (task_t, alert_t);
819 
820 void
821 set_task_alterable (task_t, int);
822 
823 int
824 set_task_groups (task_t, array_t *, gchar **);
825 
826 int
827 set_task_schedule (task_t, schedule_t, int);
828 
829 int
830 set_task_schedule_periods (const gchar *, int);
831 
832 int
833 set_task_schedule_periods_id (task_t, int);
834 
835 unsigned int task_report_count (task_t);
836 
837 int
838 task_last_report (task_t, report_t *);
839 
840 const char *
842  int,
843  int,
844  int,
845  double,
846  int,
847  int,
848  int,
849  double);
850 
851 const char *
852 task_trend (task_t, int, int);
853 
854 int task_schedule_periods (task_t);
855 
856 int
857 task_schedule_periods_uuid (const gchar *);
858 
859 schedule_t task_schedule (task_t);
860 
861 schedule_t
862 task_schedule_uuid (const gchar *);
863 
864 int task_schedule_in_trash (task_t);
865 
866 time_t
867 task_schedule_next_time_uuid (const gchar *);
868 
869 int task_schedule_next_time (task_t);
870 
871 char *
872 task_severity (task_t, int, int, int);
873 
874 int task_debugs_size (task_t);
875 
876 int task_holes_size (task_t);
877 
878 int task_infos_size (task_t);
879 
880 int task_logs_size (task_t);
881 
882 int task_warnings_size (task_t);
883 
884 int task_false_positive_size (task_t);
885 
886 task_t
887 make_task (char *, char *, int, int);
888 
889 void make_task_complete (task_t);
890 
891 int
892 copy_task (const char *, const char *, const char *, int, task_t *);
893 
894 void
895 set_task_name (task_t, const char *);
896 
897 gboolean
898 find_task_with_permission (const char *, task_t *, const char *);
899 
900 gboolean
901 find_trash_task_with_permission (const char *, task_t *, const char *);
902 
903 void reset_task (task_t);
904 
905 int
906 set_task_parameter (task_t, const char *, char *);
907 
908 char *task_observers (task_t);
909 
910 int
911 set_task_observers (task_t, const gchar *);
912 
913 int
914 request_delete_task_uuid (const char *, int);
915 
916 int
917 request_delete_task (task_t *);
918 
919 int
920 delete_task (task_t, int);
921 
922 /* For otp.c. */
923 int
924 delete_task_lock (task_t, int);
925 
926 void
927 append_to_task_comment (task_t, const char *, int);
928 
929 void
930 add_task_description_line (task_t, const char *, size_t);
931 
932 void
933 set_scan_ports (report_t, const char *, unsigned int, unsigned int);
934 
935 void
936 append_task_open_port (task_t task, const char *, const char *);
937 
938 int
939 manage_task_update_file (const gchar *, const char *, const void *);
940 
941 int
942 manage_task_remove_file (const gchar *, const char *);
943 
944 int
945 modify_task (const gchar *,
946  const gchar *,
947  const gchar *,
948  const gchar *,
949  const gchar *,
950  const gchar *,
951  const gchar *,
952  array_t *,
953  const gchar *,
954  array_t *,
955  const gchar *,
956  const gchar *,
957  array_t *,
958  const gchar *,
959  gchar **,
960  gchar **);
961 
962 void
963 init_config_file_iterator (iterator_t *, const char *, const char *);
964 
965 const char *
966 config_file_iterator_content (iterator_t *);
967 
968 int
969 config_file_iterator_length (iterator_t *);
970 
971 void
972 init_config_task_iterator (iterator_t *, config_t, int);
973 
974 const char *
975 config_task_iterator_name (iterator_t *);
976 
977 const char *
978 config_task_iterator_uuid (iterator_t *);
979 
980 int
982 
983 /* General severity related facilities. */
984 
985 int
986 severity_in_level (double, const char *);
987 
988 int
989 severity_matches_ov (double, double);
990 
991 const char *
992 severity_to_level (double, int);
993 
994 const char *
995 severity_to_type (double);
996 
1000 typedef struct
1001 {
1002  int *counts;
1003  int total;
1004  double max;
1005 } severity_data_t;
1006 
1007 double
1008 severity_data_value (int);
1009 
1010 void
1012 
1013 void
1015 
1016 void
1018 
1019 void
1020 severity_data_add_count (severity_data_t *, double, int);
1021 
1022 void
1024  const gchar *,
1025  int *,
1026  int *,
1027  int *,
1028  int *,
1029  int *,
1030  int *,
1031  int *);
1032 
1033 /* General task facilities. */
1034 
1035 const char *run_status_name (task_status_t);
1036 
1037 int
1038 start_task (const char *, char **);
1039 
1040 int
1041 stop_task (const char *);
1042 
1043 int
1044 resume_task (const char *, char **);
1045 
1046 int
1047 move_task (const char *, const char *);
1048 
1049 /* Access control. */
1050 
1051 int
1052 user_may (const char *);
1053 
1054 extern int
1055 user_can_everything (const char *);
1056 
1057 extern int
1058 user_can_super_everyone (const char *);
1059 
1060 extern int
1061 user_has_super (const char *, user_t);
1062 
1063 /* Results. */
1064 
1068 #define LSC_FAMILY_LIST \
1069  "'AIX Local Security Checks'," \
1070  " 'CentOS Local Security Checks'," \
1071  " 'Debian Local Security Checks'," \
1072  " 'Fedora Local Security Checks'," \
1073  " 'FreeBSD Local Security Checks'," \
1074  " 'Gentoo Local Security Checks'," \
1075  " 'HP-UX Local Security Checks'," \
1076  " 'Mac OS X Local Security Checks'," \
1077  " 'Mandrake Local Security Checks'," \
1078  " 'Red Hat Local Security Checks'," \
1079  " 'Solaris Local Security Checks'," \
1080  " 'SuSE Local Security Checks'," \
1081  " 'Ubuntu Local Security Checks'," \
1082  " 'Windows : Microsoft Bulletins'," \
1083  " 'Privilege escalation'"
1084 
1085 gboolean
1086 find_result_with_permission (const char *, result_t *, const char *);
1087 
1088 int
1089 result_uuid (result_t, char **);
1090 
1091 int
1092 result_detection_reference (result_t,
1093  report_t,
1094  const char *,
1095  const char *,
1096  char **,
1097  char **,
1098  char **,
1099  char **);
1100 
1101 /* Reports. */
1102 
1104 #define OVAS_MANAGE_REPORT_ID_LENGTH UUID_LEN_STR
1105 
1109 #define APPLY_OVERRIDES_DEFAULT 0
1110 
1114 #define QOD_DEFAULT 75
1115 
1119 #define MIN_QOD_DEFAULT 70
1120 
1121 void
1122 reports_clear_count_cache (int);
1123 
1124 void
1125 reports_clear_count_cache_for_override (override_t, int);
1126 
1127 void
1129  report_t,
1130  int,
1131  int,
1132  const char *);
1133 
1134 double
1135 report_severity (report_t, int, int);
1136 
1137 int report_host_count (report_t);
1138 
1139 int
1140 report_result_host_count (report_t, int);
1141 
1142 gboolean
1143 find_report_with_permission (const char *, report_t *, const char *);
1144 
1145 report_t
1146 make_report (task_t, const char *, task_status_t);
1147 
1148 int
1149 qod_from_type (const char *);
1150 
1151 result_t
1152 make_result (task_t,
1153  const char *,
1154  const char *,
1155  const char *,
1156  const char *,
1157  const char *,
1158  const char *);
1159 
1160 result_t
1161 make_osp_result (task_t,
1162  const char *,
1163  const char *,
1164  const char *,
1165  const char *,
1166  const char *,
1167  const char *,
1168  int);
1169 
1170 result_t
1171 make_cve_result (task_t, const char *, const char *, double, const char *);
1172 
1176 typedef struct
1177 {
1178  char *description;
1179  char *host;
1180  char *hostname;
1181  char *nvt_oid;
1183  char *port;
1184  char *qod;
1185  char *qod_type;
1186  char *severity;
1187  char *threat;
1189 
1193 typedef struct
1194 {
1195  char *ip;
1196  char *name;
1197  char *source_desc;
1198  char *source_name;
1199  char *source_type;
1200  char *value;
1201 } host_detail_t;
1202 
1203 void
1205 
1206 void
1207 insert_report_host_detail (report_t,
1208  const char *,
1209  const char *,
1210  const char *,
1211  const char *,
1212  const char *,
1213  const char *);
1214 
1215 int
1216 manage_report_host_detail (report_t, const char *, const char *);
1217 
1218 void hosts_set_identifiers (report_t);
1219 
1220 void
1221 hosts_set_max_severity (report_t, int *, int *);
1222 
1223 void
1224 hosts_set_details (report_t report);
1225 
1226 void clear_duration_schedules (task_t);
1227 
1228 void update_duration_schedule_periods (task_t);
1229 
1230 int
1231 create_report (array_t *,
1232  const char *,
1233  const char *,
1234  const char *,
1235  const char *,
1236  const char *,
1237  const char *,
1238  array_t *,
1239  array_t *,
1240  array_t *,
1241  char **);
1242 
1243 void report_add_result (report_t, result_t);
1244 
1245 char *report_uuid (report_t);
1246 
1247 void
1248 report_set_slave_uuid (report_t, const gchar *);
1249 
1250 void
1251 report_set_slave_name (report_t, const gchar *);
1252 
1253 void
1254 report_set_slave_host (report_t, const gchar *);
1255 
1256 void
1257 report_set_slave_port (report_t, int);
1258 
1259 void
1260 report_set_slave_username (report_t, const gchar *);
1261 
1262 void
1263 report_set_slave_password (report_t, const gchar *);
1264 
1265 void
1266 report_set_source_iface (report_t, const gchar *);
1267 
1268 int
1269 task_last_resumable_report (task_t, report_t *);
1270 
1271 gchar *task_second_last_report_id (task_t);
1272 
1273 gchar *
1274 report_path_task_uuid (gchar *);
1275 
1276 gboolean
1277 report_task (report_t, task_t *);
1278 
1279 char *report_slave_task_uuid (report_t);
1280 
1281 int
1282 report_scan_result_count (report_t,
1283  const char *,
1284  const char *,
1285  int,
1286  const char *,
1287  const char *,
1288  int,
1289  int,
1290  int *);
1291 
1292 int
1293 report_counts (const char *,
1294  int *,
1295  int *,
1296  int *,
1297  int *,
1298  int *,
1299  int *,
1300  double *,
1301  int,
1302  int,
1303  int);
1304 
1305 int
1306 report_counts_id (report_t,
1307  int *,
1308  int *,
1309  int *,
1310  int *,
1311  int *,
1312  int *,
1313  double *,
1314  const get_data_t *,
1315  const char *);
1316 
1317 int
1318 report_counts_id_no_filt (report_t,
1319  int *,
1320  int *,
1321  int *,
1322  int *,
1323  int *,
1324  int *,
1325  double *,
1326  const get_data_t *,
1327  const char *);
1328 
1329 get_data_t *
1330 report_results_get_data (int, int, int, int, int);
1331 
1332 int scan_start_time_epoch (report_t);
1333 
1334 char *
1335 scan_start_time_uuid (const char *);
1336 
1337 char *
1338 scan_end_time_uuid (const char *);
1339 
1340 void
1341 set_scan_start_time_otp (report_t, const char *);
1342 
1343 void set_scan_start_time_epoch (report_t, time_t);
1344 
1345 void
1346 set_scan_end_time (report_t, const char *);
1347 
1348 void
1349 set_scan_end_time_otp (report_t, const char *);
1350 
1351 void set_scan_end_time_epoch (report_t, time_t);
1352 
1353 void
1354 set_scan_host_start_time_otp (report_t, const char *, const char *);
1355 
1356 int
1357 scan_host_end_time (report_t, const char *);
1358 
1359 void
1360 set_scan_host_end_time (report_t, const char *, const char *);
1361 
1362 void
1363 set_scan_host_end_time_otp (report_t, const char *, const char *);
1364 
1365 int
1366 report_timestamp (const char *, gchar **);
1367 
1368 int
1369 modify_report (const char *, const char *);
1370 
1371 int
1372 delete_report (const char *, int);
1373 
1374 int
1375 report_count (const get_data_t *);
1376 
1377 int
1379 
1380 void
1382 
1383 void
1385 
1386 const char *
1387 report_iterator_uuid (iterator_t *);
1388 
1389 int
1390 result_count (const get_data_t *, report_t, const char *);
1391 
1392 int
1394  const get_data_t *,
1395  report_t,
1396  const char *,
1397  const gchar *);
1398 
1399 gboolean
1400 next_report (iterator_t *, report_t *);
1401 
1402 result_t
1404 
1405 const char *
1406 result_iterator_host (iterator_t *);
1407 
1408 const char *
1409 result_iterator_port (iterator_t *);
1410 
1411 const char *
1412 result_iterator_nvt_oid (iterator_t *);
1413 
1414 const char *
1416 
1417 const char *
1419 
1420 const char *
1422 
1423 const char *
1425 
1426 const char *
1428 
1429 const char *
1431 
1432 const char *
1434 
1435 const char *
1436 result_iterator_descr (iterator_t *);
1437 
1438 task_t
1440 
1441 report_t
1443 
1444 const char *
1446 
1447 const char *
1449 
1450 double
1452 
1453 const char *
1455 
1456 const char *
1458 
1459 const char *
1460 result_iterator_solution_type (iterator_t *);
1461 
1462 const char *
1463 result_iterator_qod (iterator_t *);
1464 
1465 const char *
1466 result_iterator_qod_type (iterator_t *);
1467 
1468 const char *
1469 result_iterator_hostname (iterator_t *);
1470 
1471 const char *
1472 result_iterator_date (iterator_t *);
1473 
1474 const char *
1475 result_iterator_detected_by_oid (iterator_t *);
1476 
1477 const char *
1478 result_iterator_asset_host_id (iterator_t *);
1479 
1480 int
1482 
1483 int
1485 
1486 int
1488 
1489 int
1491 
1492 int
1494 
1495 void
1496 init_report_host_iterator (iterator_t *, report_t, const char *, report_host_t);
1497 
1498 const char *
1499 host_iterator_host (iterator_t *);
1500 
1501 const char *
1502 host_iterator_start_time (iterator_t *);
1503 
1504 const char *
1505 host_iterator_end_time (iterator_t *);
1506 
1507 int
1509 
1510 int
1512 
1513 int
1514 collate_message_type (void *data, int, const void *, int, const void *);
1515 
1516 void trim_partial_report (report_t);
1517 
1518 int
1519 report_progress (report_t, task_t, gchar **);
1520 
1521 gchar *
1522 manage_report (report_t,
1523  report_t,
1524  const get_data_t *,
1525  report_format_t,
1526  int,
1527  int,
1528  const char *,
1529  gsize *,
1530  gchar **,
1531  gchar **,
1532  gchar **,
1533  gchar **,
1534  gchar **);
1535 
1536 int
1537 manage_send_report (report_t,
1538  report_t,
1539  report_format_t,
1540  const get_data_t *,
1541  int,
1542  int,
1543  int,
1544  int,
1545  int,
1546  gboolean (*) (const char *,
1547  int (*) (const char *, void *),
1548  void *),
1549  int (*) (const char *, void *),
1550  void *,
1551  const char *,
1552  const char *,
1553  const char *,
1554  int,
1555  const char *,
1556  const char *,
1557  int,
1558  int,
1559  const gchar *);
1560 
1561 /* Reports. */
1562 
1563 gchar *
1564 app_location (report_host_t, const gchar *);
1565 
1566 void
1568  report_host_t,
1569  int,
1570  int,
1571  const char *,
1572  const char *,
1573  int,
1574  const char *);
1575 
1576 double
1578 
1579 const char *
1580 prognosis_iterator_cpe (iterator_t *);
1581 
1582 const char *
1583 prognosis_iterator_cve (iterator_t *);
1584 
1585 const char *
1586 prognosis_iterator_description (iterator_t *);
1587 
1588 /* Targets. */
1589 
1595 #define MANAGE_ABSOLUTE_MAX_IPS_PER_TARGET 70000
1596 
1600 #define MANAGE_MAX_HOSTS 4095
1601 
1605 #define MANAGE_USER_MAX_HOSTS 16777216
1606 
1607 int
1608 manage_max_hosts ();
1609 
1610 void
1611 manage_filter_controls (const gchar *, int *, int *, gchar **, int *);
1612 
1613 void
1614 manage_report_filter_controls (const gchar *,
1615  int *,
1616  int *,
1617  gchar **,
1618  int *,
1619  int *,
1620  gchar **,
1621  gchar **,
1622  gchar **,
1623  gchar **,
1624  int *,
1625  int *,
1626  int *,
1627  int *,
1628  int *,
1629  gchar **);
1630 
1631 gchar *
1632 manage_clean_filter (const gchar *);
1633 
1634 gchar *
1635 manage_clean_filter_remove (const gchar *, const gchar *);
1636 
1637 int
1638 manage_count_hosts (const char *, const char *);
1639 
1640 gboolean
1641 find_target_with_permission (const char *, target_t *, const char *);
1642 
1643 int
1644 create_target (const char *,
1645  const char *,
1646  const char *,
1647  const char *,
1648  const char *,
1649  const char *,
1650  const char *,
1651  credential_t,
1652  const char *,
1653  credential_t,
1654  credential_t,
1655  credential_t,
1656  const char *,
1657  const char *,
1658  const char *,
1659  target_t *);
1660 
1661 int
1662 copy_target (const char *, const char *, const char *, target_t *);
1663 
1664 int
1665 modify_target (const char *,
1666  const char *,
1667  const char *,
1668  const char *,
1669  const char *,
1670  const char *,
1671  const char *,
1672  const char *,
1673  const char *,
1674  const char *,
1675  const char *,
1676  const char *,
1677  const char *,
1678  const char *);
1679 
1680 int
1681 delete_target (const char *, int);
1682 
1683 int
1684 target_count (const get_data_t *);
1685 
1686 void
1687 init_user_target_iterator (iterator_t *, target_t);
1688 
1689 void
1690 init_target_iterator_one (iterator_t *, target_t);
1691 
1692 int
1694 
1695 const char *
1696 target_iterator_hosts (iterator_t *);
1697 
1698 const char *
1699 target_iterator_exclude_hosts (iterator_t *);
1700 
1701 const char *
1702 target_iterator_reverse_lookup_only (iterator_t *);
1703 
1704 const char *
1705 target_iterator_reverse_lookup_unify (iterator_t *);
1706 
1707 const char *
1708 target_iterator_comment (iterator_t *);
1709 
1710 int
1712 
1713 const char *
1714 target_iterator_ssh_port (iterator_t *);
1715 
1716 int
1718 
1719 int
1721 
1722 int
1724 
1725 int
1727 
1728 int
1730 
1731 int
1733 
1734 int
1736 
1737 const char *
1738 target_iterator_port_list_uuid (iterator_t *);
1739 
1740 const char *
1741 target_iterator_port_list_name (iterator_t *);
1742 
1743 int
1745 
1746 const char *
1748 
1749 char *target_uuid (target_t);
1750 
1751 char *trash_target_uuid (target_t);
1752 
1753 char *target_name (target_t);
1754 
1755 char *trash_target_name (target_t);
1756 
1757 int trash_target_readable (target_t);
1758 
1759 char *target_hosts (target_t);
1760 
1761 char *target_exclude_hosts (target_t);
1762 
1763 char *target_reverse_lookup_only (target_t);
1764 
1765 char *target_reverse_lookup_unify (target_t);
1766 
1767 char *target_port_range (target_t);
1768 
1769 char *target_ssh_port (target_t);
1770 
1771 int target_in_use (target_t);
1772 
1773 int trash_target_in_use (target_t);
1774 
1775 int target_writable (target_t);
1776 
1777 int trash_target_writable (target_t);
1778 
1779 char *
1780 target_ssh_credential_name (const char *);
1781 
1782 void
1784 
1785 const char *
1786 target_task_iterator_name (iterator_t *);
1787 
1788 const char *
1789 target_task_iterator_uuid (iterator_t *);
1790 
1791 int
1793 
1794 credential_t
1795 target_credential (target_t, const char *);
1796 
1797 credential_t
1798 trash_target_credential (target_t, const char *);
1799 
1800 int
1801 trash_target_credential_location (target_t, const char *);
1802 
1803 int
1804 target_login_port (target_t, const char *);
1805 
1806 int
1807 trash_target_login_port (target_t, const char *);
1808 
1809 /* Configs. */
1810 
1814 typedef struct
1815 {
1816  char *name;
1817  char *type;
1818  char *value;
1819  char *nvt_name;
1820  char *nvt_oid;
1821  array_t *alts;
1823  char *hr_name;
1824 } preference_t;
1825 
1829 typedef struct
1830 {
1831  char *name;
1832  char *type;
1833  int include;
1835 } nvt_selector_t;
1836 
1837 int
1838 create_config (const char *,
1839  const char *,
1840  const array_t *,
1841  const array_t *,
1842  const char *,
1843  config_t *,
1844  char **);
1845 
1846 int
1847 create_config_from_scanner (const char *, const char *, const char *, char **);
1848 
1849 int
1850 copy_config (const char *, const char *, const char *, config_t *);
1851 
1852 int
1853 delete_config (const char *, int);
1854 
1855 int
1856 sync_config (const char *);
1857 
1858 gboolean
1859 find_config_with_permission (const char *, config_t *, const char *);
1860 
1861 char *config_uuid (config_t);
1862 
1863 int config_type (config_t);
1864 
1865 char *
1866 config_nvt_timeout (config_t, const char *);
1867 
1868 void
1869 init_user_config_iterator (iterator_t *, config_t, int, int, const char *);
1870 
1871 int
1873 
1874 const char *
1875 config_iterator_nvt_selector (iterator_t *);
1876 
1877 int
1879 
1880 int
1882 
1883 int
1885 
1886 int
1888 
1889 int
1891 
1892 scanner_t
1894 
1895 int
1897 
1898 char *config_nvt_selector (config_t);
1899 
1900 int config_in_use (config_t);
1901 
1902 int config_writable (config_t);
1903 
1904 int
1905 config_count (const get_data_t *);
1906 
1907 int trash_config_in_use (config_t);
1908 
1909 int trash_config_writable (config_t);
1910 
1911 int
1912 trash_config_readable_uuid (const gchar *);
1913 
1914 int config_families_growing (config_t);
1915 
1916 int config_nvts_growing (config_t);
1917 
1918 int create_task_check_config_scanner (config_t, scanner_t);
1919 
1920 int
1921 modify_task_check_config_scanner (task_t, const char *, const char *);
1922 
1923 int
1924 manage_set_config_preference (const gchar *,
1925  const char *,
1926  const char *,
1927  const char *);
1928 
1929 void
1930 init_preference_iterator (iterator_t *, config_t);
1931 
1932 const char *
1933 preference_iterator_name (iterator_t *);
1934 
1935 const char *
1936 preference_iterator_value (iterator_t *);
1937 
1938 const char *
1939 preference_iterator_type (iterator_t *);
1940 
1941 const char *
1942 preference_iterator_default (iterator_t *);
1943 
1944 const char *
1945 preference_iterator_hr_name (iterator_t *);
1946 
1947 int
1948 manage_set_config (const gchar *, const char *, const char *, const char *);
1949 
1950 int
1951 manage_set_config_nvts (const gchar *, const char *, GPtrArray *);
1952 
1953 int
1954 manage_set_config_families (const gchar *,
1955  GPtrArray *,
1956  GPtrArray *,
1957  GPtrArray *,
1958  int);
1959 
1960 void
1962 
1963 const char *
1964 config_timeout_iterator_oid (iterator_t *);
1965 
1966 const char *
1967 config_timeout_iterator_nvt_name (iterator_t *);
1968 
1969 const char *
1970 config_timeout_iterator_value (iterator_t *);
1971 
1972 void update_config_preference (const char *, const char *, const char *,
1973  const char *, gboolean);
1974 
1975 /* NVT's. */
1976 
1977 char *manage_nvt_name (nvt_t);
1978 
1979 char *
1980 nvt_oid (const char *);
1981 
1982 char *
1984 
1985 void
1986 set_nvts_feed_version (const char *);
1987 
1988 gboolean
1989 find_nvt (const char *, nvt_t *);
1990 
1991 int
1992 init_nvt_info_iterator (iterator_t *, get_data_t *, const char *);
1993 
1994 int
1995 nvt_info_count (const get_data_t *);
1996 
1997 void
1999  nvt_t,
2000  config_t,
2001  const char *,
2002  const char *,
2003  int,
2004  const char *);
2005 
2006 void
2007 init_cve_nvt_iterator (iterator_t *, const char *, int, const char *);
2008 
2009 const char *
2010 nvt_iterator_oid (iterator_t *);
2011 
2012 const char *
2013 nvt_iterator_version (iterator_t *);
2014 
2015 const char *
2016 nvt_iterator_name (iterator_t *);
2017 
2018 const char *
2019 nvt_iterator_description (iterator_t *);
2020 
2021 const char *
2022 nvt_iterator_copyright (iterator_t *);
2023 
2024 const char *
2025 nvt_iterator_cve (iterator_t *);
2026 
2027 const char *
2028 nvt_iterator_bid (iterator_t *);
2029 
2030 const char *
2031 nvt_iterator_xref (iterator_t *);
2032 
2033 const char *
2034 nvt_iterator_tag (iterator_t *);
2035 
2036 int
2038 
2039 const char *
2040 nvt_iterator_family (iterator_t *);
2041 
2042 const char *
2043 nvt_iterator_cvss_base (iterator_t *);
2044 
2045 const char *
2046 nvt_iterator_qod (iterator_t *);
2047 
2048 const char *
2049 nvt_iterator_qod_type (iterator_t *iterator);
2050 
2051 const char *
2052 nvt_iterator_solution_type (iterator_t *);
2053 
2054 char *
2055 nvt_default_timeout (const char *);
2056 
2057 int
2058 family_nvt_count (const char *);
2059 
2060 void
2061 manage_complete_nvt_cache_update (GList *, GList *);
2062 
2063 /* NVT selectors. */
2064 
2068 #define NVT_SELECTOR_TYPE_ALL 0
2069 
2073 #define NVT_SELECTOR_TYPE_FAMILY 1
2074 
2078 #define NVT_SELECTOR_TYPE_NVT 2
2079 
2083 #define NVT_SELECTOR_TYPE_ANY 999
2084 
2085 void
2086 init_family_iterator (iterator_t *, int, const char *, int);
2087 
2088 const char *
2089 family_iterator_name (iterator_t *);
2090 
2091 int
2092 nvt_selector_family_growing (const char *, const char *, int);
2093 
2094 int
2095 nvt_selector_family_count (const char *, int);
2096 
2097 int
2098 nvt_selector_nvt_count (const char *, const char *, int);
2099 
2100 void
2101 init_nvt_selector_iterator (iterator_t *, const char *, config_t, int);
2102 
2103 const char *
2104 nvt_selector_iterator_nvt (iterator_t *);
2105 
2106 const char *
2107 nvt_selector_iterator_name (iterator_t *);
2108 
2109 int
2111 
2112 int
2114 
2115 /* NVT preferences. */
2116 
2117 void
2118 manage_nvt_preference_add (const char *, const char *);
2119 
2120 void
2122 
2123 void
2124 init_nvt_preference_iterator (iterator_t *, const char *);
2125 
2126 const char *
2127 nvt_preference_iterator_name (iterator_t *);
2128 
2129 const char *
2130 nvt_preference_iterator_value (iterator_t *);
2131 
2132 char *
2134 
2135 char *
2137 
2138 char *
2140 
2141 char *
2143 
2144 int
2145 nvt_preference_count (const char *);
2146 
2147 gchar *
2148 get_nvti_xml (iterator_t *, int, int, int, const char *, config_t, int);
2149 
2150 char *
2151 task_preference_value (task_t, const char *);
2152 
2153 int
2154 set_task_preferences (task_t, array_t *);
2155 
2156 void
2158 
2159 const char *
2160 task_group_iterator_name (iterator_t *);
2161 
2162 const char *
2163 task_group_iterator_uuid (iterator_t *);
2164 
2165 void
2167 
2168 const char *
2169 task_role_iterator_name (iterator_t *);
2170 
2171 const char *
2172 task_role_iterator_uuid (iterator_t *);
2173 
2174 /* Credentials. */
2175 
2179 typedef enum
2180 {
2181  CREDENTIAL_FORMAT_NONE = 0,
2182  CREDENTIAL_FORMAT_KEY = 1,
2183  CREDENTIAL_FORMAT_RPM = 2,
2184  CREDENTIAL_FORMAT_DEB = 3,
2185  CREDENTIAL_FORMAT_EXE = 4,
2186  CREDENTIAL_FORMAT_PEM = 5,
2187  CREDENTIAL_FORMAT_ERROR = -1
2188 } credential_format_t;
2189 
2190 gboolean
2191 find_credential_with_permission (const char *, credential_t *, const char *);
2192 
2193 int
2194 create_credential (const char *,
2195  const char *,
2196  const char *,
2197  const char *,
2198  const char *,
2199  const char *,
2200  const char *,
2201  const char *,
2202  const char *,
2203  const char *,
2204  const char *,
2205  const char *,
2206  const char *,
2207  credential_t *);
2208 
2209 int
2210 copy_credential (const char *, const char *, const char *, credential_t *);
2211 
2212 int
2213 modify_credential (const char *,
2214  const char *,
2215  const char *,
2216  const char *,
2217  const char *,
2218  const char *,
2219  const char *,
2220  const char *,
2221  const char *,
2222  const char *,
2223  const char *,
2224  const char *,
2225  const char *);
2226 
2227 int
2228 delete_credential (const char *, int);
2229 
2230 int
2231 credential_count (const get_data_t *);
2232 
2233 void
2234 set_credential_privacy_algorithm (credential_t, const char *);
2235 
2236 void
2237 set_credential_public_key (credential_t, const char *);
2238 
2239 void
2240 init_credential_iterator_one (iterator_t *, credential_t);
2241 
2242 int
2244 
2245 const char *
2246 credential_iterator_login (iterator_t *);
2247 
2248 const char *
2249 credential_iterator_auth_algorithm (iterator_t *);
2250 
2251 const char *
2252 credential_iterator_privacy_algorithm (iterator_t *);
2253 
2254 const char *
2256 
2257 const char *
2259 
2260 const char *
2262 
2263 const char *
2264 credential_iterator_public_key (iterator_t *);
2265 
2266 const char *
2268 
2269 const char *
2270 credential_iterator_type (iterator_t *);
2271 
2272 int
2274 
2275 const char *
2276 credential_full_type (const char *);
2277 
2278 char *
2280 
2281 char *
2283 
2284 char *
2286 
2287 const char *
2288 credential_iterator_certificate (iterator_t *);
2289 
2290 gboolean
2291 credential_iterator_format_available (iterator_t *, credential_format_t);
2292 
2293 gchar *
2295 
2296 char *credential_uuid (credential_t);
2297 
2298 char *trash_credential_uuid (credential_t);
2299 
2300 char *credential_name (credential_t);
2301 
2302 char *trash_credential_name (credential_t);
2303 
2304 char *credential_type (credential_t);
2305 
2306 void
2307 init_credential_target_iterator (iterator_t *, credential_t, int);
2308 
2309 const char *
2310 credential_target_iterator_uuid (iterator_t *);
2311 
2312 const char *
2313 credential_target_iterator_name (iterator_t *);
2314 
2315 int
2317 
2318 void
2319 init_credential_scanner_iterator (iterator_t *, credential_t, int);
2320 
2321 const char *
2322 credential_scanner_iterator_uuid (iterator_t *);
2323 
2324 const char *
2325 credential_scanner_iterator_name (iterator_t *);
2326 
2327 int
2329 
2330 int trash_credential_in_use (credential_t);
2331 
2332 int credential_in_use (credential_t);
2333 
2334 int trash_credential_writable (credential_t);
2335 
2336 int credential_writable (credential_t);
2337 
2338 int trash_credential_readable (credential_t);
2339 
2340 gchar *
2341 credential_value (credential_t, const char *);
2342 
2343 gchar *
2344 credential_encrypted_value (credential_t, const char *);
2345 
2346 /* Agents. */
2347 
2348 int
2349 create_agent (const char *,
2350  const char *,
2351  const char *,
2352  const char *,
2353  const char *,
2354  const char *,
2355  const char *,
2356  agent_t *);
2357 
2358 int
2359 copy_agent (const char *, const char *, const char *, agent_t *);
2360 
2361 int
2362 modify_agent (const char *, const char *, const char *);
2363 
2364 int
2365 delete_agent (const char *, int);
2366 
2367 int agent_in_use (agent_t);
2368 
2369 int trash_agent_in_use (agent_t);
2370 
2371 int trash_agent_writable (agent_t);
2372 
2373 int agent_writable (agent_t);
2374 
2375 int
2376 verify_agent (const char *);
2377 
2378 char *agent_uuid (agent_t);
2379 
2380 int
2381 agent_count (const get_data_t *);
2382 
2383 int
2385 
2386 const char *
2387 agent_iterator_installer_64 (iterator_t *);
2388 
2389 const char *
2390 agent_iterator_installer_filename (iterator_t *);
2391 
2392 const char *
2394 
2395 time_t
2397 
2398 const char *
2399 agent_iterator_howto_install (iterator_t *);
2400 
2401 const char *
2402 agent_iterator_howto_use (iterator_t *);
2403 
2404 /* Assets. */
2405 
2406 char *
2407 result_host_asset_id (const char *, result_t);
2408 
2409 char *host_uuid (resource_t);
2410 
2411 host_t
2412 host_notice (const char *,
2413  const char *,
2414  const char *,
2415  const char *,
2416  const char *,
2417  int,
2418  int);
2419 
2420 void
2421 init_host_identifier_iterator (iterator_t *, host_t, int, const char *);
2422 
2423 const char *
2424 host_identifier_iterator_value (iterator_t *);
2425 
2426 const char *
2427 host_identifier_iterator_source_type (iterator_t *);
2428 
2429 const char *
2430 host_identifier_iterator_source_id (iterator_t *);
2431 
2432 const char *
2433 host_identifier_iterator_source_data (iterator_t *);
2434 
2435 int
2436 host_identifier_iterator_source_orphan (iterator_t *);
2437 
2438 const char *
2439 host_identifier_iterator_os_id (iterator_t *);
2440 
2441 const char *
2442 host_identifier_iterator_os_title (iterator_t *);
2443 
2444 int
2445 init_asset_host_iterator (iterator_t *, const get_data_t *);
2446 
2447 int
2448 asset_iterator_writable (iterator_t *);
2449 
2450 int
2451 asset_iterator_in_use (iterator_t *);
2452 
2453 const char *
2454 asset_host_iterator_severity (iterator_t *);
2455 
2456 int
2457 asset_host_count (const get_data_t *);
2458 
2459 int
2460 init_asset_os_iterator (iterator_t *, const get_data_t *);
2461 
2462 const char *
2463 asset_os_iterator_title (iterator_t *);
2464 
2465 int
2466 asset_os_iterator_installs (iterator_t *);
2467 
2468 const char *
2469 asset_os_iterator_latest_severity (iterator_t *);
2470 
2471 const char *
2472 asset_os_iterator_highest_severity (iterator_t *);
2473 
2474 const char *
2475 asset_os_iterator_average_severity (iterator_t *);
2476 
2477 int
2478 asset_os_count (const get_data_t *);
2479 
2480 int
2481 total_asset_count (const get_data_t *);
2482 
2483 void
2484 init_os_host_iterator (iterator_t *, resource_t);
2485 
2486 const char *
2487 os_host_iterator_severity (iterator_t *);
2488 
2489 void
2490 init_host_detail_iterator (iterator_t *, resource_t);
2491 
2492 const char *
2493 host_detail_iterator_name (iterator_t *);
2494 
2495 const char *
2496 host_detail_iterator_value (iterator_t *);
2497 
2498 const char *
2499 host_detail_iterator_source_type (iterator_t *);
2500 
2501 const char *
2502 host_detail_iterator_source_id (iterator_t *);
2503 
2504 int
2505 modify_asset (const char *, const char *);
2506 
2507 int
2508 delete_asset (const char *, const char *, int);
2509 
2510 int
2511 create_asset_report (const char *, const char *);
2512 
2513 int
2514 create_asset_host (const char *, const char *, resource_t *);
2515 
2516 /* Notes. */
2517 
2518 gboolean
2519 find_note_with_permission (const char *, note_t *, const char *);
2520 
2521 int
2522 create_note (const char *,
2523  const char *,
2524  const char *,
2525  const char *,
2526  const char *,
2527  const char *,
2528  const char *,
2529  task_t,
2530  result_t,
2531  note_t *);
2532 
2533 int
2534 copy_note (const char *, note_t *);
2535 
2536 int
2537 delete_note (const char *, int);
2538 
2539 int
2540 note_uuid (note_t, char **);
2541 
2542 int
2543 modify_note (const gchar *,
2544  const char *,
2545  const char *,
2546  const char *,
2547  const char *,
2548  const char *,
2549  const char *,
2550  const char *,
2551  const gchar *,
2552  const gchar *);
2553 
2554 int
2555 note_count (const get_data_t *, nvt_t, result_t, task_t);
2556 
2557 int
2558 init_note_iterator (iterator_t *, const get_data_t *, nvt_t, result_t, task_t);
2559 
2560 const char *
2561 note_iterator_nvt_oid (iterator_t *);
2562 
2563 time_t
2564 note_iterator_creation_time (iterator_t *);
2565 
2566 time_t
2567 note_iterator_modification_time (iterator_t *);
2568 
2569 const char *
2570 note_iterator_text (iterator_t *);
2571 
2572 const char *
2573 note_iterator_hosts (iterator_t *);
2574 
2575 const char *
2576 note_iterator_port (iterator_t *);
2577 
2578 const char *
2580 
2581 task_t
2583 
2584 result_t
2586 
2587 time_t
2589 
2590 int
2592 
2593 const char *
2594 note_iterator_nvt_name (iterator_t *);
2595 
2596 const char *
2598 
2599 const char *
2600 note_iterator_severity (iterator_t *);
2601 
2602 /* Overrides. */
2603 
2604 gboolean
2605 find_override_with_permission (const char *, override_t *, const char *);
2606 
2607 int
2608 create_override (const char *,
2609  const char *,
2610  const char *,
2611  const char *,
2612  const char *,
2613  const char *,
2614  const char *,
2615  const char *,
2616  const char *,
2617  task_t,
2618  result_t,
2619  override_t *);
2620 
2621 int
2622 override_uuid (override_t, char **);
2623 
2624 int
2625 copy_override (const char *, override_t *);
2626 
2627 int
2628 delete_override (const char *, int);
2629 
2630 int
2631 modify_override (const gchar *,
2632  const char *,
2633  const char *,
2634  const char *,
2635  const char *,
2636  const char *,
2637  const char *,
2638  const char *,
2639  const char *,
2640  const char *,
2641  const gchar *,
2642  const gchar *);
2643 
2644 int
2645 override_count (const get_data_t *, nvt_t, result_t, task_t);
2646 
2647 int
2649  const get_data_t *,
2650  nvt_t,
2651  result_t,
2652  task_t);
2653 
2654 const char *
2655 override_iterator_nvt_oid (iterator_t *);
2656 
2657 time_t
2658 override_iterator_creation_time (iterator_t *);
2659 
2660 time_t
2661 override_iterator_modification_time (iterator_t *);
2662 
2663 const char *
2664 override_iterator_text (iterator_t *);
2665 
2666 const char *
2667 override_iterator_hosts (iterator_t *);
2668 
2669 const char *
2670 override_iterator_port (iterator_t *);
2671 
2672 const char *
2674 
2675 const char *
2677 
2678 task_t
2680 
2681 result_t
2683 
2684 time_t
2686 
2687 int
2689 
2690 const char *
2691 override_iterator_nvt_name (iterator_t *);
2692 
2693 const char *
2695 
2696 const char *
2697 override_iterator_severity (iterator_t *);
2698 
2699 const char *
2700 override_iterator_new_severity (iterator_t *);
2701 
2702 /* Scanner messaging. */
2703 
2704 int
2705 acknowledge_bye ();
2706 
2707 int
2709 
2710 int
2712 
2713 /* System reports. */
2714 
2718 typedef struct
2719 {
2720  gchar **start;
2721  gchar **current;
2723 
2724 int
2726  const char *,
2727  const char *);
2728 
2729 void
2731 
2732 gboolean
2734 
2735 const char *
2737 
2738 const char *
2740 
2741 int
2742 manage_system_report (const char *,
2743  const char *,
2744  const char *,
2745  const char *,
2746  const char *,
2747  char **);
2748 
2749 
2750 /* Scanners. */
2751 
2755 #define SLAVE_COMMIT_SIZE_DEFAULT 0
2756 
2757 int
2758 manage_create_scanner (GSList *,
2759  const char *,
2760  const char *,
2761  const char *,
2762  const char *,
2763  const char *,
2764  const char *,
2765  const char *,
2766  const char *);
2767 
2768 int
2769 manage_modify_scanner (GSList *,
2770  const gchar *,
2771  const char *,
2772  const char *,
2773  const char *,
2774  const char *,
2775  const char *,
2776  const char *,
2777  const char *,
2778  const char *);
2779 
2780 int
2781 manage_delete_scanner (GSList *, const gchar *, const gchar *);
2782 
2783 int
2784 manage_verify_scanner (GSList *, const gchar *, const gchar *);
2785 
2786 int
2787 manage_get_scanners (GSList *, const gchar *);
2788 
2789 int
2790 create_scanner (const char *,
2791  const char *,
2792  const char *,
2793  const char *,
2794  const char *,
2795  scanner_t *,
2796  const char *,
2797  const char *);
2798 
2799 int
2800 copy_scanner (const char *, const char *, const char *, scanner_t *);
2801 
2802 int
2803 modify_scanner (const char *,
2804  const char *,
2805  const char *,
2806  const char *,
2807  const char *,
2808  const char *,
2809  const char *,
2810  const char *);
2811 
2812 int
2813 delete_scanner (const char *, int);
2814 
2815 gboolean
2816 find_scanner_with_permission (const char *, scanner_t *, const char *);
2817 
2818 int scanner_in_use (scanner_t);
2819 
2820 int trash_scanner_readable (scanner_t);
2821 
2822 int trash_scanner_in_use (scanner_t);
2823 
2824 int trash_scanner_writable (scanner_t);
2825 
2826 int scanner_writable (scanner_t);
2827 
2828 const char *
2830 
2831 char *scanner_host (scanner_t);
2832 
2833 int scanner_port (scanner_t);
2834 
2835 int scanner_type (scanner_t);
2836 
2837 char *scanner_ca_pub (scanner_t);
2838 
2839 char *scanner_key_pub (scanner_t);
2840 
2841 char *scanner_key_priv (scanner_t);
2842 
2843 char *scanner_login (scanner_t);
2844 
2845 char *scanner_password (scanner_t);
2846 
2847 int
2848 scanner_count (const get_data_t *);
2849 
2850 int
2852 
2853 const char *
2854 scanner_iterator_host (iterator_t *);
2855 
2856 int
2858 
2859 int
2861 
2862 const char *
2863 scanner_iterator_credential_name (iterator_t *);
2864 
2865 credential_t
2867 
2868 int
2870 
2871 const char *
2872 scanner_iterator_ca_pub (iterator_t *);
2873 
2874 const char *
2875 scanner_iterator_key_pub (iterator_t *);
2876 
2877 const char *
2878 scanner_iterator_credential_type (iterator_t *);
2879 
2880 void
2882 
2883 const char *
2884 scanner_config_iterator_uuid (iterator_t *);
2885 
2886 const char *
2887 scanner_config_iterator_name (iterator_t *);
2888 
2889 int
2891 
2892 void
2893 init_scanner_task_iterator (iterator_t *, scanner_t);
2894 
2895 const char *
2896 scanner_task_iterator_uuid (iterator_t *);
2897 
2898 const char *
2899 scanner_task_iterator_name (iterator_t *);
2900 
2901 int
2903 
2904 char *scanner_name (scanner_t);
2905 
2906 char *scanner_uuid (scanner_t);
2907 
2908 char *trash_scanner_name (scanner_t);
2909 
2910 char *trash_scanner_uuid (scanner_t);
2911 
2912 int
2914  char **,
2915  char **,
2916  char **,
2917  char **,
2918  char **,
2919  char **);
2920 
2921 int
2922 osp_get_details_from_iterator (iterator_t *, char **, GSList **);
2923 
2924 osp_connection_t *osp_scanner_connect (scanner_t);
2925 
2926 int
2927 verify_scanner (const char *, char **);
2928 
2929 void
2930 set_slave_commit_size (int);
2931 
2932 /* Scheduling. */
2933 
2937 #define SCHEDULE_PERIOD 10
2938 
2943 #define SCHEDULE_TIMEOUT_MIN_SECS 20
2944 
2948 #define SCHEDULE_TIMEOUT_DEFAULT 60
2949 
2950 gboolean
2951 find_schedule_with_permission (const char *, schedule_t *, const char *);
2952 
2953 int
2954 create_schedule (const char *,
2955  const char *,
2956  const char *,
2957  time_t,
2958  time_t,
2959  time_t,
2960  const char *,
2961  time_t,
2962  const char *,
2963  schedule_t *,
2964  gchar **);
2965 
2966 int
2967 copy_schedule (const char *, const char *, const char *, schedule_t *);
2968 
2969 int
2970 delete_schedule (const char *, int);
2971 
2972 void
2973 manage_auth_allow_all (int);
2974 
2975 const gchar *
2977 
2978 void
2979 set_scheduled_user_uuid (const gchar *uuid);
2980 
2981 void
2982 manage_sync (sigset_t *, int (*fork_update_nvt_cache) ());
2983 
2984 int
2985 manage_schedule (manage_connection_forker_t, gboolean, sigset_t *);
2986 
2987 char *schedule_uuid (schedule_t);
2988 
2989 char *schedule_name (schedule_t);
2990 
2991 int schedule_duration (schedule_t);
2992 
2993 int schedule_period (schedule_t);
2994 
2995 int
2996 schedule_info (schedule_t,
2997  int,
2998  time_t *,
2999  time_t *,
3000  int *,
3001  int *,
3002  int *,
3003  gchar **,
3004  gchar **);
3005 
3006 int
3008 
3009 time_t
3011 
3012 time_t
3014 
3015 time_t
3017 
3018 time_t
3020 
3021 time_t
3023 
3024 int
3025 schedule_iterator_byday (iterator_t *);
3026 
3027 gchar *
3029 
3030 const char *
3031 schedule_iterator_timezone (iterator_t *);
3032 
3033 time_t
3034 schedule_iterator_initial_offset (iterator_t *);
3035 
3036 const char *
3037 schedule_iterator_icalendar (iterator_t *);
3038 
3039 int trash_schedule_in_use (schedule_t);
3040 
3041 int schedule_in_use (schedule_t);
3042 
3043 int trash_schedule_writable (schedule_t);
3044 
3045 int trash_schedule_readable (schedule_t);
3046 
3047 int schedule_writable (schedule_t);
3048 
3049 int
3050 schedule_count (const get_data_t *);
3051 
3052 void
3053 init_schedule_task_iterator (iterator_t *, schedule_t);
3054 
3055 const char *
3056 schedule_task_iterator_uuid (iterator_t *);
3057 
3058 const char *
3059 schedule_task_iterator_name (iterator_t *);
3060 
3061 int
3063 
3064 int
3065 modify_schedule (const char *,
3066  const char *,
3067  const char *,
3068  const char *,
3069  time_t,
3070  time_t,
3071  time_t,
3072  const char *,
3073  time_t,
3074  const char *,
3075  gchar **);
3076 
3077 int
3079 
3080 void
3081 set_schedule_timeout (int);
3082 
3083 /* Report Formats. */
3084 
3085 gboolean
3087  report_format_t *,
3088  const char *);
3089 
3093 typedef struct
3094 {
3095  gchar *fallback;
3096  gchar *name;
3097  gchar *type;
3098  gchar *type_max;
3099  gchar *type_min;
3100  gchar *value;
3102 
3103 int
3104 create_report_format (const char *,
3105  const char *,
3106  const char *,
3107  const char *,
3108  const char *,
3109  const char *,
3110  int,
3111  array_t *,
3112  array_t *,
3113  array_t *,
3114  const char *,
3115  report_format_t *);
3116 
3117 int
3118 copy_report_format (const char *, const char *, report_format_t *);
3119 
3120 int
3121 modify_report_format (const char *,
3122  const char *,
3123  const char *,
3124  const char *,
3125  const char *,
3126  const char *,
3127  const char *);
3128 
3129 int
3130 delete_report_format (const char *, int);
3131 
3132 int
3133 verify_report_format (const char *);
3134 
3135 char *report_format_uuid (report_format_t);
3136 
3137 char *report_format_owner_uuid (report_format_t);
3138 
3139 char *report_format_name (report_format_t);
3140 
3141 char *report_format_content_type (report_format_t);
3142 
3143 char *report_format_extension (report_format_t);
3144 
3145 int report_format_global (report_format_t);
3146 
3147 int trash_report_format_global (report_format_t);
3148 
3149 int report_format_predefined (report_format_t);
3150 
3151 int report_format_active (report_format_t);
3152 
3153 int report_format_trust (report_format_t);
3154 
3155 int report_format_in_use (report_format_t);
3156 
3157 int trash_report_format_in_use (report_format_t);
3158 
3159 int trash_report_format_writable (report_format_t);
3160 
3161 int report_format_writable (report_format_t);
3162 
3163 int
3164 report_format_count (const get_data_t *);
3165 
3166 int
3167 init_report_format_iterator (iterator_t *, const get_data_t *);
3168 
3169 const char *
3170 report_format_iterator_extension (iterator_t *);
3171 
3172 const char *
3173 report_format_iterator_content_type (iterator_t *);
3174 
3175 const char *
3176 report_format_iterator_description (iterator_t *);
3177 
3178 int
3179 report_format_iterator_active (iterator_t *);
3180 
3181 const char *
3182 report_format_iterator_signature (iterator_t *);
3183 
3184 const char *
3185 report_format_iterator_trust (iterator_t *);
3186 
3187 const char *
3188 report_format_iterator_summary (iterator_t *);
3189 
3190 time_t
3191 report_format_iterator_trust_time (iterator_t *);
3192 
3193 void
3194 init_report_format_alert_iterator (iterator_t *, report_format_t);
3195 
3196 const char *
3197 report_format_alert_iterator_name (iterator_t *);
3198 
3199 const char *
3200 report_format_alert_iterator_uuid (iterator_t *);
3201 
3202 int
3203 report_format_alert_iterator_readable (iterator_t *);
3204 
3208 typedef struct
3209 {
3210  GPtrArray *start;
3211  gpointer *current;
3212  gchar *dir_name;
3213 } file_iterator_t;
3214 
3215 int
3217 
3218 void
3220 
3221 gboolean
3223 
3224 const char *
3226 
3227 gchar *
3229 
3236 typedef enum
3237 {
3238  REPORT_FORMAT_PARAM_TYPE_BOOLEAN = 0,
3239  REPORT_FORMAT_PARAM_TYPE_INTEGER = 1,
3240  REPORT_FORMAT_PARAM_TYPE_SELECTION = 2,
3241  REPORT_FORMAT_PARAM_TYPE_STRING = 3,
3242  REPORT_FORMAT_PARAM_TYPE_TEXT = 4,
3243  REPORT_FORMAT_PARAM_TYPE_REPORT_FORMAT_LIST = 5,
3244  REPORT_FORMAT_PARAM_TYPE_ERROR = 100
3245 } report_format_param_type_t;
3246 
3247 const char *report_format_param_type_name (report_format_param_type_t);
3248 
3249 report_format_param_type_t
3250 report_format_param_type_from_name (const char *);
3251 
3252 void
3253 init_report_format_param_iterator (iterator_t *,
3254  report_format_t,
3255  int,
3256  int,
3257  const char *);
3258 
3259 report_format_param_t
3260 report_format_param_iterator_param (iterator_t *);
3261 
3262 const char *
3263 report_format_param_iterator_name (iterator_t *);
3264 
3265 const char *
3266 report_format_param_iterator_value (iterator_t *);
3267 
3268 const char *
3269 report_format_param_iterator_type_name (iterator_t *);
3270 
3271 report_format_param_type_t
3272 report_format_param_iterator_type (iterator_t *);
3273 
3274 long long int
3275 report_format_param_iterator_type_min (iterator_t *);
3276 
3277 long long int
3278 report_format_param_iterator_type_max (iterator_t *);
3279 
3280 const char *
3281 report_format_param_iterator_fallback (iterator_t *);
3282 
3283 void
3284 init_param_option_iterator (iterator_t *,
3285  report_format_param_t,
3286  int,
3287  const char *);
3288 
3289 const char *
3290 param_option_iterator_value (iterator_t *);
3291 
3292 /* Groups. */
3293 
3294 int
3295 init_group_iterator (iterator_t *, const get_data_t *);
3296 
3297 int
3298 copy_group (const char *, const char *, const char *, group_t *);
3299 
3300 int
3301 create_group (const char *, const char *, const char *, int, group_t *);
3302 
3303 int
3304 delete_group (const char *, int);
3305 
3306 char *group_uuid (group_t);
3307 
3308 gchar *group_users (group_t);
3309 
3310 int trash_group_in_use (group_t);
3311 
3312 int group_in_use (group_t);
3313 
3314 int trash_group_writable (group_t);
3315 
3316 int group_writable (group_t);
3317 
3318 int
3319 group_count (const get_data_t *);
3320 
3321 int
3322 modify_group (const char *, const char *, const char *, const char *);
3323 
3324 /* Permissions. */
3325 
3326 int
3327 create_permission (const char *,
3328  const char *,
3329  const char *,
3330  const char *,
3331  const char *,
3332  const char *,
3333  permission_t *);
3334 
3335 int
3336 copy_permission (const char *, const char *, permission_t *);
3337 
3338 char *permission_uuid (permission_t);
3339 
3340 int
3341 permission_is_admin (const char *);
3342 
3343 int permission_in_use (permission_t);
3344 
3345 int trash_permission_in_use (permission_t);
3346 
3347 int permission_writable (permission_t);
3348 
3349 int trash_permission_writable (permission_t);
3350 
3351 int
3352 permission_count (const get_data_t *);
3353 
3354 int
3355 init_permission_iterator (iterator_t *, const get_data_t *);
3356 
3357 const char *
3358 permission_iterator_resource_type (iterator_t *);
3359 
3360 const char *
3361 permission_iterator_resource_uuid (iterator_t *);
3362 
3363 const char *
3364 permission_iterator_resource_name (iterator_t *);
3365 
3366 int
3367 permission_iterator_resource_in_trash (iterator_t *);
3368 
3369 int
3370 permission_iterator_resource_orphan (iterator_t *);
3371 
3372 int
3373 permission_iterator_resource_readable (iterator_t *);
3374 
3375 const char *
3376 permission_iterator_subject_type (iterator_t *);
3377 
3378 const char *
3379 permission_iterator_subject_uuid (iterator_t *);
3380 
3381 const char *
3382 permission_iterator_subject_name (iterator_t *);
3383 
3384 int
3385 permission_iterator_subject_in_trash (iterator_t *);
3386 
3387 int
3388 permission_iterator_subject_readable (iterator_t *);
3389 
3390 int
3391 delete_permission (const char *, int);
3392 
3393 int
3394 modify_permission (const char *,
3395  const char *,
3396  const char *,
3397  const char *,
3398  const char *,
3399  const char *,
3400  const char *);
3401 
3402 /* Permission caching */
3403 
3404 void
3405 delete_permissions_cache_for_resource (const char *, resource_t);
3406 
3407 void delete_permissions_cache_for_user (user_t);
3408 
3409 /* Port lists. */
3410 
3411 gboolean
3412 find_port_list (const char *, port_list_t *);
3413 
3414 gboolean
3415 find_port_list_with_permission (const char *, port_list_t *, const char *);
3416 
3417 gboolean
3418 find_port_range (const char *, port_list_t *);
3419 
3420 int
3421 create_port_list (const char *,
3422  const char *,
3423  const char *,
3424  const char *,
3425  array_t *,
3426  port_list_t *);
3427 
3428 int
3429 copy_port_list (const char *, const char *, const char *, port_list_t *);
3430 
3431 int
3432 modify_port_list (const char *, const char *, const char *);
3433 
3434 int
3435 create_port_range (const char *,
3436  const char *,
3437  const char *,
3438  const char *,
3439  const char *,
3440  port_range_t *);
3441 
3442 int
3443 delete_port_list (const char *, int);
3444 
3445 int
3446 delete_port_range (const char *, int);
3447 
3448 int
3449 port_list_count (const get_data_t *);
3450 
3451 int
3452 init_port_list_iterator (iterator_t *, const get_data_t *);
3453 
3454 int
3455 port_list_iterator_count_all (iterator_t *);
3456 
3457 int
3458 port_list_iterator_count_tcp (iterator_t *);
3459 
3460 int
3461 port_list_iterator_count_udp (iterator_t *);
3462 
3463 char *port_list_uuid (port_list_t);
3464 
3465 char *port_range_uuid (port_range_t);
3466 
3467 int port_list_in_use (port_list_t);
3468 
3469 int trash_port_list_in_use (port_list_t);
3470 
3471 int trash_port_list_writable (port_list_t);
3472 
3473 int port_list_writable (port_list_t);
3474 
3475 #if 0
3476 int
3477 trash_port_list_in_use (port_list_t);
3478 #endif
3479 
3480 int
3481 trash_port_list_readable_uuid (const gchar *);
3482 
3483 void
3484 init_port_range_iterator (iterator_t *, port_range_t, int, int, const char *);
3485 
3486 const char *
3487 port_range_iterator_uuid (iterator_t *);
3488 
3489 const char *
3490 port_range_iterator_comment (iterator_t *);
3491 
3492 const char *
3493 port_range_iterator_start (iterator_t *);
3494 
3495 const char *
3496 port_range_iterator_end (iterator_t *);
3497 
3498 const char *
3499 port_range_iterator_type (iterator_t *);
3500 
3501 void
3502 init_port_list_target_iterator (iterator_t *, port_list_t, int);
3503 
3504 const char *
3505 port_list_target_iterator_uuid (iterator_t *);
3506 
3507 const char *
3508 port_list_target_iterator_name (iterator_t *);
3509 
3510 int
3511 port_list_target_iterator_readable (iterator_t *);
3512 
3513 /* Roles. */
3514 
3515 int
3516 init_role_iterator (iterator_t *, const get_data_t *);
3517 
3518 int
3519 copy_role (const char *, const char *, const char *, role_t *);
3520 
3521 int
3522 create_role (const char *, const char *, const char *, role_t *);
3523 
3524 int
3525 delete_role (const char *, int);
3526 
3527 char *role_uuid (role_t);
3528 
3529 gchar *role_users (role_t);
3530 
3531 int trash_role_in_use (role_t);
3532 
3533 int role_in_use (role_t);
3534 
3535 int trash_role_writable (role_t);
3536 
3537 int role_writable (role_t);
3538 
3539 int
3540 role_count (const get_data_t *);
3541 
3542 int
3543 modify_role (const char *, const char *, const char *, const char *);
3544 
3545 /* Filter Utilities. */
3546 
3550 typedef enum
3551 {
3552  KEYWORD_TYPE_UNKNOWN,
3553  KEYWORD_TYPE_INTEGER,
3554  KEYWORD_TYPE_DOUBLE,
3555  KEYWORD_TYPE_STRING
3556 } keyword_type_t;
3557 
3561 typedef enum
3562 {
3563  KEYWORD_RELATION_APPROX,
3564  KEYWORD_RELATION_COLUMN_ABOVE,
3565  KEYWORD_RELATION_COLUMN_APPROX,
3566  KEYWORD_RELATION_COLUMN_EQUAL,
3567  KEYWORD_RELATION_COLUMN_BELOW,
3568  KEYWORD_RELATION_COLUMN_REGEXP
3569 } keyword_relation_t;
3570 
3574 struct keyword
3575 {
3576  gchar *column;
3577  int equal;
3579  double double_value;
3580  int quoted;
3581  gchar *string;
3582  keyword_type_t type;
3583  keyword_relation_t relation;
3584 };
3585 
3589 typedef struct keyword keyword_t;
3590 
3591 int
3593 
3594 const char *keyword_relation_symbol (keyword_relation_t);
3595 
3596 void
3597 filter_free (array_t *);
3598 
3599 array_t *
3600 split_filter (const gchar *);
3601 
3602 /* Filters. */
3603 
3604 gboolean
3605 find_filter (const char *, filter_t *);
3606 
3607 gboolean
3608 find_filter_with_permission (const char *, filter_t *, const char *);
3609 
3610 char *filter_uuid (filter_t);
3611 
3612 char *filter_name (filter_t);
3613 
3614 gchar *
3615 filter_term (const char *);
3616 
3617 gchar *
3618 filter_term_value (const char *, const char *);
3619 
3620 int
3621 filter_term_apply_overrides (const char *);
3622 
3623 int
3624 filter_term_autofp (const char *);
3625 
3626 int
3627 filter_term_min_qod (const char *);
3628 
3629 int
3630 create_filter (const char *,
3631  const char *,
3632  const char *,
3633  const char *,
3634  filter_t *);
3635 
3636 int
3637 copy_filter (const char *, const char *, const char *, filter_t *);
3638 
3639 int
3640 delete_filter (const char *, int);
3641 
3642 int trash_filter_in_use (filter_t);
3643 
3644 int filter_in_use (filter_t);
3645 
3646 int trash_filter_writable (filter_t);
3647 
3648 int filter_writable (filter_t);
3649 
3650 int
3651 filter_count (const get_data_t *);
3652 
3653 int
3654 init_filter_iterator (iterator_t *, const get_data_t *);
3655 
3656 const char *
3657 filter_iterator_type (iterator_t *);
3658 
3659 const char *
3660 filter_iterator_term (iterator_t *);
3661 
3662 void
3663 init_filter_alert_iterator (iterator_t *, filter_t);
3664 
3665 const char *
3666 filter_alert_iterator_name (iterator_t *);
3667 
3668 const char *
3669 filter_alert_iterator_uuid (iterator_t *);
3670 
3671 int
3672 filter_alert_iterator_readable (iterator_t *);
3673 
3674 int
3675 modify_filter (const char *,
3676  const char *,
3677  const char *,
3678  const char *,
3679  const char *);
3680 
3681 /* Schema. */
3682 
3683 int
3684 manage_schema (gchar *, gchar **, gsize *, gchar **, gchar **);
3685 
3686 /* Trashcan. */
3687 
3688 int
3689 manage_restore (const char *);
3690 
3691 int
3692 manage_empty_trashcan ();
3693 
3694 /* Scanner tags. */
3695 
3696 void
3697 parse_tags (const char *, gchar **, gchar **);
3698 
3699 /* SecInfo */
3700 
3701 int
3702 manage_read_info (gchar *, gchar *, gchar *, gchar **);
3703 
3704 int
3705 info_name_count (const gchar *, const gchar *);
3706 
3707 /* SCAP. */
3708 
3709 int
3711 
3712 const char *
3714 
3715 /* CPE. */
3716 
3717 void
3718 init_cpe_cve_iterator (iterator_t *, const char *, int, const char *);
3719 
3720 int
3721 init_cpe_info_iterator (iterator_t *, get_data_t *, const char *);
3722 
3723 int
3724 cpe_info_count (const get_data_t *get);
3725 
3726 const char *
3727 cpe_info_iterator_title (iterator_t *);
3728 
3729 const char *
3730 cpe_info_iterator_status (iterator_t *);
3731 
3732 const char *
3733 cpe_info_iterator_max_cvss (iterator_t *);
3734 
3735 const char *
3736 cpe_info_iterator_deprecated_by_id (iterator_t *);
3737 
3738 const char *
3739 cpe_info_iterator_cve_refs (iterator_t *);
3740 
3741 const char *
3742 cpe_info_iterator_nvd_id (iterator_t *);
3743 
3744 /* CVE. */
3745 
3746 const char *
3747 cve_iterator_name (iterator_t *);
3748 
3749 const char *
3750 cve_iterator_cvss (iterator_t *);
3751 
3752 const char *
3753 cve_info_iterator_cvss (iterator_t *);
3754 
3755 const char *
3756 cve_info_iterator_vector (iterator_t *);
3757 
3758 const char *
3759 cve_info_iterator_complexity (iterator_t *);
3760 
3761 const char *
3762 cve_info_iterator_authentication (iterator_t *);
3763 
3764 const char *
3765 cve_info_iterator_confidentiality_impact (iterator_t *);
3766 
3767 const char *
3768 cve_info_iterator_integrity_impact (iterator_t *);
3769 
3770 const char *
3771 cve_info_iterator_availability_impact (iterator_t *);
3772 
3773 const char *
3774 cve_info_iterator_description (iterator_t *);
3775 
3776 const char *
3777 cve_info_iterator_products (iterator_t *);
3778 
3779 int
3780 init_cve_info_iterator (iterator_t *, get_data_t *, const char *);
3781 
3782 int
3783 cve_info_count (const get_data_t *get);
3784 
3785 gchar *
3786 cve_cvss_base (const gchar *);
3787 
3788 /* OVAL definitions */
3789 int
3790 init_ovaldef_info_iterator (iterator_t *, get_data_t *, const char *);
3791 
3792 int
3793 ovaldef_info_count (const get_data_t *get);
3794 
3795 const char *
3796 ovaldef_info_iterator_version (iterator_t *);
3797 
3798 const char *
3799 ovaldef_info_iterator_deprecated (iterator_t *);
3800 
3801 const char *
3802 ovaldef_info_iterator_class (iterator_t *);
3803 
3804 const char *
3805 ovaldef_info_iterator_title (iterator_t *);
3806 
3807 const char *
3808 ovaldef_info_iterator_description (iterator_t *);
3809 
3810 const char *
3811 ovaldef_info_iterator_file (iterator_t *);
3812 
3813 const char *
3814 ovaldef_info_iterator_status (iterator_t *);
3815 
3816 const char *
3817 ovaldef_info_iterator_max_cvss (iterator_t *);
3818 
3819 const char *
3820 ovaldef_info_iterator_cve_refs (iterator_t *);
3821 
3822 char *
3823 ovaldef_severity (const char *);
3824 
3825 char *
3826 ovaldef_version (const char *);
3827 
3828 char *
3829 ovaldef_uuid (const char *, const char *);
3830 
3831 char *
3832 ovaldef_cves (const char *);
3833 
3834 /* CERT data */
3835 int
3837 
3838 /* CERT-Bund */
3839 
3840 int
3842 
3843 int
3845 
3846 const char *
3847 cert_bund_adv_info_iterator_title (iterator_t *);
3848 
3849 const char *
3850 cert_bund_adv_info_iterator_summary (iterator_t *);
3851 
3852 const char *
3853 cert_bund_adv_info_iterator_cve_refs (iterator_t *);
3854 
3855 const char *
3856 cert_bund_adv_info_iterator_max_cvss (iterator_t *);
3857 
3858 void
3859 init_cve_cert_bund_adv_iterator (iterator_t *, const char *, int, const char *);
3860 
3861 void
3862 init_nvt_cert_bund_adv_iterator (iterator_t *, const char *, int, const char *);
3863 
3864 /* DFN-CERT */
3865 
3866 int
3868 
3869 int
3870 dfn_cert_adv_info_count (const get_data_t *get);
3871 
3872 const char *
3873 dfn_cert_adv_info_iterator_title (iterator_t *);
3874 
3875 const char *
3876 dfn_cert_adv_info_iterator_summary (iterator_t *);
3877 
3878 const char *
3879 dfn_cert_adv_info_iterator_cve_refs (iterator_t *);
3880 
3881 const char *
3882 dfn_cert_adv_info_iterator_max_cvss (iterator_t *);
3883 
3884 void
3885 init_cve_dfn_cert_adv_iterator (iterator_t *, const char *, int, const char *);
3886 
3887 void
3888 init_nvt_dfn_cert_adv_iterator (iterator_t *, const char *, int, const char *);
3889 
3890 /* All SecInfo Data */
3891 
3892 int
3893 all_info_count (const get_data_t *);
3894 
3895 int
3896 total_info_count (const get_data_t *, int);
3897 
3898 int
3899 init_all_info_iterator (iterator_t *, get_data_t *, const char *);
3900 
3901 const char *
3902 all_info_iterator_type (iterator_t *);
3903 
3904 const char *
3905 all_info_iterator_extra (iterator_t *);
3906 
3907 const char *
3908 all_info_iterator_severity (iterator_t *);
3909 
3910 void
3912 
3913 const char *
3914 ovaldi_file_iterator_name (iterator_t *);
3915 
3916 /* Settings. */
3917 
3918 int
3919 manage_max_rows (int);
3920 
3921 int
3922 setting_count (const char *);
3923 
3924 int
3925 setting_is_default_ca_cert (const gchar *);
3926 
3927 char *
3928 setting_filter (const char *);
3929 
3930 const char *
3931 setting_severity ();
3932 
3933 void
3934 init_setting_iterator (iterator_t *,
3935  const char *,
3936  const char *,
3937  int,
3938  int,
3939  int,
3940  const char *);
3941 
3942 const char *
3943 setting_iterator_uuid (iterator_t *);
3944 
3945 const char *
3946 setting_iterator_name (iterator_t *);
3947 
3948 const char *
3949 setting_iterator_comment (iterator_t *);
3950 
3951 const char *
3952 setting_iterator_value (iterator_t *);
3953 
3954 int
3955 modify_setting (const gchar *, const gchar *, const gchar *, gchar **);
3956 
3957 int
3958 manage_modify_setting (GSList *,
3959  const gchar *,
3960  const gchar *,
3961  const gchar *,
3962  const char *);
3963 
3964 char *
3965 manage_default_ca_cert ();
3966 
3967 /* Users. */
3968 
3969 gboolean
3970 find_user_by_name_with_permission (const char *, user_t *, const char *);
3971 
3972 int
3973 manage_create_user (GSList *,
3974  const gchar *,
3975  const gchar *,
3976  const gchar *,
3977  const gchar *);
3978 
3979 int
3980 manage_delete_user (GSList *, const gchar *, const gchar *, const gchar *);
3981 
3982 int
3983 manage_get_users (GSList *, const gchar *, const gchar *);
3984 
3985 report_host_t
3986 manage_report_host_add (report_t, const char *, time_t, time_t);
3987 
3988 int
3989 report_host_noticeable (report_t, const gchar *);
3990 
3991 void report_host_set_end_time (report_host_t, time_t);
3992 
3993 gchar *host_routes_xml (host_t);
3994 
3995 int
3996 manage_set_password (GSList *, const gchar *, const gchar *, const gchar *);
3997 
3998 gchar *
3999 manage_user_hash (const gchar *);
4000 
4001 gchar *
4002 manage_user_uuid (const gchar *, auth_method_t);
4003 
4004 int
4005 manage_user_exists (const gchar *, auth_method_t);
4006 
4007 int
4009 
4010 int
4011 copy_user (const char *, const char *, const char *, user_t *);
4012 
4013 gchar *
4014 keyfile_to_auth_conf_settings_xml (const gchar *);
4015 
4016 int
4017 init_user_iterator (iterator_t *, const get_data_t *);
4018 
4019 const char *
4020 user_iterator_role (iterator_t *);
4021 
4022 const char *
4023 user_iterator_method (iterator_t *);
4024 
4025 const char *
4026 user_iterator_hosts (iterator_t *);
4027 
4028 int
4029 user_iterator_hosts_allow (iterator_t *);
4030 
4031 const char *
4032 user_iterator_ifaces (iterator_t *);
4033 
4034 int
4035 user_iterator_ifaces_allow (iterator_t *);
4036 
4037 void
4038 init_user_group_iterator (iterator_t *, user_t);
4039 
4040 const char *
4041 user_group_iterator_uuid (iterator_t *);
4042 
4043 const char *
4044 user_group_iterator_name (iterator_t *);
4045 
4046 int
4047 user_group_iterator_readable (iterator_t *);
4048 
4049 void
4050 init_user_role_iterator (iterator_t *, user_t);
4051 
4052 const char *
4053 user_role_iterator_uuid (iterator_t *);
4054 
4055 const char *
4056 user_role_iterator_name (iterator_t *);
4057 
4058 int
4059 user_role_iterator_readable (iterator_t *);
4060 
4061 int
4062 create_user (const gchar *,
4063  const gchar *,
4064  const gchar *,
4065  const gchar *,
4066  int,
4067  const gchar *,
4068  int,
4069  const array_t *,
4070  array_t *,
4071  gchar **,
4072  array_t *,
4073  gchar **,
4074  gchar **,
4075  user_t *,
4076  int);
4077 
4078 int
4079 delete_user (const char *, const char *, int, int, const char *, const char *);
4080 
4081 int
4082 modify_user (const gchar *,
4083  gchar **,
4084  const gchar *,
4085  const gchar *,
4086  const gchar *,
4087  const gchar *,
4088  int,
4089  const gchar *,
4090  int,
4091  const array_t *,
4092  array_t *,
4093  gchar **,
4094  array_t *,
4095  gchar **,
4096  gchar **);
4097 
4098 int user_in_use (user_t);
4099 
4100 int trash_user_in_use (user_t);
4101 
4102 int user_writable (user_t);
4103 
4104 int trash_user_writable (user_t);
4105 
4106 int
4107 user_count (const get_data_t *);
4108 
4109 gchar *
4110 user_name (const char *);
4111 
4112 char *user_uuid (user_t);
4113 
4114 gchar *
4115 user_ifaces (const char *);
4116 
4117 int
4118 user_ifaces_allow (const char *);
4119 
4120 gchar *
4121 user_hosts (const char *);
4122 
4123 int
4124 user_hosts_allow (const char *);
4125 
4126 int
4127 init_vuln_iterator (iterator_t *, const get_data_t *);
4128 
4129 int
4130 vuln_iterator_results (iterator_t *);
4131 
4132 const char *
4133 vuln_iterator_oldest (iterator_t *);
4134 
4135 const char *
4136 vuln_iterator_newest (iterator_t *);
4137 
4138 const char *
4139 vuln_iterator_type (iterator_t *);
4140 
4141 int
4142 vuln_iterator_hosts (iterator_t *);
4143 
4144 double
4145 vuln_iterator_severity (iterator_t *);
4146 
4147 int
4148 vuln_iterator_qod (iterator_t *);
4149 
4150 int
4151 vuln_count (const get_data_t *);
4152 
4153 void
4154 manage_get_ldap_info (int *, gchar **, gchar **, int *, gchar **);
4155 
4156 void
4157 manage_set_ldap_info (int, gchar *, gchar *, int, gchar *);
4158 
4159 void
4160 manage_get_radius_info (int *, char **, char **);
4161 
4162 void
4163 manage_set_radius_info (int, gchar *, gchar *);
4164 
4165 /* Tags */
4166 
4167 char *tag_uuid (target_t);
4168 
4169 int
4170 copy_tag (const char *, const char *, const char *, tag_t *);
4171 
4172 int
4173 create_tag (const char *,
4174  const char *,
4175  const char *,
4176  const char *,
4177  array_t *,
4178  const char *,
4179  const char *,
4180  tag_t *,
4181  gchar **);
4182 
4183 int
4184 delete_tag (const char *, int);
4185 
4186 int
4187 modify_tag (const char *,
4188  const char *,
4189  const char *,
4190  const char *,
4191  const char *,
4192  array_t *,
4193  const char *,
4194  const char *,
4195  const char *,
4196  gchar **);
4197 
4198 int
4199 init_tag_iterator (iterator_t *, const get_data_t *);
4200 
4201 int
4202 tag_count (const get_data_t *get);
4203 
4204 const char *
4205 tag_iterator_resource_type (iterator_t *);
4206 
4207 int
4208 tag_iterator_active (iterator_t *);
4209 
4210 const char *
4211 tag_iterator_value (iterator_t *);
4212 
4213 int
4214 tag_iterator_resources (iterator_t *);
4215 
4216 resource_t
4217 tag_resource_iterator_id (iterator_t *);
4218 
4219 const char *
4220 tag_resource_iterator_uuid (iterator_t *);
4221 
4222 int
4223 tag_resource_iterator_location (iterator_t *);
4224 
4225 const char *
4226 tag_resource_iterator_name (iterator_t *);
4227 
4228 int
4229 tag_resource_iterator_readable (iterator_t *);
4230 
4231 int
4232 init_tag_name_iterator (iterator_t *, const get_data_t *);
4233 
4234 const char *
4235 tag_name_iterator_name (iterator_t *);
4236 
4237 int
4238 init_resource_tag_iterator (iterator_t *,
4239  const char *,
4240  resource_t,
4241  int,
4242  const char *,
4243  int);
4244 
4245 const char *
4246 resource_tag_iterator_uuid (iterator_t *);
4247 
4248 const char *
4249 resource_tag_iterator_name (iterator_t *);
4250 
4251 const char *
4252 resource_tag_iterator_value (iterator_t *);
4253 
4254 const char *
4255 resource_tag_iterator_comment (iterator_t *);
4256 
4257 int
4258 resource_tag_exists (const char *, resource_t, int);
4259 
4260 int
4261 resource_tag_count (const char *, resource_t, int);
4262 
4263 int tag_in_use (tag_t);
4264 
4265 int trash_tag_in_use (tag_t);
4266 
4267 int tag_writable (tag_t);
4268 
4269 int trash_tag_writable (tag_t);
4270 
4271 /* Resource aggregates */
4272 
4276 typedef struct
4277 {
4278  gchar *field;
4279  gchar *stat;
4280  int order;
4281 } sort_data_t;
4282 
4283 void
4284 sort_data_free (sort_data_t *);
4285 
4286 int
4288  const char *,
4289  const get_data_t *,
4290  int,
4291  GArray *,
4292  const char *,
4293  const char *,
4294  GArray *,
4295  GArray *,
4296  int,
4297  int,
4298  const char *,
4299  const char *);
4300 
4301 int
4303 
4304 double
4306 
4307 double
4309 
4310 double
4312 
4313 double
4315 
4316 const char *
4317 aggregate_iterator_text (iterator_t *, int, int);
4318 
4319 const char *
4321 
4322 const char *
4324 
4325 /* Feeds. */
4326 
4327 #define NVT_FEED 1
4328 #define SCAP_FEED 2
4329 #define CERT_FEED 3
4330 
4331 int
4332 gvm_migrate_secinfo (int);
4333 
4334 gboolean
4335 gvm_sync_script_perform_selftest (const gchar *, gchar **);
4336 
4337 gboolean
4338 gvm_get_sync_script_identification (const gchar *, gchar **, int);
4339 
4340 gboolean
4341 gvm_get_sync_script_description (const gchar *, gchar **);
4342 
4343 gboolean
4344 gvm_get_sync_script_feed_version (const gchar *, gchar **);
4345 
4346 /* Wizards. */
4347 
4348 int
4349 manage_run_wizard (const gchar *,
4350  int (*) (void *, gchar *, gchar **),
4351  void *,
4352  array_t *,
4353  int,
4354  const char *,
4355  gchar **,
4356  gchar **,
4357  gchar **);
4358 
4359 /* Helpers. */
4360 
4361 gchar *
4362 xml_escape_text_truncated (const char *, size_t, const char *);
4363 
4364 int
4365 column_is_timestamp (const char *);
4366 
4367 char *
4368 type_columns (const char *);
4369 
4370 char *
4371 type_trash_columns (const char *);
4372 
4373 gboolean
4374 manage_migrate_needs_timezone (GSList *, const gchar *);
4375 
4376 /* Optimize. */
4377 
4378 int
4379 manage_optimize (GSList *, const gchar *, const gchar *);
4380 
4381 /* Signal management */
4382 
4383 int
4384 get_termination_signal ();
4385 
4386 int
4387 sql_cancel ();
4388 
4389 #endif /* not _GVMD_MANAGE_H */
int move_task(const char *task_id, const char *slave_id)
Reassign a task to another slave.
Definition: manage.c:5993
const char * override_iterator_new_threat(iterator_t *iterator)
Get the threat from an override iterator.
Definition: manage_sql.c:47270
void severity_data_add_count(severity_data_t *severity_data, double severity, int count)
Add a multiple severity occurrences to the counts of a severity_data_t.
Definition: manage.c:1051
int target_iterator_esxi_credential(iterator_t *iterator)
Get the ESXi LSC credential from a target iterator.
Definition: manage_sql.c:35868
double aggregate_iterator_max(iterator_t *iterator, int data_column_index)
Get the maximum from an aggregate iterator.
Definition: manage_sql.c:5891
int modify_scanner(const char *scanner_id, const char *name, const char *comment, const char *host, const char *port, const char *type, const char *ca_pub, const char *credential_id)
Modify an scanner.
Definition: manage_sql.c:48089
int init_aggregate_iterator(iterator_t *iterator, const char *type, const get_data_t *get, int distinct, GArray *data_columns, const char *group_column, const char *subgroup_column, GArray *text_columns, GArray *sort_data, int first_group, int max_groups, const char *extra_tables, const char *given_extra_where)
Initialise a GET_AGGREGATES iterator, including observed resources.
Definition: manage_sql.c:5444
time_t agent_iterator_trust_time(iterator_t *iterator)
Get the installer trust time from a agent iterator.
Definition: manage_sql.c:44860
double result_iterator_severity_double(iterator_t *iterator)
Get the severity from a result iterator as double.
Definition: manage_sql.c:24813
const char * result_iterator_level(iterator_t *iterator)
Get the severity/threat level from a result iterator.
Definition: manage_sql.c:24865
int report_progress(report_t report, task_t task, gchar **hosts_xml)
Calculate the progress of a report.
Definition: manage_sql.c:29204
void init_nvt_iterator(iterator_t *iterator, nvt_t nvt, config_t config, const char *family, const char *category, int ascending, const char *sort_field)
Initialise an NVT iterator.
Definition: manage_sql_nvts.c:696
int start_task(const char *task_id, char **report_id)
Start a task.
Definition: manage.c:5809
int delete_report(const char *report_id, int dummy)
Delete a report.
Definition: manage_sql.c:26864
int details
Boolean. Whether to include full details.
Definition: manage.h:318
const char * alert_data_iterator_name(iterator_t *iterator)
Return the name from an alert data iterator.
Definition: manage_sql.c:8819
void init_manage_process(int update_nvt_cache, const gchar *database)
Initialize the manage library for a process.
Definition: manage_sql.c:15283
int result_iterator_has_dfn_certs(iterator_t *iterator)
Get whether DFN-CERTs may exist from a result iterator.
Definition: manage_sql.c:25011
void manage_nvt_preferences_enable()
Enable the NVT preferences.
Definition: manage_sql.c:41138
int manage_count_hosts(const char *given_hosts, const char *exclude_hosts)
Return number of hosts described by a hosts string.
Definition: manage_sql.c:34062
const char * aggregate_iterator_subgroup_value(iterator_t *iterator)
Get the value of the subgroup column from an aggregate iterator.
Definition: manage_sql.c:5980
char * scanner_uuid(scanner_t scanner)
Return the UUID of a scanner.
Definition: manage_sql.c:48858
char * port
Port.
Definition: manage.h:1183
int delete_task(task_t task, int ultimate)
Complete deletion of a task.
Definition: manage_sql.c:33279
char * credential_iterator_deb(iterator_t *iterator)
Get the deb from a Credential iterator.
Definition: manage_sql.c:43423
void set_scan_start_time_otp(report_t report, const char *timestamp)
Set the start time of a scan.
Definition: manage_sql.c:25826
int trash
Boolean. Whether to return from trashcan.
Definition: manage.h:324
int target_iterator_ssh_credential(iterator_t *iterator)
Get the SSH LSC credential from a target iterator.
Definition: manage_sql.c:35693
char * ip
IP.
Definition: manage.h:1195
char * default_value
Default value of preference.
Definition: manage.h:1822
char * string
Original string describing port.
Definition: manage.h:193
int init_cve_info_iterator(iterator_t *iterator, get_data_t *get, const char *name)
Initialise a info iterator.
Definition: manage_sql_secinfo.c:333
alert_condition_t alert_condition_from_name(const char *name)
Get an alert condition from a name.
Definition: manage.c:1399
int config_writable(config_t config)
Return whether a config can be modified.
Definition: manage_sql.c:37699
gchar * manage_clean_filter(const gchar *filter)
Clean a filter.
Definition: manage_sql.c:2660
char * task_config_uuid(task_t task)
Return the UUID of the config of a task.
Definition: manage_sql.c:19100
int credential_iterator_allow_insecure(iterator_t *iterator)
Get the login from a Credential iterator.
Definition: manage_sql.c:43254
char * host
Host.
Definition: manage.h:1179
int resume_task(const char *task_id, char **report_id)
Resume a task.
Definition: manage.c:5959
int order
The sort order.
Definition: manage.h:4280
int manage_verify_scanner(GSList *log_config, const gchar *database, const gchar *uuid)
Verify the given scanner.
Definition: manage_sql.c:47843
char * agent_uuid(agent_t agent)
Return the UUID of an agent.
Definition: manage_sql.c:44578
int nvt_selector_family_count(const char *quoted_selector, int families_growing)
Get the number of families selected by an NVT selector.
Definition: manage_sql.c:39691
const char * type_name_plural(const char *type)
Return the plural name of a resource type.
Definition: manage.c:562
gchar * file_iterator_content_64(file_iterator_t *iterator)
Return the file contents from a file iterator.
Definition: manage.c:7661
int create_override(const char *active, const char *nvt, const char *text, const char *hosts, const char *port, const char *threat, const char *new_threat, const char *severity, const char *new_severity, task_t task, result_t result, override_t *override)
Create an override.
Definition: manage_sql.c:46111
char * name
Name of preference.
Definition: manage.h:1816
char * ovaldef_uuid(const char *name, const char *fname)
Get the uuid for an OVALDEF from a name and file name.
Definition: manage_sql_secinfo.c:656
int info_name_count(const char *type, const char *name)
Count number of info of a given subtype with a given name.
Definition: manage_sql.c:6123
void reset_task(task_t task)
Reset all running information for a task.
Definition: manage_sql.c:33619
void manage_session_set_timezone(const char *zone)
Setup session timezone.
Definition: manage_pg.c:67
Severity data for result count cache.
Definition: manage.h:1000
int scanner_iterator_port(iterator_t *iterator)
Get the port from an scanner iterator.
Definition: manage_sql.c:48491
char * name
Detail name.
Definition: manage.h:1196
void init_alert_data_iterator(iterator_t *iterator, alert_t alert, int trash, const char *table)
Initialise an alert data iterator.
Definition: manage_sql.c:8800
int init_manage_helper(GSList *log_config, const gchar *database, int max_ips_per_target)
Initialize the manage library for a helper program.
Definition: manage_sql.c:18194
int create_schedule(const char *name, const char *comment, const char *ical_string, time_t first_time, time_t period, time_t period_months, const char *byday, time_t duration, const char *zone, schedule_t *schedule, gchar **error_out)
Create a schedule.
Definition: manage_sql.c:49497
int report_counts_id(report_t report, int *debugs, int *holes, int *infos, int *logs, int *warnings, int *false_positives, double *severity, const get_data_t *get, const char *host)
Get only the filtered message counts for a report.
Definition: manage_sql.c:26596
char * report_format_uuid(report_format_t report_format)
Return the UUID of a report format.
Definition: manage_sql.c:52227
const char * result_iterator_nvt_family(iterator_t *iterator)
Get the NVT family from a result iterator.
Definition: manage_sql.c:24559
char * scanner_key_priv(scanner_t scanner)
Return the private key of a scanner.
Definition: manage_sql.c:48969
int get_certificate_info(const gchar *certificate, time_t *activation_time, time_t *expiration_time, gchar **fingerprint, gchar **issuer)
Gathers info from a certificate.
Definition: manage.c:304
char * credential_type(credential_t credential)
Get the type of a Credential.
Definition: manage_sql.c:43651
gchar * stat
The statistic to sort by.
Definition: manage.h:4279
Data about a report sent by an alert.
Definition: manage.h:397
int create_note(const char *active, const char *nvt, const char *text, const char *hosts, const char *port, const char *severity, const char *threat, task_t task, result_t result, note_t *note)
Create a note.
Definition: manage_sql.c:45116
int delete_config(const char *config_id, int ultimate)
Delete a config.
Definition: manage_sql.c:37129
int modify_report_format(const char *report_format_id, const char *name, const char *summary, const char *active, const char *param_name, const char *param_value, const char *predefined)
Modify a report format.
Definition: manage_sql.c:51771
int create_credential(const char *name, const char *comment, const char *login, const char *given_password, const char *key_private, const char *key_public, const char *certificate, const char *community, const char *auth_algorithm, const char *privacy_password, const char *privacy_algorithm, const char *given_type, const char *allow_insecure, credential_t *credential)
Create a Credential.
Definition: manage_sql.c:41667
void parse_tags(const char *scanner_tags, gchar **tags, gchar **cvss_base)
Split up the tags received from the scanner.
Definition: manage.c:7711
char * scanner_login(scanner_t scanner)
Return the login associated with a scanner.
Definition: manage_sql.c:49008
int create_scanner(const char *name, const char *comment, const char *host, const char *port, const char *type, scanner_t *new_scanner, const char *ca_pub, const char *credential_id)
Create a scanner.
Definition: manage_sql.c:47961
char * report_format_owner_uuid(report_format_t report_format)
Return the UUID of the owner of a report format.
Definition: manage_sql.c:52241
gpointer * current
Current file.
Definition: manage.h:3211
port_protocol_t protocol
Port protocol (TCP, UDP, ...).
Definition: manage.h:192
int modify_schedule(const char *schedule_id, const char *name, const char *comment, const char *ical_string, time_t first_time, time_t period, time_t period_months, const char *byday, time_t duration, const char *zone, gchar **error_out)
Modify a schedule.
Definition: manage_sql.c:50521
int manage_check_alerts(GSList *log_config, const gchar *database)
Check if any SecInfo alerts are due.
Definition: manage_sql.c:6818
int task_last_report(task_t task, report_t *report)
Get the report from the most recently completed invocation of task.
Definition: manage_sql.c:19678
int manage_cert_loaded()
Check whether CERT is available.
Definition: manage_pg.c:3656
int credential_target_iterator_readable(iterator_t *iterator)
Get the read permission status from a GET iterator.
Definition: manage_sql.c:43753
char * nvt_preference_iterator_nvt(iterator_t *iterator)
Get the NVT from an NVT preference iterator.
Definition: manage_sql.c:41280
int config_iterator_families_growing(iterator_t *iterator)
Get the families growing state from a config iterator.
Definition: manage_sql.c:37600
void init_nvt_preference_iterator(iterator_t *iterator, const char *name)
Initialise an NVT preference iterator.
Definition: manage_sql.c:41154
void manage_nvt_preference_add(const char *name, const char *value)
Add an NVT preference.
Definition: manage_sql.c:41107
const char * manage_scap_update_time()
GET SCAP update time, as a string.
Definition: manage.c:8311
char * scanner_password(scanner_t scanner)
Return the password associated with a scanner.
Definition: manage_sql.c:49026
void set_scan_host_start_time_otp(report_t report, const char *host, const char *timestamp)
Set the start time of a scanned host.
Definition: manage_sql.c:26018
int delete_scanner(const char *scanner_id, int ultimate)
Delete a scanner.
Definition: manage_sql.c:48257
const char * event_name(event_t event)
Get the name of an alert event.
Definition: manage.c:1239
gchar * remote_filename
Path or filename to send to / as.
Definition: manage.h:400
const char * severity_to_type(double severity)
Get the message type matching a severity score.
Definition: manage.c:838
int scanner_type(scanner_t scanner)
Return the type of a scanner.
Definition: manage_sql.c:48916
char * report_uuid(report_t report)
Return the UUID of a report.
Definition: manage_sql.c:22670
gboolean next_report(iterator_t *iterator, report_t *report)
Read the next report from an iterator.
Definition: manage_sql.c:23324
int trash_config_in_use(config_t config)
Return whether a trashcan config is referenced by a task.
Definition: manage_sql.c:37725
char * qod
QoD (quality of detection).
Definition: manage.h:1184
int alert_iterator_condition(iterator_t *iterator)
Return the condition from an alert iterator.
Definition: manage_sql.c:8634
char * task_hosts_ordering(task_t task)
Return the hosts ordering of a task.
Definition: manage_sql.c:19030
gchar * credential_iterator_formats_xml(iterator_t *iterator)
Get XML of available formats for a credential iterator.
Definition: manage_sql.c:43554
void cleanup_report_type_iterator(report_type_iterator_t *iterator)
Cleanup a report type iterator.
Definition: manage.c:6484
int report_format_writable(report_format_t report_format)
Return whether a report format is writable.
Definition: manage_sql.c:52358
int scanner_count(const get_data_t *get)
Count number of scanners.
Definition: manage_sql.c:49096
int target_in_use(target_t target)
Return whether a target is in use by a task.
Definition: manage_sql.c:36302
void init_task_group_iterator(iterator_t *iterator, task_t task)
Initialise a task group iterator.
Definition: manage_sql.c:6676
void init_cpe_cve_iterator(iterator_t *iterator, const char *cve, int ascending, const char *sort_field)
Initialise an CVE iterator, for CVEs reported for a certain CPE.
Definition: manage_sql_secinfo.c:249
int set_task_observers(task_t task, const gchar *observers)
Set the observers of a task.
Definition: manage_sql.c:20323
int alert_iterator_active(iterator_t *iterator)
Return the active state from an alert.
Definition: manage_sql.c:8781
const char * alert_task_iterator_name(iterator_t *iterator)
Return the name from an alert task iterator.
Definition: manage_sql.c:14613
A report format file iterator.
Definition: manage.h:3208
void set_task_target(task_t task, target_t target)
Set the target of a task.
Definition: manage_sql.c:19194
char * nvt_preference_iterator_real_name(iterator_t *iterator)
Get the real name from an NVT preference iterator.
Definition: manage_sql.c:41225
void init_severity_data(severity_data_t *data)
Initialize a severity data structure.
Definition: manage.c:1003
int config_in_use(config_t config)
Return whether a config is referenced by a task.
Definition: manage_sql.c:37682
int init_system_report_type_iterator(report_type_iterator_t *iterator, const char *type, const char *slave_id)
Initialise a system report type iterator.
Definition: manage.c:6459
int task_schedule_in_trash(task_t task)
Get whether the task schedule is in the trash.
Definition: manage_sql.c:20142
char * target_exclude_hosts(target_t target)
Return the excluded hosts associated with a target.
Definition: manage_sql.c:36071
void init_target_iterator_one(iterator_t *iterator, target_t target)
Initialise a target iterator, given a single target.
Definition: manage_sql.c:35632
int manage_scap_db_version()
Return the database version of the actual database.
Definition: manage_sql.c:6244
void set_scan_host_end_time(report_t report, const char *host, const char *timestamp)
Set the end time of a scanned host.
Definition: manage_sql.c:25946
void trim_partial_report(report_t report)
Prepare a partial report for resumption of the scan.
Definition: manage_sql.c:27027
int task_in_trash_id(const gchar *task_id)
Return whether a task is in the trashcan.
Definition: manage_sql.c:18957
int manage_max_hosts()
Get the maximum allowed number of hosts per target.
Definition: manage_sql.c:34021
const char * alert_task_iterator_uuid(iterator_t *iterator)
Return the uuid from an alert task iterator.
Definition: manage_sql.c:14629
const char * note_iterator_threat(iterator_t *iterator)
Get the threat from a note iterator.
Definition: manage_sql.c:45954
int result_iterator_may_have_overrides(iterator_t *iterator)
Get whether overrides may exist from a result iterator.
Definition: manage_sql.c:24969
int report_format_active(report_format_t report_format)
Return whether a report format is active.
Definition: manage_sql.c:52429
gchar * alert_condition_description(alert_condition_t condition, alert_t alert)
Get a description of an alert condition.
Definition: manage.c:1269
int init_agent_iterator(iterator_t *iterator, const get_data_t *get)
Initialise an agent iterator.
Definition: manage_sql.c:44745
gchar * credential_encrypted_value(credential_t credential, const char *value_name)
Get a possibly encrypted credential value in decrypted form.
Definition: manage_sql.c:42850
int integer_value
Integer value of the keyword.
Definition: manage.h:3578
int manage_set_config_nvts(const gchar *config_id, const char *family, GPtrArray *selected_nvts)
Set the NVT&#39;s selected for a single family of a config.
Definition: manage_sql.c:38210
const char * result_iterator_nvt_xref(iterator_t *iterator)
Get the NVT XREF from a result iterator.
Definition: manage_sql.c:24631
int manage_task_update_file(const gchar *task_id, const char *name, const void *content)
Add a file to a task, or update the file on the task.
Definition: manage_sql.c:33638
const char * result_iterator_original_level(iterator_t *iterator)
Get the original severity/threat level from a result iterator.
Definition: manage_sql.c:24836
int task_last_resumable_report(task_t task, report_t *report)
Get the report from the most recently stopped invocation of task.
Definition: manage_sql.c:19775
char * task_owner_name(task_t task)
Return the name of the owner of a task.
Definition: manage_sql.c:18972
int create_task_check_config_scanner(config_t config, scanner_t scanner)
Check scanner and config values match for a task.
Definition: manage_sql.c:36944
gchar * value
Value of param.
Definition: manage.h:3100
gboolean find_scanner_with_permission(const char *uuid, scanner_t *scanner, const char *permission)
Find a scanner for a specific permission, given a UUID.
Definition: manage_sql.c:47892
void add_task_alert(task_t task, alert_t alert)
Add an alert to a task.
Definition: manage_sql.c:19825
char * target_name(target_t target)
Return the name of a target.
Definition: manage_sql.c:35974
int init_report_iterator(iterator_t *iterator, const get_data_t *get)
Initialise a report iterator, including observed reports.
Definition: manage_sql.c:23226
void insert_report_host_detail(report_t report, const char *host, const char *s_type, const char *s_name, const char *s_desc, const char *name, const char *value)
Insert a host detail into a report.
Definition: manage_sql.c:22172
int report_counts(const char *report_id, int *debugs, int *holes, int *infos, int *logs, int *warnings, int *false_positives, double *severity, int override, int autofp, int min_qod)
Get the message counts for a report given the UUID.
Definition: manage_sql.c:26207
report_t result_iterator_report(iterator_t *iterator)
Get the report from a result iterator.
Definition: manage_sql.c:24725
char * trash_credential_uuid(credential_t credential)
Get the UUID of a Credential in the trashcan.
Definition: manage_sql.c:43607
gchar * truncate_certificate(const gchar *certificate)
Truncate a certificate, removing extra data.
Definition: manage.c:180
int alert_writable(alert_t alert)
Return whether a alert is writable.
Definition: manage_sql.c:8564
int trash_task_writable(task_t task)
Return whether a trashcan task is writable.
Definition: manage_sql.c:15249
scanner_t config_iterator_scanner(iterator_t *iterator)
Get the scanner from a config iterator.
Definition: manage_sql.c:37648
int target_iterator_snmp_credential(iterator_t *iterator)
Get the SNMP LSC credential from a target iterator.
Definition: manage_sql.c:35900
gboolean find_resource(const char *type, const char *uuid, resource_t *resource)
Find a resource given a UUID.
Definition: manage_sql.c:4468
int trash_agent_in_use(agent_t agent)
Check whether a trashcan agent is writable.
Definition: manage_sql.c:44539
void set_task_end_time_epoch(task_t task, time_t time)
Set the end time of a task.
Definition: manage_sql.c:25736
A port.
Definition: manage.h:189
gboolean find_note_with_permission(const char *uuid, note_t *note, const char *permission)
Find a note for a specific permission, given a UUID.
Definition: manage_sql.c:45058
int config_type(config_t config)
Return the type of a config.
Definition: manage_sql.c:36877
void set_db_version(int version)
Set the database version of the actual database.
Definition: manage_sql.c:6361
int create_report_format(const char *uuid, const char *name, const char *content_type, const char *extension, const char *summary, const char *description, int global, array_t *files, array_t *params, array_t *params_options, const char *signature, report_format_t *report_format)
Create a report format.
Definition: manage_sql.c:50934
void set_scan_ports(report_t report, const char *host, unsigned int current, unsigned int max)
Set the ports for a particular host in a scan.
Definition: manage_sql.c:33503
scanner_t task_scanner(task_t task)
Return the scanner of a task.
Definition: manage_sql.c:19240
A generic SQL iterator structure.
Definition: iterator.h:50
const char * result_iterator_original_severity(iterator_t *iterator)
Get the original severity from a result iterator.
Definition: manage_sql.c:24763
int trash_credential_writable(credential_t credential)
Check whether a trashcan Credential is writable.
Definition: manage_sql.c:42816
const char * result_iterator_nvt_name(iterator_t *iterator)
Get the NVT name from a result iterator.
Definition: manage_sql.c:24541
char * nvt_oid
OID of NVT preference affects.
Definition: manage.h:1820
char * hr_name
Extended, more human-readable name used by OSP.
Definition: manage.h:1823
const char * alert_data_iterator_data(iterator_t *iterator)
Return the data from an alert data iterator.
Definition: manage_sql.c:8836
int init_result_get_iterator(iterator_t *iterator, const get_data_t *get, report_t report, const char *host, const gchar *extra_order)
Initialise a result iterator.
Definition: manage_sql.c:24379
int trash_agent_writable(agent_t agent)
Check whether a trashcan agent is writable.
Definition: manage_sql.c:44565
gchar * column
The column prefix, or NULL.
Definition: manage.h:3576
result_t result_iterator_result(iterator_t *iterator)
Get the result from a result iterator.
Definition: manage_sql.c:24497
int result_uuid(result_t result, char **id)
Return the UUID of a result.
Definition: manage_sql.c:21228
gchar * summary
Summary of command.
Definition: manage.h:102
gchar * get_nvti_xml(iterator_t *nvts, int details, int pref_count, int preferences, const char *timeout, config_t config, int close_tag)
Create and return XML description for an NVT.
Definition: manage.c:8109
int target_iterator_ssh_trash(iterator_t *iterator)
Get the location of the SSH LSC credential from a target iterator.
Definition: manage_sql.c:35734
int schedule_writable(schedule_t schedule)
Return whether a schedule is writable.
Definition: manage_sql.c:49798
const char * override_iterator_threat(iterator_t *iterator)
Get the threat from a override iterator.
Definition: manage_sql.c:47254
gchar * name
Name.
Definition: manage.h:59
int * counts
Counts.
Definition: manage.h:1002
int init_task_iterator(iterator_t *iterator, const get_data_t *get)
Initialise a task iterator.
Definition: manage_sql.c:15010
int trash_report_format_in_use(report_format_t report_format)
Return whether a report format in trash is referenced by an alert.
Definition: manage_sql.c:52335
int trash_config_writable(config_t config)
Return whether a trashcan config is writable.
Definition: manage_sql.c:37741
time_t schedule_iterator_first_time(iterator_t *iterator)
Get the first time from a schedule iterator.
Definition: manage_sql.c:50044
int modify_agent(const char *agent_id, const char *name, const char *comment)
Modify an agent.
Definition: manage_sql.c:44376
gchar * manage_user_hash(const gchar *username)
Get user hash.
Definition: manage_sql.c:18295
int delete_alert(const char *alert_id, int ultimate)
Delete an alert.
Definition: manage_sql.c:8207
task_t make_task(char *name, char *comment, int in_assets, int event)
Make a task.
Definition: manage_sql.c:32889
task_t current_scanner_task
The task currently running on the scanner.
Definition: manage.c:1161
void set_nvts_feed_version(const char *feed_version)
Set the feed version of the plugins in the plugin cache.
Definition: manage_sql_nvts.c:128
gboolean find_trash_task_with_permission(const char *uuid, task_t *task, const char *permission)
Find a task in the trashcan for a specific permission, given a UUID.
Definition: manage_sql.c:33537
void append_to_task_comment(task_t task, const char *text, int length)
Append text to the comment associated with a task.
Definition: manage_sql.c:33489
gchar * type_max
Maximum value for integer type.
Definition: manage.h:3098
int report_result_host_count(report_t report, int min_qod)
Count a report&#39;s total number of hosts with results.
Definition: manage_sql.c:28390
char * credential_name(credential_t credential)
Get the name of an LSC credential.
Definition: manage_sql.c:43622
int config_nvts_growing(config_t config)
Get the NVT growth status of a config.
Definition: manage_sql.c:39801
char * alert_iterator_filter_name(iterator_t *iterator)
Return the filter name from an alert iterator.
Definition: manage_sql.c:8705
void init_preference_iterator(iterator_t *iterator, config_t config)
Initialise a preference iterator.
Definition: manage_sql.c:37773
void filter_free(array_t *split)
Free a split filter.
Definition: manage_sql.c:1862
int trash_target_writable(target_t target)
Return whether a trashcan target is writable.
Definition: manage_sql.c:36348
int modify_note(const gchar *note_id, const char *active, const char *nvt, const char *text, const char *hosts, const char *port, const char *severity, const char *threat, const gchar *task_id, const gchar *result_id)
Modify a note.
Definition: manage_sql.c:45350
char * task_config_name(task_t task)
Return the name of the config of a task.
Definition: manage_sql.c:19119
gchar * type_min
Minimum value for integer type.
Definition: manage.h:3099
int trash_scanner_writable(scanner_t scanner)
Check whether a trashcan scanner is writable.
Definition: manage_sql.c:48806
const char * alert_method_name(alert_method_t method)
Get the name of an alert method.
Definition: manage.c:1358
int manage_set_config(const gchar *config_id, const char *name, const char *comment, const char *scanner_id)
Set the name, comment and scanner of a config.
Definition: manage_sql.c:38137
void manage_auth_allow_all(int scheduled)
Ensure that any subsequent authentications succeed.
Definition: manage.c:6850
char * filt_id
Filter ID. Overrides "filter".
Definition: manage.h:319
gchar * app_location(report_host_t report_host, const gchar *app)
Get the location of an App for a report&#39;s host.
Definition: manage_sql.c:21448
int host_iterator_max_port(iterator_t *iterator)
Get the max port from a host iterator.
Definition: manage_sql.c:25175
int note_iterator_active(iterator_t *iterator)
Get the active status from an note iterator.
Definition: manage_sql.c:46016
char * type
Type of preference (radio, password, ...).
Definition: manage.h:1817
void init_user_config_iterator(iterator_t *iterator, config_t config, int trash, int ascending, const char *sort_field)
Initialise a config iterator, limited to user&#39;s configs.
Definition: manage_sql.c:37485
void init_config_task_iterator(iterator_t *iterator, config_t config, int ascending)
Initialise a config task iterator.
Definition: manage_sql.c:38483
int trash_schedule_writable(schedule_t schedule)
Return whether a trashcan schedule is writable.
Definition: manage_sql.c:49811
gchar * certificate_iso_time(time_t time)
Converts a certificate time to an ISO time string.
Definition: manage.c:405
char * threat
Threat.
Definition: manage.h:1187
int override_uuid(override_t override, char **id)
Return the UUID of an override.
Definition: manage_sql.c:46293
char * description
Description of the message.
Definition: manage.h:205
void manage_sync(sigset_t *sigmask_current, int(*fork_update_nvt_cache)())
Perform any syncing that is due.
Definition: manage.c:7205
char * scanner_host(scanner_t scanner)
Return the host of a scanner.
Definition: manage_sql.c:48883
int alert_iterator_filter_trash(iterator_t *iterator)
Return the location of an alert iterator filter.
Definition: manage_sql.c:8730
int init_schedule_iterator(iterator_t *iterator, const get_data_t *get)
Initialise a schedule iterator.
Definition: manage_sql.c:50018
report_t global_current_report
The report of the current task.
Definition: manage.c:1166
double max
Max.
Definition: manage.h:1004
int nvt_iterator_category(iterator_t *iterator)
Get the category from an NVT iterator.
Definition: manage_sql_nvts.c:866
gboolean find_report_with_permission(const char *uuid, report_t *report, const char *permission)
Find a report for a specific permission, given a UUID.
Definition: manage_sql.c:33590
int manage_scap_db_supported_version()
Return the database version supported by this manager.
Definition: manage_sql.c:6233
report_t task_iterator_current_report(iterator_t *iterator)
Return the current report of a task.
Definition: manage_sql.c:19514
void init_scanner_task_iterator(iterator_t *iterator, scanner_t scanner)
Initialise a scanner task iterator.
Definition: manage_sql.c:48689
char * report_format_extension(report_format_t report_format)
Return the extension of a report format.
Definition: manage_sql.c:52385
int task_schedule_next_time(task_t task)
Get next time a scheduled task will run, following schedule timezone.
Definition: manage_sql.c:20192
keyword_type_t type
Type of keyword.
Definition: manage.h:3582
int trash_credential_in_use(credential_t credential)
Check whether a trashcan Credential is in use.
Definition: manage_sql.c:42766
char * tag_uuid(tag_t tag)
Return the UUID of a tag.
Definition: manage_sql.c:35932
int total
Total.
Definition: manage.h:1003
int host_iterator_current_port(iterator_t *iterator)
Get the current port from a host iterator.
Definition: manage_sql.c:25159
int severity_matches_ov(double severity, double ov_severity)
Check whether a severity matches an override&#39;s severity.
Definition: manage.c:782
void manage_transaction_stop(gboolean force_commit)
Commit the current transaction, if any.
Definition: manage_sql.c:34189
gchar * manage_report(report_t report, report_t delta_report, const get_data_t *get, const report_format_t report_format, int notes_details, int overrides_details, const char *type, gsize *output_length, gchar **extension, gchar **content_type, gchar **filter_term_return, gchar **zone_return, gchar **host_summary)
Generate a report.
Definition: manage_sql.c:31550
int init_override_iterator(iterator_t *iterator, const get_data_t *get, nvt_t nvt, result_t result, task_t task)
Initialise an override iterator.
Definition: manage_sql.c:47081
const gchar * get_scheduled_user_uuid()
Access UUID of user that scheduled the current task.
Definition: manage.c:6861
char * scanner_name(scanner_t scanner)
Return the name of a scanner.
Definition: manage_sql.c:48844
int family_nvt_count(const char *family)
Get the number of NVTs in one or all families.
Definition: manage_sql_nvts.c:940
GPtrArray * start
Array of files.
Definition: manage.h:3210
char * report_slave_task_uuid(report_t report)
Return the UUID of the task on the slave.
Definition: manage_sql.c:26962
char * ovaldef_version(const char *id)
Get the version of an OVALDEF using an ID.
Definition: manage_sql_secinfo.c:703
gboolean report_task(report_t report, task_t *task)
Return the task of a report.
Definition: manage_sql.c:22685
int manage_db_version()
Return the database version of the actual database.
Definition: manage_sql.c:6207
A command.
Definition: manage.h:99
gchar * name
Name.
Definition: manage.h:3096
char * report_format_name(report_format_t report_format)
Return the name of a report format.
Definition: manage_sql.c:52284
int init_scanner_iterator(iterator_t *iterator, const get_data_t *get)
Initialise an scanner iterator.
Definition: manage_sql.c:48463
time_t override_iterator_end_time(iterator_t *iterator)
Get the end time from an override iterator.
Definition: manage_sql.c:47315
void init_report_errors_iterator(iterator_t *iterator, report_t report)
Initialise a report errors iterator.
Definition: manage_sql.c:25226
const char * credential_iterator_private_key(iterator_t *iterator)
Get the private_key from a Credential iterator.
Definition: manage_sql.c:43335
gboolean find_credential_with_permission(const char *uuid, credential_t *credential, const char *permission)
Find a credential for a specific permission, given a UUID.
Definition: manage_sql.c:41512
int init_ovaldef_info_iterator(iterator_t *iterator, get_data_t *get, const char *name)
Initialise an OVAL definition (ovaldef) info iterator.
Definition: manage_sql_secinfo.c:477
int init_all_info_iterator(iterator_t *iterator, get_data_t *get, const char *name)
Initialise an info iterator.
Definition: manage_sql_secinfo.c:1198
const char * task_iterator_first_report(iterator_t *iterator)
Get the first report UUID from a task iterator.
Definition: manage_sql.c:15099
void clear_duration_schedules(task_t task)
Clear once-off schedules from tasks where the duration has passed.
Definition: manage_sql.c:20463
int manage_task_remove_file(const gchar *task_id, const char *name)
Remove a file on a task.
Definition: manage_sql.c:33695
int schedule_period(schedule_t schedule)
Return the period of a schedule.
Definition: manage_sql.c:49877
int trash_config_readable_uuid(const gchar *config_id)
Return whether a trashcan config is readable.
Definition: manage_sql.c:37754
report_format_param_type_t report_format_param_type_from_name(const char *name)
Get a report format param type from a name.
Definition: manage.c:7461
void set_task_scanner(task_t task, scanner_t scanner)
Set the scanner of a task.
Definition: manage_sql.c:19265
void init_ovaldi_file_iterator(iterator_t *iterator)
Initialise an ovaldi file iterator.
Definition: manage_sql_secinfo.c:1413
gchar * name
Command name.
Definition: manage.h:101
int copy_agent(const char *name, const char *comment, const char *agent_id, agent_t *new_agent)
Create an agent from an existing agent.
Definition: manage_sql.c:44355
const char * override_iterator_nvt_type(iterator_t *iterator)
Get the NVT type from a override iterator.
Definition: manage_sql.c:47357
const char * credential_full_type(const char *abbreviation)
Get the written-out name of an LSC Credential type.
Definition: manage.c:6211
int trash_scanner_in_use(scanner_t scanner)
Check whether a trashcan scanner is writable.
Definition: manage_sql.c:48773
time_t schedule_iterator_next_time(iterator_t *iterator)
Get the next time a schedule could be schedulable.
Definition: manage_sql.c:50157
int modify_override(const gchar *override_id, const char *active, const char *nvt, const char *text, const char *hosts, const char *port, const char *threat, const char *new_threat, const char *severity, const char *new_severity, const gchar *task_id, const gchar *result_id)
Modify an override.
Definition: manage_sql.c:46450
int scanner_task_iterator_readable(iterator_t *iterator)
Get the read permission status from a GET iterator.
Definition: manage_sql.c:48743
int alert_task_iterator_readable(iterator_t *iterator)
Get the read permission status from a GET iterator.
Definition: manage_sql.c:14645
char * alert_iterator_filter_uuid(iterator_t *iterator)
Return the filter UUID from an alert iterator.
Definition: manage_sql.c:8680
int get_schedule_timeout()
Get the current schedule timeout.
Definition: manage.c:7401
int osp_get_details_from_iterator(iterator_t *iterator, char **desc, GSList **params)
Get an OSP Scanner&#39;s get_scanner_details info.
Definition: manage_sql.c:49179
void alert_report_data_free(alert_report_data_t *data)
Frees a alert_report_data_t struct, including contained data.
Definition: manage.c:1176
int target_iterator_snmp_trash(iterator_t *iterator)
Get the SNMP LSC credential location from a target iterator.
Definition: manage_sql.c:35916
time_t note_iterator_end_time(iterator_t *iterator)
Get the end time from an note iterator.
Definition: manage_sql.c:46000
char * target_reverse_lookup_only(target_t target)
Return the reverse_lookup_only value of a target.
Definition: manage_sql.c:36085
char * description
Description of NVT.
Definition: manage.h:1178
int credential_scanner_iterator_readable(iterator_t *iterator)
Get the read permission status from a Credential Scanner iterator.
Definition: manage_sql.c:43828
int authenticate(credentials_t *credentials)
Authenticate credentials.
Definition: manage_sql.c:18741
int report_host_noticeable(report_t report, const gchar *host)
Check if a report host is alive and has at least one result.
Definition: manage_sql.c:32511
int modify_task_check_config_scanner(task_t task, const char *config_id, const char *scanner_id)
Check scanner and config values match for a task.
Definition: manage_sql.c:36975
int scanner_iterator_type(iterator_t *iterator)
Get the type from an scanner iterator.
Definition: manage_sql.c:48507
const char * result_iterator_nvt_cve(iterator_t *iterator)
Get the NVT CVE from a result iterator.
Definition: manage_sql.c:24595
int target_iterator_port_list_trash(iterator_t *iterator)
Get the location of the port list from a target iterator.
Definition: manage_sql.c:35784
char * trash_scanner_name(scanner_t scanner)
Return the name of a scanner in the trashcan.
Definition: manage_sql.c:49068
gchar * subtype
Subtype, or NULL.
Definition: manage.h:326
task_status_t task_iterator_run_status(iterator_t *iterator)
Get the run status from a task iterator.
Definition: manage_sql.c:15069
char * ovaldef_cves(const char *id)
Get the CVE names of an OVALDEF as ", " separated str.
Definition: manage_sql_secinfo.c:724
A CREATE_REPORT result.
Definition: manage.h:1176
void set_scan_start_time_epoch(report_t report, time_t timestamp)
Set the start time of a scan.
Definition: manage_sql.c:25813
int agent_count(const get_data_t *get)
Count number of agents.
Definition: manage_sql.c:44896
gchar * field
The field to sort by.
Definition: manage.h:4278
result_t make_result(task_t task, const char *host, const char *hostname, const char *port, const char *nvt, const char *type, const char *description)
Make a result.
Definition: manage_sql.c:21099
void init_target_task_iterator(iterator_t *iterator, target_t target)
Initialise a target task iterator.
Definition: manage_sql.c:36362
char * source_type
Source type.
Definition: manage.h:1199
int schedule_task_iterator_readable(iterator_t *iterator)
Get the read permission status from a GET iterator.
Definition: manage_sql.c:50491
char * value
Value of preference.
Definition: manage.h:1818
char * scanner_ca_pub(scanner_t scanner)
Return the CA Certificate of a scanner.
Definition: manage_sql.c:48936
void host_detail_free(host_detail_t *detail)
Free a host detail.
Definition: manage_sql.c:22150
gboolean find_task_with_permission(const char *uuid, task_t *task, const char *permission)
Find a task for a specific permission, given a UUID.
Definition: manage_sql.c:33521
void set_task_alterable(task_t task, int alterable)
Set the alterable state of a task.
Definition: manage_sql.c:19891
gchar * type
Type (boolean, string, integer, ...).
Definition: manage.h:3097
int scan_host_end_time(report_t report, const char *host)
Get the end time of a scanned host.
Definition: manage_sql.c:25925
int equal
Whether the keyword is like "=example".
Definition: manage.h:3577
int init_config_iterator(iterator_t *iterator, const get_data_t *get)
Initialise a scan config iterator.
Definition: manage_sql.c:37532
void init_cve_dfn_cert_adv_iterator(iterator_t *iterator, const char *cve, int ascending, const char *sort_field)
Initialise CVE iterator, for CVEs referenced by a DFN-CERT advisory.
Definition: manage_sql_secinfo.c:1060
command_t gmp_commands[]
The GMP command list.
Definition: manage_sql.c:566
void set_task_start_time_epoch(task_t task, int time)
Set the start time of a task.
Definition: manage_sql.c:19607
Command data for a get command.
Definition: manage.h:316
int manage_decrypt_all_credentials(GSList *log_config, const gchar *database)
Decrypt all credentials.
Definition: manage_sql.c:6544
char * schedule_uuid(schedule_t schedule)
Return the UUID of a schedule.
Definition: manage_sql.c:49849
const char * agent_iterator_trust(iterator_t *iterator)
Get the trust value from an agent iterator.
Definition: manage_sql.c:44840
void init_report_host_iterator(iterator_t *iterator, report_t report, const char *host, report_host_t report_host)
Initialise a host iterator.
Definition: manage_sql.c:25026
const char * keyword_relation_symbol(keyword_relation_t relation)
Get the symbol of a keyword relation.
Definition: manage_sql.c:1431
gboolean find_override_with_permission(const char *uuid, override_t *override, const char *permission)
Find a override for a specific permission, given a UUID.
Definition: manage_sql.c:46084
gchar * event_description(event_t event, const void *event_data, const char *task_name)
Get a description of an alert event.
Definition: manage.c:1317
double aggregate_iterator_min(iterator_t *iterator, int data_column_index)
Get the minimum from an aggregate iterator.
Definition: manage_sql.c:5875
credential_t trash_target_credential(target_t target, const char *type)
Get a credential from a target in the trashcan.
Definition: manage_sql.c:34422
void manage_report_filter_controls(const gchar *filter, int *first, int *max, gchar **sort_field, int *sort_order, int *result_hosts_only, gchar **min_qod, gchar **levels, gchar **delta_states, gchar **search_phrase, int *search_phrase_exact, int *autofp, int *notes, int *overrides, int *apply_overrides, gchar **zone)
Get info from a filter for report.
Definition: manage_sql.c:2316
gboolean find_nvt(const char *oid, nvt_t *nvt)
Find an NVT given an identifier.
Definition: manage_sql_nvts.c:148
An NVT selector.
Definition: manage.h:1829
const char * result_iterator_nvt_cvss_base(iterator_t *iterator)
Get the NVT CVSS base value from a result iterator.
Definition: manage_sql.c:24577
void set_credential_privacy_algorithm(credential_t credential, const char *algorithm)
Set the privacy_algorithm of a Credential.
Definition: manage_sql.c:42970
time_t schedule_iterator_period(iterator_t *iterator)
Get the period from a schedule iterator.
Definition: manage_sql.c:50060
void cleanup_manage_process(gboolean cleanup)
Cleanup the manage library.
Definition: manage_sql.c:18220
void init_scanner_config_iterator(iterator_t *iterator, scanner_t scanner)
Initialise a scanner config iterator.
Definition: manage_sql.c:48622
int manage_set_config_families(const gchar *config_id, GPtrArray *growing_all_families, GPtrArray *static_all_families, GPtrArray *growing_families, int grow_families)
Refresh NVT selection of a config from given families.
Definition: manage_sql.c:40324
int cve_info_count(const get_data_t *get)
Count number of cve.
Definition: manage_sql_secinfo.c:315
const char * result_iterator_nvt_bid(iterator_t *iterator)
Get the NVT BID from a result iterator.
Definition: manage_sql.c:24613
task_t note_iterator_task(iterator_t *iterator)
Get the task from a note iterator.
Definition: manage_sql.c:45971
void update_duration_schedule_periods(task_t task)
Update tasks with limited run schedules which have durations.
Definition: manage_sql.c:20508
int create_alert(const char *name, const char *comment, const char *filter_id, const char *active, event_t event, GPtrArray *event_data, alert_condition_t condition, GPtrArray *condition_data, alert_method_t method, GPtrArray *method_data, alert_t *alert)
Create an alert.
Definition: manage_sql.c:7570
int manage_set_config_preference(const gchar *config_id, const char *nvt, const char *name, const char *value_64)
Set a preference of a config.
Definition: manage_sql.c:37939
int cert_bund_adv_info_count(const get_data_t *get)
Count number of cert_bund_adv.
Definition: manage_sql_secinfo.c:812
const char * credential_iterator_privacy_password(iterator_t *iterator)
Get the privacy password from a Credential iterator.
Definition: manage_sql.c:43365
int set_task_preferences(task_t task, array_t *preferences)
Set the preferences of a task.
Definition: manage_sql.c:41397
Struct for defining a report format param.
Definition: manage.h:3093
int manage_backup_db(const gchar *database)
Backup the database to a file.
Definition: manage_pg.c:3692
gboolean find_config_with_permission(const char *uuid, config_t *config, const char *permission)
Find a config for a set of permissions, given a UUID.
Definition: manage_sql.c:36439
gchar * content_type
The MIME content type of the report.
Definition: manage.h:401
void set_task_start_time_otp(task_t task, char *time)
Set the start time of a task.
Definition: manage_sql.c:19622
gboolean find_target_with_permission(const char *uuid, target_t *target, const char *permission)
Find a target for a specific permission, given a UUID.
Definition: manage_sql.c:34047
int modify_alert(const char *alert_id, const char *name, const char *comment, const char *filter_id, const char *active, event_t event, GPtrArray *event_data, alert_condition_t condition, GPtrArray *condition_data, alert_method_t method, GPtrArray *method_data)
Modify an alert.
Definition: manage_sql.c:7913
int task_iterator_total_reports(iterator_t *iterator)
Get the number of reports of a task iterator.
Definition: manage_sql.c:15085
double aggregate_iterator_mean(iterator_t *iterator, int data_column_index)
Get the mean from an aggregate iterator.
Definition: manage_sql.c:5907
gboolean find_schedule_with_permission(const char *uuid, schedule_t *schedule, const char *permission)
Find a schedule for a specific permission, given a UUID.
Definition: manage_sql.c:49420
int manage_trash_resource_name(const char *type, const char *uuid, char **name)
Get the name of a trashcan resource.
Definition: manage_sql.c:5012
int report_format_predefined(report_format_t report_format)
Return whether a report format is predefined.
Definition: manage_sql.c:52416
int nvt_selector_family_growing(const char *selector, const char *family, int all)
Get whether an NVT selector family is growing.
Definition: manage_sql.c:39994
void init_schedule_task_iterator(iterator_t *iterator, schedule_t schedule)
Initialise a schedule task iterator.
Definition: manage_sql.c:50436
double report_severity(report_t report, int overrides, int min_qod)
Get the maximum severity of a report.
Definition: manage_sql.c:26617
result_t note_iterator_result(iterator_t *iterator)
Get the result from a note iterator.
Definition: manage_sql.c:45985
int nvt_selector_nvt_count(const char *selector, const char *family, int growing)
Get the number of NVTs selected by an NVT selector.
Definition: manage_sql.c:40054
keyword_relation_t relation
The relation.
Definition: manage.h:3583
int manage_delete_scanner(GSList *log_config, const gchar *database, const gchar *uuid)
Delete the given scanner.
Definition: manage_sql.c:47572
char * task_severity(task_t task, int overrides, int min_qod, int offset)
Return the severity score of a task, taking overrides into account.
Definition: manage_sql.c:20269
int ignore_max_rows_per_page
Definition: manage.h:327
int set_task_schedule_periods_id(task_t task, int periods)
Set the schedule periods of a task, given an ID.
Definition: manage_sql.c:20065
task_status_t task_run_status(task_t task)
Return the run state of a task.
Definition: manage_sql.c:19295
char * nvt_preference_iterator_config_value(iterator_t *iterator, config_t config)
Get the config value from an NVT preference iterator.
Definition: manage_sql.c:41307
gchar * string
The keyword string, outer quotes removed.
Definition: manage.h:3581
char * trash_scanner_uuid(scanner_t scanner)
Return the UUID of a scanner in the trashcan.
Definition: manage_sql.c:49082
int trash_target_in_use(target_t target)
Return whether a trashcan target is referenced by a task.
Definition: manage_sql.c:36319
char * severity
Severity score.
Definition: manage.h:1186
void init_report_iterator_task(iterator_t *iterator, task_t task)
Initialise a report iterator.
Definition: manage_sql.c:23285
char * hostname
Hostname message describes.
Definition: manage.h:203
int task_alterable(task_t task)
Return whether a task is an Alterable Task.
Definition: manage_sql.c:15219
void cleanup_severity_data(severity_data_t *data)
Clean up a severity data structure.
Definition: manage.c:1020
credential_t scanner_iterator_credential(iterator_t *iterator)
Get the credential of the scanner from a scanner iterator.
Definition: manage_sql.c:48543
gchar * xml_escape_text_truncated(const char *string, size_t max_len, const char *suffix)
XML escapes text truncating to a maximum length with a suffix.
Definition: manage.c:513
int init_report_format_file_iterator(file_iterator_t *iterator, report_format_t report_format)
Initialise a report format file iterator.
Definition: manage.c:7573
char * value
Detail value.
Definition: manage.h:1200
int task_in_trash(task_t task)
Return whether a task is in the trashcan.
Definition: manage_sql.c:18940
int override_count(const get_data_t *get, nvt_t nvt, result_t result, task_t task)
Count number of overrides.
Definition: manage_sql.c:46950
int result_iterator_may_have_tickets(iterator_t *iterator)
Get whether tickets may exist from a result iterator.
Definition: manage_sql.c:24983
int config_count(const get_data_t *get)
Count the number of scan configs.
Definition: manage_sql.c:37466
int trash_scanner_readable(scanner_t scanner)
Return whether a trashcan scanner is readable.
Definition: manage_sql.c:48819
int copy_schedule(const char *name, const char *comment, const char *schedule_id, schedule_t *new_schedule)
Create a schedule from an existing schedule.
Definition: manage_sql.c:49628
char * trash_target_name(target_t target)
Return the name of a trashcan target.
Definition: manage_sql.c:35988
int trash_target_credential_location(target_t target, const char *type)
Get whether a credential of a trash target is in trashcan.
Definition: manage_sql.c:34463
gchar * type
Type of resource.
Definition: manage.h:325
void set_task_end_time(task_t task, char *time)
Set the end time of a task.
Definition: manage_sql.c:25715
int init_cpe_info_iterator(iterator_t *iterator, get_data_t *get, const char *name)
Initialise a info iterator.
Definition: manage_sql_secinfo.c:149
int all_info_count(const get_data_t *get)
Count number of SecInfo entries.
Definition: manage_sql_secinfo.c:1129
int total_info_count(const get_data_t *get, int filtered)
Count number of all SecInfo entries.
Definition: manage_sql_secinfo.c:1143
int manage_create_scanner(GSList *log_config, const gchar *database, const char *name, const char *host, const char *port, const char *type, const char *ca_pub_path, const char *key_pub_path, const char *key_priv_path)
Create the given scanner.
Definition: manage_sql.c:47414
char * type
Name of NVT selector.
Definition: manage.h:1832
int task_uuid(task_t task, char **id)
Return the UUID of a task.
Definition: manage_sql.c:18925
int trash_target_login_port(target_t target, const char *type)
Get a port from a target in the trashcan.
Definition: manage_sql.c:34541
void init_config_timeout_iterator(iterator_t *iterator, config_t config)
Initialise a config timeout iterator.
Definition: manage_sql.c:38557
void set_schedule_timeout(int new_timeout)
Set the schedule timeout.
Definition: manage.c:7412
const char * aggregate_iterator_value(iterator_t *iterator)
Get the value of the group column from a statistics iterator.
Definition: manage_sql.c:5963
int alert_in_use(alert_t alert)
Return whether a alert is in use by a task.
Definition: manage_sql.c:8534
int scanner_iterator_credential_trash(iterator_t *iterator)
Get the credential location of the scanner from a scanner iterator.
Definition: manage_sql.c:48559
char * trash_target_uuid(target_t target)
Return the UUID of a trashcan target.
Definition: manage_sql.c:35960
int trash_alert_writable(alert_t alert)
Return whether a trashcan alert is writable.
Definition: manage_sql.c:8577
static int fork_update_nvt_cache()
Update the NVT cache in a child process.
Definition: gvmd.c:1210
int request_delete_task(task_t *task_pointer)
Request deletion of a task.
Definition: manage_sql.c:33087
char * task_comment(task_t task)
Return the comment of a task.
Definition: manage_sql.c:19016
int agent_in_use(agent_t agent)
Check whether an agent is in use.
Definition: manage_sql.c:44526
gboolean credential_iterator_format_available(iterator_t *iterator, credential_format_t format)
Test if a credential format is available for an iterator.
Definition: manage_sql.c:43510
int verify_agent(const char *agent_id)
Verify an agent.
Definition: manage_sql.c:44914
const gchar * certificate_time_status(time_t activates, time_t expires)
Tests the activation and expiration time of a certificate.
Definition: manage.c:424
char * nvt_oid(const char *name)
Guess the OID of an NVT given a name.
Definition: manage_sql_nvts.c:98
int init_note_iterator(iterator_t *iterator, const get_data_t *get, nvt_t nvt, result_t result, task_t task)
Initialise a note iterator.
Definition: manage_sql.c:45782
int resource_count(const char *type, const get_data_t *get)
Return number of resources of a certain type for current user.
Definition: manage_sql.c:18814
int modify_report(const char *report_id, const char *comment)
Modify a report.
Definition: manage_sql.c:26806
int alert_iterator_filter_readable(iterator_t *iterator)
Return the filter readable state from an alert iterator.
Definition: manage_sql.c:8748
void init_cve_cert_bund_adv_iterator(iterator_t *iterator, const char *cve, int ascending, const char *sort_field)
Initialise CVE iterator, for CVEs referenced by a CERT-Bund advisory.
Definition: manage_sql_secinfo.c:876
const char * scanner_uuid_default()
Return the UUID of the default scanner.
Definition: manage_sql.c:48870
gboolean find_alert_with_permission(const char *uuid, alert_t *alert, const char *permission)
Find a alert for a specific permission, given a UUID.
Definition: manage_sql.c:6850
char * manage_nvt_name(nvt_t nvt)
Get the name of an NVT.
Definition: manage_sql_nvts.c:85
const char * credential_iterator_password(iterator_t *iterator)
Get the password from a Credential iterator.
Definition: manage_sql.c:43320
void set_scheduled_user_uuid(const gchar *user_uuid)
Set UUID of user that scheduled the current task. The previous value is freed and a copy of the UUID ...
Definition: manage.c:6873
int task_target_in_trash(task_t task)
Return whether the target of a task is in the trashcan.
Definition: manage_sql.c:19225
void severity_data_level_counts(const severity_data_t *severity_data, const gchar *severity_class, int *errors, int *debugs, int *false_positives, int *logs, int *lows, int *mediums, int *highs)
Count the occurrences of severities in the levels.
Definition: manage.c:1103
void severity_data_add(severity_data_t *severity_data, double severity)
Add a severity occurrence to the counts of a severity_data_t.
Definition: manage.c:1032
char * scan_end_time_uuid(const char *uuid)
Get the end time of a scan.
Definition: manage_sql.c:25857
char * nvt_name
Name of NVT preference affects.
Definition: manage.h:1819
const char * run_status_name(task_status_t status)
Get the name of a run status.
Definition: manage.c:1486
int set_task_groups(task_t task, array_t *groups, gchar **group_id_return)
Set observer groups on a task, removing any previous groups.
Definition: manage_sql.c:19908
int delete_task_lock(task_t task, int ultimate)
Complete deletion of a task.
Definition: manage_sql.c:33378
void alert_report_data_reset(alert_report_data_t *data)
Frees content of an alert_report_data_t, but not the struct itself.
Definition: manage.c:1191
int target_count(const get_data_t *get)
Count number of targets.
Definition: manage_sql.c:35616
void report_set_slave_name(report_t report, const gchar *name)
Set the name of the slave on a report.
Definition: manage_sql.c:22813
const char * report_format_param_type_name(report_format_param_type_t type)
Get the name of a report format param type.
Definition: manage.c:7430
int report_count(const get_data_t *get)
Count number of reports.
Definition: manage_sql.c:23190
int trash_alert_in_use(alert_t alert)
Return whether a trashcan alert is in use by a task.
Definition: manage_sql.c:8548
int copy_alert(const char *name, const char *comment, const char *alert_id, alert_t *new_alert)
Create an alert from an existing alert.
Definition: manage_sql.c:7828
const char * type_name(const char *type)
Return the name of a resource type.
Definition: manage.c:591
task_t result_iterator_task(iterator_t *iterator)
Get the task from a result iterator.
Definition: manage_sql.c:24711
int set_task_schedule_periods(const gchar *task_id, int periods)
Set the schedule periods of a task, given a UUID.
Definition: manage_sql.c:20040
int schedule_in_use(schedule_t schedule)
Return whether a schedule is in use by a task.
Definition: manage_sql.c:49768
Keyword.
Definition: manage.h:3574
gboolean find_report_format_with_permission(const char *uuid, report_format_t *report_format, const char *permission)
Find a reportformat for a specific permission, given a UUID.
Definition: manage_sql.c:50821
const char * task_iterator_trend_counts(iterator_t *iterator, int holes_a, int warns_a, int infos_a, double severity_a, int holes_b, int warns_b, int infos_b, double severity_b)
Return the trend of a task, given counts.
Definition: manage_sql.c:32781
void update_config_preference(const char *config_id, const char *type, const char *preference_name, const char *new_value, gboolean insert)
Update or optionally insert a NVT preference.
Definition: manage_sql.c:38614
int agent_writable(agent_t agent)
Check whether a agent is writable.
Definition: manage_sql.c:44552
time_t task_schedule_next_time_uuid(const gchar *task_id)
Get the next time a scheduled task will be due.
Definition: manage_sql.c:20211
gboolean next_file(file_iterator_t *iterator)
Increment a report type iterator.
Definition: manage.c:7632
gchar * truncate_private_key(const gchar *private_key)
Truncate a private key, removing extra data.
Definition: manage.c:240
char * id
ID of single item to get.
Definition: manage.h:323
int init_alert_iterator(iterator_t *iterator, const get_data_t *get)
Initialise an alert iterator, including observed alerts.
Definition: manage_sql.c:8592
int delete_override(const char *override_id, int ultimate)
Delete a override.
Definition: manage_sql.c:46327
int credential_writable(credential_t credential)
Check whether a Credential is writable.
Definition: manage_sql.c:42803
void init_alert_task_iterator(iterator_t *iterator, alert_t alert, int ascending)
Initialise an alert task iterator.
Definition: manage_sql.c:14573
int manage_send_report(report_t report, report_t delta_report, report_format_t report_format, const get_data_t *get, int notes_details, int overrides_details, int result_tags, int ignore_pagination, int base64, gboolean(*send)(const char *, int(*)(const char *, void *), void *), int(*send_data_1)(const char *, void *), void *send_data_2, const char *alert_id, const char *type, const char *host, int pos, const char *host_search_phrase, const char *host_levels, int host_first_result, int host_max_results, const gchar *prefix)
Generate a report.
Definition: manage_sql.c:32275
char * source_name
Source name.
Definition: manage.h:1198
const char * file_iterator_name(file_iterator_t *iterator)
Return the name from a file iterator.
Definition: manage.c:7648
int manage_scanner_set_default()
Set the default scanner as the scanner to connect to.
Definition: manage_sql.c:18550
void get_data_reset(get_data_t *data)
Reset command data.
Definition: gmp.c:2152
void init_cve_nvt_iterator(iterator_t *iterator, const char *cve, int ascending, const char *sort_field)
Initialise an NVT iterator, for NVTs of a certain CVE.
Definition: manage_sql_nvts.c:781
gchar ** current
Current type.
Definition: manage.h:2721
int report_format_in_use(report_format_t report_format)
Return whether a report format is referenced by an alert.
Definition: manage_sql.c:52313
int override_iterator_active(iterator_t *iterator)
Get the active status from an override iterator.
Definition: manage_sql.c:47331
char * filter_replacement
Filter term to replace the one in filt_id.
Definition: manage.h:322
double severity_data_value(int index)
Convert an index in the counts array to a severity value.
Definition: manage.c:983
char * nvts_feed_version()
Return feed version of the plugins in the plugin cache.
Definition: manage_sql_nvts.c:113
int aggregate_iterator_count(iterator_t *iterator)
Get the count from an aggregate iterator.
Definition: manage_sql.c:5861
int config_iterator_family_count(iterator_t *iterator)
Get the family count from a config iterator.
Definition: manage_sql.c:37568
int scanner_config_iterator_readable(iterator_t *iterator)
Get the read permission status from a GET iterator.
Definition: manage_sql.c:48676
void init_host_prognosis_iterator(iterator_t *iterator, report_host_t report_host, int first_result, int max_results, const char *levels, const char *search_phrase, int sort_order, const char *sort_field)
Initialise a report host prognosis iterator.
Definition: manage_sql.c:21624
int manage_get_scanners(GSList *log_config, const gchar *database)
List scanners.
Definition: manage_sql.c:49384
int nvt_selector_iterator_include(iterator_t *iterator)
Get whether the selector rule is an include rule.
Definition: manage_sql.c:39874
void init_task_role_iterator(iterator_t *iterator, task_t task)
Initialise a task role iterator.
Definition: manage_sql.c:6705
char * oid
NVT identifier.
Definition: manage.h:206
int scanner_in_use(scanner_t scanner)
Check whether an scanner is in use.
Definition: manage_sql.c:48757
int task_iterator_finished_reports(iterator_t *iterator)
Get the number of reports of a task iterator.
Definition: manage_sql.c:15141
char * task_name(task_t task)
Return the name of a task.
Definition: manage_sql.c:19002
int manage_schedule(manage_connection_forker_t fork_connection, gboolean run_tasks, sigset_t *sigmask_current)
Schedule any actions that are due.
Definition: manage.c:7226
osp_connection_t * osp_scanner_connect(scanner_t scanner)
Create a new connection to an OSP scanner.
Definition: manage_sql.c:49114
int manage_resource_name(const char *type, const char *uuid, char **name)
Get the name of a resource.
Definition: manage_sql.c:4997
gchar * fallback
Fallback value.
Definition: manage.h:3095
char * qod_type
QoD type.
Definition: manage.h:1185
int config_iterator_nvt_count(iterator_t *iterator)
Get the nvt count from a config iterator.
Definition: manage_sql.c:37584
int trash_report_format_writable(report_format_t report_format)
Return whether a trashcan report_format is writable.
Definition: manage_sql.c:52372
int config_iterator_scanner_trash(iterator_t *iterator)
Get whether scanner is in trash from a config iterator.
Definition: manage_sql.c:37664
int init_nvt_info_iterator(iterator_t *iterator, get_data_t *get, const char *name)
Initialise an NVT iterator.
Definition: manage_sql_nvts.c:389
gchar * local_filename
Path to the local report file.
Definition: manage.h:399
void init_nvt_selector_iterator(iterator_t *iterator, const char *selector, config_t config, int type)
Initialise an NVT selector iterator.
Definition: manage_sql.c:39832
int delete_note(const char *note_id, int ultimate)
Delete a note.
Definition: manage_sql.c:45239
int create_config_from_scanner(const char *scanner_id, const char *name, const char *comment, char **uuid)
Create a config from an OSP scanner.
Definition: manage_sql.c:36786
void init_family_iterator(iterator_t *iterator, int all, const char *selector, int ascending)
Initialise an NVT selector family iterator.
Definition: manage_sql.c:39926
int init_cert_bund_adv_info_iterator(iterator_t *iterator, get_data_t *get, const char *name)
Initialise an CERT-Bund advisory (cert_bund_adv) info iterator.
Definition: manage_sql_secinfo.c:762
int manage_check_current_task()
Handle state changes to current task made by other processes.
Definition: manage.c:6149
char * credential_uuid(credential_t credential)
Get the UUID of a Credential.
Definition: manage_sql.c:43593
const char * task_iterator_run_status_name(iterator_t *iterator)
Get the run status name from a task iterator.
Definition: manage_sql.c:15113
int task_upload_progress(task_t task)
Return the upload progress of a task.
Definition: manage_sql.c:19558
char * scan_start_time_uuid(const char *uuid)
Get the start time of a scan.
Definition: manage_sql.c:25782
int copy_override(const char *override_id, override_t *new_override)
Create a override from an existing override.
Definition: manage_sql.c:46310
void set_scan_end_time_otp(report_t report, const char *timestamp)
Set the end time of a scan.
Definition: manage_sql.c:25906
int task_config_in_trash(task_t task)
Return whether the config of a task is in the trashcan.
Definition: manage_sql.c:19138
gchar * cve_cvss_base(const gchar *cve)
Get the short file name for an OVALDEF.
Definition: manage_sql_secinfo.c:298
char * config_nvt_timeout(config_t config, const char *oid)
Get the timeout value for an NVT in a config.
Definition: manage_sql.c:36925
int request_delete_task_uuid(const char *task_id, int ultimate)
Request deletion of a task.
Definition: manage_sql.c:33140
void init_credential_iterator_one(iterator_t *iterator, credential_t credential)
Initialise a Credential iterator, given a single Credential.
Definition: manage_sql.c:43141
int result_iterator_has_cert_bunds(iterator_t *iterator)
Get whether CERT-Bunds may exist from a result iterator.
Definition: manage_sql.c:24997
scanner_t task_iterator_scanner(iterator_t *iterator)
Get the UUID of task scanner from a task iterator.
Definition: manage_sql.c:15169
char * scan_nvt_version
Version of NVT used at scan time.
Definition: manage.h:1182
int manage_cert_db_version()
Return the database version of the actual database.
Definition: manage_sql.c:6278
schedule_t task_schedule_uuid(const gchar *task_id)
Return the schedule of a task.
Definition: manage_sql.c:20109
resource_t get_iterator_resource(iterator_t *iterator)
Get the resource from a GET iterator.
Definition: manage_sql.c:44654
const char * report_type_iterator_title(report_type_iterator_t *iterator)
Return the title from a report type iterator.
Definition: manage.c:6528
char * config_uuid(config_t config)
Return the UUID of a config.
Definition: manage_sql.c:36864
int verify_scanner(const char *scanner_id, char **version)
Verify a scanner.
Definition: manage_sql.c:49275
void report_set_source_iface(report_t report, const gchar *iface)
Set the source interface of a report.
Definition: manage_sql.c:22861
int create_agent(const char *name, const char *comment, const char *installer_64, const char *installer_filename, const char *installer_signature_64, const char *howto_install, const char *howto_use, agent_t *agent)
Create an agent entry.
Definition: manage_sql.c:44145
char * host
Host message describes.
Definition: manage.h:202
const char * get_iterator_comment(iterator_t *iterator)
Get the comment from a GET iterator.
Definition: manage_sql.c:44686
void make_task_complete(task_t task)
Complete the creation of a task.
Definition: manage_sql.c:32939
An NVT preference.
Definition: manage.h:1814
int copy_note(const char *note_id, note_t *new_note)
Create a note from an existing note.
Definition: manage_sql.c:45222
gchar * manage_clean_filter_remove(const gchar *filter, const gchar *column)
Clean a filter, removing a keyword in the process.
Definition: manage_sql.c:2585
char * alert_uuid(alert_t alert)
Return the UUID of an alert.
Definition: manage_sql.c:8360
void set_task_hosts_ordering(task_t task, const char *ordering)
Set the hosts ordering of a task.
Definition: manage_sql.c:19209
int nvt_selector_iterator_type(iterator_t *iterator)
Get the type from an NVT selector.
Definition: manage_sql.c:39908
char * target_ssh_port(target_t target)
Return the SSH LSC port of a target.
Definition: manage_sql.c:36144
int create_report(array_t *results, const char *task_id, const char *task_name, const char *task_comment, const char *in_assets, const char *scan_start, const char *scan_end, array_t *host_starts, array_t *host_ends, array_t *details, char **report_id)
Create a report from an array of results.
Definition: manage_sql.c:22241
int report_timestamp(const char *report_id, gchar **timestamp)
Get the timestamp of a report.
Definition: manage_sql.c:26047
gchar * port_name_formatted(const char *field)
Returns formatted port number, protocol and iana name from.
Definition: manage_sql.c:6323
void report_set_slave_host(report_t report, const gchar *host)
Set the host of the slave of a report.
Definition: manage_sql.c:22830
int manage_migrate(GSList *log_config, const gchar *database)
Migrate database to version supported by this manager.
Definition: manage_migrators.c:15544
const char * alert_condition_name(alert_condition_t condition)
Get the name of an alert condition.
Definition: manage.c:1212
credentials_t current_credentials
Current credentials during any GMP command.
Definition: manage.c:863
result_t override_iterator_result(iterator_t *iterator)
Get the result from a override iterator.
Definition: manage_sql.c:47300
gchar * report_format_name
Name of the report format used.
Definition: manage.h:402
int manage_test_alert(const char *alert_id, gchar **script_message)
Test an alert.
Definition: manage_sql.c:14054
unsigned int number
Port number.
Definition: manage.h:191
int config_families_growing(config_t config)
Get the family growth status of a config.
Definition: manage_sql.c:39816
int result_iterator_may_have_notes(iterator_t *iterator)
Get whether notes may exist from a result iterator.
Definition: manage_sql.c:24955
void cleanup_file_iterator(file_iterator_t *iterator)
Cleanup a report type iterator.
Definition: manage.c:7616
const char * result_iterator_nvt_tag(iterator_t *iterator)
Get the NVT tags from a result iterator.
Definition: manage_sql.c:24649
int manage_modify_scanner(GSList *log_config, const gchar *database, const char *scanner_id, const char *name, const char *host, const char *port, const char *type, const char *ca_pub_path, const char *key_pub_path, const char *key_priv_path)
Modify the given scanner.
Definition: manage_sql.c:47643
void manage_complete_nvt_cache_update(GList *nvts_list, GList *nvt_preferences_list)
Complete an update of the NVT cache.
Definition: manage_sql_nvts.c:1112
int task_result_count(task_t task, int min_qod)
Return number of results in a task.
Definition: manage_sql.c:19473
int schedule_info(schedule_t schedule, int trash, time_t *first_time, time_t *next_time, int *period, int *period_months, int *duration, gchar **icalendar, gchar **zone)
Return info about a schedule.
Definition: manage_sql.c:49913
int scanner_writable(scanner_t scanner)
Check whether a scanner is writable.
Definition: manage_sql.c:48793
int schedule_count(const get_data_t *get)
Count the number of schedules.
Definition: manage_sql.c:49999
int cpe_info_count(const get_data_t *get)
Count number of cpe.
Definition: manage_sql_secinfo.c:131
int init_target_iterator(iterator_t *iterator, const get_data_t *get)
Initialise a target iterator, including observed targets.
Definition: manage_sql.c:35658
config_t task_config(task_t task)
Return the config of a task.
Definition: manage_sql.c:19073
const char * task_iterator_hosts_ordering(iterator_t *iterator)
Get the hosts ordering value from a task iterator.
Definition: manage_sql.c:15155
int trash_schedule_readable(schedule_t schedule)
Return whether a trashcan schedule is readable.
Definition: manage_sql.c:49824
char * trash_credential_name(credential_t credential)
Get the name of an LSC credential in the trashcan.
Definition: manage_sql.c:43636
credential_t target_credential(target_t target, const char *type)
Get a credential from a target.
Definition: manage_sql.c:34381
int config_task_iterator_readable(iterator_t *iterator)
Get the read permission status from a GET iterator.
Definition: manage_sql.c:38542
const char * credential_iterator_community(iterator_t *iterator)
Get the SNMP community from a Credential iterator.
Definition: manage_sql.c:43350
int alert_count(const get_data_t *get)
Count the number of alerts.
Definition: manage_sql.c:8517
int copy_config(const char *name, const char *comment, const char *config_id, config_t *new_config)
Create a config from an existing config.
Definition: manage_sql.c:37053
int scan_start_time_epoch(report_t report)
Get the start time of a scan, in seconds since the epoch.
Definition: manage_sql.c:25768
target_t task_target(task_t task)
Return the target of a task.
Definition: manage_sql.c:19168
int target_iterator_smb_credential(iterator_t *iterator)
Get the SMB LSC credential from a target iterator.
Definition: manage_sql.c:35718
char * ovaldef_severity(const char *id)
Get the severity of an OVALDEF using an ID.
Definition: manage_sql_secinfo.c:682
int nvt_preference_count(const char *name)
Get the number preferences available for an NVT.
Definition: manage_sql.c:41339
void manage_cleanup_process_error(int signal)
Cleanup as immediately as possible.
Definition: manage_sql.c:18257
int target_login_port(target_t target, const char *type)
Get a login port from a target.
Definition: manage_sql.c:34501
char * target_uuid(target_t target)
Return the UUID of a target.
Definition: manage_sql.c:35946
int acknowledge_bye()
Acknowledge a scanner BYE.
Definition: manage.c:6121
unsigned int task_count(const get_data_t *get)
Return the number of tasks associated with the current user.
Definition: manage_sql.c:18874
double prognosis_iterator_cvss_double(iterator_t *iterator)
Get the CVSS from a result iterator as a double.
Definition: manage_sql.c:21433
void init_credential_scanner_iterator(iterator_t *iterator, credential_t credential, int ascending)
Initialise a Credential scanner iterator.
Definition: manage_sql.c:43769
int note_count(const get_data_t *get, nvt_t nvt, result_t result, task_t task)
Count number of notes.
Definition: manage_sql.c:45652
void set_task_config(task_t task, config_t config)
Set the config of a task.
Definition: manage_sql.c:19152
result_t make_cve_result(task_t task, const char *host, const char *nvt, double cvss, const char *description)
Make a CVE result.
Definition: manage_sql.c:21199
void init_nvt_dfn_cert_adv_iterator(iterator_t *iterator, const char *oid, int ascending, const char *sort_field)
Initialise an DFN-CERT iterator, for advisories relevant to a NVT.
Definition: manage_sql_secinfo.c:1093
int manage_db_supported_version()
Return the database version supported by this manager.
Definition: manage_sql.c:6195
gboolean find_result_with_permission(const char *uuid, result_t *result, const char *permission)
Find a result for a set of permissions, given a UUID.
Definition: manage_sql.c:20707
void set_scan_host_end_time_otp(report_t report, const char *host, const char *timestamp)
Set the end time of a scanned host.
Definition: manage_sql.c:25970
int modify_task(const gchar *task_id, const gchar *name, const gchar *comment, const gchar *scanner_id, const gchar *target_id, const gchar *config_id, const gchar *observers, array_t *alerts, const gchar *alterable, array_t *groups, const gchar *schedule_id, const gchar *schedule_periods, array_t *preferences, const gchar *hosts_ordering, gchar **fail_alert_id, gchar **fail_group_id)
Modify a task.
Definition: manage_sql.c:33801
char * nvt_default_timeout(const char *oid)
Get the default timeout of an NVT.
Definition: manage_sql_nvts.c:923
void set_scan_end_time(report_t report, const char *timestamp)
Set the end time of a scan.
Definition: manage_sql.c:25888
char * schedule_name(schedule_t schedule)
Return the name of a schedule.
Definition: manage_sql.c:49863
int manage_cert_db_supported_version()
Return the database version supported by this manager.
Definition: manage_sql.c:6267
int copy_target(const char *name, const char *comment, const char *target_id, target_t *new_target)
Create a target from an existing target.
Definition: manage_sql.c:34850
gchar * credential_value(credential_t credential, const char *value_name)
Get a value from a credential.
Definition: manage_sql.c:42830
void manage_filter_controls(const gchar *filter, int *first, int *max, gchar **sort_field, int *sort_order)
Get info from a filter.
Definition: manage_sql.c:2131
int config_iterator_type(iterator_t *iterator)
Get the type from a config iterator.
Definition: manage_sql.c:37632
char * credential_iterator_rpm(iterator_t *iterator)
Get the rpm from a Credential iterator.
Definition: manage_sql.c:43379
gchar * task_second_last_report_id(task_t task)
Get report ID from second most recently completed invocation of task.
Definition: manage_sql.c:19809
int quoted
Whether the keyword was quoted.
Definition: manage.h:3580
void set_scan_end_time_epoch(report_t report, time_t timestamp)
Set the end time of a scan.
Definition: manage_sql.c:25874
report_t make_report(task_t task, const char *uuid, task_status_t status)
Make a report.
Definition: manage_sql.c:22098
char * nvt_oid
OID of NVT.
Definition: manage.h:1181
const char * note_iterator_nvt_type(iterator_t *iterator)
Get the NVT type from a note iterator.
Definition: manage_sql.c:46042
char * source_desc
Source description.
Definition: manage.h:1197
char * config_nvt_selector(config_t config)
Return the NVT selector associated with a config.
Definition: manage_sql.c:37919
A system report type iterator.
Definition: manage.h:2718
const char * result_iterator_scan_nvt_version(iterator_t *iterator)
Get the NVT version used during the scan from a result iterator.
Definition: manage_sql.c:24740
int manage_alert(const char *alert_id, const char *task_id, event_t event, const void *event_data, gchar **script_message)
Escalate an alert with task and event data.
Definition: manage_sql.c:13954
void init_nvt_cert_bund_adv_iterator(iterator_t *iterator, const char *oid, int ascending, const char *sort_field)
Initialise an CERT-Bund iterator, for advisories relevant to a NVT.
Definition: manage_sql_secinfo.c:909
int trash_schedule_in_use(schedule_t schedule)
Return whether a trashcan schedule is in use by a task.
Definition: manage_sql.c:49782
static PGconn * conn
Handle on the database.
Definition: sql_pg.c:81
int copy_credential(const char *name, const char *comment, const char *credential_id, credential_t *new_credential)
Create an LSC Credential from an existing one.
Definition: manage_sql.c:42112
int credential_count(const get_data_t *get)
Count number of LSC Credentials.
Definition: manage_sql.c:42716
char * manage_port_name(int number, const char *protocol)
Returns associated name for a tcp/ip port.
Definition: manage_sql.c:6304
alert_method_t alert_method_from_name(const char *name)
Get an alert method from a name.
Definition: manage.c:1447
int schedule_duration(schedule_t schedule)
Return the duration of a schedule.
Definition: manage_sql.c:49891
int init_dfn_cert_adv_info_iterator(iterator_t *iterator, get_data_t *get, const char *name)
Initialise an DFN-CERT advisory (dfn_cert_adv) info iterator.
Definition: manage_sql_secinfo.c:948
int copy_report_format(const char *name, const char *source_uuid, report_format_t *new_report_format)
Create Report Format from an existing Report Format.
Definition: manage_sql.c:51549
int delete_schedule(const char *schedule_id, int ultimate)
Delete a schedule.
Definition: manage_sql.c:49647
host_t host_notice(const char *host_name, const char *identifier_type, const char *identifier_value, const char *source_type, const char *source_id, int check_add_to_assets, int check_for_existing_identifier)
Notice a host.
Definition: manage_sql.c:20971
time_t schedule_iterator_period_months(iterator_t *iterator)
Get the period months from a schedule iterator.
Definition: manage_sql.c:50076
port_t port
The port.
Definition: manage.h:204
int modify_target(const char *target_id, const char *name, const char *hosts, const char *exclude_hosts, const char *comment, const char *port_list_id, const char *ssh_credential_id, const char *ssh_port, const char *smb_credential_id, const char *esxi_credential_id, const char *snmp_credential_id, const char *reverse_lookup_only, const char *reverse_lookup_unify, const char *alive_tests)
Modify a target.
Definition: manage_sql.c:35043
user_t get_iterator_owner(iterator_t *iterator)
Get the owner from a GET iterator.
Definition: manage_sql.c:44729
The record of a message.
Definition: manage.h:200
char * name
Name of NVT selector.
Definition: manage.h:1831
int config_iterator_nvts_growing(iterator_t *iterator)
Get the NVTs growing state from a config iterator.
Definition: manage_sql.c:37616
int credential_in_use(credential_t credential)
Check whether a Credential is in use.
Definition: manage_sql.c:42733
void init_task_alert_iterator(iterator_t *iterator, task_t task)
Initialise a task alert iterator.
Definition: manage_sql.c:8898
int dfn_cert_adv_info_count(const get_data_t *get)
Count number of dfn_cert_adv.
Definition: manage_sql_secinfo.c:998
gchar * schedule_iterator_byday_string(iterator_t *iterator)
Get the byday string from a schedule iterator.
Definition: manage_sql.c:50092
int note_uuid(note_t note, char **id)
Return the UUID of a note.
Definition: manage_sql.c:45322
char * credential_iterator_exe(iterator_t *iterator)
Get the exe from a Credential iterator.
Definition: manage_sql.c:43475
Headers for Iterators.
int delete_report_format(const char *report_format_id, int ultimate)
Delete a report format.
Definition: manage_sql.c:51955
char * task_preference_value(task_t task, const char *name)
Get the value of a task preference.
Definition: manage_sql.c:41361
int manage_system_report(const char *name, const char *duration, const char *start_time, const char *end_time, const char *slave_id, char **report)
Get a system report.
Definition: manage.c:6668
char * task_observers(task_t task)
Return the observers of a task.
Definition: manage_sql.c:19044
char * target_hosts(target_t target)
Return the hosts associated with a target.
Definition: manage_sql.c:36056
const char * severity_to_level(double severity, int mode)
Get the threat level matching a severity score.
Definition: manage.c:799
time_t schedule_iterator_duration(iterator_t *iterator)
Get the duration from a schedule iterator.
Definition: manage_sql.c:50121
int sync_config(const char *config_id)
Synchronize a config.
Definition: manage_sql.c:37363
char * scanner_key_pub(scanner_t scanner)
Return the Certificate of a scanner.
Definition: manage_sql.c:48949
gboolean next_report_type(report_type_iterator_t *iterator)
Increment a report type iterator.
Definition: manage.c:6499
int delete_agent(const char *agent_id, int ultimate)
Delete an agent.
Definition: manage_sql.c:44440
array_t * alts
Array of gchar&#39;s. Alternate values for radio type.
Definition: manage.h:1821
int type_is_scap(const char *type)
Check if a type is a SCAP type.
Definition: manage.c:620
array_t * split_filter(const gchar *given_filter)
Split the filter term into parts.
Definition: manage_sql.c:1953
int delete_target(const char *target_id, int ultimate)
Delete a target.
Definition: manage_sql.c:34884
void set_task_run_status(task_t task, task_status_t status)
Set the run state of a task.
Definition: manage_sql.c:19366
int task_schedule_periods(task_t task)
Get the number of times the period schedule should run on the task.
Definition: manage_sql.c:20158
char * family_or_nvt
Family or NVT that this selector selects.
Definition: manage.h:1834
void init_credential_target_iterator(iterator_t *iterator, credential_t credential, int ascending)
Initialise a Credential target iterator.
Definition: manage_sql.c:43692
int set_task_schedule(task_t task, schedule_t schedule, int periods)
Set the schedule of a task.
Definition: manage_sql.c:19977
Sort data for aggregates commands.
Definition: manage.h:4276
void report_add_result(report_t report, result_t result)
Add a result to a report.
Definition: manage_sql.c:22878
gchar ** start
First type.
Definition: manage.h:2720
get_data_t * report_results_get_data(int first, int rows, int apply_overrides, int autofp, int min_qod)
Create a new basic get_data_t struct to get report results.
Definition: manage.c:932
int acknowledge_feed_version_info()
Acknowledge scanner PLUGINS_FEED_VERSION message,.
Definition: manage.c:6135
int alert_iterator_event(iterator_t *iterator)
Return the event from an alert iterator.
Definition: manage_sql.c:8618
int trash_task_in_use(task_t task)
Return whether a trashcan task is referenced by a task.
Definition: manage_sql.c:15206
const char * report_type_iterator_name(report_type_iterator_t *iterator)
Return the name from a report type iterator.
Definition: manage.c:6515
int trash_target_readable(target_t target)
Return whether a trashcan target is readable.
Definition: manage_sql.c:36030
int target_iterator_esxi_trash(iterator_t *iterator)
Get the ESXi LSC credential from a target iterator.
Definition: manage_sql.c:35884
int stop_task(const char *task_id)
Initiate stopping a task.
Definition: manage.c:5930
int alert_iterator_method(iterator_t *iterator)
Return the method from an alert iterator.
Definition: manage_sql.c:8650
char * target_reverse_lookup_unify(target_t target)
Return the reverse_lookup_unify value of a target.
Definition: manage_sql.c:36099
event_t event_from_name(const char *name)
Get an event from a name.
Definition: manage.c:1422
char * target_port_range(target_t target)
Return the port range of a target, in OTP format.
Definition: manage_sql.c:36231
void init_report_counts_build_iterator(iterator_t *iterator, report_t report, int min_qod_limit, int add_defaults, const char *users_where)
Initializes an iterator for updating the report cache.
Definition: manage_sql.c:21865
int report_host_count(report_t report)
Count a report&#39;s total number of hosts.
Definition: manage_sql.c:28374
result_t make_osp_result(task_t task, const char *host, const char *nvt, const char *type, const char *description, const char *port, const char *severity, int qod)
Make an OSP result.
Definition: manage_sql.c:20770
int task_writable(task_t task)
Return whether a task is writable.
Definition: manage_sql.c:15234
int target_writable(target_t target)
Return whether a target is writable.
Definition: manage_sql.c:36335
int init_credential_iterator(iterator_t *iterator, const get_data_t *get)
Initialise a Credential iterator.
Definition: manage_sql.c:43168
int target_iterator_smb_trash(iterator_t *iterator)
Get the location of the SMB LSC credential from a target iterator.
Definition: manage_sql.c:35750
int task_average_scan_duration(task_t task)
Get the average duration of all finished reports of a task.
Definition: manage_sql.c:15264
void set_task_name(task_t task, const char *name)
Set the name of a task.
Definition: manage_sql.c:32954
int include
Whether family/NVT is included or excluded.
Definition: manage.h:1833
int scanner_port(scanner_t scanner)
Return the port of a scanner.
Definition: manage_sql.c:48896
int create_target(const char *name, const char *asset_hosts_filter, const char *hosts, const char *exclude_hosts, const char *comment, const char *port_list_id, const char *port_range, credential_t ssh_credential, const char *ssh_port, credential_t smb_credential, credential_t esxi_credential, credential_t snmp_credential, const char *reverse_lookup_only, const char *reverse_lookup_unify, const char *alive_tests, target_t *target)
Create a target.
Definition: manage_sql.c:34598
int copy_scanner(const char *name, const char *comment, const char *scanner_id, scanner_t *new_scanner)
Create a scanner from an existing scanner.
Definition: manage_sql.c:48059
gchar * dir_name
Dir holding files.
Definition: manage.h:3212
int severity_in_level(double severity, const char *level)
Check whether a severity falls within a threat level.
Definition: manage.c:728
int manage_scap_loaded()
Check whether SCAP is available.
Definition: manage_pg.c:3672
const char * target_iterator_alive_tests(iterator_t *iterator)
Get the alive test description from a target iterator.
Definition: manage_sql.c:35829
char * filter_replace
Column to replace in filter.
Definition: manage.h:321
const char * aggregate_iterator_text(iterator_t *iterator, int text_column_index, int data_columns)
Get the value of a text column from an aggregate iterator.
Definition: manage_sql.c:5941
report_t task_running_report(task_t task)
Return the running report of a task.
Definition: manage_sql.c:19491
Name value pair.
Definition: manage.h:57
int modify_credential(const char *credential_id, const char *name, const char *comment, const char *login, const char *password, const char *key_private, const char *key_public, const char *certificate, const char *community, const char *auth_algorithm, const char *privacy_password, const char *privacy_algorithm, const char *allow_insecure)
Modify a Credential.
Definition: manage_sql.c:42161
int result_detection_reference(result_t result, report_t report, const gchar *host, const char *oid, char **ref, char **product, char **location, char **name)
Get product detection results corresponding to a given vulnerability detection result.
Definition: manage_sql.c:21251
A host detail for create_report.
Definition: manage.h:1193
schedule_t task_schedule(task_t task)
Return the schedule of a task.
Definition: manage_sql.c:20082
void set_credential_public_key(credential_t credential, const char *public_key)
Set the public key of a Credential.
Definition: manage_sql.c:43075
const char * task_iterator_last_report(iterator_t *iterator)
Get the last report UUID from a task iterator.
Definition: manage_sql.c:15127
int task_in_use(task_t task)
Return whether a task is in use by a task.
Definition: manage_sql.c:15183
int keyword_special(keyword_t *keyword)
Get whether a keyword is special (like "and").
Definition: manage_sql.c:1465
int copy_task(const char *name, const char *comment, const char *task_id, int alterable, task_t *new_task)
Create a task from an existing task.
Definition: manage_sql.c:32996
int task_schedule_periods_uuid(const gchar *task_id)
Set the next time a scheduled task will be due.
Definition: manage_sql.c:20171
void manage_reset_currents()
Cleanup as immediately as possible.
Definition: manage_sql.c:18278
int trash_credential_readable(credential_t credential)
Return whether a trashcan credential is readable.
Definition: manage_sql.c:43665
const char * task_trend(task_t task, int override, int min_qod)
Return the trend of a task.
Definition: manage_sql.c:32810
int manage_encrypt_all_credentials(GSList *log_config, const gchar *database)
Encrypt or re-encrypt all credentials.
Definition: manage_sql.c:6512
int minimal
Whether to respond with minimal information.
Definition: manage.h:330
int qod_from_type(const char *qod_type)
Get QoD percentage for a qod_type string.
Definition: manage_sql.c:20844
int nvt_info_count(const get_data_t *get)
Count number of nvt.
Definition: manage_sql_nvts.c:468
char * hostname
Hostname.
Definition: manage.h:1180
double aggregate_iterator_sum(iterator_t *iterator, int data_column_index)
Get the sum from a statistics iterator.
Definition: manage_sql.c:5923
int task_scanner_in_trash(task_t task)
Return whether the scanner of a task is in the trashcan.
Definition: manage_sql.c:19281
int result_count(const get_data_t *get, report_t report, const char *host)
Count the number of results.
Definition: manage_sql.c:24446
int delete_credential(const char *credential_id, int ultimate)
Delete a Credential.
Definition: manage_sql.c:42468
gboolean manage_migrate_needs_timezone(GSList *log_config, const gchar *database)
Check whether the migration needs the real timezone.
Definition: manage_migrators.c:15495
void manage_transaction_start()
Start a new IMMEDIATE transaction.
Definition: manage_sql.c:34169
gchar * value
Param value.
Definition: manage.h:60
double double_value
Floating point value of the keyword.
Definition: manage.h:3579
int ovaldef_info_count(const get_data_t *get)
Count number of ovaldef.
Definition: manage_sql_secinfo.c:526
char * filter
Filter term.
Definition: manage.h:320
int target_task_iterator_readable(iterator_t *iterator)
Get the read permission status from a GET iterator.
Definition: manage_sql.c:36419
void report_set_slave_port(report_t report, int port)
Set the port of the slave of a report.
Definition: manage_sql.c:22847
int osp_get_version_from_iterator(iterator_t *iterator, char **s_name, char **s_ver, char **d_name, char **d_ver, char **p_name, char **p_ver)
Get an OSP Scanner&#39;s get_version info.
Definition: manage_sql.c:49149
long long int resource_t
A resource, like a task or target.
Definition: iterator.h:40
int manage_read_info(gchar *type, gchar *uid, gchar *name, gchar **result)
Read raw information.
Definition: manage.c:8358
task_t override_iterator_task(iterator_t *iterator)
Get the task from a override iterator.
Definition: manage_sql.c:47286
char * report_format_content_type(report_format_t report_format)
Return the content type of a report format.
Definition: manage_sql.c:52298
int init_manage(GSList *log_config, int nvt_cache_mode, const gchar *database, int max_ips_per_target, int max_email_attachment_size, int max_email_include_size, int max_email_message_size, manage_connection_forker_t fork_connection, int skip_db_check)
Initialize the manage library.
Definition: manage_sql.c:18160
char * nvt_preference_iterator_type(iterator_t *iterator)
Get the type from an NVT preference iterator.
Definition: manage_sql.c:41253
int create_config(const char *proposed_name, const char *comment, const array_t *selectors, const array_t *preferences, const char *config_type, config_t *config, char **name)
Create a config.
Definition: manage_sql.c:36600
void report_set_slave_uuid(report_t report, const gchar *uuid)
Set the UUID of the slave on a report.
Definition: manage_sql.c:22796