-
Notifications
You must be signed in to change notification settings - Fork 159
/
Copy pathmanage.h
4130 lines (2910 loc) · 84.2 KB
/
manage.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* Copyright (C) 2009-2022 Greenbone AG
*
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* @file manage.h
* @brief Headers for Greenbone Vulnerability Manager: the Manage library.
*/
#ifndef _GVMD_MANAGE_H
#define _GVMD_MANAGE_H
#include "iterator.h"
#include "manage_configs.h"
#include "manage_get.h"
#include "utils.h"
#include <stdio.h>
#include <glib.h>
#include <gnutls/gnutls.h>
#include <gvm/base/array.h>
#include <gvm/base/credentials.h>
#include <gvm/base/nvti.h>
#include <gvm/base/networking.h>
#include <gvm/util/serverutils.h>
#include <gvm/util/authutils.h>
#include <gvm/osp/osp.h>
#if OPENVASD
#include <gvm/openvasd/openvasd.h>
#endif
/**
* @brief Data structure for info used to connect to the database
*/
typedef struct {
gchar *name; ///< The database name
gchar *host; ///< The database host or socket directory
gchar *port; ///< The database port or socket file extension
gchar *user; ///< The database user name
} db_conn_info_t;
/**
* @brief OID of ping_host.nasl
*/
#define OID_PING_HOST "1.3.6.1.4.1.25623.1.0.100315"
/**
* @brief OID of ssh_authorization_init.nasl
*/
#define OID_SSH_AUTH "1.3.6.1.4.1.25623.1.0.103591"
/**
* @brief OID of smb_authorization.nasl
*/
#define OID_SMB_AUTH "1.3.6.1.4.1.25623.1.0.90023"
/**
* @brief OID of gb_esxi_authorization.nasl
*/
#define OID_ESXI_AUTH "1.3.6.1.4.1.25623.1.0.105058"
/**
* @brief OID of gb_snmp_authorization.nasl
*/
#define OID_SNMP_AUTH "1.3.6.1.4.1.25623.1.0.105076"
/**
* @brief OID of find_services.nasl
*/
#define OID_SERVICES "1.3.6.1.4.1.25623.1.0.10330"
/**
* @brief OID of logins.nasl
*/
#define OID_LOGINS "1.3.6.1.4.1.25623.1.0.10870"
/**
* @brief OID of global_settings.nasl
*/
#define OID_GLOBAL_SETTINGS "1.3.6.1.4.1.25623.1.0.12288"
/**
* @brief Flag with all Glib log levels.
*/
#define ALL_LOG_LEVELS (G_LOG_LEVEL_MASK \
| G_LOG_FLAG_FATAL \
| G_LOG_FLAG_RECURSION)
/**
* @brief Defines g_info for glib versions older than 2.40.
*/
#ifndef g_info
#define g_info(...) g_log (G_LOG_DOMAIN, \
G_LOG_LEVEL_INFO, \
__VA_ARGS__)
#endif /* g_info not defined */
/**
* @brief Name value pair.
*/
typedef struct
{
gchar *name; ///< Name.
gchar *value; ///< Param value.
} name_value_t;
/**
* @brief Fork helper function type.
*/
typedef int (*manage_connection_forker_t) (gvm_connection_t * conn,
const gchar* uuid);
int
init_manage (GSList*, const db_conn_info_t *, int, int, int, int,
manage_connection_forker_t, int);
int
init_manage_helper (GSList *, const db_conn_info_t *, int, int);
void
init_manage_process (const db_conn_info_t*);
void
cleanup_manage_process (gboolean);
void
manage_cleanup_process_error (int);
void
manage_reset_currents ();
/* Commands. */
#define MAX_LOCK_RETRIES 16
/**
* @brief A command.
*/
typedef struct
{
gchar *name; ///< Command name.
gchar *summary; ///< Summary of command.
} command_t;
/**
* @brief The GMP command list.
*/
extern command_t gmp_commands[];
/* Certificate and key management. */
gchar*
truncate_certificate (const gchar*);
gchar*
truncate_private_key (const gchar*);
int
get_certificate_info (const gchar *,
gssize,
gboolean,
time_t *,
time_t *,
gchar **,
gchar **,
gchar **,
gchar **,
gchar **,
gnutls_x509_crt_fmt_t *);
gchar *
certificate_iso_time (time_t);
const gchar *
certificate_time_status (time_t, time_t);
void
parse_ssldetails (const char *, time_t *, time_t *, gchar **, gchar **);
const char*
tls_certificate_format_str (gnutls_x509_crt_fmt_t certificate_format);
/* Credentials. */
extern credentials_t current_credentials;
int
authenticate (credentials_t*);
void
logout_user ();
/* Database. */
int
manage_db_supported_version ();
int
manage_db_version ();
int
manage_scap_db_supported_version ();
int
manage_scap_db_version ();
int
manage_cert_db_supported_version ();
int
manage_cert_db_version ();
void
set_db_version (int version);
int
manage_migrate (GSList*, const db_conn_info_t*);
int
manage_encrypt_all_credentials (GSList *, const db_conn_info_t *);
int
manage_decrypt_all_credentials (GSList *, const db_conn_info_t *);
int
manage_create_encryption_key (GSList *log_config,
const db_conn_info_t *database);
int
manage_set_encryption_key (GSList *log_config,
const db_conn_info_t *database,
const char*);
char *
current_encryption_key_uid (gboolean);
void
set_current_encryption_key_uid (const char *new_uid);
void
manage_session_set_timezone (const char *);
void
manage_transaction_start ();
void
manage_transaction_stop (gboolean);
/* Task structures. */
/**
* @brief Task statuses, also used as scan/report statuses.
*
* These numbers are used in the database, so if the number associated with
* any symbol changes then a migrator must be added to update existing data.
*/
typedef enum
{
TASK_STATUS_DELETE_REQUESTED = 0,
TASK_STATUS_DONE = 1,
TASK_STATUS_NEW = 2,
TASK_STATUS_REQUESTED = 3,
TASK_STATUS_RUNNING = 4,
TASK_STATUS_STOP_REQUESTED = 10,
TASK_STATUS_STOP_WAITING = 11,
TASK_STATUS_STOPPED = 12,
TASK_STATUS_INTERRUPTED = 13,
TASK_STATUS_DELETE_ULTIMATE_REQUESTED = 14,
/* 15 was removed (TASK_STATUS_STOP_REQUESTED_GIVEUP). */
TASK_STATUS_DELETE_WAITING = 16,
TASK_STATUS_DELETE_ULTIMATE_WAITING = 17,
TASK_STATUS_QUEUED = 18,
TASK_STATUS_PROCESSING = 19,
} task_status_t;
/**
* Minimum value for number of reports to keep on auto_delete
*/
#define AUTO_DELETE_KEEP_MIN 2
/**
* Maximum value for number of reports to keep on auto_delete
*/
#define AUTO_DELETE_KEEP_MAX 1200
/**
* @brief Alive tests.
*
* These numbers are used in the database, so if the number associated with
* any symbol changes then a migrator must be added to update existing data.
*/
typedef enum
{
ALIVE_TEST_TCP_ACK_SERVICE = 1,
ALIVE_TEST_ICMP = 2,
ALIVE_TEST_ARP = 4,
ALIVE_TEST_CONSIDER_ALIVE = 8,
ALIVE_TEST_TCP_SYN_SERVICE = 16
} alive_test_t;
/**
* @brief Scanner types.
*
* These numbers are used in the database, so if the number associated with
* any symbol changes then a migrator must be added to update existing data.
*/
typedef enum scanner_type
{
SCANNER_TYPE_NONE = 0,
/* 1 was removed (SCANNER_TYPE_OSP). */
SCANNER_TYPE_OPENVAS = 2,
SCANNER_TYPE_CVE = 3,
/* 4 was removed (SCANNER_TYPE_GMP). */
SCANNER_TYPE_OSP_SENSOR = 5,
SCANNER_TYPE_OPENVASD = 6,
SCANNER_TYPE_MAX = 7,
} scanner_type_t;
int
scanner_type_valid (scanner_type_t);
typedef resource_t credential_t;
typedef resource_t alert_t;
typedef resource_t filter_t;
typedef resource_t group_t;
typedef resource_t host_t;
typedef resource_t tag_t;
typedef resource_t target_t;
typedef resource_t task_t;
typedef resource_t ticket_t;
typedef resource_t tls_certificate_t;
typedef resource_t result_t;
typedef resource_t report_t;
typedef resource_t report_host_t;
typedef resource_t report_config_t;
typedef resource_t report_config_param_t;
typedef resource_t report_format_t;
typedef resource_t report_format_param_t;
typedef resource_t role_t;
typedef resource_t note_t;
typedef resource_t nvt_t;
typedef resource_t override_t;
typedef resource_t permission_t;
typedef resource_t port_list_t;
typedef resource_t port_range_t;
typedef resource_t schedule_t;
typedef resource_t scanner_t;
typedef resource_t setting_t;
typedef resource_t user_t;
/* GMP GET support.
*
* The standalone parts of the GET support are in manage_get.h. */
resource_t
get_iterator_resource (iterator_t*);
user_t
get_iterator_owner (iterator_t*);
/* Resources. */
int
manage_resource_name (const char *, const char *, char **);
int
manage_trash_resource_name (const char *, const char *, char **);
int
resource_count (const char *, const get_data_t *);
int
resource_id_exists (const char *, const char *);
int
trash_id_exists (const char *, const char *);
gboolean
find_resource (const char*, const char*, resource_t*);
gboolean
find_resource_no_acl (const char*, const char*, resource_t*);
const char *
type_name_plural (const char*);
const char *
type_name (const char*);
int
type_is_scap (const char*);
int
delete_resource (const char *, const char *, int);
int
resource_id_deprecated (const char *, const char *);
void
set_resource_id_deprecated (const char *, const char *, gboolean);
/* Events and Alerts. */
/**
* @brief Data about a report sent by an alert.
*/
typedef struct {
gchar *local_filename; ///< Path to the local report file.
gchar *remote_filename; ///< Path or filename to send to / as.
gchar *content_type; ///< The MIME content type of the report.
gchar *report_format_name; ///< Name of the report format used.
} alert_report_data_t;
void
alert_report_data_free (alert_report_data_t *);
void
alert_report_data_reset (alert_report_data_t *);
/**
* @brief Default format string for alert email, when including report.
*/
#define ALERT_MESSAGE_INCLUDE \
"Task '$n': $e\n" \
"\n" \
"After the event $e,\n" \
"the following condition was met: $c\n" \
"\n" \
"This email escalation is configured to apply report format '$r'.\n" \
"Full details and other report formats are available on the scan engine.\n" \
"\n" \
"$t" \
"\n" \
"$i" \
"\n" \
"\n" \
"Note:\n" \
"This email was sent to you as a configured security scan escalation.\n" \
"Please contact your local system administrator if you think you\n" \
"should not have received it.\n"
/**
* @brief Default format string for SecInfo alert email, when including report.
*/
#define SECINFO_ALERT_MESSAGE_INCLUDE \
"Task '$n': $e\n" \
"\n" \
"After the event $e,\n" \
"the following condition was met: $c\n" \
"\n" \
"This email escalation is configured to apply report format '$r'.\n" \
"Full details and other report formats are available on the scan engine.\n" \
"\n" \
"$t" \
"\n" \
"$i" \
"\n" \
"\n" \
"Note:\n" \
"This email was sent to you as a configured security scan escalation.\n" \
"Please contact your local system administrator if you think you\n" \
"should not have received it.\n"
/**
* @brief Default format string for alert email, when attaching report.
*/
#define ALERT_MESSAGE_ATTACH \
"Task '$n': $e\n" \
"\n" \
"After the event $e,\n" \
"the following condition was met: $c\n" \
"\n" \
"This email escalation is configured to attach report format '$r'.\n" \
"Full details and other report formats are available on the scan engine.\n" \
"\n" \
"$t" \
"\n" \
"Note:\n" \
"This email was sent to you as a configured security scan escalation.\n" \
"Please contact your local system administrator if you think you\n" \
"should not have received it.\n"
/**
* @brief Default format string for SecInfo alert email, when attaching report.
*/
#define SECINFO_ALERT_MESSAGE_ATTACH \
"Task '$n': $e\n" \
"\n" \
"After the event $e,\n" \
"the following condition was met: $c\n" \
"\n" \
"This email escalation is configured to attach report format '$r'.\n" \
"Full details and other report formats are available on the scan engine.\n" \
"\n" \
"$t" \
"\n" \
"Note:\n" \
"This email was sent to you as a configured security scan escalation.\n" \
"Please contact your local system administrator if you think you\n" \
"should not have received it.\n"
/**
* @brief Default description format string for vFire alert.
*/
#define ALERT_VFIRE_CALL_DESCRIPTION \
"GVM Task '$n': $e\n" \
"\n" \
"After the event $e,\n" \
"the following condition was met: $c\n" \
"\n" \
"This ticket includes reports in the following format(s):\n" \
"$r.\n" \
"Full details and other report formats are available on the scan engine.\n" \
"\n" \
"$t" \
"\n" \
"Note:\n" \
"This ticket was created automatically as a security scan escalation.\n" \
"Please contact your local system administrator if you think it\n" \
"was created or assigned erroneously.\n"
/**
* @brief Types of task events.
*/
typedef enum
{
EVENT_ERROR,
EVENT_TASK_RUN_STATUS_CHANGED,
EVENT_NEW_SECINFO,
EVENT_UPDATED_SECINFO,
EVENT_TICKET_RECEIVED,
EVENT_ASSIGNED_TICKET_CHANGED,
EVENT_OWNED_TICKET_CHANGED
} event_t;
/**
* @brief Types of alerts.
*/
typedef enum
{
ALERT_METHOD_ERROR,
ALERT_METHOD_EMAIL,
ALERT_METHOD_HTTP_GET,
ALERT_METHOD_SOURCEFIRE,
ALERT_METHOD_START_TASK,
ALERT_METHOD_SYSLOG,
ALERT_METHOD_VERINICE,
ALERT_METHOD_SEND,
ALERT_METHOD_SCP,
ALERT_METHOD_SNMP,
ALERT_METHOD_SMB,
ALERT_METHOD_TIPPINGPOINT,
ALERT_METHOD_VFIRE,
} alert_method_t;
/**
* @brief Types of alert conditions.
*/
typedef enum
{
ALERT_CONDITION_ERROR,
ALERT_CONDITION_ALWAYS,
ALERT_CONDITION_SEVERITY_AT_LEAST,
ALERT_CONDITION_SEVERITY_CHANGED,
ALERT_CONDITION_FILTER_COUNT_AT_LEAST,
ALERT_CONDITION_FILTER_COUNT_CHANGED
} alert_condition_t;
int
manage_check_alerts (GSList *, const db_conn_info_t *);
int
create_alert (const char*, const char*, const char*, const char*, event_t,
GPtrArray*, alert_condition_t, GPtrArray*, alert_method_t,
GPtrArray*, alert_t*);
int
copy_alert (const char*, const char*, const char*, alert_t*);
int
modify_alert (const char*, const char*, const char*, const char*,
const char*, event_t, GPtrArray*, alert_condition_t, GPtrArray*,
alert_method_t, GPtrArray*);
int
delete_alert (const char *, int);
char *
alert_uuid (alert_t);
gboolean
find_alert_with_permission (const char *, alert_t *, const char *);
int
manage_alert (const char *, const char *, event_t, const void*, gchar **);
int
manage_test_alert (const char *, gchar **);
int
alert_in_use (alert_t);
int
trash_alert_in_use (alert_t);
int
alert_writable (alert_t);
int
trash_alert_writable (alert_t);
int
alert_count (const get_data_t *);
int
init_alert_iterator (iterator_t*, get_data_t*);
int
alert_iterator_event (iterator_t*);
int
alert_iterator_condition (iterator_t*);
int
alert_iterator_method (iterator_t*);
char *
alert_iterator_filter_uuid (iterator_t*);
char *
alert_iterator_filter_name (iterator_t*);
int
alert_iterator_filter_trash (iterator_t*);
int
alert_iterator_filter_readable (iterator_t*);
int
alert_iterator_active (iterator_t*);
const char*
alert_condition_name (alert_condition_t);
gchar*
alert_condition_description (alert_condition_t, alert_t);
const char*
event_name (event_t);
gchar*
event_description (event_t, const void *, const char *);
alert_method_t
alert_method (alert_t alert);
const char*
alert_method_name (alert_method_t);
alert_condition_t
alert_condition_from_name (const char*);
event_t
event_from_name (const char*);
alert_method_t
alert_method_from_name (const char*);
void
init_alert_data_iterator (iterator_t *, alert_t, int, const char *);
const char*
alert_data_iterator_name (iterator_t*);
const char*
alert_data_iterator_data (iterator_t*);
void
init_alert_task_iterator (iterator_t*, alert_t, int);
const char*
alert_task_iterator_name (iterator_t*);
const char*
alert_task_iterator_uuid (iterator_t*);
int
alert_task_iterator_readable (iterator_t*);
void
init_task_alert_iterator (iterator_t*, task_t);
const char*
task_alert_iterator_uuid (iterator_t*);
const char*
task_alert_iterator_name (iterator_t*);
/* Task global variables and preprocessor variables. */
/**
* @brief The task currently running on the scanner.
*/
extern task_t current_scanner_task;
extern report_t global_current_report;
/* Task code specific to the representation of tasks. */
unsigned int
task_count (const get_data_t *);
int
init_task_iterator (iterator_t*, get_data_t *);
task_status_t
task_iterator_run_status (iterator_t*);
const char *
task_iterator_run_status_name (iterator_t*);
int
task_iterator_total_reports (iterator_t*);
int
task_iterator_finished_reports (iterator_t *);
const char *
task_iterator_first_report (iterator_t*);
const char *
task_iterator_last_report (iterator_t *);
report_t
task_iterator_current_report (iterator_t *);
const char *
task_iterator_hosts_ordering (iterator_t *);
scanner_t
task_iterator_scanner (iterator_t *);
const char *
task_iterator_usage_type (iterator_t *);
int
task_uuid (task_t, char **);
int
task_in_trash (task_t);
int
task_in_trash_id (const gchar *);
int
task_in_use (task_t);
int
trash_task_in_use (task_t);
int
task_writable (task_t);
int
task_alterable (task_t);
int
trash_task_writable (task_t);
int
task_average_scan_duration (task_t);
char*
task_owner_name (task_t);
char*
task_name (task_t);
char*
task_comment (task_t);
char*
task_hosts_ordering (task_t);
scanner_t
task_scanner (task_t);
int
task_scanner_in_trash (task_t);
config_t
task_config (task_t);
char*
task_config_uuid (task_t);
char*
task_config_name (task_t);
int
task_config_in_trash (task_t);
void
set_task_config (task_t, config_t);
target_t
task_target (task_t);
int
task_target_in_trash (task_t);
void
set_task_target (task_t, target_t);
void
set_task_hosts_ordering (task_t, const char *);
void
set_task_scanner (task_t, scanner_t);
int
task_usage_type (task_t, char**);
void
set_task_usage_type (task_t, const char *);
char*
task_description (task_t);
void
set_task_description (task_t, char*, gsize);
task_status_t
task_run_status (task_t);
void
set_task_run_status (task_t, task_status_t);
int
task_result_count (task_t, int);
report_t
task_running_report (task_t);
int
task_upload_progress (task_t);
void
set_task_start_time_epoch (task_t, int);
void
set_task_start_time_ctime (task_t, char*);
void
set_task_end_time (task_t task, char* time);
void
set_task_end_time_epoch (task_t, time_t);
void
add_task_alert (task_t, alert_t);
void
set_task_alterable (task_t, int);
int
set_task_groups (task_t, array_t*, gchar**);
int
set_task_schedule (task_t, schedule_t, int);
int
set_task_schedule_periods (const gchar *, int);
int
set_task_schedule_periods_id (task_t, int);
unsigned int
task_report_count (task_t);
int
task_last_report (task_t, report_t*);
const char *
task_iterator_trend_counts (iterator_t *, int, int, int, int, double, int, int,
int, int, double);
int
task_schedule_periods (task_t);
int
task_schedule_periods_uuid (const gchar *);
schedule_t
task_schedule (task_t);
schedule_t
task_schedule_uuid (const gchar *);
int
task_schedule_in_trash (task_t);
time_t
task_schedule_next_time_uuid (const gchar *);
int
task_schedule_next_time (task_t);
int
task_debugs_size (task_t);
int
task_holes_size (task_t);
int
task_infos_size (task_t);
int
task_logs_size (task_t);
int
task_warnings_size (task_t);
int
task_false_positive_size (task_t);
task_t
make_task (char*, char*, int, int);
void
make_task_complete (task_t);
int
copy_task (const char*, const char*, const char *, int, task_t*);
void
set_task_name (task_t, const char *);
gboolean
find_task_with_permission (const char*, task_t*, const char *);
gboolean
find_trash_task_with_permission (const char*, task_t*, const char *);
void
reset_task (task_t);
int
set_task_parameter (task_t, const char*, char*);
char*
task_observers (task_t);
int
set_task_observers (task_t, const gchar *);
int
request_delete_task_uuid (const char *, int);
int
request_delete_task (task_t*);
int
delete_task (task_t, int);
void
append_to_task_comment (task_t, const char*, int);
void
add_task_description_line (task_t, const char*, size_t);
void
set_scan_ports (report_t, const char*, unsigned int, unsigned int);