31 #include "cmdhandler.h"
38 #include "clientpipe.h"
45 static const char *module_str =
"zone_list_cmd";
58 "List all zones currently in the database.\n\n"
63 run(
int sockfd, cmdhandler_ctx_type* context,
const char *cmd)
65 const char* fmt =
"%-31s %-13s %-26s %-34s\n";
79 client_printf_err(sockfd,
"Unable to get list of zones, memory allocation or database error!\n");
83 client_printf(sockfd,
"Database set to: %s\n", engine->
config->
datastore);
85 client_printf(sockfd,
"No zones in database.\n");
90 client_printf(sockfd,
"Zones:\n");
91 client_printf(sockfd, fmt,
"Zone:",
"Policy:",
"Next change:",
92 "Signer Configuration:");
96 nctime =
"invalid date/time";
102 nctime =
"as soon as possible";
104 nctime =
"no changes scheduled";
124 client_printf(sockfd, fmt,
139 "zone list", &usage, &help, NULL, &run
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_name(const zone_db_t *zone)
const char * zone_db_signconf_path(const zone_db_t *zone)
policy_t * zone_db_get_policy(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)
const db_value_t * zone_db_policy_id(const zone_db_t *zone)
struct cmd_func_block zone_list_funcblock