37 #include "clientpipe.h" 44 static const char *module_str =
"zone_list_cmd";
57 "List all zones currently in the database.\n\n" 62 handles(
const char *cmd, ssize_t n)
71 const char* fmt =
"%-31s %-13s %-26s %-34s\n";
83 client_printf_err(sockfd,
"Unable to get list of zones, memory allocation or database error!\n");
87 client_printf(sockfd,
"Database set to: %s\n", engine->
config->
datastore);
89 client_printf(sockfd,
"No zones in database.\n");
94 client_printf(sockfd,
"Zones:\n");
95 client_printf(sockfd, fmt,
"Zone:",
"Policy:",
"Next change:",
96 "Signer Configuration:");
100 nctime =
"invalid date/time";
106 nctime =
"as soon as possible";
108 nctime =
"no changes scheduled";
128 client_printf(sockfd, fmt,
const char * zone_signconf_path(const zone_t *zone)
const db_value_t * zone_policy_id(const zone_t *zone)
const zone_t * zone_list_next(zone_list_t *zone_list)
void ods_log_debug(const char *format,...)
const char * policy_name(const policy_t *policy)
policy_t * zone_get_policy(const zone_t *zone)
void zone_list_free(zone_list_t *zone_list)
int(* run)(int sockfd, struct engine_struct *engine, const char *cmd, ssize_t n, db_connection_t *dbconn)
int zone_next_change(const zone_t *zone)
void(* usage)(int sockfd)
int db_value_cmp(const db_value_t *value_a, const db_value_t *value_b, int *result)
engineconfig_type * config
void policy_free(policy_t *policy)
const char * zone_name(const zone_t *zone)
zone_list_t * zone_list_new_get(const db_connection_t *connection)
int(* handles)(const char *cmd, ssize_t n)
struct cmd_func_block * zone_list_funcblock(void)
const db_value_t * policy_id(const policy_t *policy)