test_zone.c
Go to the documentation of this file.
/*
* Copyright (c) 2014 Jerry Lundström <lundstrom.jerry@gmail.com>
* Copyright (c) 2014 .SE (The Internet Infrastructure Foundation).
* Copyright (c) 2014 OpenDNSSEC AB (svb)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include "CUnit/Basic.h"
#include "../db_configuration.h"
#include "../db_connection.h"
#include "../zone_db.h"
#include <string.h>
static db_configuration_list_t* configuration_list = NULL;
static db_configuration_t* configuration = NULL;
static db_connection_t* connection = NULL;
static zone_db_t* object = NULL;
static zone_list_db_t* object_list = NULL;
static db_value_t id = DB_VALUE_EMPTY;
static db_clause_list_t* clause_list = NULL;
static int db_sqlite = 0;
static int db_mysql = 0;
#if defined(ENFORCER_DATABASE_SQLITE3)
int test_zone_init_suite_sqlite(void) {
if (configuration_list) {
return 1;
}
if (configuration) {
return 1;
}
if (connection) {
return 1;
}
/*
* Setup the configuration for the connection
*/
if (!(configuration_list = db_configuration_list_new())) {
return 1;
}
if (!(configuration = db_configuration_new())
|| db_configuration_set_name(configuration, "backend")
|| db_configuration_set_value(configuration, "sqlite")
|| db_configuration_list_add(configuration_list, configuration))
{
db_configuration_free(configuration);
configuration = NULL;
db_configuration_list_free(configuration_list);
configuration_list = NULL;
return 1;
}
configuration = NULL;
if (!(configuration = db_configuration_new())
|| db_configuration_set_name(configuration, "file")
|| db_configuration_set_value(configuration, "test.db")
|| db_configuration_list_add(configuration_list, configuration))
{
db_configuration_free(configuration);
configuration = NULL;
db_configuration_list_free(configuration_list);
configuration_list = NULL;
return 1;
}
configuration = NULL;
/*
* Connect to the database
*/
if (!(connection = db_connection_new())
|| db_connection_set_configuration_list(connection, configuration_list))
{
db_connection_free(connection);
connection = NULL;
db_configuration_list_free(configuration_list);
configuration_list = NULL;
return 1;
}
configuration_list = NULL;
if (db_connection_setup(connection)
|| db_connection_connect(connection))
{
db_connection_free(connection);
connection = NULL;
return 1;
}
db_sqlite = 1;
db_mysql = 0;
return 0;
}
#endif
#if defined(ENFORCER_DATABASE_MYSQL)
int test_zone_init_suite_mysql(void) {
if (configuration_list) {
return 1;
}
if (configuration) {
return 1;
}
if (connection) {
return 1;
}
/*
* Setup the configuration for the connection
*/
if (!(configuration_list = db_configuration_list_new())) {
return 1;
}
if (!(configuration = db_configuration_new())
|| db_configuration_set_name(configuration, "backend")
|| db_configuration_set_value(configuration, "mysql")
|| db_configuration_list_add(configuration_list, configuration))
{
db_configuration_free(configuration);
configuration = NULL;
db_configuration_list_free(configuration_list);
configuration_list = NULL;
return 1;
}
configuration = NULL;
if (!(configuration = db_configuration_new())
|| db_configuration_set_name(configuration, "host")
|| db_configuration_set_value(configuration, ENFORCER_DB_HOST)
|| db_configuration_list_add(configuration_list, configuration))
{
db_configuration_free(configuration);
configuration = NULL;
db_configuration_list_free(configuration_list);
configuration_list = NULL;
return 1;
}
configuration = NULL;
if (!(configuration = db_configuration_new())
|| db_configuration_set_name(configuration, "port")
|| db_configuration_set_value(configuration, ENFORCER_DB_PORT_TEXT)
|| db_configuration_list_add(configuration_list, configuration))
{
db_configuration_free(configuration);
configuration = NULL;
db_configuration_list_free(configuration_list);
configuration_list = NULL;
return 1;
}
configuration = NULL;
if (!(configuration = db_configuration_new())
|| db_configuration_set_name(configuration, "user")
|| db_configuration_set_value(configuration, ENFORCER_DB_USERNAME)
|| db_configuration_list_add(configuration_list, configuration))
{
db_configuration_free(configuration);
configuration = NULL;
db_configuration_list_free(configuration_list);
configuration_list = NULL;
return 1;
}
configuration = NULL;
if (!(configuration = db_configuration_new())
|| db_configuration_set_name(configuration, "pass")
|| db_configuration_set_value(configuration, ENFORCER_DB_PASSWORD)
|| db_configuration_list_add(configuration_list, configuration))
{
db_configuration_free(configuration);
configuration = NULL;
db_configuration_list_free(configuration_list);
configuration_list = NULL;
return 1;
}
configuration = NULL;
if (!(configuration = db_configuration_new())
|| db_configuration_set_name(configuration, "db")
|| db_configuration_set_value(configuration, ENFORCER_DB_DATABASE)
|| db_configuration_list_add(configuration_list, configuration))
{
db_configuration_free(configuration);
configuration = NULL;
db_configuration_list_free(configuration_list);
configuration_list = NULL;
return 1;
}
configuration = NULL;
/*
* Connect to the database
*/
if (!(connection = db_connection_new())
|| db_connection_set_configuration_list(connection, configuration_list))
{
db_connection_free(connection);
connection = NULL;
db_configuration_list_free(configuration_list);
configuration_list = NULL;
return 1;
}
configuration_list = NULL;
if (db_connection_setup(connection)
|| db_connection_connect(connection))
{
db_connection_free(connection);
connection = NULL;
return 1;
}
db_sqlite = 0;
db_mysql = 1;
return 0;
}
#endif
static int test_zone_clean_suite(void) {
db_connection_free(connection);
connection = NULL;
db_configuration_free(configuration);
configuration = NULL;
db_configuration_list_free(configuration_list);
configuration_list = NULL;
db_value_reset(&id);
db_clause_list_free(clause_list);
clause_list = NULL;
return 0;
}
static void test_zone_new(void) {
CU_ASSERT_PTR_NOT_NULL_FATAL((object = zone_db_new(connection)));
CU_ASSERT_PTR_NOT_NULL_FATAL((object_list = zone_list_db_new(connection)));
}
static void test_zone_set(void) {
db_value_t policy_id = DB_VALUE_EMPTY;
if (db_sqlite) {
CU_ASSERT(!db_value_from_int32(&policy_id, 1));
}
if (db_mysql) {
CU_ASSERT(!db_value_from_uint64(&policy_id, 1));
}
CU_ASSERT(!zone_db_set_policy_id(object, &policy_id));
CU_ASSERT(!zone_db_set_name(object, "name 1"));
CU_ASSERT(!zone_db_set_signconf_needs_writing(object, 1));
CU_ASSERT(!zone_db_set_signconf_path(object, "signconf_path 1"));
CU_ASSERT(!zone_db_set_next_change(object, 1));
CU_ASSERT(!zone_db_set_ttl_end_ds(object, 1));
CU_ASSERT(!zone_db_set_ttl_end_dk(object, 1));
CU_ASSERT(!zone_db_set_ttl_end_rs(object, 1));
CU_ASSERT(!zone_db_set_roll_ksk_now(object, 1));
CU_ASSERT(!zone_db_set_roll_zsk_now(object, 1));
CU_ASSERT(!zone_db_set_roll_csk_now(object, 1));
CU_ASSERT(!zone_db_set_input_adapter_type(object, "input_adapter_type 1"));
CU_ASSERT(!zone_db_set_input_adapter_uri(object, "input_adapter_uri 1"));
CU_ASSERT(!zone_db_set_output_adapter_type(object, "output_adapter_type 1"));
CU_ASSERT(!zone_db_set_output_adapter_uri(object, "output_adapter_uri 1"));
CU_ASSERT(!zone_db_set_next_ksk_roll(object, 1));
CU_ASSERT(!zone_db_set_next_zsk_roll(object, 1));
CU_ASSERT(!zone_db_set_next_csk_roll(object, 1));
db_value_reset(&policy_id);
}
static void test_zone_get(void) {
int ret;
db_value_t policy_id = DB_VALUE_EMPTY;
if (db_sqlite) {
CU_ASSERT(!db_value_from_int32(&policy_id, 1));
}
if (db_mysql) {
CU_ASSERT(!db_value_from_uint64(&policy_id, 1));
}
CU_ASSERT(!db_value_cmp(zone_db_policy_id(object), &policy_id, &ret));
CU_ASSERT(!ret);
CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_name(object));
CU_ASSERT(!strcmp(zone_db_name(object), "name 1"));
CU_ASSERT(zone_db_signconf_needs_writing(object) == 1);
CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_signconf_path(object));
CU_ASSERT(!strcmp(zone_db_signconf_path(object), "signconf_path 1"));
CU_ASSERT(zone_db_next_change(object) == 1);
CU_ASSERT(zone_db_ttl_end_ds(object) == 1);
CU_ASSERT(zone_db_ttl_end_dk(object) == 1);
CU_ASSERT(zone_db_ttl_end_rs(object) == 1);
CU_ASSERT(zone_db_roll_ksk_now(object) == 1);
CU_ASSERT(zone_db_roll_zsk_now(object) == 1);
CU_ASSERT(zone_db_roll_csk_now(object) == 1);
CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_input_adapter_type(object));
CU_ASSERT(!strcmp(zone_db_input_adapter_type(object), "input_adapter_type 1"));
CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_input_adapter_uri(object));
CU_ASSERT(!strcmp(zone_db_input_adapter_uri(object), "input_adapter_uri 1"));
CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_output_adapter_type(object));
CU_ASSERT(!strcmp(zone_db_output_adapter_type(object), "output_adapter_type 1"));
CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_output_adapter_uri(object));
CU_ASSERT(!strcmp(zone_db_output_adapter_uri(object), "output_adapter_uri 1"));
CU_ASSERT(zone_db_next_ksk_roll(object) == 1);
CU_ASSERT(zone_db_next_zsk_roll(object) == 1);
CU_ASSERT(zone_db_next_csk_roll(object) == 1);
db_value_reset(&policy_id);
}
static void test_zone_create(void) {
CU_ASSERT_FATAL(!zone_db_create(object));
}
static void test_zone_clauses(void) {
CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
CU_ASSERT_PTR_NOT_NULL(zone_db_policy_id_clause(clause_list, zone_db_policy_id(object)));
CU_ASSERT(!zone_list_db_get_by_clauses(object_list, clause_list));
CU_ASSERT_PTR_NOT_NULL(zone_list_db_next(object_list));
db_clause_list_free(clause_list);
clause_list = NULL;
CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
CU_ASSERT(!zone_list_db_get_by_clauses(object_list, clause_list));
CU_ASSERT_PTR_NOT_NULL(zone_list_db_next(object_list));
db_clause_list_free(clause_list);
clause_list = NULL;
CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
CU_ASSERT(!zone_list_db_get_by_clauses(object_list, clause_list));
CU_ASSERT_PTR_NOT_NULL(zone_list_db_next(object_list));
db_clause_list_free(clause_list);
clause_list = NULL;
CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
CU_ASSERT(!zone_list_db_get_by_clauses(object_list, clause_list));
CU_ASSERT_PTR_NOT_NULL(zone_list_db_next(object_list));
db_clause_list_free(clause_list);
clause_list = NULL;
CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
CU_ASSERT(!zone_list_db_get_by_clauses(object_list, clause_list));
CU_ASSERT_PTR_NOT_NULL(zone_list_db_next(object_list));
db_clause_list_free(clause_list);
clause_list = NULL;
CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
CU_ASSERT(!zone_list_db_get_by_clauses(object_list, clause_list));
CU_ASSERT_PTR_NOT_NULL(zone_list_db_next(object_list));
db_clause_list_free(clause_list);
clause_list = NULL;
CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
CU_ASSERT(!zone_list_db_get_by_clauses(object_list, clause_list));
CU_ASSERT_PTR_NOT_NULL(zone_list_db_next(object_list));
db_clause_list_free(clause_list);
clause_list = NULL;
CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
CU_ASSERT(!zone_list_db_get_by_clauses(object_list, clause_list));
CU_ASSERT_PTR_NOT_NULL(zone_list_db_next(object_list));
db_clause_list_free(clause_list);
clause_list = NULL;
CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
CU_ASSERT(!zone_list_db_get_by_clauses(object_list, clause_list));
CU_ASSERT_PTR_NOT_NULL(zone_list_db_next(object_list));
db_clause_list_free(clause_list);
clause_list = NULL;
CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
CU_ASSERT(!zone_list_db_get_by_clauses(object_list, clause_list));
CU_ASSERT_PTR_NOT_NULL(zone_list_db_next(object_list));
db_clause_list_free(clause_list);
clause_list = NULL;
CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
CU_ASSERT(!zone_list_db_get_by_clauses(object_list, clause_list));
CU_ASSERT_PTR_NOT_NULL(zone_list_db_next(object_list));
db_clause_list_free(clause_list);
clause_list = NULL;
CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
CU_ASSERT(!zone_list_db_get_by_clauses(object_list, clause_list));
CU_ASSERT_PTR_NOT_NULL(zone_list_db_next(object_list));
db_clause_list_free(clause_list);
clause_list = NULL;
CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
CU_ASSERT(!zone_list_db_get_by_clauses(object_list, clause_list));
CU_ASSERT_PTR_NOT_NULL(zone_list_db_next(object_list));
db_clause_list_free(clause_list);
clause_list = NULL;
CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
CU_ASSERT(!zone_list_db_get_by_clauses(object_list, clause_list));
CU_ASSERT_PTR_NOT_NULL(zone_list_db_next(object_list));
db_clause_list_free(clause_list);
clause_list = NULL;
CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
CU_ASSERT(!zone_list_db_get_by_clauses(object_list, clause_list));
CU_ASSERT_PTR_NOT_NULL(zone_list_db_next(object_list));
db_clause_list_free(clause_list);
clause_list = NULL;
CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
CU_ASSERT(!zone_list_db_get_by_clauses(object_list, clause_list));
CU_ASSERT_PTR_NOT_NULL(zone_list_db_next(object_list));
db_clause_list_free(clause_list);
clause_list = NULL;
CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
CU_ASSERT(!zone_list_db_get_by_clauses(object_list, clause_list));
CU_ASSERT_PTR_NOT_NULL(zone_list_db_next(object_list));
db_clause_list_free(clause_list);
clause_list = NULL;
CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
CU_ASSERT(!zone_list_db_get_by_clauses(object_list, clause_list));
CU_ASSERT_PTR_NOT_NULL(zone_list_db_next(object_list));
db_clause_list_free(clause_list);
clause_list = NULL;
}
static void test_zone_count(void) {
size_t count;
CU_ASSERT(!zone_db_count(object, NULL, &count));
CU_ASSERT(count == 1);
CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
CU_ASSERT_PTR_NOT_NULL(zone_db_policy_id_clause(clause_list, zone_db_policy_id(object)));
CU_ASSERT(!zone_db_count(object, clause_list, &count));
CU_ASSERT(count == 1);
db_clause_list_free(clause_list);
clause_list = NULL;
CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
CU_ASSERT(!zone_db_count(object, clause_list, &count));
CU_ASSERT(count == 1);
db_clause_list_free(clause_list);
clause_list = NULL;
CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
CU_ASSERT(!zone_db_count(object, clause_list, &count));
CU_ASSERT(count == 1);
db_clause_list_free(clause_list);
clause_list = NULL;
CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
CU_ASSERT(!zone_db_count(object, clause_list, &count));
CU_ASSERT(count == 1);
db_clause_list_free(clause_list);
clause_list = NULL;
CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
CU_ASSERT(!zone_db_count(object, clause_list, &count));
CU_ASSERT(count == 1);
db_clause_list_free(clause_list);
clause_list = NULL;
CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
CU_ASSERT(!zone_db_count(object, clause_list, &count));
CU_ASSERT(count == 1);
db_clause_list_free(clause_list);
clause_list = NULL;
CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
CU_ASSERT(!zone_db_count(object, clause_list, &count));
CU_ASSERT(count == 1);
db_clause_list_free(clause_list);
clause_list = NULL;
CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
CU_ASSERT(!zone_db_count(object, clause_list, &count));
CU_ASSERT(count == 1);
db_clause_list_free(clause_list);
clause_list = NULL;
CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
CU_ASSERT(!zone_db_count(object, clause_list, &count));
CU_ASSERT(count == 1);
db_clause_list_free(clause_list);
clause_list = NULL;
CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
CU_ASSERT(!zone_db_count(object, clause_list, &count));
CU_ASSERT(count == 1);
db_clause_list_free(clause_list);
clause_list = NULL;
CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
CU_ASSERT(!zone_db_count(object, clause_list, &count));
CU_ASSERT(count == 1);
db_clause_list_free(clause_list);
clause_list = NULL;
CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
CU_ASSERT(!zone_db_count(object, clause_list, &count));
CU_ASSERT(count == 1);
db_clause_list_free(clause_list);
clause_list = NULL;
CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
CU_ASSERT(!zone_db_count(object, clause_list, &count));
CU_ASSERT(count == 1);
db_clause_list_free(clause_list);
clause_list = NULL;
CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
CU_ASSERT(!zone_db_count(object, clause_list, &count));
CU_ASSERT(count == 1);
db_clause_list_free(clause_list);
clause_list = NULL;
CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
CU_ASSERT(!zone_db_count(object, clause_list, &count));
CU_ASSERT(count == 1);
db_clause_list_free(clause_list);
clause_list = NULL;
CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
CU_ASSERT(!zone_db_count(object, clause_list, &count));
CU_ASSERT(count == 1);
db_clause_list_free(clause_list);
clause_list = NULL;
CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
CU_ASSERT(!zone_db_count(object, clause_list, &count));
CU_ASSERT(count == 1);
db_clause_list_free(clause_list);
clause_list = NULL;
CU_ASSERT_PTR_NOT_NULL_FATAL((clause_list = db_clause_list_new()));
CU_ASSERT(!zone_db_count(object, clause_list, &count));
CU_ASSERT(count == 1);
db_clause_list_free(clause_list);
clause_list = NULL;
}
static void test_zone_list(void) {
const zone_db_t* item;
zone_db_t* item2;
zone_list_db_t* new_list;
CU_ASSERT_FATAL(!zone_list_db_get(object_list));
CU_ASSERT_PTR_NOT_NULL_FATAL((item = zone_list_db_next(object_list)));
CU_ASSERT_FATAL(!db_value_copy(&id, zone_db_id(item)));
CU_ASSERT_PTR_NOT_NULL_FATAL((item = zone_list_db_begin(object_list)));
CU_ASSERT_FATAL(!zone_list_db_get(object_list));
CU_ASSERT_PTR_NOT_NULL_FATAL((item2 = zone_list_db_get_next(object_list)));
zone_db_free(item2);
CU_PASS("zone_db_free");
CU_ASSERT_PTR_NOT_NULL((new_list = zone_list_db_new_get(connection)));
CU_ASSERT_PTR_NOT_NULL(zone_list_db_next(new_list));
zone_list_db_free(new_list);
}
static void test_zone_list_store(void) {
zone_list_db_t* new_list;
CU_ASSERT_PTR_NOT_NULL((new_list = zone_list_db_new(connection)));
CU_ASSERT_FATAL(!zone_list_db_object_store(new_list));
CU_ASSERT_FATAL(!zone_list_db_get(new_list));
CU_ASSERT_PTR_NOT_NULL_FATAL(zone_list_db_next(new_list));
CU_ASSERT_PTR_NOT_NULL_FATAL(zone_list_db_begin(new_list));
CU_PASS("zone_db_free");
zone_list_db_free(new_list);
}
static void test_zone_list_associated(void) {
zone_list_db_t* new_list;
CU_ASSERT_PTR_NOT_NULL((new_list = zone_list_db_new(connection)));
CU_ASSERT_FATAL(!zone_list_db_get(new_list));
CU_ASSERT_PTR_NOT_NULL_FATAL(zone_list_db_next(new_list));
CU_ASSERT_PTR_NOT_NULL_FATAL(zone_list_db_begin(new_list));
CU_PASS("zone_db_free");
zone_list_db_free(new_list);
}
static void test_zone_read(void) {
CU_ASSERT_FATAL(!zone_db_get_by_id(object, &id));
}
static void test_zone_verify(void) {
int ret;
db_value_t policy_id = DB_VALUE_EMPTY;
if (db_sqlite) {
CU_ASSERT(!db_value_from_int32(&policy_id, 1));
}
if (db_mysql) {
CU_ASSERT(!db_value_from_uint64(&policy_id, 1));
}
CU_ASSERT(!db_value_cmp(zone_db_policy_id(object), &policy_id, &ret));
CU_ASSERT(!ret);
CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_name(object));
CU_ASSERT(!strcmp(zone_db_name(object), "name 1"));
CU_ASSERT(zone_db_signconf_needs_writing(object) == 1);
CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_signconf_path(object));
CU_ASSERT(!strcmp(zone_db_signconf_path(object), "signconf_path 1"));
CU_ASSERT(zone_db_next_change(object) == 1);
CU_ASSERT(zone_db_ttl_end_ds(object) == 1);
CU_ASSERT(zone_db_ttl_end_dk(object) == 1);
CU_ASSERT(zone_db_ttl_end_rs(object) == 1);
CU_ASSERT(zone_db_roll_ksk_now(object) == 1);
CU_ASSERT(zone_db_roll_zsk_now(object) == 1);
CU_ASSERT(zone_db_roll_csk_now(object) == 1);
CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_input_adapter_type(object));
CU_ASSERT(!strcmp(zone_db_input_adapter_type(object), "input_adapter_type 1"));
CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_input_adapter_uri(object));
CU_ASSERT(!strcmp(zone_db_input_adapter_uri(object), "input_adapter_uri 1"));
CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_output_adapter_type(object));
CU_ASSERT(!strcmp(zone_db_output_adapter_type(object), "output_adapter_type 1"));
CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_output_adapter_uri(object));
CU_ASSERT(!strcmp(zone_db_output_adapter_uri(object), "output_adapter_uri 1"));
CU_ASSERT(zone_db_next_ksk_roll(object) == 1);
CU_ASSERT(zone_db_next_zsk_roll(object) == 1);
CU_ASSERT(zone_db_next_csk_roll(object) == 1);
db_value_reset(&policy_id);
}
static void test_zone_read_by_name(void) {
CU_ASSERT_FATAL(!zone_db_get_by_name(object, "name 1"));
}
static void test_zone_verify_name(void) {
int ret;
db_value_t policy_id = DB_VALUE_EMPTY;
if (db_sqlite) {
CU_ASSERT(!db_value_from_int32(&policy_id, 1));
}
if (db_mysql) {
CU_ASSERT(!db_value_from_uint64(&policy_id, 1));
}
CU_ASSERT(!db_value_cmp(zone_db_policy_id(object), &policy_id, &ret));
CU_ASSERT(!ret);
CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_name(object));
CU_ASSERT(!strcmp(zone_db_name(object), "name 1"));
CU_ASSERT(zone_db_signconf_needs_writing(object) == 1);
CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_signconf_path(object));
CU_ASSERT(!strcmp(zone_db_signconf_path(object), "signconf_path 1"));
CU_ASSERT(zone_db_next_change(object) == 1);
CU_ASSERT(zone_db_ttl_end_ds(object) == 1);
CU_ASSERT(zone_db_ttl_end_dk(object) == 1);
CU_ASSERT(zone_db_ttl_end_rs(object) == 1);
CU_ASSERT(zone_db_roll_ksk_now(object) == 1);
CU_ASSERT(zone_db_roll_zsk_now(object) == 1);
CU_ASSERT(zone_db_roll_csk_now(object) == 1);
CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_input_adapter_type(object));
CU_ASSERT(!strcmp(zone_db_input_adapter_type(object), "input_adapter_type 1"));
CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_input_adapter_uri(object));
CU_ASSERT(!strcmp(zone_db_input_adapter_uri(object), "input_adapter_uri 1"));
CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_output_adapter_type(object));
CU_ASSERT(!strcmp(zone_db_output_adapter_type(object), "output_adapter_type 1"));
CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_output_adapter_uri(object));
CU_ASSERT(!strcmp(zone_db_output_adapter_uri(object), "output_adapter_uri 1"));
CU_ASSERT(zone_db_next_ksk_roll(object) == 1);
CU_ASSERT(zone_db_next_zsk_roll(object) == 1);
CU_ASSERT(zone_db_next_csk_roll(object) == 1);
db_value_reset(&policy_id);
}
static void test_zone_change(void) {
db_value_t policy_id = DB_VALUE_EMPTY;
if (db_sqlite) {
CU_ASSERT(!db_value_from_int32(&policy_id, 1));
}
if (db_mysql) {
CU_ASSERT(!db_value_from_uint64(&policy_id, 1));
}
CU_ASSERT(!zone_db_set_policy_id(object, &policy_id));
CU_ASSERT(!zone_db_set_name(object, "name 2"));
CU_ASSERT(!zone_db_set_signconf_needs_writing(object, 2));
CU_ASSERT(!zone_db_set_signconf_path(object, "signconf_path 2"));
CU_ASSERT(!zone_db_set_next_change(object, 2));
CU_ASSERT(!zone_db_set_ttl_end_ds(object, 2));
CU_ASSERT(!zone_db_set_ttl_end_dk(object, 2));
CU_ASSERT(!zone_db_set_ttl_end_rs(object, 2));
CU_ASSERT(!zone_db_set_roll_ksk_now(object, 2));
CU_ASSERT(!zone_db_set_roll_zsk_now(object, 2));
CU_ASSERT(!zone_db_set_roll_csk_now(object, 2));
CU_ASSERT(!zone_db_set_input_adapter_type(object, "input_adapter_type 2"));
CU_ASSERT(!zone_db_set_input_adapter_uri(object, "input_adapter_uri 2"));
CU_ASSERT(!zone_db_set_output_adapter_type(object, "output_adapter_type 2"));
CU_ASSERT(!zone_db_set_output_adapter_uri(object, "output_adapter_uri 2"));
CU_ASSERT(!zone_db_set_next_ksk_roll(object, 2));
CU_ASSERT(!zone_db_set_next_zsk_roll(object, 2));
CU_ASSERT(!zone_db_set_next_csk_roll(object, 2));
db_value_reset(&policy_id);
}
static void test_zone_update(void) {
CU_ASSERT_FATAL(!zone_db_update(object));
}
static void test_zone_read2(void) {
CU_ASSERT_FATAL(!zone_db_get_by_id(object, &id));
}
static void test_zone_verify2(void) {
int ret;
db_value_t policy_id = DB_VALUE_EMPTY;
if (db_sqlite) {
CU_ASSERT(!db_value_from_int32(&policy_id, 1));
}
if (db_mysql) {
CU_ASSERT(!db_value_from_uint64(&policy_id, 1));
}
CU_ASSERT(!db_value_cmp(zone_db_policy_id(object), &policy_id, &ret));
CU_ASSERT(!ret);
CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_name(object));
CU_ASSERT(!strcmp(zone_db_name(object), "name 2"));
CU_ASSERT(zone_db_signconf_needs_writing(object) == 2);
CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_signconf_path(object));
CU_ASSERT(!strcmp(zone_db_signconf_path(object), "signconf_path 2"));
CU_ASSERT(zone_db_next_change(object) == 2);
CU_ASSERT(zone_db_ttl_end_ds(object) == 2);
CU_ASSERT(zone_db_ttl_end_dk(object) == 2);
CU_ASSERT(zone_db_ttl_end_rs(object) == 2);
CU_ASSERT(zone_db_roll_ksk_now(object) == 2);
CU_ASSERT(zone_db_roll_zsk_now(object) == 2);
CU_ASSERT(zone_db_roll_csk_now(object) == 2);
CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_input_adapter_type(object));
CU_ASSERT(!strcmp(zone_db_input_adapter_type(object), "input_adapter_type 2"));
CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_input_adapter_uri(object));
CU_ASSERT(!strcmp(zone_db_input_adapter_uri(object), "input_adapter_uri 2"));
CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_output_adapter_type(object));
CU_ASSERT(!strcmp(zone_db_output_adapter_type(object), "output_adapter_type 2"));
CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_output_adapter_uri(object));
CU_ASSERT(!strcmp(zone_db_output_adapter_uri(object), "output_adapter_uri 2"));
CU_ASSERT(zone_db_next_ksk_roll(object) == 2);
CU_ASSERT(zone_db_next_zsk_roll(object) == 2);
CU_ASSERT(zone_db_next_csk_roll(object) == 2);
db_value_reset(&policy_id);
}
static void test_zone_read_by_name2(void) {
CU_ASSERT_FATAL(!zone_db_get_by_name(object, "name 2"));
}
static void test_zone_verify_name2(void) {
int ret;
db_value_t policy_id = DB_VALUE_EMPTY;
if (db_sqlite) {
CU_ASSERT(!db_value_from_int32(&policy_id, 1));
}
if (db_mysql) {
CU_ASSERT(!db_value_from_uint64(&policy_id, 1));
}
CU_ASSERT(!db_value_cmp(zone_db_policy_id(object), &policy_id, &ret));
CU_ASSERT(!ret);
CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_name(object));
CU_ASSERT(!strcmp(zone_db_name(object), "name 2"));
CU_ASSERT(zone_db_signconf_needs_writing(object) == 2);
CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_signconf_path(object));
CU_ASSERT(!strcmp(zone_db_signconf_path(object), "signconf_path 2"));
CU_ASSERT(zone_db_next_change(object) == 2);
CU_ASSERT(zone_db_ttl_end_ds(object) == 2);
CU_ASSERT(zone_db_ttl_end_dk(object) == 2);
CU_ASSERT(zone_db_ttl_end_rs(object) == 2);
CU_ASSERT(zone_db_roll_ksk_now(object) == 2);
CU_ASSERT(zone_db_roll_zsk_now(object) == 2);
CU_ASSERT(zone_db_roll_csk_now(object) == 2);
CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_input_adapter_type(object));
CU_ASSERT(!strcmp(zone_db_input_adapter_type(object), "input_adapter_type 2"));
CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_input_adapter_uri(object));
CU_ASSERT(!strcmp(zone_db_input_adapter_uri(object), "input_adapter_uri 2"));
CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_output_adapter_type(object));
CU_ASSERT(!strcmp(zone_db_output_adapter_type(object), "output_adapter_type 2"));
CU_ASSERT_PTR_NOT_NULL_FATAL(zone_db_output_adapter_uri(object));
CU_ASSERT(!strcmp(zone_db_output_adapter_uri(object), "output_adapter_uri 2"));
CU_ASSERT(zone_db_next_ksk_roll(object) == 2);
CU_ASSERT(zone_db_next_zsk_roll(object) == 2);
CU_ASSERT(zone_db_next_csk_roll(object) == 2);
db_value_reset(&policy_id);
}
static void test_zone_delete(void) {
CU_ASSERT_FATAL(!zone_db_delete(object));
}
static void test_zone_list2(void) {
CU_ASSERT_FATAL(!zone_list_db_get(object_list));
CU_ASSERT_PTR_NULL(zone_list_db_next(object_list));
}
static void test_zone_end(void) {
if (object) {
zone_db_free(object);
CU_PASS("zone_db_free");
}
if (object_list) {
zone_list_db_free(object_list);
CU_PASS("zone_list_db_free");
}
}
static int test_zone_add_tests(CU_pSuite pSuite) {
if (!CU_add_test(pSuite, "new object", test_zone_new)
|| !CU_add_test(pSuite, "set fields", test_zone_set)
|| !CU_add_test(pSuite, "get fields", test_zone_get)
|| !CU_add_test(pSuite, "create object", test_zone_create)
|| !CU_add_test(pSuite, "object clauses", test_zone_clauses)
|| !CU_add_test(pSuite, "object count", test_zone_count)
|| !CU_add_test(pSuite, "list objects", test_zone_list)
|| !CU_add_test(pSuite, "list objects (store)", test_zone_list_store)
|| !CU_add_test(pSuite, "list objects (associated)", test_zone_list_associated)
|| !CU_add_test(pSuite, "read object by id", test_zone_read)
|| !CU_add_test(pSuite, "verify fields", test_zone_verify)
|| !CU_add_test(pSuite, "read object by name", test_zone_read_by_name)
|| !CU_add_test(pSuite, "verify fields (name)", test_zone_verify_name)
|| !CU_add_test(pSuite, "change object", test_zone_change)
|| !CU_add_test(pSuite, "update object", test_zone_update)
|| !CU_add_test(pSuite, "reread object by id", test_zone_read2)
|| !CU_add_test(pSuite, "verify fields after update", test_zone_verify2)
|| !CU_add_test(pSuite, "reread object by name", test_zone_read_by_name2)
|| !CU_add_test(pSuite, "verify fields after update (name)", test_zone_verify_name2)
|| !CU_add_test(pSuite, "delete object", test_zone_delete)
|| !CU_add_test(pSuite, "list objects to verify delete", test_zone_list2)
|| !CU_add_test(pSuite, "end test", test_zone_end))
{
return CU_get_error();
}
return 0;
}
int test_zone_add_suite(void) {
CU_pSuite pSuite = NULL;
int ret;
#if defined(ENFORCER_DATABASE_SQLITE3)
pSuite = CU_add_suite("Test of zone (SQLite)", test_zone_init_suite_sqlite, test_zone_clean_suite);
if (!pSuite) {
return CU_get_error();
}
ret = test_zone_add_tests(pSuite);
if (ret) {
return ret;
}
#endif
#if defined(ENFORCER_DATABASE_MYSQL)
pSuite = CU_add_suite("Test of zone (MySQL)", test_zone_init_suite_mysql, test_zone_clean_suite);
if (!pSuite) {
return CU_get_error();
}
ret = test_zone_add_tests(pSuite);
if (ret) {
return ret;
}
#endif
return 0;
}
db_clause_list_new
db_clause_list_t * db_clause_list_new(void)
Definition db_clause.c:202
db_clause_list_free
void db_clause_list_free(db_clause_list_t *clause_list)
Definition db_clause.c:209
db_configuration_new
db_configuration_t * db_configuration_new(void)
Definition db_configuration.c:41
db_configuration_list_new
db_configuration_list_t * db_configuration_list_new(void)
Definition db_configuration.c:127
db_configuration_free
void db_configuration_free(db_configuration_t *configuration)
Definition db_configuration.c:48
db_configuration_set_name
int db_configuration_set_name(db_configuration_t *configuration, const char *name)
Definition db_configuration.c:68
db_configuration_list_add
int db_configuration_list_add(db_configuration_list_t *configuration_list, db_configuration_t *configuration)
Definition db_configuration.c:150
db_configuration_set_value
int db_configuration_set_value(db_configuration_t *configuration, const char *value)
Definition db_configuration.c:89
db_configuration_list_free
void db_configuration_list_free(db_configuration_list_t *configuration_list)
Definition db_configuration.c:134
db_connection_connect
int db_connection_connect(const db_connection_t *connection)
Definition db_connection.c:88
db_connection_new
db_connection_t * db_connection_new(void)
Definition db_connection.c:38
db_connection_setup
int db_connection_setup(db_connection_t *connection)
Definition db_connection.c:66
db_connection_free
void db_connection_free(db_connection_t *connection)
Definition db_connection.c:45
db_connection_set_configuration_list
int db_connection_set_configuration_list(db_connection_t *connection, const db_configuration_list_t *configuration_list)
Definition db_connection.c:54
db_value_from_int32
int db_value_from_int32(db_value_t *value, db_type_int32_t from_int32)
Definition db_value.c:479
db_value_copy
int db_value_copy(db_value_t *value, const db_value_t *from_value)
Definition db_value.c:77
db_value_cmp
int db_value_cmp(const db_value_t *value_a, const db_value_t *value_b, int *result)
Definition db_value.c:102
db_value_reset
void db_value_reset(db_value_t *value)
Definition db_value.c:60
db_value_from_uint64
int db_value_from_uint64(db_value_t *value, db_type_uint64_t from_uint64)
Definition db_value.c:518
DB_VALUE_EMPTY
#define DB_VALUE_EMPTY
Definition db_value.h:60
policy_id
const db_value_t * policy_id(const policy_t *policy)
Definition policy.c:805
db_clause_list
Definition db_clause.h:226
db_configuration_list
Definition db_configuration.h:93
db_configuration
Definition db_configuration.h:41
db_connection
Definition db_connection.h:46
db_value
Definition db_value.h:48
zone_db
Definition zone_db.h:46
zone_list_db
Definition zone_db.h:466
test_zone_add_suite
int test_zone_add_suite(void)
Definition test_zone.c:852
zone_list_db_new_get
zone_list_db_t * zone_list_db_new_get(const db_connection_t *connection)
Definition zone_db.c:2402
zone_db_roll_zsk_now
unsigned int zone_db_roll_zsk_now(const zone_db_t *zone)
Definition zone_db.c:846
zone_db_set_input_adapter_type
int zone_db_set_input_adapter_type(zone_db_t *zone, const char *input_adapter_type_text)
Definition zone_db.c:1061
zone_db_set_ttl_end_dk
int zone_db_set_ttl_end_dk(zone_db_t *zone, unsigned int ttl_end_dk)
Definition zone_db.c:1011
zone_list_db_object_store
int zone_list_db_object_store(zone_list_db_t *zone_list)
Definition zone_db.c:1979
zone_db_free
void zone_db_free(zone_db_t *zone)
Definition zone_db.c:325
zone_db_set_next_ksk_roll
int zone_db_set_next_ksk_roll(zone_db_t *zone, unsigned int next_ksk_roll)
Definition zone_db.c:1149
zone_db_ttl_end_rs
unsigned int zone_db_ttl_end_rs(const zone_db_t *zone)
Definition zone_db.c:830
zone_db_set_signconf_needs_writing
int zone_db_set_signconf_needs_writing(zone_db_t *zone, unsigned int signconf_needs_writing)
Definition zone_db.c:959
zone_db_delete
int zone_db_delete(zone_db_t *zone)
Definition zone_db.c:1884
zone_db_signconf_path
const char * zone_db_signconf_path(const zone_db_t *zone)
Definition zone_db.c:798
zone_db_ttl_end_ds
unsigned int zone_db_ttl_end_ds(const zone_db_t *zone)
Definition zone_db.c:814
zone_db_policy_id
const db_value_t * zone_db_policy_id(const zone_db_t *zone)
Definition zone_db.c:736
zone_db_set_output_adapter_type
int zone_db_set_output_adapter_type(zone_db_t *zone, const char *output_adapter_type_text)
Definition zone_db.c:1105
zone_db_set_roll_zsk_now
int zone_db_set_roll_zsk_now(zone_db_t *zone, unsigned int roll_zsk_now)
Definition zone_db.c:1041
zone_db_set_roll_csk_now
int zone_db_set_roll_csk_now(zone_db_t *zone, unsigned int roll_csk_now)
Definition zone_db.c:1051
zone_db_set_policy_id
int zone_db_set_policy_id(zone_db_t *zone, const db_value_t *policy_id)
Definition zone_db.c:918
zone_db_roll_ksk_now
unsigned int zone_db_roll_ksk_now(const zone_db_t *zone)
Definition zone_db.c:838
zone_db_name
const char * zone_db_name(const zone_db_t *zone)
Definition zone_db.c:782
zone_list_db_begin
const zone_db_t * zone_list_db_begin(zone_list_db_t *zone_list)
Definition zone_db.c:2547
zone_db_next_ksk_roll
unsigned int zone_db_next_ksk_roll(const zone_db_t *zone)
Definition zone_db.c:894
zone_list_db_get_next
zone_db_t * zone_list_db_get_next(zone_list_db_t *zone_list)
Definition zone_db.c:2669
zone_list_db_new
zone_list_db_t * zone_list_db_new(const db_connection_t *connection)
Definition zone_db.c:1946
zone_db_next_csk_roll
unsigned int zone_db_next_csk_roll(const zone_db_t *zone)
Definition zone_db.c:910
zone_db_create
int zone_db_create(zone_db_t *zone)
Definition zone_db.c:1206
zone_list_db_get_by_clauses
int zone_list_db_get_by_clauses(zone_list_db_t *zone_list, const db_clause_list_t *clause_list)
Definition zone_db.c:2419
zone_db_set_ttl_end_ds
int zone_db_set_ttl_end_ds(zone_db_t *zone, unsigned int ttl_end_ds)
Definition zone_db.c:1001
zone_db_count
int zone_db_count(zone_db_t *zone, db_clause_list_t *clause_list, size_t *count)
Definition zone_db.c:1930
zone_db_set_next_zsk_roll
int zone_db_set_next_zsk_roll(zone_db_t *zone, unsigned int next_zsk_roll)
Definition zone_db.c:1159
zone_db_set_roll_ksk_now
int zone_db_set_roll_ksk_now(zone_db_t *zone, unsigned int roll_ksk_now)
Definition zone_db.c:1031
zone_db_set_next_csk_roll
int zone_db_set_next_csk_roll(zone_db_t *zone, unsigned int next_csk_roll)
Definition zone_db.c:1169
zone_db_input_adapter_uri
const char * zone_db_input_adapter_uri(const zone_db_t *zone)
Definition zone_db.c:870
zone_db_set_signconf_path
int zone_db_set_signconf_path(zone_db_t *zone, const char *signconf_path_text)
Definition zone_db.c:969
zone_db_update
int zone_db_update(zone_db_t *zone)
Definition zone_db.c:1589
zone_db_get_by_id
int zone_db_get_by_id(zone_db_t *zone, const db_value_t *id)
Definition zone_db.c:1466
zone_list_db_get
int zone_list_db_get(zone_list_db_t *zone_list)
Definition zone_db.c:2363
zone_db_ttl_end_dk
unsigned int zone_db_ttl_end_dk(const zone_db_t *zone)
Definition zone_db.c:822
zone_db_new
zone_db_t * zone_db_new(const db_connection_t *connection)
Definition zone_db.c:287
zone_db_id
const db_value_t * zone_db_id(const zone_db_t *zone)
Definition zone_db.c:728
zone_db_policy_id_clause
db_clause_t * zone_db_policy_id_clause(db_clause_list_t *clause_list, const db_value_t *policy_id)
Definition zone_db.c:1179
zone_db_set_output_adapter_uri
int zone_db_set_output_adapter_uri(zone_db_t *zone, const char *output_adapter_uri_text)
Definition zone_db.c:1127
zone_db_set_name
int zone_db_set_name(zone_db_t *zone, const char *name_text)
Definition zone_db.c:937
zone_db_output_adapter_type
const char * zone_db_output_adapter_type(const zone_db_t *zone)
Definition zone_db.c:878
zone_db_next_zsk_roll
unsigned int zone_db_next_zsk_roll(const zone_db_t *zone)
Definition zone_db.c:902
zone_db_get_by_name
int zone_db_get_by_name(zone_db_t *zone, const char *name)
Definition zone_db.c:1519
zone_db_output_adapter_uri
const char * zone_db_output_adapter_uri(const zone_db_t *zone)
Definition zone_db.c:886
zone_db_signconf_needs_writing
unsigned int zone_db_signconf_needs_writing(const zone_db_t *zone)
Definition zone_db.c:790
zone_db_roll_csk_now
unsigned int zone_db_roll_csk_now(const zone_db_t *zone)
Definition zone_db.c:854
zone_db_set_ttl_end_rs
int zone_db_set_ttl_end_rs(zone_db_t *zone, unsigned int ttl_end_rs)
Definition zone_db.c:1021
zone_list_db_next
const zone_db_t * zone_list_db_next(zone_list_db_t *zone_list)
Definition zone_db.c:2603
zone_db_next_change
int zone_db_next_change(const zone_db_t *zone)
Definition zone_db.c:806
zone_db_set_next_change
int zone_db_set_next_change(zone_db_t *zone, int next_change)
Definition zone_db.c:991
zone_db_input_adapter_type
const char * zone_db_input_adapter_type(const zone_db_t *zone)
Definition zone_db.c:862
zone_list_db_free
void zone_list_db_free(zone_list_db_t *zone_list)
Definition zone_db.c:1989
zone_db_set_input_adapter_uri
int zone_db_set_input_adapter_uri(zone_db_t *zone, const char *input_adapter_uri_text)
Definition zone_db.c:1083