Data Structures | Typedefs | Enumerations | Functions

/build/buildd-opendnssec_1.3.2-1~bpo60+1-armel-4stS1W/opendnssec-1.3.2/signer/src/scheduler/task.h File Reference

#include "config.h"
#include "shared/allocator.h"
#include <ldns/ldns.h>
Include dependency graph for task.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  task_struct

Typedefs

typedef enum task_id_enum task_id
typedef struct task_struct task_type

Enumerations

enum  task_id_enum {
  TASK_NONE = 0, TASK_SIGNCONF, TASK_READ, TASK_NSECIFY,
  TASK_SIGN, TASK_AUDIT, TASK_WRITE
}

Functions

task_typetask_create (task_id what, time_t when, const char *who, void *zone)
task_typetask_recover_from_backup (const char *filename, void *zone)
void task_backup (FILE *fd, task_type *task)
void task_cleanup (task_type *task)
int task_compare (const void *a, const void *b)
char * task2str (task_type *task, char *buftask)
const char * task_what2str (int taskid)
const char * task_who2str (const char *who)
void task_print (FILE *out, task_type *task)
void task_log (task_type *task)

Typedef Documentation

typedef enum task_id_enum task_id

Definition at line 51 of file task.h.

typedef struct task_struct task_type

Task.

Definition at line 56 of file task.h.


Enumeration Type Documentation

Tasks.

Enumerator:
TASK_NONE 
TASK_SIGNCONF 
TASK_READ 
TASK_NSECIFY 
TASK_SIGN 
TASK_AUDIT 
TASK_WRITE 

Definition at line 42 of file task.h.


Function Documentation

char* task2str ( task_type task,
char *  buftask 
)

Convert task to string.

Parameters:
[in] task task
[out] buffer to store string-based task in
Returns:
string-format task

Convert task to string.

Definition at line 273 of file task.c.

References task_struct::flush, task_what2str(), task_who2str(), task_struct::what, task_struct::when, and task_struct::who.

void task_backup ( FILE *  fd,
task_type task 
)

Backup task.

Parameters:
[in] fd file descriptor
[in] task task

Backup task.

Definition at line 144 of file task.c.

References task_struct::backoff, task_struct::flush, task_struct::halted, task_struct::interrupt, ods_log_assert, task_struct::what, and task_struct::when.

Referenced by zone_backup().

void task_cleanup ( task_type task  ) 

Clean up task.

Parameters:
[in] task task

Clean up task.

Definition at line 169 of file task.c.

References task_struct::allocator, allocator_cleanup(), allocator_deallocate(), task_struct::dname, and task_struct::who.

Referenced by engine_update_zones(), and zone_recover().

int task_compare ( const void *  a,
const void *  b 
)

Compare tasks.

Parameters:
[in] a one task
[in] b another task
Returns:
int -1, 0 or 1

Compare tasks.

Definition at line 193 of file task.c.

References task_struct::dname, ods_log_assert, task_struct::what, and task_struct::when.

Referenced by schedule_create().

task_type* task_create ( task_id  what,
time_t  when,
const char *  who,
void *  zone 
)

Create a new task.

Parameters:
[in] what task identifier
[in] when scheduled time
[in] who zone name
[in] zone pointer to zone
Returns:
task_type* created task

Create a new task.

Definition at line 50 of file task.c.

References task_struct::allocator, allocator_alloc(), allocator_cleanup(), allocator_create(), allocator_strdup(), task_struct::backoff, task_struct::dname, task_struct::flush, task_struct::halted, task_struct::interrupt, ods_log_assert, ods_log_error(), task_struct::what, task_struct::when, task_struct::who, and task_struct::zone.

Referenced by engine_update_zones(), task_recover_from_backup(), and zone_recover().

void task_log ( task_type task  ) 

Log task.

Parameters:
[in] task task

Log task.

Definition at line 327 of file task.c.

References task_struct::flush, ods_log_debug(), task_what2str(), task_who2str(), task_struct::what, task_struct::when, and task_struct::who.

Referenced by schedule_task().

void task_print ( FILE *  out,
task_type task 
)

Print task.

Parameters:
[in] out file descriptor
[in] task task

Print task.

Definition at line 305 of file task.c.

References task_struct::flush, task_what2str(), task_who2str(), task_struct::what, task_struct::when, and task_struct::who.

Referenced by schedule_print().

task_type* task_recover_from_backup ( const char *  filename,
void *  zone 
)

Recover a task from backup.

Parameters:
[in] filename where the task backup is stored
[in] zone pointer to zone structure
Returns:
task_type* created task

Recover a task from backup.

Definition at line 94 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, ods_fclose(), ods_fopen(), ods_log_assert, ods_log_debug(), ods_log_error(), and task_create().

const char* task_what2str ( int  what  ) 

String-format of who.

Parameters:
[in] what task identifier
Returns:
const char* string-format of what

String-format of what.

Definition at line 222 of file task.c.

References TASK_AUDIT, TASK_NONE, TASK_NSECIFY, TASK_READ, TASK_SIGN, TASK_SIGNCONF, and TASK_WRITE.

Referenced by schedule_task(), task2str(), task_log(), task_print(), unschedule_task(), and zone_load_signconf().

const char* task_who2str ( const char *  who  ) 

String-format of who.

Parameters:
[in] what task owner
Returns:
const char* string-format of who

String-format of who.

Definition at line 259 of file task.c.

Referenced by schedule_task(), task2str(), task_log(), task_print(), and unschedule_task().