zonelist.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_ZONELIST_H
#define SIGNER_ZONELIST_H
#include <ldns/ldns.h>
#include <stdio.h>
#include <time.h>
typedef struct zonelist_struct zonelist_type;
#include "status.h"
#include "locks.h"
#include "signer/zone.h"
struct zonelist_struct {
ldns_rbtree_t* zones;
time_t last_modified;
int just_added;
int just_updated;
int just_removed;
pthread_mutex_t zl_lock;
};
extern zonelist_type* zonelist_create(void);
extern zone_type* zonelist_lookup_zone_by_name(zonelist_type* zonelist,
const char* name, ldns_rr_class klass);
extern zone_type* zonelist_lookup_zone_by_dname(zonelist_type* zonelist,
ldns_rdf* dname, ldns_rr_class klass);
extern zone_type* zonelist_add_zone(zonelist_type* zl, zone_type* zone);
extern void zonelist_del_zone(zonelist_type* zlist, zone_type* zone);
extern ods_status zonelist_update(zonelist_type* zl, const char* zlfile);
extern void zonelist_cleanup(zonelist_type* zl);
extern void zonelist_free(zonelist_type* zl);
#endif /* SIGNER_ZONELIST_H */
zone_struct
Definition zone.h:60
zonelist_struct
Definition zonelist.h:44
zonelist_struct::just_updated
int just_updated
Definition zonelist.h:48
zonelist_struct::last_modified
time_t last_modified
Definition zonelist.h:46
zonelist_struct::just_removed
int just_removed
Definition zonelist.h:49
zonelist_struct::zl_lock
pthread_mutex_t zl_lock
Definition zonelist.h:50
zonelist_struct::zones
ldns_rbtree_t * zones
Definition zonelist.h:45
zonelist_struct::just_added
int just_added
Definition zonelist.h:47
zone.h
zonelist_lookup_zone_by_dname
zone_type * zonelist_lookup_zone_by_dname(zonelist_type *zonelist, ldns_rdf *dname, ldns_rr_class klass)
Definition zonelist.c:182
zonelist_del_zone
void zonelist_del_zone(zonelist_type *zlist, zone_type *zone)
Definition zonelist.c:238
zonelist_free
void zonelist_free(zonelist_type *zl)
Definition zonelist.c:453
zonelist_create
zonelist_type * zonelist_create(void)
Definition zonelist.c:74
zonelist_update
ods_status zonelist_update(zonelist_type *zl, const char *zlfile)
Definition zonelist.c:342
zonelist_cleanup
void zonelist_cleanup(zonelist_type *zl)
Definition zonelist.c:432
zonelist_add_zone
zone_type * zonelist_add_zone(zonelist_type *zl, zone_type *zone)
Definition zonelist.c:201
zonelist_lookup_zone_by_name
zone_type * zonelist_lookup_zone_by_name(zonelist_type *zonelist, const char *name, ldns_rr_class klass)
Definition zonelist.c:157