33 #include "cmdhandler.h"
40 #include "clientpipe.h"
44 static const char *module_str =
"enforce_cmd";
57 " --zone <zone> aka -z\n");
64 "Force enforce task to run for a zone."
65 " Without arguments run enforce task for every zone.\n"
67 "zone Schedule enforce task for this zone for *now*\n"
77 run(
int sockfd, cmdhandler_ctx_type* context,
const char *cmd)
84 int long_index = 0, opt = 0;
85 char const *zone_name = NULL;
90 static struct option long_options[] = {
91 {
"zone", required_argument, 0,
'z'},
99 if (!(buf = strdup(cmd))) {
100 client_printf_err(sockfd,
"memory error\n");
103 argc = ods_str_explode(buf,
MAX_ARGS, argv);
105 client_printf_err(sockfd,
"too many arguments\n");
106 ods_log_error(
"[%s] too many arguments for %s command",
113 while ((opt = getopt_long(argc, (
char*
const*)argv,
"z:", long_options, &long_index)) != -1) {
119 client_printf_err(sockfd,
"unknown arguments\n");
120 ods_log_error(
"[%s] unknown arguments for %s command",
137 "enforce", &usage, &help, NULL, &run
struct cmd_func_block enforce_funcblock
void enforce_task_flush_all(engine_type *engine, db_connection_t *dbconn)
void enforce_task_flush_zone(engine_type *engine, char const *zonename)
db_connection_t * getconnectioncontext(cmdhandler_ctx_type *context)
engine_type * getglobalcontext(cmdhandler_ctx_type *context)