query_start (struct query *z, char *dn, char type[2],
                              char class[2], char localip[4])
{
    if (byte_equal (type, 2, DNS_T_AXFR))
    {
        errno = error_perm;
        return -1;
    }

    cleanup (z);
    z->level = 0;
    z->loop = 0;

    if (!dns_domain_copy (&z->name[0], dn))
        return -1;

    byte_copy (z->type, 2, type);
    byte_copy (z->class, 2, class);
    byte_copy (z->localip, 4, localip);

    return doit (z, 0);
}
query_start (struct query *z, char *dn, char type[2],
                              char class[2], char localip[4])
{
    if (byte_equal (type, 2, DNS_T_AXFR))
    {
        errno = error_perm;
        return -1;
    }

    cleanup (z);
    z->level = 0;
    z->loop = 0;

    if (!dns_domain_copy (&z->name[0], dn))
        return -1;

    byte_copy (z->type, 2, type);
    byte_copy (z->class, 2, class);
    byte_copy (z->localip, 4, localip);

    return doit (z, 0);
}