apply_respip_action(struct worker* worker, const struct query_info* qinfo,
	struct respip_client_info* cinfo, struct reply_info* rep,
	struct comm_reply* repinfo, struct ub_packed_rrset_key** alias_rrset,
	struct reply_info** encode_repp, struct auth_zones* az)
{
	struct respip_action_info actinfo = {0, 0, 0, 0, NULL, 0, NULL};
	actinfo.action = respip_none;

	if(qinfo->qtype != LDNS_RR_TYPE_A &&
		qinfo->qtype != LDNS_RR_TYPE_AAAA &&
		qinfo->qtype != LDNS_RR_TYPE_ANY)
		return 1;

	if(!respip_rewrite_reply(qinfo, cinfo, rep, encode_repp, &actinfo,
		alias_rrset, 0, worker->scratchpad, az, NULL))
		return 0;

	/* xxx_deny actions mean dropping the reply, unless the original reply
	 * was redirected to response-ip data. */
	if((actinfo.action == respip_deny ||
		actinfo.action == respip_inform_deny) &&
		*encode_repp == rep)
		*encode_repp = NULL;

	/* If address info is returned, it means the action should be an
	 * 'inform' variant and the information should be logged. */
	if(actinfo.addrinfo) {
		respip_inform_print(&actinfo, qinfo->qname,
			qinfo->qtype, qinfo->qclass, qinfo->local_alias,
			repinfo);

		if(worker->stats.extended && actinfo.rpz_used) {
			if(actinfo.rpz_disabled)
				worker->stats.rpz_action[RPZ_DISABLED_ACTION]++;
			if(actinfo.rpz_cname_override)
				worker->stats.rpz_action[RPZ_CNAME_OVERRIDE_ACTION]++;
			else
				worker->stats.rpz_action[
					respip_action_to_rpz_action(actinfo.action)]++;
		}
	}

	return 1;
}
apply_respip_action(struct worker* worker, const struct query_info* qinfo,
	struct respip_client_info* cinfo, struct reply_info* rep,
	struct comm_reply* repinfo, struct ub_packed_rrset_key** alias_rrset,
	struct reply_info** encode_repp, struct auth_zones* az)
{
	struct respip_action_info actinfo = {0, 0, 0, 0, NULL, 0, NULL};
	actinfo.action = respip_none;

	if(qinfo->qtype != LDNS_RR_TYPE_A &&
		qinfo->qtype != LDNS_RR_TYPE_AAAA &&
		qinfo->qtype != LDNS_RR_TYPE_ANY)
		return 1;

	if(!respip_rewrite_reply(qinfo, cinfo, rep, encode_repp, &actinfo,
		alias_rrset, 0, worker->scratchpad, az, NULL))
		return 0;

	 
	if((actinfo.action == respip_deny ||
		actinfo.action == respip_inform_deny) &&
		*encode_repp == rep)
		*encode_repp = NULL;

	 
	if(actinfo.addrinfo) {
		respip_inform_print(&actinfo, qinfo->qname,
			qinfo->qtype, qinfo->qclass, qinfo->local_alias,
			repinfo);

		if(worker->stats.extended && actinfo.rpz_used) {
			if(actinfo.rpz_disabled)
				worker->stats.rpz_action[RPZ_DISABLED_ACTION]++;
			if(actinfo.rpz_cname_override)
				worker->stats.rpz_action[RPZ_CNAME_OVERRIDE_ACTION]++;
			else
				worker->stats.rpz_action[
					respip_action_to_rpz_action(actinfo.action)]++;
		}
	}

	return 1;
}