zone.h
Go to the documentation of this file.
#ifndef LDNS_ZONE_H
#define LDNS_ZONE_H
#include <ldns/common.h>
#include <ldns/rdata.h>
#include <ldns/rr.h>
#include <ldns/error.h>
#ifdef __cplusplus
extern "C" {
#endif
struct ldns_struct_zone
{
ldns_rr *_soa;
/* basically a zone is a list of rr's */
ldns_rr_list *_rrs;
/* we could change this to be a b-tree etc etc todo */
};
typedef struct ldns_struct_zone ldns_zone;
ldns_zone * ldns_zone_new(void);
ldns_rr * ldns_zone_soa(const ldns_zone *z);
size_t ldns_zone_rr_count(const ldns_zone *z);
void ldns_zone_set_soa(ldns_zone *z, ldns_rr *soa);
ldns_rr_list * ldns_zone_rrs(const ldns_zone *z);
void ldns_zone_set_rrs(ldns_zone *z, ldns_rr_list *rrlist);
bool ldns_zone_push_rr_list(ldns_zone *z, const ldns_rr_list *list);
bool ldns_zone_push_rr(ldns_zone *z, ldns_rr *rr);
ldns_rr_list *ldns_zone_glue_rr_list(const ldns_zone *z);
ldns_status ldns_zone_new_frm_fp(ldns_zone **z, FILE *fp, const ldns_rdf *origin, uint32_t ttl, ldns_rr_class c);
ldns_status ldns_zone_new_frm_fp_l(ldns_zone **z, FILE *fp, const ldns_rdf *origin, uint32_t ttl, ldns_rr_class c, int *line_nr);
void ldns_zone_free(ldns_zone *zone);
void ldns_zone_deep_free(ldns_zone *zone);
void ldns_zone_sort(ldns_zone *zone);
#ifdef __cplusplus
}
#endif
#endif /* LDNS_ZONE_H */
common.h
Common definitions for LDNS.
error.h
Defines error numbers and functions to translate those to a readable string.
ldns_status
enum ldns_enum_status ldns_status
Definition error.h:148
rdata.h
Defines ldns_rdf and functions to manipulate those.
ldns_rdf
struct ldns_struct_rdf ldns_rdf
Definition rdata.h:205
rr.h
Contains the definition of ldns_rr and functions to manipulate those.
ldns_rr
struct ldns_struct_rr ldns_rr
Definition rr.h:337
ldns_rr_list
struct ldns_struct_rr_list ldns_rr_list
Definition rr.h:351
ldns_rr_class
enum ldns_enum_rr_class ldns_rr_class
Definition rr.h:61
ldns_struct_zone
DNS Zone.
Definition zone.h:43
ldns_struct_zone::_rrs
ldns_rr_list * _rrs
Definition zone.h:47
ldns_struct_zone::_soa
ldns_rr * _soa
the soa defines a zone
Definition zone.h:45
ldns_zone_set_soa
void ldns_zone_set_soa(ldns_zone *z, ldns_rr *soa)
Set the zone's soa record.
Definition zone.c:29
ldns_zone_soa
ldns_rr * ldns_zone_soa(const ldns_zone *z)
Return the soa record of a zone.
Definition zone.c:17
ldns_zone_push_rr
signed char ldns_zone_push_rr(ldns_zone *z, ldns_rr *rr)
push an single rr to a zone structure.
Definition zone.c:53
ldns_zone_rr_count
size_t ldns_zone_rr_count(const ldns_zone *z)
Returns the number of resource records in the zone, NOT counting the SOA record.
Definition zone.c:23
ldns_zone_set_rrs
void ldns_zone_set_rrs(ldns_zone *z, ldns_rr_list *rrlist)
Set the zone's contents.
Definition zone.c:41
ldns_zone_rrs
ldns_rr_list * ldns_zone_rrs(const ldns_zone *z)
Get a list of a zone's content.
Definition zone.c:35
ldns_zone_glue_rr_list
ldns_rr_list * ldns_zone_glue_rr_list(const ldns_zone *z)
Retrieve all resource records from the zone that are glue records.
Definition zone.c:65
ldns_zone_deep_free
void ldns_zone_deep_free(ldns_zone *zone)
Frees the allocated memory for the zone, the soa rr in it, and the rr_list structure in it,...
Definition zone.c:376
ldns_zone_push_rr_list
signed char ldns_zone_push_rr_list(ldns_zone *z, const ldns_rr_list *list)
push an rrlist to a zone structure.
Definition zone.c:47
ldns_zone_new_frm_fp
ldns_status ldns_zone_new_frm_fp(ldns_zone **z, FILE *fp, const ldns_rdf *origin, uint32_t ttl, ldns_rr_class c)
Create a new zone from a file.
Definition zone.c:187
ldns_zone_new
ldns_zone * ldns_zone_new(void)
create a new ldns_zone structure
Definition zone.c:165
ldns_zone_free
void ldns_zone_free(ldns_zone *zone)
Frees the allocated memory for the zone, and the rr_list structure in it.
Definition zone.c:369
ldns_zone_sort
void ldns_zone_sort(ldns_zone *zone)
Sort the rrs in a zone, with the current impl.
Definition zone.c:359
ldns_zone_new_frm_fp_l
ldns_status ldns_zone_new_frm_fp_l(ldns_zone **z, FILE *fp, const ldns_rdf *origin, uint32_t ttl, ldns_rr_class c, int *line_nr)
Create a new zone from a file, keep track of the line numbering.
ldns_zone
struct ldns_struct_zone ldns_zone
Definition zone.h:50