key_dependency.h File Reference
`#include "db_object.h"`
`#include "key_dependency_ext.h"`
`#include "zone_db.h"`
`#include "key_data.h"`

Go to the source code of this file.

## Data Structures

struct | key_dependency
struct | key_dependency_list

## Typedefs

typedef struct key_dependency | key_dependency_t
typedef struct key_dependency_list | key_dependency_list_t
typedef enum key_dependency_type | key_dependency_type_t

## Enumerations

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 }

## Functions

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)
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)

## Variables

const db_enum_t | key_dependency_enum_set_type []

## Typedef Documentation

## key_dependency_list_t

typedef struct key_dependency_list key_dependency_list_t

Definition at line 38 of file key_dependency.h.

## key_dependency_t

typedef struct key_dependency key_dependency_t

Definition at line 37 of file key_dependency.h.

## key_dependency_type_t

typedef enum key_dependency_type key_dependency_type_t

## Enumeration Type Documentation

## key_dependency_type

enum key_dependency_type

Enumerator
KEY_DEPENDENCY_TYPE_INVALID |
KEY_DEPENDENCY_TYPE_DS |
KEY_DEPENDENCY_TYPE_RRSIG |
KEY_DEPENDENCY_TYPE_DNSKEY |
KEY_DEPENDENCY_TYPE_RRSIGDNSKEY |

Definition at line 40 of file key_dependency.h.

## Function Documentation

## key_dependency_copy()

int key_dependency_copy | ( | key_dependency_t * | key_dependency,
|  | const key_dependency_t * | key_dependency_copy
| ) |  |

Copy the content of a key dependency object.

Parameters

  [in] | key_dependency | a key_dependency_t pointer.
  [in] | key_dependency_copy | a key_dependency_t pointer.

Returns
  DB_ERROR_* on failure, otherwise DB_OK.

Definition at line 206 of file key_dependency.c.

References key_dependency::associated_from_key_data_id, key_dependency::associated_to_key_data_id, key_dependency::associated_zone_id, DB_ERROR_UNKNOWN, DB_OK, db_value_copy(), key_dependency::from_key_data_id, key_dependency::id, key_data_free(), key_data_new_copy(), key_dependency::private_from_key_data_id, key_dependency::private_to_key_data_id, key_dependency::private_zone_id, key_dependency::rev, key_dependency::to_key_data_id, key_dependency::type, zone_db_free(), zone_db_new_copy(), and key_dependency::zone_id.

Referenced by key_dependency_new_copy().

## key_dependency_create()

int key_dependency_create | ( | key_dependency_t * | key_dependency | ) |

Create a key dependency object in the database.

Parameters

  [in] | key_dependency | a key_dependency_t pointer.

Returns
  DB_ERROR_* on failure, otherwise DB_OK.

Definition at line 468 of file key_dependency.c.

## key_dependency_delete()

int key_dependency_delete | ( | key_dependency_t * | key_dependency | ) |

Delete a key dependency object from the database.

Parameters

  [in] | key_dependency | a key_dependency_t pointer.

Returns
  DB_ERROR_* on failure, otherwise DB_OK.

Definition at line 616 of file key_dependency.c.

## key_dependency_free()

void key_dependency_free | ( | key_dependency_t * | key_dependency | ) |

Delete a key dependency object, this does not delete it from the database.

Parameters

  [in] | key_dependency | a key_dependency_t pointer.

Definition at line 183 of file key_dependency.c.

References db_object_free(), db_value_reset(), key_dependency::dbo, key_dependency::from_key_data_id, key_dependency::id, key_data_free(), key_dependency::private_from_key_data_id, key_dependency::private_to_key_data_id, key_dependency::private_zone_id, key_dependency::rev, key_dependency::to_key_data_id, zone_db_free(), and key_dependency::zone_id.

Referenced by key_dependency_list_copy(), key_dependency_list_free(), and key_dependency_new_copy().

## key_dependency_from_key_data_id()

const db_value_t* key_dependency_from_key_data_id | ( | const key_dependency_t * | key_dependency | ) |

Get the from_key_data_id of a key dependency object.

Parameters

  [in] | key_dependency | a key_dependency_t pointer.

Returns
  a db_value_t pointer or NULL on error.

Definition at line 336 of file key_dependency.c.

References key_dependency::from_key_data_id.

## key_dependency_from_result()

int key_dependency_from_result | ( | key_dependency_t * | key_dependency,
|  | const db_result_t * | result
| ) |  |

Set the content of a key dependency object based on a database result.

Parameters

  [in] | key_dependency | a key_dependency_t pointer.
  [in] | result | a db_result_t pointer.

Returns
  DB_ERROR_* on failure, otherwise DB_OK.

Definition at line 281 of file key_dependency.c.

## key_dependency_get_by_id()

int key_dependency_get_by_id | ( | key_dependency_t * | key_dependency,
|  | const db_value_t * | id
| ) |  |

Get a key dependency object from the database by a id specified in `id`.

Parameters

  [in] | key_dependency | a key_dependency_t pointer.
  [in] | id | a db_value_t pointer.

Returns
  DB_ERROR_* on failure, otherwise DB_OK.

Definition at line 563 of file key_dependency.c.

## key_dependency_get_from_key_data()

key_data_t* key_dependency_get_from_key_data | ( | const key_dependency_t * | key_dependency | ) |

Get the from_key_data_id object related to a key dependency object. The caller will be given ownership of this object and is responsible for freeing it.

Parameters

  [in] | key_dependency | a key_dependency_t pointer.

Returns
  a key_data_t pointer or NULL on error or if no object could be found.

Definition at line 344 of file key_dependency.c.

References key_dependency::associated_from_key_data_id, db_object_connection(), db_value_not_empty(), key_dependency::dbo, key_dependency::from_key_data_id, key_data_copy(), key_data_free(), key_data_get_by_id(), key_data_new(), and key_dependency::private_from_key_data_id.

## key_dependency_list_begin()

const key_dependency_t* key_dependency_list_begin | ( | key_dependency_list_t * | key_dependency_list | ) |

Get the first key dependency object in a key dependency object list and reset the position of the list.

Parameters

  [in] | key_dependency_list | a key_dependency_list_t pointer.

Returns
  a key_dependency_t pointer or NULL on error or if there are no key dependency objects in the key dependency object list.

Definition at line 1183 of file key_dependency.c.

## 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
| ) |  |

Copy the content of another key dependency object list.

Parameters

  [in] | key_dependency_list | a key_dependency_list_t pointer.
  [in] | from_key_dependency_list | a key_dependency_list_t pointer.

Returns
  DB_ERROR_* on failure, otherwise DB_OK.

Definition at line 743 of file key_dependency.c.

References key_dependency_list::associated_fetch, DB_ERROR_UNKNOWN, DB_OK, db_result_list_free(), db_result_list_new_copy(), key_dependency_list::from_key_data_id_list, key_data_list_new_copy(), key_dependency_free(), key_dependency_new_copy(), key_dependency_list::object_list, key_dependency_list::object_list_first, key_dependency_list::object_list_position, key_dependency_list::object_list_size, key_dependency_list::object_store, key_dependency_list::result_list, key_dependency_list::to_key_data_id_list, key_dependency_list::zone_id_list, and zone_list_db_new_copy().

Referenced by key_dependency_list_new_copy().

## key_dependency_list_free()

void key_dependency_list_free | ( | key_dependency_list_t * | key_dependency_list | ) |

Delete a key dependency object list.

Parameters

  [in] | key_dependency_list | a key_dependency_list_t pointer.

Definition at line 709 of file key_dependency.c.

References db_object_free(), db_result_list_free(), key_dependency_list::dbo, key_dependency_list::from_key_data_id_list, key_data_list_free(), key_dependency_list::key_dependency, key_dependency_free(), key_dependency_list::object_list, key_dependency_list::object_list_size, key_dependency_list::result_list, key_dependency_list::to_key_data_id_list, key_dependency_list::zone_id_list, and zone_list_db_free().

Referenced by key_dependency_list_new_copy(), key_dependency_list_new_get_by_zone_id(), zone_db_copy(), and zone_db_free().

## key_dependency_list_get_begin()

key_dependency_t* key_dependency_list_get_begin | ( | key_dependency_list_t * | key_dependency_list | ) |

Get the first key dependency object in a key dependency object list and reset the position of the list. The caller will be given ownership of this object and is responsible for freeing it.

Parameters

  [in] | key_dependency_list | a key_dependency_list_t pointer.

Returns
  a key_dependency_t pointer or NULL on error or if there are no key dependency objects in the key dependency object list.

Definition at line 1239 of file key_dependency.c.

## 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
| ) |  |

Get key dependency objects from the database by a clause list.

Parameters

  [in] | key_dependency_list | a key_dependency_list_t pointer.
  [in] | clause_list | a db_clause_list_t pointer.

Returns
  DB_ERROR_* on failure, otherwise DB_OK.

Definition at line 1055 of file key_dependency.c.

## 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
| ) |  |

Get key dependency objects from the database by a zone_id specified in `zone_id`.

Parameters

  [in] | key_dependency_list | a key_dependency_list_t pointer.
  [in] | zone_id | a db_value_t pointer.

Returns
  DB_ERROR_* on failure, otherwise DB_OK.

Definition at line 1097 of file key_dependency.c.

Referenced by key_dependency_list_new_get_by_zone_id().

## key_dependency_list_get_next()

key_dependency_t* key_dependency_list_get_next | ( | key_dependency_list_t * | key_dependency_list | ) |

Get the next key dependency object in a key dependency object list. The caller will be given ownership of this object and is responsible for freeing it.

Parameters

  [in] | key_dependency_list | a key_dependency_list_t pointer.

Returns
  a key_dependency_t pointer or NULL on error or if there are no more key dependency objects in the key dependency object list.

Definition at line 1341 of file key_dependency.c.

## key_dependency_list_new()

key_dependency_list_t* key_dependency_list_new | ( | const db_connection_t * | connection | ) |

Create a new key dependency object list.

Parameters

  [in] | connection | a db_connection_t pointer.

Returns
  a key_dependency_list_t pointer or NULL on error.

Definition at line 666 of file key_dependency.c.

References key_dependency_list::dbo.

Referenced by key_dependency_list_new_copy(), and key_dependency_list_new_get_by_zone_id().

## key_dependency_list_new_copy()

key_dependency_list_t* key_dependency_list_new_copy | ( | const key_dependency_list_t * | key_dependency_copy | ) |

Create a new key dependency object list that is a copy of another.

Parameters

  [in] | key_dependency_list | a key_dependency_list_t pointer.

Returns
  a key_dependency_list_t pointer or NULL on error.

Definition at line 680 of file key_dependency.c.

References db_object_connection(), key_dependency_list::dbo, key_dependency_list_copy(), key_dependency_list_free(), and key_dependency_list_new().

Referenced by zone_db_copy().

## 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
| ) |  |

Get a new list of key dependency objects from the database by a zone_id specified in `zone_id`.

Parameters

  [in] | connection | a db_connection_t pointer.
  [in] | zone_id | a db_value_t pointer.

Returns
  a key_dependency_list_t pointer or NULL on error.

Definition at line 1160 of file key_dependency.c.

References db_value_not_empty(), key_dependency_list_free(), key_dependency_list_get_by_zone_id(), and key_dependency_list_new().

Referenced by zone_db_get_key_dependencies().

## key_dependency_list_next()

const key_dependency_t* key_dependency_list_next | ( | key_dependency_list_t * | key_dependency_list | ) |

Get the next key dependency object in a key dependency object list. Ownership of this object is retained within the list and the object is only valid until the next call to this function.

Parameters

  [in] | key_dependency_list | a key_dependency_list_t pointer.

Returns
  a key_dependency_t pointer or NULL on error or if there are no more key dependency objects in the key dependency object list.

Definition at line 1275 of file key_dependency.c.

## key_dependency_list_object_store()

int key_dependency_list_object_store | ( | key_dependency_list_t * | key_dependency_list | ) |

Specify that objects should be stored within the list as they are fetch, this is optimal if the list is to be iterated over more then once.

Parameters

  [in] | key_dependency_list | a key_dependency_list_t pointer.

Returns
  DB_ERROR_* on failure, otherwise DB_OK.

Definition at line 699 of file key_dependency.c.

References DB_ERROR_UNKNOWN, DB_OK, and key_dependency_list::object_store.

## key_dependency_list_size()

size_t key_dependency_list_size | ( | key_dependency_list_t * | key_dependency_list | ) |

Get the size of a key dependency object list.

Parameters

  [in] | key_dependency_list | a key_dependency_list_t pointer.

Returns
  a size_t with the size of the list or zero on error, if the list is empty or if the backend does not support returning the size.

Definition at line 1377 of file key_dependency.c.

References db_result_list_size(), key_dependency_list::object_list, key_dependency_list::object_list_size, key_dependency_list::object_store, and key_dependency_list::result_list.

## key_dependency_new()

key_dependency_t* key_dependency_new | ( | const db_connection_t * | connection | ) |

Create a new key dependency object.

Parameters

  [in] | connection | a db_connection_t pointer.

Returns
  a key_dependency_t pointer or NULL on error.

Definition at line 144 of file key_dependency.c.

References key_dependency::dbo.

Referenced by key_dependency_new_copy().

## key_dependency_new_copy()

key_dependency_t* key_dependency_new_copy | ( | const key_dependency_t * | key_dependency | ) |

Create a new key dependency object that is a copy of another key dependency object.

Parameters

  [in] | key_dependency | a key_dependency_t pointer.

Returns
  a key_dependency_t pointer or NULL on error.

Definition at line 164 of file key_dependency.c.

References db_object_connection(), key_dependency::dbo, key_dependency_copy(), key_dependency_free(), and key_dependency_new().

Referenced by key_dependency_list_copy().

## 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
| ) |  |

Set the from_key_data_id of a key dependency object. If this fails the original value may have been lost.

Parameters

  [in] | key_dependency | a key_dependency_t pointer.
  [in] | from_key_data_id | a db_value_t pointer.

Returns
  DB_ERROR_* on failure, otherwise DB_OK.

Definition at line 417 of file key_dependency.c.

References DB_ERROR_UNKNOWN, DB_OK, db_value_copy(), db_value_not_empty(), db_value_reset(), and key_dependency::from_key_data_id.

## 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
| ) |  |

Set the to_key_data_id of a key dependency object. If this fails the original value may have been lost.

Parameters

  [in] | key_dependency | a key_dependency_t pointer.
  [in] | to_key_data_id | a db_value_t pointer.

Returns
  DB_ERROR_* on failure, otherwise DB_OK.

Definition at line 436 of file key_dependency.c.

References DB_ERROR_UNKNOWN, DB_OK, db_value_copy(), db_value_not_empty(), db_value_reset(), and key_dependency::to_key_data_id.

## key_dependency_set_type()

int key_dependency_set_type | ( | key_dependency_t * | key_dependency,
|  | key_dependency_type_t | type
| ) |  |

Set the type of a key dependency object.

Parameters

  [in] | key_dependency | a key_dependency_t pointer.
  [in] | type | a key_dependency_type_t.

Returns
  DB_ERROR_* on failure, otherwise DB_OK.

Definition at line 455 of file key_dependency.c.

References DB_ERROR_UNKNOWN, DB_OK, KEY_DEPENDENCY_TYPE_INVALID, and key_dependency::type.

## key_dependency_set_zone_id()

int key_dependency_set_zone_id | ( | key_dependency_t * | key_dependency,
|  | const db_value_t * | zone_id
| ) |  |

Set the zone_id of a key dependency object. If this fails the original value may have been lost.

Parameters

  [in] | key_dependency | a key_dependency_t pointer.
  [in] | zone_id | a db_value_t pointer.

Returns
  DB_ERROR_* on failure, otherwise DB_OK.

Definition at line 398 of file key_dependency.c.

References DB_ERROR_UNKNOWN, DB_OK, db_value_copy(), db_value_not_empty(), db_value_reset(), and key_dependency::zone_id.

## key_dependency_to_key_data_id()

const db_value_t* key_dependency_to_key_data_id | ( | const key_dependency_t * | key_dependency | ) |

Get the to_key_data_id of a key dependency object.

Parameters

  [in] | key_dependency | a key_dependency_t pointer.

Returns
  a db_value_t pointer or NULL on error.

Definition at line 382 of file key_dependency.c.

References key_dependency::to_key_data_id.

## key_dependency_type()

key_dependency_type_t key_dependency_type | ( | const key_dependency_t * | key_dependency | ) |

Get the type of a key dependency object.

Parameters

  [in] | key_dependency | a key_dependency_t pointer.

Returns
  a key_dependency_type_t which may be KEY_DEPENDENCY_TYPE_INVALID on error or if no type has been set.

Definition at line 390 of file key_dependency.c.

References KEY_DEPENDENCY_TYPE_INVALID, and key_dependency::type.

## key_dependency_zone_id()

const db_value_t* key_dependency_zone_id | ( | const key_dependency_t * | key_dependency | ) |

Get the zone_id of a key dependency object.

Parameters

  [in] | key_dependency | a key_dependency_t pointer.

Returns
  a db_value_t pointer or NULL on error.

Definition at line 328 of file key_dependency.c.

References key_dependency::zone_id.

## Variable Documentation

## key_dependency_enum_set_type

const db_enum_t key_dependency_enum_set_type[]

Definition at line 36 of file key_dependency.c.