38 static const char* ixfr_str =
"journal";
53 part->
plus = ldns_rr_list_new();
55 ods_log_error(
"[%s] unable to create ixfr part: " 56 "ldns_rr_list_new() failed", ixfr_str);
60 part->
min = ldns_rr_list_new();
62 ods_log_error(
"[%s] unable to create ixfr part: " 63 "ldns_rr_list_new() failed", ixfr_str);
64 ldns_rr_list_free(part->
plus);
82 ldns_rr_list_deep_free(part->
min);
83 ldns_rr_list_free(part->
plus);
99 ods_log_assert(zone->
name);
103 ods_log_error(
"[%s] unable to create ixfr for zone %s: " 104 "allocator_alloc() failed", ixfr_str, zone->
name);
128 ods_log_assert(zone);
129 ods_log_assert(zone->
db);
134 ods_log_assert(ixfr->
part[0]);
135 ods_log_assert(ixfr->
part[0]->
plus);
136 if (!ldns_rr_list_push_rr(ixfr->
part[0]->
plus, rr)) {
137 ods_fatal_exit(
"[%s] fatal unable to +RR: ldns_rr_list_push_rr() failed",
140 if (ldns_rr_get_type(rr) == LDNS_RR_TYPE_SOA) {
158 ods_log_assert(zone);
159 ods_log_assert(zone->
db);
164 ods_log_assert(ixfr->
part[0]);
165 ods_log_assert(ixfr->
part[0]->
min);
166 if (!ldns_rr_list_push_rr(ixfr->
part[0]->
min, rr)) {
167 ods_fatal_exit(
"[%s] fatal unable to -RR: ldns_rr_list_push_rr() failed",
170 if (ldns_rr_get_type(rr) == LDNS_RR_TYPE_SOA) {
181 part_rr_list_print_nonsoa(FILE* fd, ldns_rr_list* list)
188 for (i = 0; i < ldns_rr_list_rr_count(list); i++) {
189 if (ldns_rr_get_type(ldns_rr_list_rr(list, i)) != LDNS_RR_TYPE_SOA) {
190 if (util_rr_print(fd, ldns_rr_list_rr(list, i)) != ODS_STATUS_OK) {
213 part = ixfr->
part[i];
217 ods_log_assert(part->
min);
218 ods_log_assert(part->
plus);
219 ods_log_assert(part->
soamin);
221 if (util_rr_print(fd, part->
soamin) != ODS_STATUS_OK) {
224 error = part_rr_list_print_nonsoa(fd, part->
min);
228 if (util_rr_print(fd, part->
soaplus) != ODS_STATUS_OK) {
231 error = part_rr_list_print_nonsoa(fd, part->
plus);
249 ods_log_debug(
"[%s] print ixfr", ixfr_str);
251 ods_log_deeebug(
"[%s] print ixfr part #%d", ixfr_str, i);
252 part_print(fd, ixfr, i);
281 ods_log_assert(zone);
282 ods_log_debug(
"[%s] purge ixfr for zone %s", ixfr_str, zone->
name);
285 part_cleanup(ixfr->
part[i]);
286 ixfr->
part[i] = NULL;
289 ixfr->
part[i] = NULL;
292 ixfr->
part[0] = part_create();
293 if (!ixfr->
part[0]) {
294 ods_fatal_exit(
"[%s] fatal unable to purge ixfr for zone %s: " 295 "part_create() failed", ixfr_str, zone->
name);
312 part_cleanup(ixfr->
part[i]);
void ixfr_cleanup(ixfr_type *ixfr)
void ixfr_print(FILE *fd, ixfr_type *ixfr)
ixfr_type * ixfr_create(zone_type *zone)
void ixfr_add_rr(ixfr_type *ixfr, ldns_rr *rr)
void ixfr_del_rr(ixfr_type *ixfr, ldns_rr *rr)
part_type * part[IXFR_MAX_PARTS]
adapter_type * adoutbound
query_state ixfr(query_type *q, engine_type *engine)
lock_basic_type ixfr_lock
void ixfr_purge(ixfr_type *ixfr)