31#include "cmdhandler.h"
38#include "clientpipe.h"
39#include "longgetopt.h"
46static const char *module_str =
"zone_list_cmd";
59 "List all zones currently in the database.\n\n"
64run(cmdhandler_ctx_type* context,
int argc,
char* argv[])
66 int sockfd = context->sockfd;
67 const char* fmt =
"%-31s %-13s %-26s %-34s\n";
78 client_printf_err(sockfd,
"Unable to get list of zones, memory allocation or database error!\n");
82 client_printf(sockfd,
"Database set to: %s\n", engine->
config->
datastore);
84 client_printf(sockfd,
"No zones in database.\n");
89 client_printf(sockfd,
"Zones:\n");
90 client_printf(sockfd, fmt,
"Zone:",
"Policy:",
"Next change:",
91 "Signer Configuration:");
95 nctime =
"invalid date/time";
101 nctime =
"as soon as possible";
103 nctime =
"no changes scheduled";
123 client_printf(sockfd, fmt,
138 "zone list", &usage, &help, NULL, NULL, &run, NULL
int db_value_cmp(const db_value_t *value_a, const db_value_t *value_b, int *result)
db_connection_t * getconnectioncontext(cmdhandler_ctx_type *context)
engine_type * getglobalcontext(cmdhandler_ctx_type *context)
const char * policy_name(const policy_t *policy)
const db_value_t * policy_id(const policy_t *policy)
void policy_free(policy_t *policy)
engineconfig_type * config
zone_list_db_t * zone_list_db_new_get(const db_connection_t *connection)
const char * zone_db_signconf_path(const zone_db_t *zone)
const db_value_t * zone_db_policy_id(const zone_db_t *zone)
policy_t * zone_db_get_policy(const zone_db_t *zone)
const char * zone_db_name(const zone_db_t *zone)
const zone_db_t * zone_list_db_next(zone_list_db_t *zone_list)
int zone_db_next_change(const zone_db_t *zone)
void zone_list_db_free(zone_list_db_t *zone_list)
struct cmd_func_block zone_list_funcblock