OpenDNSSEC-enforcer  2.0.2
keystate_ds_submit_task.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011 Surfnet
3  * Copyright (c) 2011 .SE (The Internet Infrastructure Foundation).
4  * Copyright (c) 2011 OpenDNSSEC AB (svb)
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  * notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
20  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
22  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
24  * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
25  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  *
28  */
29 #include "config.h"
30 
31 #include "clientpipe.h"
32 #include "scheduler/task.h"
33 #include "daemon/engine.h"
34 #include "duration.h"
35 #include "keystate/keystate_ds.h"
36 #include "enforcer/enforce_task.h"
37 
39 
40 /* static const char *module_str = "keystate_ds_submit_task"; */
41 
42 /* executed headless */
43 static task_type *
44 keystate_ds_submit_task_perform(task_type *task)
45 {
46  assert(task);
47 
48  (void)change_keys_from_to(task->dbconn, -1, NULL, NULL, 0,
50  (engine_type*)task->context);
51  task_cleanup(task);
53  return NULL;
54 }
55 
56 task_type *
58 {
59  task_id what_id;
60  const char *what = "ds-submit";
61  const char *who = "KSK keys with submit flag set";
62 
63  what_id = task_register(what, "keystate_ds_submit_task_perform",
64  keystate_ds_submit_task_perform);
65  return task_create(what_id, time_now(), who, what, engine, NULL);
66 }
task_type * keystate_ds_submit_task(engine_type *engine)
void * context
Definition: task.h:68
enum task_id_enum task_id
Definition: task.h:53
void task_cleanup(task_type *task)
Definition: task.c:147
db_connection_t * dbconn
Definition: task.h:71
task_id task_register(const char *short_name, const char *long_name, how_type how)
Definition: task.c:82
task_type * task_create(task_id what_id, time_t when, const char *who, const char *what, void *context, how_type clean_context)
Definition: task.c:110
int flush_enforce_task(engine_type *engine, bool enforce_all)
Definition: enforce_task.c:323
int change_keys_from_to(db_connection_t *dbconn, int sockfd, const char *zonename, const hsm_key_t *hsmkey, int keytag, key_data_ds_at_parent_t state_from, key_data_ds_at_parent_t state_to, engine_type *engine)
Definition: keystate_ds.c:342