namedb.h
Go to the documentation of this file.
/*
* Copyright (c) 2009 NLNet Labs. 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 SIGNER_NAMEDB_H
#define SIGNER_NAMEDB_H
#include "config.h"
#include <ldns/ldns.h>
typedef struct namedb_struct namedb_type;
#include "signer/denial.h"
#include "signer/domain.h"
#include "signer/zone.h"
#include "signer/nsec3params.h"
struct namedb_struct {
zone_type* zone;
ldns_rbtree_t* domains;
ldns_rbtree_t* denials;
uint32_t inbserial;
uint32_t intserial;
uint32_t outserial;
uint32_t altserial;
unsigned is_initialized : 1;
unsigned serial_updated : 1;
unsigned force_serial : 1;
unsigned have_serial : 1;
};
void namedb_init_denials(namedb_type* db);
namedb_type* namedb_create(void* zone);
ods_status namedb_update_serial(namedb_type* db, const char* zone_name,
const char* format, uint32_t inbound_serial);
ods_status namedb_domain_entize(namedb_type* db, domain_type* domain,
ldns_rdf* apex);
domain_type* namedb_lookup_domain(namedb_type* db, ldns_rdf* dname);
domain_type* namedb_add_domain(namedb_type* db, ldns_rdf* dname);
domain_type* namedb_del_domain(namedb_type* db, domain_type* domain);
denial_type* namedb_lookup_denial(namedb_type* db, ldns_rdf* dname);
denial_type* namedb_add_denial(namedb_type* db, ldns_rdf* dname,
nsec3params_type* n3p);
denial_type* namedb_del_denial(namedb_type* db, denial_type* denial);
ods_status namedb_examine(namedb_type* db);
void namedb_diff(namedb_type* db, unsigned is_ixfr, unsigned more_coming);
void namedb_rollback(namedb_type* db, unsigned keepsc);
void namedb_nsecify(namedb_type* db, uint32_t* num_added);
void namedb_export(FILE* fd, namedb_type* db, ods_status* status);
void namedb_wipe_denial(namedb_type* db);
void namedb_cleanup_denials(namedb_type* db);
void namedb_cleanup(namedb_type* db);
void namedb_backup2(FILE* fd, namedb_type* db);
#endif /* SIGNER_NAMEDB_H */
namedb_nsecify
void namedb_nsecify(namedb_type *db, uint32_t *num_added)
Definition: namedb.c:872
namedb_struct::intserial
uint32_t intserial
Definition: namedb.h:54
namedb_create
namedb_type * namedb_create(void *zone)
Definition: namedb.c:121
namedb_update_serial
ods_status namedb_update_serial(namedb_type *db, const char *zone_name, const char *format, uint32_t inbound_serial)
Definition: namedb.c:193
namedb_diff
void namedb_diff(namedb_type *db, unsigned is_ixfr, unsigned more_coming)
Definition: namedb.c:811
zone_struct
Definition: zone.h:60
namedb_struct::have_serial
unsigned have_serial
Definition: namedb.h:60
namedb_cleanup_denials
void namedb_cleanup_denials(namedb_type *db)
Definition: namedb.c:1116
namedb_export
void namedb_export(FILE *fd, namedb_type *db, ods_status *status)
Definition: namedb.c:1025
namedb_struct::outserial
uint32_t outserial
Definition: namedb.h:55
namedb_struct::domains
ldns_rbtree_t * domains
Definition: namedb.h:51
namedb_domain_entize
ods_status namedb_domain_entize(namedb_type *db, domain_type *domain, ldns_rdf *apex)
Definition: namedb.c:281
denial.h
namedb_struct
Definition: namedb.h:49
namedb_cleanup
void namedb_cleanup(namedb_type *db)
Definition: namedb.c:1131
denial_struct
Definition: denial.h:50
namedb_struct::inbserial
uint32_t inbserial
Definition: namedb.h:53
namedb_struct::serial_updated
unsigned serial_updated
Definition: namedb.h:58
namedb_struct::is_initialized
unsigned is_initialized
Definition: namedb.h:57
namedb_struct::denials
ldns_rbtree_t * denials
Definition: namedb.h:52
domain_struct
Definition: domain.h:52
namedb_struct::force_serial
unsigned force_serial
Definition: namedb.h:59
zone.h
namedb_del_denial
denial_type * namedb_del_denial(namedb_type *db, denial_type *denial)
Definition: namedb.c:768
namedb_wipe_denial
void namedb_wipe_denial(namedb_type *db)
Definition: namedb.c:979
namedb_init_denials
void namedb_init_denials(namedb_type *db)
Definition: namedb.c:95
namedb_add_denial
denial_type * namedb_add_denial(namedb_type *db, ldns_rdf *dname, nsec3params_type *n3p)
Definition: namedb.c:703
namedb_lookup_denial
denial_type * namedb_lookup_denial(namedb_type *db, ldns_rdf *dname)
Definition: namedb.c:424
nsec3params_struct
Definition: nsec3params.h:47
domain.h
namedb_rollback
void namedb_rollback(namedb_type *db, unsigned keepsc)
Definition: namedb.c:847
namedb_lookup_domain
domain_type * namedb_lookup_domain(namedb_type *db, ldns_rdf *dname)
Definition: namedb.c:338
namedb_struct::altserial
uint32_t altserial
Definition: namedb.h:56
nsec3params.h
namedb_del_domain
domain_type * namedb_del_domain(namedb_type *db, domain_type *domain)
Definition: namedb.c:391
namedb_struct::zone
zone_type * zone
Definition: namedb.h:50
namedb_backup2
void namedb_backup2(FILE *fd, namedb_type *db)
Definition: namedb.c:1152
namedb_examine
ods_status namedb_examine(namedb_type *db)
Definition: namedb.c:902
namedb_add_domain
domain_type * namedb_add_domain(namedb_type *db, ldns_rdf *dname)
Definition: namedb.c:352