Example #1
0
void
xfrd_notify_start(struct notify_zone_t* zone)
{
	if(zone->is_waiting || zone->notify_send_enable)
		return;
	notify_enable(zone, NULL);
}
Example #2
0
void
xfrd_send_notify(rbtree_t* tree, const dname_type* apex, struct xfrd_soa* new_soa)
{
	/* lookup the zone */
	struct notify_zone_t* zone = (struct notify_zone_t*)
		rbtree_search(tree, apex);
	assert(zone);
	if(zone->notify_send_enable)
		notify_disable(zone);

	notify_enable(zone, new_soa);
}
Example #3
0
void
notify_handle_master_zone_soainfo(rbtree_t* tree,
	const dname_type* apex, struct xfrd_soa* new_soa)
{
	/* lookup the zone */
	struct notify_zone_t* zone = (struct notify_zone_t*)
		rbtree_search(tree, apex);
	if(!zone) return; /* got SOAINFO but zone was deleted meanwhile */

	/* check if SOA changed */
	if( (new_soa == NULL && zone->current_soa->serial == 0) ||
		(new_soa && new_soa->serial == zone->current_soa->serial))
		return;
	if(zone->notify_send_enable)
		notify_disable(zone);
	notify_enable(zone, new_soa);
}
Example #4
0
/**
 * Send notifies.
 *
 */
static void
dnsout_send_notify(void* zone)
{
    zone_type* z = (zone_type*) zone;
    rrset_type* rrset = NULL;
    ldns_rr* soa = NULL;
    if (!z || !z->notify) {
        ods_log_error("[%s] unable to send notify for zone %s: no notify "
                      "handler", adapter_str, z->name);
        return;
    }
    ods_log_assert(z->adoutbound);
    ods_log_assert(z->adoutbound->config);
    ods_log_assert(z->adoutbound->type == ADAPTER_DNS);
    ods_log_assert(z->db);
    ods_log_assert(z->name);
    ods_log_debug("[%s] enable notify for zone %s serial %u", adapter_str,
                  z->name, z->db->intserial);
    rrset = zone_lookup_rrset(z, z->apex, LDNS_RR_TYPE_SOA);
    ods_log_assert(rrset);
    soa = ldns_rr_clone(rrset->rrs[0].rr);
    notify_enable(z->notify, soa);
    return;
}