OpenDNSSEC-signer 1.2.1
|
#include "config.h"
#include "scheduler/locks.h"
#include <stdio.h>
#include <time.h>
#include <ldns/ldns.h>
Go to the source code of this file.
typedef enum task_id_enum task_id |
typedef struct task_struct task_type |
typedef struct tasklist_struct tasklist_type |
enum task_id_enum |
char* task2str | ( | task_type * | task, |
char * | buftask | ||
) |
Convert task to string.
[in] | task | task |
[out] | buffer | to store string-based task in |
Convert task to string.
Definition at line 253 of file task.c.
References task_struct::flush, se_calloc(), se_log_assert, time_now(), task_struct::what, task_struct::when, and task_struct::who.
void task_backup | ( | task_type * | task | ) |
Backup task.
[in] | task | task |
Backup task.
Definition at line 130 of file task.c.
References task_struct::backoff, task_struct::flush, se_build_path(), se_fclose(), se_fopen(), se_free(), se_log_warning(), task_struct::what, task_struct::when, and task_struct::who.
Referenced by worker_start().
void task_cleanup | ( | task_type * | task | ) |
Clean up task.
[in] | task | task |
Clean up task.
Definition at line 169 of file task.c.
References task_struct::dname, se_free(), se_log_warning(), and task_struct::who.
Referenced by tasklist_cleanup(), tasklist_schedule_task(), worker_start(), and zonelist_update().
int task_compare | ( | const void * | a, |
const void * | b | ||
) |
Compare tasks.
[in] | a | one task |
[in] | b | another task |
Compare tasks.
Definition at line 192 of file task.c.
References task_struct::dname, se_log_assert, and task_struct::when.
Referenced by tasklist_create().
task_type* task_create | ( | int | what, |
time_t | when, | ||
const char * | who, | ||
struct zone_struct * | zone | ||
) |
Create a new task.
[in] | what | task identifier |
[in] | when | scheduled time |
[in] | who | zone name |
[in] | zone | pointer to zone structure |
Create a new task.
Definition at line 56 of file task.c.
References task_struct::backoff, task_struct::dname, task_struct::flush, se_log_assert, se_malloc(), se_strdup(), zone_struct::task, task_struct::what, task_struct::when, task_struct::who, and task_struct::zone.
Referenced by task_recover_from_backup(), zone_recover_from_backup(), and zone_update_signconf().
void task_print | ( | FILE * | out, |
task_type * | task | ||
) |
Print task.
[in] | out | file descriptor |
[in] | task | task |
Print task.
Definition at line 292 of file task.c.
References task_struct::flush, se_log_assert, time_now(), task_struct::what, task_struct::when, and task_struct::who.
Referenced by tasklist_print().
task_type* task_recover_from_backup | ( | const char * | filename, |
struct zone_struct * | zone | ||
) |
Recover a task from backup.
[in] | filename | where the task backup is stored |
[in] | zone | pointer to zone structure |
Recover a task from backup.
Definition at line 80 of file task.c.
References task_struct::backoff, backup_read_check_str(), backup_read_int(), backup_read_str(), backup_read_time_t(), task_struct::flush, se_fclose(), se_fopen(), se_free(), se_log_assert, se_log_debug(), se_log_error(), and task_create().
Referenced by zone_recover_from_backup().
void tasklist_cleanup | ( | tasklist_type * | list | ) |
Cleanup task list.
list[in] | tasklist to be cleaned up |
Clean up task list.
Definition at line 368 of file task.c.
References lock_basic_destroy, se_free(), se_log_debug(), se_log_warning(), se_rbnode_free(), task_cleanup(), tasklist_struct::tasklist_lock, and tasklist_struct::tasks.
Referenced by engine_cleanup().
tasklist_type* tasklist_create | ( | void | ) |
New task list. number of possible tasks
New task list.
Definition at line 348 of file task.c.
References tasklist_struct::loading, lock_basic_init, lock_basic_lock, lock_basic_unlock, se_log_debug(), se_malloc(), task_compare(), tasklist_struct::tasklist_lock, and tasklist_struct::tasks.
task_type* tasklist_delete_task | ( | tasklist_type * | list, |
task_type * | task | ||
) |
Delete task from task list.
[in] | list | task list |
[in] | task | task to delete |
Delete task from task list.
Definition at line 511 of file task.c.
References se_free(), se_log_assert, se_log_debug(), se_log_error(), se_log_warning(), and tasklist_struct::tasks.
Referenced by tasklist_pop_task(), zone_update_signconf(), and zonelist_update().
task_type* tasklist_first_task | ( | tasklist_type * | list | ) |
First task from task list.
[in] | list | task list |
First task from task list.
Definition at line 576 of file task.c.
References se_log_assert, and tasklist_struct::tasks.
Referenced by worker_start().
void tasklist_flush | ( | tasklist_type * | list, |
task_id | what | ||
) |
Flush task list.
list[in] | tasklist to be flushed |
list[in] | what if not TASK_NONE, change the what to do |
Flush task list.
Definition at line 484 of file task.c.
References task_struct::flush, se_log_assert, se_log_debug(), TASK_NONE, tasklist_struct::tasks, and task_struct::what.
task_type* tasklist_pop_task | ( | tasklist_type * | list | ) |
Pop task from task list.
[in] | list | task list |
Pop task from task list.
Definition at line 542 of file task.c.
References task_struct::flush, se_log_assert, se_log_debug(), tasklist_delete_task(), tasklist_struct::tasks, time_now(), task_struct::when, and task_struct::who.
Referenced by worker_start().
void tasklist_print | ( | FILE * | out, |
tasklist_type * | list | ||
) |
Print task list.
[in] | out | file descriptor |
[in] | list | task list |
Print task list.
Definition at line 599 of file task.c.
References se_log_assert, task_print(), and tasklist_struct::tasks.
task_type* tasklist_schedule_task | ( | tasklist_type * | list, |
task_type * | task, | ||
int | log | ||
) |
Schedule a task.
[in] | list | task list |
[in] | task | task to schedule |
[in] | log | log new task |
Schedule a task.
Definition at line 435 of file task.c.
References zone_struct::in_progress, se_free(), se_log_assert, se_log_debug(), se_log_error(), task_cleanup(), tasklist_struct::tasks, task_struct::what, task_struct::who, and task_struct::zone.
Referenced by worker_start(), zone_recover_from_backup(), and zone_update_signconf().