cachegeneric (const char type[2], const char *d,
                    const char *data, unsigned int datalen, uint32 ttl)
{
    char key[257];
    unsigned int len = 0;

    len = dns_domain_length (d);
    if (len > 255)
      return;

    byte_copy (key, 2, type);
    byte_copy (key + 2, len, d);
    case_lowerb (key + 2, len);

    cache_set (key, len + 2, data, datalen, ttl);
}
cachegeneric (const char type[2], const char *d,
                    const char *data, unsigned int datalen, uint32 ttl)
{
    char key[257];
    unsigned int len = 0;

    len = dns_domain_length (d);
    if (len > 255)
      return;

    byte_copy (key, 2, type);
    byte_copy (key + 2, len, d);
    case_lowerb (key + 2, len);

    cache_set (key, len + 2, data, datalen, ttl);
}