OpenDNSSEC-enforcer
2.1.13
src
policy
policy_resalt_cmd.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
30
#include "config.h"
31
32
#include "cmdhandler.h"
33
#include "
daemon/enforcercommands.h
"
34
#include "
policy/policy_resalt_task.h
"
35
#include "duration.h"
36
#include "file.h"
37
#include "log.h"
38
#include "str.h"
39
#include "
daemon/engine.h
"
40
#include "clientpipe.h"
41
#include "longgetopt.h"
42
43
#include "
policy/policy_resalt_cmd.h
"
44
45
/* static const char *module_str = "policy_resalt_cmd"; */
46
47
static
void
48
usage(
int
sockfd)
49
{
50
client_printf(sockfd,
51
"policy resalt\n"
52
);
53
}
54
55
static
void
56
help(
int
sockfd)
57
{
58
client_printf(sockfd,
"Generate new NSEC3 salts for policies that have salts older than the resalt duration.\n\n"
);
59
}
60
61
static
int
62
run(cmdhandler_ctx_type* context,
int
argc,
char
* argv[])
63
{
64
db_connection_t
* dbconn =
getconnectioncontext
(context);;
65
engine_type
* engine =
getglobalcontext
(context);
66
67
return
flush_resalt_task_now
(engine, dbconn);
68
}
69
70
struct
cmd_func_block
resalt_funcblock
= {
71
"policy resalt"
, &usage, &help, NULL, NULL, &run, NULL
72
};
getconnectioncontext
db_connection_t * getconnectioncontext(cmdhandler_ctx_type *context)
Definition
enforcercommands.c:107
getglobalcontext
engine_type * getglobalcontext(cmdhandler_ctx_type *context)
Definition
enforcercommands.c:101
enforcercommands.h
engine.h
resalt_funcblock
struct cmd_func_block resalt_funcblock
Definition
policy_resalt_cmd.c:70
policy_resalt_cmd.h
flush_resalt_task_now
int flush_resalt_task_now(engine_type *engine, db_connection_t *dbconn)
Definition
policy_resalt_task.c:206
policy_resalt_task.h
db_connection
Definition
db_connection.h:46
engine_struct
Definition
engine.h:47
Generated by
1.9.8