key_dependency.h
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.
*
*/
#ifndef __key_dependency_h
#define __key_dependency_h
#include "db_object.h"
struct key_dependency;
struct key_dependency_list;
typedef struct key_dependency key_dependency_t;
typedef struct key_dependency_list key_dependency_list_t;
typedef enum key_dependency_type {
KEY_DEPENDENCY_TYPE_INVALID = -1,
KEY_DEPENDENCY_TYPE_DS = 0,
KEY_DEPENDENCY_TYPE_RRSIG = 1,
KEY_DEPENDENCY_TYPE_DNSKEY = 2,
KEY_DEPENDENCY_TYPE_RRSIGDNSKEY = 3
} key_dependency_type_t;
extern const db_enum_t key_dependency_enum_set_type[];
#include "key_dependency_ext.h"
#include "zone_db.h"
#include "key_data.h"
struct key_dependency {
db_object_t* dbo;
db_value_t id;
db_value_t rev;
db_value_t zone_id;
const zone_db_t* associated_zone_id;
zone_db_t* private_zone_id;
db_value_t from_key_data_id;
const key_data_t* associated_from_key_data_id;
key_data_t* private_from_key_data_id;
db_value_t to_key_data_id;
const key_data_t* associated_to_key_data_id;
key_data_t* private_to_key_data_id;
key_dependency_type_t type;
};
key_dependency_t* key_dependency_new(const db_connection_t* connection);
key_dependency_t* key_dependency_new_copy(const key_dependency_t* key_dependency);
void key_dependency_free(key_dependency_t* key_dependency);
int key_dependency_copy(key_dependency_t* key_dependency, const key_dependency_t* key_dependency_copy);
int key_dependency_from_result(key_dependency_t* key_dependency, const db_result_t* result);
const db_value_t* key_dependency_zone_id(const key_dependency_t* key_dependency);
const db_value_t* key_dependency_from_key_data_id(const key_dependency_t* key_dependency);
key_data_t* key_dependency_get_from_key_data(const key_dependency_t* key_dependency);
const db_value_t* key_dependency_to_key_data_id(const key_dependency_t* key_dependency);
key_dependency_type_t key_dependency_type(const key_dependency_t* key_dependency);
int key_dependency_set_zone_id(key_dependency_t* key_dependency, const db_value_t* zone_id);
int key_dependency_set_from_key_data_id(key_dependency_t* key_dependency, const db_value_t* from_key_data_id);
int key_dependency_set_to_key_data_id(key_dependency_t* key_dependency, const db_value_t* to_key_data_id);
int key_dependency_set_type(key_dependency_t* key_dependency, key_dependency_type_t type);
int key_dependency_create(key_dependency_t* key_dependency);
int key_dependency_get_by_id(key_dependency_t* key_dependency, const db_value_t* id);
int key_dependency_delete(key_dependency_t* key_dependency);
struct key_dependency_list {
db_object_t* dbo;
db_result_list_t* result_list;
const db_result_t* result;
key_dependency_t* key_dependency;
int object_store;
key_dependency_t** object_list;
size_t object_list_size;
size_t object_list_position;
int object_list_first;
int associated_fetch;
zone_list_db_t* zone_id_list;
key_data_list_t* from_key_data_id_list;
key_data_list_t* to_key_data_id_list;
};
key_dependency_list_t* key_dependency_list_new(const db_connection_t* connection);
key_dependency_list_t* key_dependency_list_new_copy(const key_dependency_list_t* key_dependency_copy);
int key_dependency_list_object_store(key_dependency_list_t* key_dependency_list);
void key_dependency_list_free(key_dependency_list_t* key_dependency_list);
int key_dependency_list_copy(key_dependency_list_t* key_dependency_list, const key_dependency_list_t* from_key_dependency_list);
int key_dependency_list_get_by_clauses(key_dependency_list_t* key_dependency_list, const db_clause_list_t* clause_list);
int key_dependency_list_get_by_zone_id(key_dependency_list_t* key_dependency_list, const db_value_t* zone_id);
key_dependency_list_t* key_dependency_list_new_get_by_zone_id(const db_connection_t* connection, const db_value_t* zone_id);
const key_dependency_t* key_dependency_list_begin(key_dependency_list_t* key_dependency_list);
key_dependency_t* key_dependency_list_get_begin(key_dependency_list_t* key_dependency_list);
const key_dependency_t* key_dependency_list_next(key_dependency_list_t* key_dependency_list);
key_dependency_t* key_dependency_list_get_next(key_dependency_list_t* key_dependency_list);
size_t key_dependency_list_size(key_dependency_list_t* key_dependency_list);
#endif
key_dependency_list::object_list
key_dependency_t ** object_list
Definition: key_dependency.h:207
key_dependency_free
void key_dependency_free(key_dependency_t *key_dependency)
Definition: key_dependency.c:183
key_data_list
Definition: key_data.h:477
key_dependency_enum_set_type
const db_enum_t key_dependency_enum_set_type[]
Definition: key_dependency.c:36
key_dependency_to_key_data_id
const db_value_t * key_dependency_to_key_data_id(const key_dependency_t *key_dependency)
Definition: key_dependency.c:382
key_dependency_zone_id
const db_value_t * key_dependency_zone_id(const key_dependency_t *key_dependency)
Definition: key_dependency.c:328
zone_db.h
key_dependency::associated_zone_id
const zone_db_t * associated_zone_id
Definition: key_dependency.h:61
key_dependency_ext.h
key_dependency_list::zone_id_list
zone_list_db_t * zone_id_list
Definition: key_dependency.h:212
key_data.h
key_dependency_list::dbo
db_object_t * dbo
Definition: key_dependency.h:202
key_dependency::type
key_dependency_type_t type
Definition: key_dependency.h:69
db_object
Definition: db_object.h:201
KEY_DEPENDENCY_TYPE_DNSKEY
Definition: key_dependency.h:44
key_dependency::associated_from_key_data_id
const key_data_t * associated_from_key_data_id
Definition: key_dependency.h:64
key_dependency_list_get_by_clauses
int key_dependency_list_get_by_clauses(key_dependency_list_t *key_dependency_list, const db_clause_list_t *clause_list)
Definition: key_dependency.c:1055
db_clause_list
Definition: db_clause.h:226
key_dependency_list_copy
int key_dependency_list_copy(key_dependency_list_t *key_dependency_list, const key_dependency_list_t *from_key_dependency_list)
Definition: key_dependency.c:743
key_dependency_get_from_key_data
key_data_t * key_dependency_get_from_key_data(const key_dependency_t *key_dependency)
Definition: key_dependency.c:344
key_dependency_list::to_key_data_id_list
key_data_list_t * to_key_data_id_list
Definition: key_dependency.h:214
key_dependency_list_next
const key_dependency_t * key_dependency_list_next(key_dependency_list_t *key_dependency_list)
Definition: key_dependency.c:1275
KEY_DEPENDENCY_TYPE_DS
Definition: key_dependency.h:42
key_dependency_list_begin
const key_dependency_t * key_dependency_list_begin(key_dependency_list_t *key_dependency_list)
Definition: key_dependency.c:1183
key_dependency_list_get_by_zone_id
int key_dependency_list_get_by_zone_id(key_dependency_list_t *key_dependency_list, const db_value_t *zone_id)
Definition: key_dependency.c:1097
key_dependency_set_to_key_data_id
int key_dependency_set_to_key_data_id(key_dependency_t *key_dependency, const db_value_t *to_key_data_id)
Definition: key_dependency.c:436
db_result_list
Definition: db_result.h:114
key_dependency::private_from_key_data_id
key_data_t * private_from_key_data_id
Definition: key_dependency.h:65
db_value
Definition: db_value.h:48
key_dependency::zone_id
db_value_t zone_id
Definition: key_dependency.h:60
key_dependency_from_key_data_id
const db_value_t * key_dependency_from_key_data_id(const key_dependency_t *key_dependency)
Definition: key_dependency.c:336
key_dependency::id
db_value_t id
Definition: key_dependency.h:58
key_dependency_list::object_list_first
int object_list_first
Definition: key_dependency.h:210
key_dependency_copy
int key_dependency_copy(key_dependency_t *key_dependency, const key_dependency_t *key_dependency_copy)
Definition: key_dependency.c:206
key_dependency::to_key_data_id
db_value_t to_key_data_id
Definition: key_dependency.h:66
key_dependency_delete
int key_dependency_delete(key_dependency_t *key_dependency)
Definition: key_dependency.c:616
key_dependency_from_result
int key_dependency_from_result(key_dependency_t *key_dependency, const db_result_t *result)
Definition: key_dependency.c:281
key_dependency_set_from_key_data_id
int key_dependency_set_from_key_data_id(key_dependency_t *key_dependency, const db_value_t *from_key_data_id)
Definition: key_dependency.c:417
key_dependency::rev
db_value_t rev
Definition: key_dependency.h:59
zone_db
Definition: zone_db.h:46
key_dependency_list::object_list_size
size_t object_list_size
Definition: key_dependency.h:208
key_dependency_list::result_list
db_result_list_t * result_list
Definition: key_dependency.h:203
key_dependency
Definition: key_dependency.h:56
KEY_DEPENDENCY_TYPE_INVALID
Definition: key_dependency.h:41
key_dependency_type
key_dependency_type
Definition: key_dependency.h:40
key_dependency_list_new_copy
key_dependency_list_t * key_dependency_list_new_copy(const key_dependency_list_t *key_dependency_copy)
Definition: key_dependency.c:680
key_dependency_list::associated_fetch
int associated_fetch
Definition: key_dependency.h:211
key_dependency_list_get_begin
key_dependency_t * key_dependency_list_get_begin(key_dependency_list_t *key_dependency_list)
Definition: key_dependency.c:1239
zone_list_db
Definition: zone_db.h:466
key_dependency_list_object_store
int key_dependency_list_object_store(key_dependency_list_t *key_dependency_list)
Definition: key_dependency.c:699
key_dependency_list::object_store
int object_store
Definition: key_dependency.h:206
key_dependency_set_zone_id
int key_dependency_set_zone_id(key_dependency_t *key_dependency, const db_value_t *zone_id)
Definition: key_dependency.c:398
db_result
Definition: db_result.h:56
key_dependency_list_free
void key_dependency_list_free(key_dependency_list_t *key_dependency_list)
Definition: key_dependency.c:709
key_dependency_list::key_dependency
key_dependency_t * key_dependency
Definition: key_dependency.h:205
key_dependency_get_by_id
int key_dependency_get_by_id(key_dependency_t *key_dependency, const db_value_t *id)
Definition: key_dependency.c:563
key_dependency_list_new_get_by_zone_id
key_dependency_list_t * key_dependency_list_new_get_by_zone_id(const db_connection_t *connection, const db_value_t *zone_id)
Definition: key_dependency.c:1160
KEY_DEPENDENCY_TYPE_RRSIGDNSKEY
Definition: key_dependency.h:45
key_dependency_list_new
key_dependency_list_t * key_dependency_list_new(const db_connection_t *connection)
Definition: key_dependency.c:666
key_dependency::dbo
db_object_t * dbo
Definition: key_dependency.h:57
key_dependency::associated_to_key_data_id
const key_data_t * associated_to_key_data_id
Definition: key_dependency.h:67
key_dependency_list
Definition: key_dependency.h:201
key_dependency_list_size
size_t key_dependency_list_size(key_dependency_list_t *key_dependency_list)
Definition: key_dependency.c:1377
key_dependency::private_to_key_data_id
key_data_t * private_to_key_data_id
Definition: key_dependency.h:68
db_object.h
key_data
Definition: key_data.h:66
db_connection
Definition: db_connection.h:46
db_enum
Definition: db_enum.h:38
key_dependency_create
int key_dependency_create(key_dependency_t *key_dependency)
Definition: key_dependency.c:468
key_dependency_list::result
const db_result_t * result
Definition: key_dependency.h:204
key_dependency_new
key_dependency_t * key_dependency_new(const db_connection_t *connection)
Definition: key_dependency.c:144
key_dependency_list::object_list_position
size_t object_list_position
Definition: key_dependency.h:209
key_dependency_list_get_next
key_dependency_t * key_dependency_list_get_next(key_dependency_list_t *key_dependency_list)
Definition: key_dependency.c:1341
key_dependency_new_copy
key_dependency_t * key_dependency_new_copy(const key_dependency_t *key_dependency)
Definition: key_dependency.c:164
key_dependency::private_zone_id
zone_db_t * private_zone_id
Definition: key_dependency.h:62
key_dependency_type_t
enum key_dependency_type key_dependency_type_t
KEY_DEPENDENCY_TYPE_RRSIG
Definition: key_dependency.h:43
key_dependency::from_key_data_id
db_value_t from_key_data_id
Definition: key_dependency.h:63
key_dependency_set_type
int key_dependency_set_type(key_dependency_t *key_dependency, key_dependency_type_t type)
Definition: key_dependency.c:455
key_dependency_list::from_key_data_id_list
key_data_list_t * from_key_data_id_list
Definition: key_dependency.h:213