zone.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_ZONE_H
#define SIGNER_ZONE_H
#include "config.h"
#include <ldns/ldns.h>
enum zone_zl_status_enum {
ZONE_ZL_OK = 0,
ZONE_ZL_ADDED,
ZONE_ZL_UPDATED,
ZONE_ZL_REMOVED
};
typedef enum zone_zl_status_enum zone_zl_status;
typedef struct zone_struct zone_type;
#include "adapter/adapter.h"
#include "scheduler/schedule.h"
#include "locks.h"
#include "status.h"
#include "signer/ixfr.h"
#include "signer/namedb.h"
#include "signer/signconf.h"
#include "signer/stats.h"
#include "signer/rrset.h"
#include "wire/buffer.h"
#include "wire/notify.h"
#include "wire/xfrd.h"
#include "datastructure.h"
#include "daemon/engine.h"
struct schedule_struct;
struct zone_struct {
ldns_rdf* apex; /* wire format zone name */
ldns_rr_class klass; /* class */
uint32_t default_ttl; /* ttl */
/* from conf.xml */
char *notify_command; /* placeholder for the whole notify command */
const char* notify_ns; /* master name server reload command */
char** notify_args; /* reload command arguments */
/* from zonelist.xml */
const char* name; /* string format zone name */
const char* policy_name; /* policy identifier */
const char* signconf_filename; /* signconf filename */
zone_zl_status zl_status; /* zonelist status */
/* adapters */
adapter_type* adinbound; /* inbound adapter */
adapter_type* adoutbound; /* outbound adapter */
/* from signconf.xml */
signconf_type* signconf; /* signer configuration values */
/* zone data */
namedb_type* db;
ixfr_type* ixfr;
/* zone transfers */
xfrd_type* xfrd;
notify_type* notify;
/* statistics */
stats_type* stats;
pthread_mutex_t zone_lock;
pthread_mutex_t xfr_lock;
/* backing store for rrsigs (both domain as denial) */
collection_class rrstore;
int zoneconfigvalid; /* flag indicating whether the signconf has at least once been read */
};
zone_type* zone_create(char* name, ldns_rr_class klass);
ods_status zone_load_signconf(zone_type* zone, signconf_type** new_signconf);
ods_status zone_reschedule_task(zone_type* zone, schedule_type* taskq,
task_id what);
ods_status zone_publish_dnskeys(zone_type* zone, int skip_hsm_access);
void zone_rollback_dnskeys(zone_type* zone);
ods_status zone_publish_nsec3param(zone_type* zone);
void zone_rollback_nsec3param(zone_type* zone);
ods_status zone_prepare_keys(zone_type* zone);
ods_status zone_update_serial(zone_type* zone);
rrset_type* zone_lookup_rrset(zone_type* zone, ldns_rdf* owner,
ldns_rr_type type);
ods_status zone_add_rr(zone_type* zone, ldns_rr* rr, int do_stats);
ods_status zone_del_rr(zone_type* zone, ldns_rr* rr, int do_stats);
ods_status zone_del_nsec3params(zone_type* zone);
void zone_merge(zone_type* z1, zone_type* z2);
void zone_cleanup(zone_type* zone);
ods_status zone_backup2(zone_type* zone, time_t nextResign);
ods_status zone_recover2(engine_type* engine, zone_type* zone);
#endif /* SIGNER_ZONE_H */
notify.h
zone_struct::default_ttl
uint32_t default_ttl
Definition: zone.h:63
stats_struct
Definition: stats.h:50
zone_zl_status_enum
zone_zl_status_enum
Definition: zone.h:33
engine.h
namedb.h
zone_struct::notify_command
char * notify_command
Definition: zone.h:65
zone_merge
void zone_merge(zone_type *z1, zone_type *z2)
Definition: zone.c:696
ZONE_ZL_ADDED
Definition: zone.h:35
zone_struct
Definition: zone.h:60
signconf_struct
Definition: signconf.h:41
zone_struct::zoneconfigvalid
int zoneconfigvalid
Definition: zone.h:90
zone_struct::zl_status
zone_zl_status zl_status
Definition: zone.h:72
signconf.h
zone_load_signconf
ods_status zone_load_signconf(zone_type *zone, signconf_type **new_signconf)
Definition: zone.c:133
ZONE_ZL_UPDATED
Definition: zone.h:36
zone_update_serial
ods_status zone_update_serial(zone_type *zone)
Definition: zone.c:436
zone_add_rr
ods_status zone_add_rr(zone_type *zone, ldns_rr *rr, int do_stats)
Definition: zone.c:531
stats.h
xfrd.h
notify_struct
Definition: notify.h:56
zone_struct::adoutbound
adapter_type * adoutbound
Definition: zone.h:75
zone_backup2
ods_status zone_backup2(zone_type *zone, time_t nextResign)
Definition: zone.c:1042
zone_create
zone_type * zone_create(char *name, ldns_rr_class klass)
Definition: zone.c:55
zone_publish_nsec3param
ods_status zone_publish_nsec3param(zone_type *zone)
Definition: zone.c:307
namedb_struct
Definition: namedb.h:49
zone_struct::zone_lock
pthread_mutex_t zone_lock
Definition: zone.h:86
zone_del_nsec3params
ods_status zone_del_nsec3params(zone_type *zone)
Definition: zone.c:657
zone_cleanup
void zone_cleanup(zone_type *zone)
Definition: zone.c:761
zone_struct::db
namedb_type * db
Definition: zone.h:79
zone_lookup_rrset
rrset_type * zone_lookup_rrset(zone_type *zone, ldns_rdf *owner, ldns_rr_type type)
Definition: zone.c:512
zone_struct::ixfr
ixfr_type * ixfr
Definition: zone.h:80
adapter.h
zone_prepare_keys
ods_status zone_prepare_keys(zone_type *zone)
Definition: zone.c:394
zone_struct::signconf
signconf_type * signconf
Definition: zone.h:77
zone_struct::adinbound
adapter_type * adinbound
Definition: zone.h:74
zone_publish_dnskeys
ods_status zone_publish_dnskeys(zone_type *zone, int skip_hsm_access)
Definition: zone.c:186
zone_struct::notify_args
char ** notify_args
Definition: zone.h:67
zone_reschedule_task
ods_status zone_reschedule_task(zone_type *zone, schedule_type *taskq, task_id what)
rrset.h
zone_struct::signconf_filename
const char * signconf_filename
Definition: zone.h:71
zone_zl_status
enum zone_zl_status_enum zone_zl_status
Definition: zone.h:39
zone_struct::notify_ns
const char * notify_ns
Definition: zone.h:66
zone_rollback_dnskeys
void zone_rollback_dnskeys(zone_type *zone)
Definition: zone.c:279
ixfr_struct
Definition: ixfr.h:62
zone_struct::klass
ldns_rr_class klass
Definition: zone.h:62
zone_struct::rrstore
collection_class rrstore
Definition: zone.h:89
adapter_struct
Definition: adapter.h:57
engine_struct
Definition: engine.h:51
buffer.h
zone_rollback_nsec3param
void zone_rollback_nsec3param(zone_type *zone)
Definition: zone.c:370
zone_struct::xfr_lock
pthread_mutex_t xfr_lock
Definition: zone.h:87
zone_struct::name
const char * name
Definition: zone.h:69
rrset_struct
Definition: rrset.h:59
zone_del_rr
ods_status zone_del_rr(zone_type *zone, ldns_rr *rr, int do_stats)
Definition: zone.c:613
xfrd_struct
Definition: xfrd.h:93
zone_recover2
ods_status zone_recover2(engine_type *engine, zone_type *zone)
Definition: zone.c:794
zone_struct::notify
notify_type * notify
Definition: zone.h:83
ZONE_ZL_REMOVED
Definition: zone.h:37
ixfr.h
zone_struct::policy_name
const char * policy_name
Definition: zone.h:70
zone_struct::xfrd
xfrd_type * xfrd
Definition: zone.h:82
zone_struct::apex
ldns_rdf * apex
Definition: zone.h:61
zone_struct::stats
stats_type * stats
Definition: zone.h:85
ZONE_ZL_OK
Definition: zone.h:34