ldns documentation

- Main Page
- Related Pages
- Data Structures
- Files

- File List
- Globals

zone.h
Go to the documentation of this file.
1
23 #ifndef LDNS_ZONE_H
24 #define LDNS_ZONE_H
25
26 #include <ldns/common.h>
27 #include <ldns/rdata.h>
28 #include <ldns/rr.h>
29 #include <ldns/error.h>
30
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34
42 struct ldns_struct_zone
43 {
45 ldns_rr *_soa;
46 /* basicly a zone is a list of rr's */
47 ldns_rr_list *_rrs;
48 /* we could change this to be a b-tree etc etc todo */
49 };
50 typedef struct ldns_struct_zone ldns_zone;
51
56 ldns_zone * ldns_zone_new(void);
57
63 ldns_rr * ldns_zone_soa(const ldns_zone *z);
64
70 size_t ldns_zone_rr_count(const ldns_zone *z);
71
77 void ldns_zone_set_soa(ldns_zone *z, ldns_rr *soa);
78
86 ldns_rr_list * ldns_zone_rrs(const ldns_zone *z);
87
93 void ldns_zone_set_rrs(ldns_zone *z, ldns_rr_list *rrlist);
94
102 bool ldns_zone_push_rr_list(ldns_zone *z, ldns_rr_list *list);
103
111 bool ldns_zone_push_rr(ldns_zone *z, ldns_rr *rr);
112
126 ldns_rr_list *ldns_zone_glue_rr_list(const ldns_zone *z);
127
138 ldns_status ldns_zone_new_frm_fp(ldns_zone **z, FILE *fp, ldns_rdf *origin, uint32_t ttl, ldns_rr_class c);
139
151 ldns_status ldns_zone_new_frm_fp_l(ldns_zone **z, FILE *fp, ldns_rdf *origin, uint32_t ttl, ldns_rr_class c, int *line_nr);
152
157 void ldns_zone_free(ldns_zone *zone);
158
164 void ldns_zone_deep_free(ldns_zone *zone);
165
170 void ldns_zone_sort(ldns_zone *zone);
171
172 #ifdef __cplusplus
173 }
174 #endif
175
176 #endif /* LDNS_ZONE_H */
ldns_zone_set_rrs
void ldns_zone_set_rrs(ldns_zone *z, ldns_rr_list *rrlist)
Set the zone&#39;s contents.
Definition: zone.c:41
rdata.h
Defines ldns_rdf and functions to manipulate those.
ldns_rr_class
enum ldns_enum_rr_class ldns_rr_class
Definition: rr.h:64
ldns_struct_rr_list
List or Set of Resource Records.
Definition: rr.h:327
ldns_zone_soa
ldns_rr * ldns_zone_soa(const ldns_zone *z)
Return the soa record of a zone.
Definition: zone.c:17
ldns_struct_zone::_rrs
ldns_rr_list * _rrs
Definition: zone.h:47
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:313
ldns_struct_zone
DNS Zone.
Definition: zone.h:42
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:66
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:54
rr.h
Contains the definition of ldns_rr and functions to manipulate those.
ldns_struct_rr
Resource Record.
Definition: rr.h:299
ldns_zone_push_rr_list
signed char ldns_zone_push_rr_list(ldns_zone *z, ldns_rr_list *list)
push an rrlist to a zone structure.
Definition: zone.c:47
error.h
Defines error numbers and functions to translate those to a readable string.
ldns_struct_zone::_soa
ldns_rr * _soa
the soa defines a zone
Definition: zone.h:45
ldns_zone_new_frm_fp_l
ldns_status ldns_zone_new_frm_fp_l(ldns_zone **z, FILE *fp, 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_new_frm_fp
ldns_status ldns_zone_new_frm_fp(ldns_zone **z, FILE *fp, ldns_rdf *origin, uint32_t ttl, ldns_rr_class c)
Create a new zone from a file.
Definition: zone.c:188
ldns_zone_set_soa
void ldns_zone_set_soa(ldns_zone *z, ldns_rr *soa)
Set the zone&#39;s soa record.
Definition: zone.c:29
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_sort
void ldns_zone_sort(ldns_zone *zone)
Sort the rrs in a zone, with the current impl.
Definition: zone.c:296
ldns_status
enum ldns_enum_status ldns_status
Definition: error.h:131
ldns_zone_rrs
ldns_rr_list * ldns_zone_rrs(const ldns_zone *z)
Get a list of a zone&#39;s content.
Definition: zone.c:35
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:306
ldns_zone_new
ldns_zone * ldns_zone_new(void)
create a new ldns_zone structure
Definition: zone.c:166
ldns_struct_rdf
Resource record data field.
Definition: rdata.h:166
common.h
Common definitions for LDNS.