OpenDNSSEC-signer  1.4.5
Data Structures | Typedefs | Functions
schedule.h File Reference
#include "config.h"
#include "scheduler/task.h"
#include "shared/allocator.h"
#include "shared/locks.h"
#include "shared/status.h"
#include <stdio.h>
#include <time.h>
#include <ldns/ldns.h>
Include dependency graph for schedule.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  schedule_struct
 

Typedefs

typedef struct schedule_struct schedule_type
 

Functions

schedule_typeschedule_create (allocator_type *allocator)
 
void schedule_flush (schedule_type *schedule, task_id override)
 
task_typeschedule_lookup_task (schedule_type *schedule, task_type *task)
 
ods_status schedule_task (schedule_type *schedule, task_type *task, int log)
 
task_typeunschedule_task (schedule_type *schedule, task_type *task)
 
ods_status reschedule_task (schedule_type *schedule, task_type *task, task_id what, time_t when)
 
task_typeschedule_pop_task (schedule_type *schedule)
 
task_typeschedule_get_first_task (schedule_type *schedule)
 
void schedule_print (FILE *out, schedule_type *schedule)
 
void schedule_cleanup (schedule_type *schedule)
 

Typedef Documentation

Task scheduling. Task schedule.

Definition at line 57 of file schedule.h.

Function Documentation

ods_status reschedule_task ( schedule_type schedule,
task_type task,
task_id  what,
time_t  when 
)

Reschedule task.

Parameters
[in]scheduleschedule
[in]tasktask to delete
[in]whatnew task
[in]whennew time
Returns
ods_status status

Reschedule task.

Definition at line 223 of file schedule.c.

References ODS_STATUS_ASSERT_ERR, schedule_task(), schedule_struct::tasks, unschedule_task(), task_struct::what, and task_struct::when.

void schedule_cleanup ( schedule_type schedule)

Clean up schedule.

Parameters
[in]scheduleschedule to be cleaned up

Clean up schedule.

Definition at line 357 of file schedule.c.

References schedule_struct::allocator, allocator_deallocate(), lock_basic_destroy, ods_log_debug(), schedule_struct::schedule_lock, and schedule_struct::tasks.

Referenced by engine_cleanup().

schedule_type* schedule_create ( allocator_type allocator)

Create new schedule.

Parameters
[in]allocatormemory allocator
Returns
schedule_type* created schedule

Create new schedule.

Definition at line 48 of file schedule.c.

References schedule_struct::allocator, allocator_alloc(), allocator_deallocate(), schedule_struct::flushcount, schedule_struct::loading, lock_basic_init, ods_log_error(), schedule_struct::schedule_lock, task_compare(), and schedule_struct::tasks.

void schedule_flush ( schedule_type schedule,
task_id  override 
)

Flush schedule.

Parameters
[in]scheduleschedule to be flushed
[in]overrideoverride task

Flush schedule.

Definition at line 81 of file schedule.c.

References task_struct::flush, schedule_struct::flushcount, ods_log_debug(), TASK_NONE, schedule_struct::tasks, and task_struct::what.

task_type* schedule_get_first_task ( schedule_type schedule)

Get the first scheduled task.

Parameters
[in]scheduleschedule
Returns
task_type* first scheduled task

Get the first scheduled task.

Definition at line 245 of file schedule.c.

References task_struct::flush, schedule_struct::flushcount, ods_log_info(), ods_log_warning(), and schedule_struct::tasks.

Referenced by schedule_pop_task().

task_type* schedule_lookup_task ( schedule_type schedule,
task_type task 
)

Look up task.

Parameters
[in]scheduleschedule
[in]tasktask
Returns
task_type* task, if found

Look up task.

Definition at line 125 of file schedule.c.

References ods_log_assert, and schedule_struct::tasks.

Referenced by schedule_task().

task_type* schedule_pop_task ( schedule_type schedule)

Pop the first scheduled task.

Parameters
[in]scheduleschedule
Returns
task_type* popped task

Pop the first scheduled task.

Definition at line 285 of file schedule.c.

References task_struct::flush, ods_log_debug(), schedule_get_first_task(), task_who2str(), schedule_struct::tasks, time_now(), unschedule_task(), and task_struct::when.

void schedule_print ( FILE *  out,
schedule_type schedule 
)

Print schedule.

Parameters
[in]outfile descriptor
[in]scheduleschedule

Print schedule.

Definition at line 313 of file schedule.c.

References task_print(), and schedule_struct::tasks.

ods_status schedule_task ( schedule_type schedule,
task_type task,
int  log 
)

Schedule task.

Parameters
[in]scheduleschedule
[in]tasktask
[in]logadd entry in log for this
Returns
ods_status status

Schedule task.

Definition at line 146 of file schedule.c.

References task_struct::flush, schedule_struct::flushcount, ods_log_debug(), ods_log_error(), ODS_STATUS_ASSERT_ERR, ODS_STATUS_ERR, ODS_STATUS_MALLOC_ERR, ODS_STATUS_OK, schedule_lookup_task(), task_log(), task_what2str(), task_who2str(), schedule_struct::tasks, and task_struct::what.

Referenced by engine_update_zones(), reschedule_task(), and zone_reschedule_task().

task_type* unschedule_task ( schedule_type schedule,
task_type task 
)

Unschedule task.

Parameters
[in]scheduleschedule
[in]tasktask to delete
Returns
task_type* task, if it was scheduled

Unschedule task.

Definition at line 191 of file schedule.c.

References task_struct::flush, schedule_struct::flushcount, ods_log_debug(), ods_log_warning(), task_what2str(), task_who2str(), schedule_struct::tasks, and task_struct::what.

Referenced by engine_update_zones(), reschedule_task(), schedule_pop_task(), and zone_reschedule_task().